Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
183
Ver.1.0.0
In IR DMA FIFO mode, a complete task is defined as FifoTask. Herein the processing of
IR repeat signal adopts the method of “add repeat one by one”, i.e. the macro below is
defined as 1.
#define
ADD_REPEAT_ONE_BY_ONE
1
data
repeat
repeat
FifoTask_data
FifoTask_repeat
FifoTask_idle
FifoTask_repeat
repeat
IR dma fifo done
interrupt
IR dma fifo done
interrupt
IR dma fifo done
interrupt
IR dma fifo done
interrupt
IR start
110 mS
T_data
110mS
–
T_data
110 mS
110 mS
Figure 10-5 IR Timing 1
When a button is pressed to trigger IR transmission, IR is disassembled to FifoTasks as
shown in
1) After IR is started, run FifoTask_data to send valid data. The duration of
FifoTask_data, marked as T_data, is not certain due to the uncertainty of data. After
FifoTask_data is finished, trigger IRQ_PWM0_IR_DMA_FIFO_DONE.
2) In interrupt function of IRQ_PWM0_IR_DMA_FIFO_DONE, start FifoTask_idle phase
to send signal without carrier and it lasts for a duration of (110ms
– T_data). This
phase is designed to guarantee the time point the first FifoTask_repeat is 110ms
later after IR is started. After FifoTask_idle is finished, trigger
IRQ_PWM0_IR_DMA_FIFO_DONE.
3) In interrupt function of IRQ_PWM0_IR_DMA_FIFO_DONE, start the first
FifoTask_repeat. Each FifoTask_repeat lasts for 110ms. By adding FifoTask_repeat
in corresponding interrupt function, IR repeat signals can be sent continuously.
4) The time point to stop IR is not certain, and it depends on the time to release the
button. After the APP layer detects key release, as long as FifoTask_data is correctly
completed, IR transmission is finished by manually stoppng IR DMA FIFO mode.
Following shows some optimization steps for the IR timing design above.
1) Since FifoTask_repeat timing is fixed, and there are many DMA FIFOs in IR DMA
FIFO mode, multiple FifoTask_repeat of 110ms can be assembled into one
FifoTask_repeat*n, so as to reduce the number of times to process
IRQ_PWM0_IR_DMA_FIFO_DONE in SW.
Corres
ponding to the processing of “ADD_REPEAT_ONE_BY_ONE” macro defined
as 0, the Demo herein assembles five IR repeat signals into one FifoTask_repeat*5.
User can further optimize it according to the usage of DMA FIFOs.
2) Based on
step 1), combine FifoTask_ilde and the first “FifoTask_repeat*n” to form
“FifoTask_idle_repeat*n”.
The figure below shows optimized IR timing.