
Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
177
Ver.1.0.0
10.1.4 PWM Revert
“static inline void pwm_revert(pwm_id id)” is used to invert PWM0 ~ PWM5 waveform.
“static inline pwm_n_revert(pwm_id id)” is used to invert PWM0_N ~ PWM5_N waveform.
10.1.5 PWM Start and Stop
Use the two interfaces below to enable (start)/disable (stop) certain PWM.
void
pwm_start
(
pwm_id
id) ;
void
pwm_stop
(
pwm_id
id) ;
10.1.6 PWM Mode
PWM supports five modes: Normal mode(also Continuous mode), Counting mode, IR
mode, IR FIFO mode and IR DMA FIFO mode.
typedef
enum
{
PWM_NORMAL_MODE
= 0x00,
PWM_COUNT_MODE
= 0x01,
PWM_IR_MODE
= 0x03,
PWM_IR_FIFO_MODE
= 0x07,
PWM_IR_DMA_FIFO_MODE
= 0x0F,
}
pwm_mode
;
The API to set PWM mode is:
void
pwm_set_mode
(
pwm_id
id,
pwm_mode
mode)
PWM0 supports all five modes, Normal mode, Counting mode, IR mode, IR FIFO mode
and IR DMA FIFO mod, while PWM1 ~ PWM5 only support normal mode. In other words,
PWM0 supports other four special modes besides normal mode.
Please section 8.5 in TLSR8232 datasheet for details of PWM modes.
10.1.7 PWM Pulse Number
void
pwm_set_pulse_num
(
pwm_id
id,
unsigned
short
pulse_num)
is used to
set the number of Signal Frame
s of specified PWM waveforms. Here “pulse” means
Signal Frames.
For normal mode (Continuous mode), there is no limit to the number of Signal Frames,
therefore this API is meaningless to normal mode. This API is only useful to other four
special modes.