
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:
PWMx
Pin
PWMx_n
Pin
PWM0
PA0/PB3
PWM0_N
PB6/PC2
PWM1
PB1/PB7
PWM1_N
PA2/PB4
PWM2
PA4/PB2
PWM2_N
PC1
PWM3
PB0/PC7
PWM3_N
PA1
PWM4
PA3/PB5/PC6
PWM4_N
PA6
PWM5
PA5/PA7
PWM5_N
PC3