Re: [RFC]PWM API Update


Tomasz Bursztyka
 

Hi Baohong,

static inline int pwm_pin_set(struct device *dev, uint32_t pwm,
uint32_t period_cycles, uint32_t pulse_cycles);

static inline int pwm_pin_set_usec(struct device *dev, uint32_t pwm,
uint32_t period_usec, uint32_t pulse_usec);

Note: implementation of pwm_pin_set_usec API shall convert the
input (in usec) to cycles and then call pwm_pin_set.

I felt that get_cycles_per_sec() is not needed since there are already
constant definition for this. (e.g. CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
in boards/arduino_101_sss/arduino_101_sss_defconfig).
Actually, this might be true if the PWM device is on the SoC and/or it's
controller clocked
at same speed. But I think this is still needed if the PWM device is
external, and clocked
differently. (external clock source for it, etc etc...) Don't you think so?

Br,

Tomasz

Join devel@lists.zephyrproject.org to automatically receive all group messages.