Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1 174 Ver.1.0.0
10. IR
10.1 PWM Driver
Please refer to PWM section in TLSR8232 datasheet to better understand PWM driver.
PWM related hardware configurations are very simple and are basically implemented by
operating registers. APIs are all defined in “pwm.h” (c files not needed) and are
implemented by using “static inline function”, which improves efficiency and saves code
size.
10.1.1 PWM id and Pin
TLSR8232 supports up to 12-channel PWM: PWM0 ~ PWM5 and PWM0_N ~ PWM5_N.
Six-channel PWM is defined in driver:
typedef enum {
PWM0_ID = 0,
PWM1_ID,
PWM2_ID,
PWM3_ID,
PWM4_ID,
PWM5_ID,
}pwm_id;
Only six-channel PWM0~PWM5 are configured in software, while the other six-channel
PWM0_N~PWM5_N is inverted output of PWM0~PWM5 waveform. For example:
PWM0_N is inverted output of PWM0 waveform. When PWM0 is high level, PWM0_N is
low level; When PWM0 is low level, PWM0_N is high level. Therefore, as long as
PWM0~PWM5 are configured, PWM0_N~PWM5_N are configured.
IC pins of the 12-channel PWM are shown as below: