Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
53
Ver.1.0.0
Code of UI entry in mainloop is executed during UI task/suspend part in Figure 3-9. This
duration can be used for UI task only, or MCU can enter suspend for the redundant time
so as to reduce power consumption.
In Advertising state,
function “blt_sdk_main_loop” does not have much tasks to process,
only needs to trigger some callback events related to Adv, including
BLT_EV_FLAG_ADV_DURATION_TIMEOUT, BLT_EV_FLAG_CONNECT, etc.
3.2.4.3 Timing Sequence in Conn state Slave Role
Conn interval
UI task/suspend
UI task/suspend
UI task
UI task
brx
event
brx
event
brx
post
brx
start
brx
working
Figure 3-10 Timing Sequence in Conn state Slave Role
, each conn interval starts with a brx event, i.e. transfer process
of BLE RF packets by Link Layer: PHY enters Rx state, and an ack packet will be sent to
respond to each received data packet from Master.
In 5316 BLE SDK, each brx process has three phases.
1) brx start phase
When Master needs to send packet, an interrupt is triggered by Timer0 tick irq to
enter brx start phase. During this interrupt, MCU sets BLE state machine of PHY to
enter brx state, hardware in bottom layer prepares for packet transfer, and then MCU
exits from the interrupt irq.
2) brx working phase
After brx start phase ends and MCU exits from irq, hardware in bottom layer enters
Rx state first and waits for packet from Master. An ack packet will be sent to respond
to each received data packet from Master. During the brx working phase, all packet
reception and transmission are implemented automatically without involvement of
software.
3) brx post phase
After packet transfer is finished, the brx working phase is finished. Timer0 tick irq
triggeres an interrupt to switch to the brx post phase. During this phase, protocol
stack will process BLE data and timing sequence according to packet transfer in the
brx working phase.
During the three phases, brx start and brx post are implemented in interrupt, while brx
working phase does not need the involvement of software, and UI task can be executed
normally. During the brx working
phase, MCU can’t enter suspend since hardware needs
to transfer packets.
Within each conn interval, the duration except for brx event can be used for UI task only,
or MCU can enter suspend for the redundant time so as to reduce power consumption.