2.3 PHY APIs

The following table lists the PHY Library APIs.

Table 2-1. PHY Library APIs
S. No.API NameDescriptionAPI Type
1PHY_TaskHandler()

PHY Task handling

This function,

  • Checks and allocates the receive buffer
  • Processes the PHY incoming frame queue
  • Implements the PHY state machine
NA
2PHY_Init()

Initializes the PHY layer

This function is called to initialize the PHY. The transceiver is initialized, interrupt handlers are set, Arbiter mode is initialized, the PHY PIBs are set to their default values and PHY state machine is set to PHY_IDLE state

Synchronous
3PHY_Reset()Resets the PHY state machine and sets the default PIB value if requestedSynchronous
4PHY_EdStart(uint8_t scanDuration)This function runs the ED scan for the scan duration specified.Asynchronous
5PHY_EdEndCallback(uint8_t eneryLevel)User callback function for finished ED scanNA
6PHY_PibGet(uint8_t attribute, uint8_t * value)This function is called to retrieve the transceiver information base attributesSynchronous
7PHY_PibSet(uint8_t attribute, PibValue_t *value)This function is called to set the transceiver information base attributesSynchronous
8PHY_RxEnable(uint8_t state)

Switches receiver on or off

This function switches the receiver on (PHY_STATE_RX_ON) or off (PHY_STATE_TRX_OFF).

Asynchronous
9PHY_RxFrameCallback(frame_info_t *rx_frame)User call back function for frame receptionNA
10PHY_TxFrame(PHY_FrameInfo_t *txFrame, PHY_CSMAMode_t csmaMode, bool performFrameRetry)

Requests to PHY to transmit frame

This function is called by the upper layer to deliver a frame to the PHY to be transmitted by the transceiver.

Asynchronous
11PHY_TxDoneCallback(PHY_Retval_t status, PHY_FrameInfo_t *frame)User call back function for frame transmissionNA
12PHY_TrxSleep()Sets the transceiver to sleepSynchronous
13PHY_TrxWakeup()Wakes-up the transceiver from sleepSynchronous
14PHY_CCAPerform()

Performs the CCA request

This function performs a CCA request and returns the channel status as PHY_IDLE or PHY_BUSY

Synchronous
15PHY_EdSample()Performs Single ED measurementSynchronous
16PHY_ConfigRxSensitivity(uint8_t rxSensVal)Sets the RX Sensitivity value in the TransceiverSynchronous
17PHY_StartContinuousTransmit()Starts the continuous transmit in the TransceiverSynchronous
18PHY_StopContinuousTransmit()Stops the continuous transmit in the TransceiverSynchronous
19PHY_ConfigTxPwr(uint8_t txPower)Sets the Tx power in TransceiverSynchronous
20PHY_ConfigAntennaDiversity(bool div_ctrl, uint8_t ant_ctrl)Enables/Disables the Antenna Diversity and sets the Antenna to be used for TransmissionSynchronous
21PHY_ConfigRxRPCMode()Enables the Receiver RPC (Reduced Power Consumption) modeSynchronous
22PHY_ConfigRxPromiscuousMode()Enables Rx Promiscuous modeSynchronous
23PHY_ConfigAutoAck() Enable/Disables the Automatic Acknowledgment after receptionSynchronous
24PHY_ConfigReservedFrameFiltering()Configures TRX for receiving reserved frameSynchronous
25PHY_GetTrxConfig()To read a current setting of particular transceiver parameterSynchronous
26PHY_GetTrxStatus()Returns the current status of the TransceiverSynchronous
27PHY_GetRSSIBaseVal()Get RSSI base value of TRXSynchronous
28PHY_GetSWVersion()To Get the current Software version of PHYSynchronous
29PHY_ConvertTxPwrRegValToDbmTo convert the Tx Power Register index value to dbm valueSynchronous
30PHY_IsFramePendingFromNextLayerTo check whether any frame is pending from higher layer upon reception of data request command frame (Ex: MAC/APP).Synchronous