
Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
184
Ver.1.0.0
data
FifoTask_data
FifoTask_idle_repeat*n
FifoTask_repeat*n
re
pe
at
IR dma fifo done
interrupt
IR dma fifo done
interrupt
IR dma fifo done
interrupt
IR start
110 mS * n
110 mS * n
re
pe
at
re
pe
at
re
pe
at
re
pe
at
110mS
……
1
n
……
1
n
2,3...
2,3...
……
……
Figure 10-6 IR Timing 2
As per the IR timing design above, corresponding code in SW flow is shown as below:
At IR start, invoke the function “ir_nec_send”, enable FifoTask_data, and use interrupt to
control the following flow. In the interrupt when FifoTask_data is finished, enable
FifoTask_idle. In the interrupt when FifoTask_idle is finished, enable FifoTask_repeat.
Before manually stopping IR DMA FIFO mode, FifoTask_repeat is executed continually.
void
ir_nec_send
(
u8
addr1,
u8
addr2,
u8
cmd)
{
//Add FifoTask_data to Dma
ir_send_ctrl.
is_sending
= IR_SENDING_DATA;
ir_send_ctrl.
sending_start_time
= clock_time();
pwm_start_dma_ir_sending();
}
void
rc_ir_irq_prc
(
void
)
{
if
(reg_pwm_irq_sta &
FLD_IRQ_PWM0_IR_DMA_FIFO_DONE
)
{
reg_pwm_irq_sta =
FLD_IRQ_PWM0_IR_DMA_FIFO_DONE
;
if
(ir_send_ctrl.
repeat_enable
){
if
(ir_send_ctrl.
is_sending
== IR_SENDING_DATA){
ir_send_ctrl.
is_sending
= IR_SENDING_REPEAT;
//Add FifoTask_idle_repeat*n to Dma
pwm_start_dma_ir_sending();
}