1.5.1 How the G3 RF PAL module works
Description
The G3 RF Platform Abstraction Layer (PAL) module is the access point to the IEEE 802.15.4 RF PHY layer.
The G3 RF PAL module offers the necessary functions to control the RF IEEE 802.15.4 PHY layer, which include:
Module initialization
Transmitting and receiving frames
Accessing Parameter Information Base (PIB) to get/set configuration parameters
Reseting the RF transceiver
Module Initialization
The RF PAL is not initialized at System level (SYS_Initialize).
The first step that a client (RF MAC) has to take when using RF PAL is to initialize it, by calling PAL_RF_Initialize, which takes a pointer to initialization data as parameter (this initialization data includes all the callback functions to receive events from RF PAL; see PAL_RF_INIT for details). This will return a SYS_MODULE_OBJ, which is used to check the status of RF PAL, by calling PAL_RF_Status. The status is checked in each call to MAC_RF_Tasks until PAL_RF_STATUS_READY is returned.
Once the RF PAL is ready, the handle (PAL_RF_HANDLE) is obtained by calling PAL_RF_HandleGet and it will be used to call other functions of the RF PAL module.
Transmitting and Receiving frames
Frames are sent to the G3 Network using the PAL_RF_TxRequest primitive. The result of the requested transmission is provided by RF PAL by invoking PAL_RF_TxConfirm callback.
Received frames are reported by RF PAL by invoking PAL_RF_DataIndication callback.
Accessing Parameter Information Base (PIB)
Parameter Information Base (PIB) is a set of parameters that can be accessed for reading and/or writing. They serve mainly 2 purposes: RF PHY layer configuration through PIB writing and information retrieval through PIB reading.
The reading and writing of parameters are made by means of PAL_RF_GetMacRtPib and PAL_RF_SetMacRtPib primitives, respectively.
A list of available parameters is found on PAL_RF_PIB_ATTRIBUTE definition.