mirror of https://github.com/ARMmbed/mbed-os.git
pwmout - RZ_A2XX - add read methods for period and pulsewidth
parent
c4559ba8e2
commit
2d5e51794b
|
@ -166,6 +166,11 @@ void pwmout_period_us(pwmout_t *obj, int us)
|
||||||
pwmout_write(obj, obj->duty);
|
pwmout_write(obj, obj->duty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int pwmout_read_period_us(pwmout_t *obj)
|
||||||
|
{
|
||||||
|
return obj->pwm->GTPR.LONG;
|
||||||
|
}
|
||||||
|
|
||||||
void pwmout_pulsewidth(pwmout_t *obj, float seconds)
|
void pwmout_pulsewidth(pwmout_t *obj, float seconds)
|
||||||
{
|
{
|
||||||
pwmout_pulsewidth_us(obj, seconds * 1000000.0f);
|
pwmout_pulsewidth_us(obj, seconds * 1000000.0f);
|
||||||
|
@ -188,6 +193,14 @@ void pwmout_pulsewidth_us(pwmout_t *obj, int us)
|
||||||
pwmout_write(obj, value);
|
pwmout_write(obj, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int pwmout_read_pulsewidth_us(pwmout_t *obj)
|
||||||
|
{
|
||||||
|
if (obj->type == 0) {
|
||||||
|
return (float)obj->pwm->GTCCRC.LONG;
|
||||||
|
}
|
||||||
|
return (float)obj->pwm->GTCCRE.LONG ;
|
||||||
|
}
|
||||||
|
|
||||||
const PinMap *pwmout_pinmap()
|
const PinMap *pwmout_pinmap()
|
||||||
{
|
{
|
||||||
return PinMap_PWM;
|
return PinMap_PWM;
|
||||||
|
|
Loading…
Reference in New Issue