FreeStar Pro SMAC Programmers’ Guide
Rev B
0006-00-08-02-000
Page 33 of 34
The process_radio_msg() function must be routinely called to run the radio state machine.
It is the first function called in the RangeAppReceive() function in
applications.c
.
3.5 CHANGING OR QUERYING THE RF CHANNEL
3.5.1 More
information
See Freescale documents
“Simple Media Access Controller (SMAC) User’s Guide”
(Freescale Doc
# SMACRM) and
“MC1322x Simple Media Access Controller (SMAC) Reference Manual”
(Freescale
Doc # 22xSMACRM) for more information.
The SMAC codebase contains an API to change the channel named
MLMESetChannelRequest().
The SMAC API called MLMEGetChannelRequest() can be used to read the current RF
channel.
When a request to change the channel is received on the UART the ChangeChannel()
function is used. It is found in
main_state.c
. The function checks the data range of the
received UART data and uses both of the SMAC API’s to check and change the channel.
3.6 CHANGING THE RF POWER
3.6.1 More
information
See Freescale documents
“Simple Media Access Controller (SMAC) User’s Guide”
(Freescale Doc
# SMACRM) and
“MC1322x Simple Media Access Controller (SMAC) Reference Manual”
(Freescale
Doc # 22xSMACRM) for more information.
The SMAC codebase contains an API to change the power named
MLMEPAOutputAdjust(). It is called in the ChangePower() function in the
main_state.c
.
For example, this ChangePower() function is used in the SetManualRangeTx() function in
applications.c
.
3.7 RECEIVING A UART MESSAGE
UART messages are parsed as they are received with the use of function pointers.
Each state of the function checks for valid data (start byte, message type, checksum and
end-of-frame).
If a valid UART message is received another function pointer is set up based on the
message Type.
This function will respond as appropriate for the message type and received data.
See
uart_parse.c
3.8 TRANSMITTING A UART MESSAGE
The MC13224V has an internal 32-byte transmit buffer.
Data is fed into the buffer and as interrupts occur, the application code waits for the buffer
to empty.
See
uart_parse.c
and the UartIsr1A function in
main_state.c