diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/cy_pwmout_api.c b/targets/TARGET_Cypress/TARGET_PSOC6/cy_pwmout_api.c index 6e83a81fca..dee7cf2b25 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/cy_pwmout_api.c +++ b/targets/TARGET_Cypress/TARGET_PSOC6/cy_pwmout_api.c @@ -74,6 +74,11 @@ void pwmout_period_us(pwmout_t *obj, int us) } } +int pwmout_read_period_us(pwmout_t *obj) +{ + return obj->period_us; +} + void pwmout_pulsewidth(pwmout_t *obj, float seconds) { pwmout_pulsewidth_us(obj, (int)(seconds * CY_US_PER_SECOND)); @@ -92,6 +97,11 @@ void pwmout_pulsewidth_us(pwmout_t *obj, int us) } } +int pwmout_read_pulsewidth_us(pwmout_t *obj) +{ + return obj->width_us; +} + const PinMap *pwmout_pinmap(void) { return PinMap_PWM_OUT;