
Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
186
Ver.1.0.0
Clear system status
“FLD_IRQ_PWM0_IR_DMA_FIFO_DONE”.
10.2.4.3 IR Variable Initialization
Related variables in the SDK demo includes waveform_start_bit_1st,
waveform_start_bit_2nd, and etc.
As introduced in IR timing design, FifoTask_data and FifoTask_repeat should be
configured.
Start signal = 9ms carrier 4.5ms low level signal (no carrier). Call
“pwm_config_dma_fifo_waveform” to configure the two corresponding DMA FIFO data.
//start bit, 9000 us carrier, 4500 us low
waveform_start_bit_1st = pwm_config_dma_fifo_waveform(1,
PWM0_PULSE_NORMAL
, 9000 *
CLOCK_SYS_CLOCK_1US
/PWM_CARRIER_CYCLE_TICK);
waveform_start_bit_2nd = pwm_config_dma_fifo_waveform(0,
PWM0_PULSE_NORMAL
, 4500 *
CLOCK_SYS_CLOCK_1US
/PWM_CARRIER_CYCLE_TICK);
u16
waveform_stop_bit_2nd;
The method also applies
to configure stop signal, repeat signal, data logic “1” signal, and
data logic “0” signal.
10.2.5 FIFO Task Configuration
10.2.5.1 FIFO Task_data
As per demo IR protocol, to send a cmd (e.g. 7), first send start signal, i.e. 9ms carrier
4.5ms low level signal
(no carrier); then send “ ~ cmd +
~cmd”. In the demo code, address is 0x88.
When sending the final bit of “~cmd”, logical “0” or logical “1” always contains some non-
carrier signals at the end. If “~cmd” is not followed by any data, there may be a problem
on Rx side: Since there’s no boundary to differentiate carrier, the FW does not know
whether the non-carrier signal duration of the final bit is 560us or 1690us, and fails to
recognize whether it’s logical “0” or logical “1”.
To solve this
problem, the Data signal should be followed by a “stop” signal which is
defined as 560us carrier 500us non-carrier signal.
Thus, the FifoTask_data mainly contains the three parts below:
1) start signal: 9ms carrier 4.5ms low level signal (no carrier)
2) data signal: ~ cmd + ~cmd
3) stop signal: 560us carrier 500us non-carrier signal
The code below is used to configure DMA Fifo buffer and start IR transmission.
//// set waveform input in sequence //////
T_dmaData_buf.
data_num
= 0;
//waveform for start bit