Chengdu Ebyte Electronic Technology Co.,Ltd.
MBL Evaluation Kit User Manual
Copyright ©2012–2021
,
Chengdu Ebyte Electronic Technology Co.,Ltd.
8
2.3 Main function
main.c in which is the main function entry. The flow of the demonstration function is simplified as follows:
Matters
Description
1
Key Function
If a key is pressed, the command data is sent wirelessly. In essence, this means
sending a specific string "ping" and expecting to receive a response "pong".
2
Serial data to wireless
transmission
The serial port automatically starts transmitting data wirelessly when it receives
the data, which of course contains some special command responses that are
mainly used for special tests and can be ignored by the user. Once the
transmission is complete, the user function is automatically called back so that the
transmission logic can be handled by itself.
3
Receive data
wirelessly
The underlying driver will copy the data and pass it to the user callback function,
which will handle the receiving logic itself.
The software process is simplified as shown in the following diagram:
2.4 Sending and Receiving Timing
Wireless modules exist in multiple operating states and can only perform specific functions in the
corresponding states. In terms of the simplest sending and receiving data, only the transmitting mode and
receiving mode are considered.
Matters
Description
1
Receiving Mode
Receive mode is automatically entered after the default initialization is completed.
In essence, this means that the receive function is called during initialization and
thus enters receive mode. If you want to consider entering other modes after
initialization, such as sleep, you can directly replace the function Go_xxxxx() with
the same type.
2
Sending Mode
When the transmit function is called, the underlying driver actually switches the
module into standby mode first, where the configuration of modulation
parameters, such as frequency, power, frequency bias, etc., is usually done. After
the parameters are configured correctly, it gradually enters some intermediate
modes, turning on the internal FIFO, PA, external XTAL, etc., and the current