mirror of https://github.com/ARMmbed/mbed-os.git
pwmout - NUC472 - add read methods for period and pulsewidth
parent
20dce73257
commit
a6f9c5b84f
|
@ -187,6 +187,11 @@ void pwmout_period_us(pwmout_t* obj, int us)
|
|||
pwmout_config(obj);
|
||||
}
|
||||
|
||||
int pwmout_read_period_us(pwmout_t *obj)
|
||||
{
|
||||
return obj->period_us;
|
||||
}
|
||||
|
||||
void pwmout_pulsewidth(pwmout_t *obj, float seconds)
|
||||
{
|
||||
pwmout_pulsewidth_us(obj, seconds * 1000000.0f);
|
||||
|
@ -203,6 +208,10 @@ void pwmout_pulsewidth_us(pwmout_t* obj, int us)
|
|||
pwmout_config(obj);
|
||||
}
|
||||
|
||||
int pwmout_read_pulsewidth_us(pwmout_t *obj {
|
||||
return obj->pulsewidth_us;
|
||||
}
|
||||
|
||||
static void pwmout_config(pwmout_t *obj)
|
||||
{
|
||||
PWM_T *pwm_base = (PWM_T *) NU_MODBASE(obj->pwm);
|
||||
|
|
Loading…
Reference in New Issue