NXP / fsl_phy_mcr20a

Fork of fsl_phy_mcr20a by Freescale

Embed: (wiki syntax)

« Back to documentation index

Phy.h File Reference

Phy.h File Reference

Go to the source code of this file.

Functions

void PhyHwInit (void)
 Initialize the 802.15.4 Radio registers.
void PhyAbort (void)
 Aborts the current sequence and force the radio to IDLE.
phyStatus_t PhyPdDataRequest (pdDataReq_t *pTxPacket, volatile phyRxParams_t *pRxParams, volatile phyTxParams_t *pTxParams)
 This function will start a TX sequence. The packet will be sent OTA.
phyStatus_t PhyPlmeRxRequest (phySlottedMode_t phyRxMode, phyRxParams_t *pRxParams)
 This function will start a RX sequence.
phyStatus_t PhyPlmeCcaEdRequest (phyCCAType_t ccaParam, phyContCCAMode_t cccaMode)
 This function will start a CCA / CCCA sequence.
phyStatus_t PhyPlmeSetCurrentChannelRequest (uint8_t channel, uint8_t pan)
 This function will set the channel number for the specified PAN.
uint8_t PhyPlmeGetCurrentChannelRequest (uint8_t pan)
 This function will return the current channel for a specified PAN.
phyStatus_t PhyPlmeSetPwrLevelRequest (uint8_t pwrStep)
 This function will set the radio Tx power.
phyStatus_t PhyPlmeSetPwrState (uint8_t state)
 Change the XCVR power state.
phyStatus_t PhyPlmeSetPIBRequest (phyPibId_t pibId, uint64_t pibValue, uint8_t phyRegistrySet, instanceId_t instanceId)
 This function will set the value of PHY PIBs.
phyStatus_t PhyPlmeGetPIBRequest (phyPibId_t pibId, uint64_t *pibValue, uint8_t phyRegistrySet, instanceId_t instanceId)
 This function will return the value of PHY PIBs.
uint32_t PhyTimeGetEventTimeout (void)
 Return the timeout value for the current sequence.
void PhyTimeDisableEventTimeout (void)
 Disables the sequence timeout.
void PhyTimeDisableEventTrigger (void)
 Disable the time trigger for a sequence.
void PhyTimeSetWakeUpTime (uint32_t *pWakeUpTime)
 Set TMR4 timeout value.
void PhyTimeInitEventTimer (uint32_t *pAbsTime)
 Initialize the Event Timer.
bool_t PhyTimeIsWakeUpTimeExpired (void)
 Check if TMR4 IRQ occured, and aknowledge it.
void PhyTimeDisableWaitTimeout (void)
 Disable the TMR1 timeout.
void PHY_InstallIsr (void)
 This function installs the PHY ISR.
void PHY_InterruptHandler (void)
 PHY ISR.
void PhyIsrPassRxParams (volatile phyRxParams_t *pRxParam)
 Sets the location of the Rx parameters.
void PhyIsrPassTaskParams (instanceId_t instanceId)
 Sets the current PHY instance waiting for an IRQ.
void PhyIsrTimeoutCleanup (void)
 Clear and mask PHY IRQ, disable timeout, set sequence to Idle.
void PhyIsrSeqCleanup (void)
 Clear and mask PHY IRQ, set sequence to Idle.
uint8_t PhyGetLastRxLqiValue (void)
 This function returns the LQI for the las received packet.
uint8_t PhyGetLastRxRssiValue (void)
 This function returns the RSSI for the las received packet.
void PhyPlmeSetRxOnWhenIdle (bool_t state, instanceId_t instanceId)
 This function sets the state of the PhyRxOnWhenIdle PIB.
void PhyPlmeSetFrameWaitTime (uint32_t time, instanceId_t instanceId)
 This function sets the value of the maxFrameWaitTime PIB.
uint8_t Phy_GetEnergyLevel (uint8_t energyLeveldB)
 Scales energy level to 0-255.
void Radio_Phy_PdDataConfirm (instanceId_t instanceId, bool_t framePending)
 This function signals the PHY task that a TX operation completed successfully. If the received ACK has FP=1, then the radio will enter RX state for maxFrameWaitTime duration.
void Radio_Phy_TimeWaitTimeoutIndication (instanceId_t instanceId)
 This function signals the PHY task that timer1 compare match occured.
void Radio_Phy_TimeRxTimeoutIndication (instanceId_t instanceId)
 This function signals the PHY task that the programmed sequence has timed out The Radio is forced to Idle.
void Radio_Phy_PdDataIndication (instanceId_t instanceId)
 This function signals the PHY task that new data has been received.
void Radio_Phy_TimeStartEventIndication (instanceId_t instanceId)
 This function signals the PHY task that the programmed sequence has started.
void Radio_Phy_PlmeCcaConfirm (phyStatus_t phyChannelStatus, instanceId_t instanceId)
 This function signals the PHY task that a CCA sequence has finished.
void Radio_Phy_PlmeEdConfirm (uint8_t energyLeveldB, instanceId_t instanceId)
 This function signals the PHY task that a ED sequence has finished.
void Radio_Phy_PlmeSyncLossIndication (instanceId_t instanceId)
 This function signals the PHY task that a Sync Loss occured (PLL unlock) The Radio is forced to Idle.
void Radio_Phy_PlmeRxSfdDetect (instanceId_t instanceId, uint32_t param)
 This function signals the PHY task that a SFD was detected. Also, if there is not enough time to receive the entire packet, the RX timeout will be extended.
void Radio_Phy_PlmeFilterFailRx (instanceId_t instanceId)
 This function signals the PHY task that a Filter Fail occured.
void Radio_Phy_UnexpectedTransceiverReset (instanceId_t instanceId)
 This function signals the PHY task that an unexpected Transceiver Reset occured and force the TRX to Off.
bool_t PhyIsIdleRx (instanceId_t instanceId)
 This function starts the IdleRX if the PhyRxOnWhenIdle PIB is set.

Detailed Description

Copyright (c) 2015, Freescale Semiconductor, Inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

o Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

o Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

o Neither the name of Freescale Semiconductor, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file Phy.h.


Function Documentation

uint8_t Phy_GetEnergyLevel ( uint8_t  energyLevel )

Scales energy level to 0-255.

*********************************************************************************

Parameters:
[in]energyLevelthe energ level reported by HW
Returns:
uint8_t the energy level scaled in 0x00-0xFF

Definition at line 182 of file PhyISR.c.

void PHY_InstallIsr ( void   )

This function installs the PHY ISR.

*********************************************************************************

Definition at line 574 of file PhyISR.c.

void PHY_InterruptHandler ( void   )

PHY ISR.

*********************************************************************************

Definition at line 288 of file PhyISR.c.

void PhyAbort ( void   )

Aborts the current sequence and force the radio to IDLE.

*********************************************************************************

Definition at line 870 of file PhyPacketProcessor.c.

uint8_t PhyGetLastRxLqiValue ( void   )

This function returns the LQI for the las received packet.

*********************************************************************************

Returns:
uint8_t LQI value

Definition at line 253 of file PhyISR.c.

uint8_t PhyGetLastRxRssiValue ( void   )

This function returns the RSSI for the las received packet.

*********************************************************************************

Returns:
uint8_t RSSI value

Definition at line 264 of file PhyISR.c.

void PhyHwInit ( void   )

Initialize the 802.15.4 Radio registers.

*********************************************************************************

Definition at line 929 of file PhyPacketProcessor.c.

bool_t PhyIsIdleRx ( instanceId_t  instanceId )

This function starts the IdleRX if the PhyRxOnWhenIdle PIB is set.

*********************************************************************************

Parameters:
[in]instanceIdThe instance of the PHY

Definition at line 624 of file PhyStateMachine.c.

void PhyIsrPassRxParams ( volatile phyRxParams_t *  pRxParam )

Sets the location of the Rx parameters.

*********************************************************************************

Parameters:
[in]pRxParampointer to Rx parameters

Definition at line 119 of file PhyISR.c.

void PhyIsrPassTaskParams ( instanceId_t  instanceId )

Sets the current PHY instance waiting for an IRQ.

*********************************************************************************

Parameters:
[in]instanceIdinstance of the PHY

Definition at line 105 of file PhyISR.c.

void PhyIsrSeqCleanup ( void   )

Clear and mask PHY IRQ, set sequence to Idle.

*********************************************************************************

Definition at line 131 of file PhyISR.c.

void PhyIsrTimeoutCleanup ( void   )

Clear and mask PHY IRQ, disable timeout, set sequence to Idle.

*********************************************************************************

Definition at line 152 of file PhyISR.c.

phyStatus_t PhyPdDataRequest ( pdDataReq_t *  pTxPacket,
volatile phyRxParams_t *  pRxParams,
volatile phyTxParams_t *  pTxParams 
)

This function will start a TX sequence. The packet will be sent OTA.

*********************************************************************************

Parameters:
[in]pTxPacketpointer to the TX packet structure
[in]pRxParamspointer to RX parameters
[in]pTxParamspointer to TX parameters
Returns:
phyStatus_t

Definition at line 98 of file PhyPlmeData.c.

phyStatus_t PhyPlmeCcaEdRequest ( phyCCAType_t  ccaParam,
phyContCCAMode_t  cccaMode 
)

This function will start a CCA / CCCA sequence.

*********************************************************************************

Parameters:
[in]ccaParamthe type of CCA
[in]cccaModecontinuous or single CCA
Returns:
phyStatus_t

Definition at line 318 of file PhyPlmeData.c.

uint8_t PhyPlmeGetCurrentChannelRequest ( uint8_t  pan )

This function will return the current channel for a specified PAN.

*********************************************************************************

Parameters:
[in]panthe PAN registers (0/1)
Returns:
uint8_t current channel number

Definition at line 434 of file PhyPlmeData.c.

phyStatus_t PhyPlmeGetPIBRequest ( phyPibId_t  pibId,
uint64_t *  pibValue,
uint8_t  phyRegistrySet,
instanceId_t  instanceId 
)

This function will return the value of PHY PIBs.

*********************************************************************************

Parameters:
[in]pibIdthe Id of the PIB
[out]pibValuepointer to a location where the value will be stored
[in]phyRegistrySetthe PAN registers (0/1)
[in]instanceIdthe instance of the PHY
Returns:
phyStatus_t

Definition at line 596 of file PhyPlmeData.c.

phyStatus_t PhyPlmeRxRequest ( phySlottedMode_t  phyRxMode,
phyRxParams_t *  pRxParams 
)

This function will start a RX sequence.

*********************************************************************************

Parameters:
[in]phyRxModeslotted/unslotted
[in]pRxParamspointer to RX parameters
Returns:
phyStatus_t

Definition at line 235 of file PhyPlmeData.c.

phyStatus_t PhyPlmeSetCurrentChannelRequest ( uint8_t  channel,
uint8_t  pan 
)

This function will set the channel number for the specified PAN.

*********************************************************************************

Parameters:
[in]channelnew channel number
[in]panthe PAN registers (0/1)
Returns:
phyStatus_t

Definition at line 397 of file PhyPlmeData.c.

void PhyPlmeSetFrameWaitTime ( uint32_t  time,
instanceId_t  instanceId 
)

This function sets the value of the maxFrameWaitTime PIB.

*********************************************************************************

Parameters:
[in]instanceIdThe instance of the PHY
[in]timeThe maxFrameWaitTime value

Definition at line 563 of file PhyStateMachine.c.

phyStatus_t PhyPlmeSetPIBRequest ( phyPibId_t  pibId,
uint64_t  pibValue,
uint8_t  phyRegistrySet,
instanceId_t  instanceId 
)

This function will set the value of PHY PIBs.

*********************************************************************************

Parameters:
[in]pibIdthe Id of the PIB
[in]pibValuethe new value of the PIB
[in]phyRegistrySetthe PAN registers (0/1)
[in]instanceIdthe instance of the PHY
Returns:
phyStatus_t

Definition at line 507 of file PhyPlmeData.c.

phyStatus_t PhyPlmeSetPwrLevelRequest ( uint8_t  pwrStep )

This function will set the radio Tx power.

*********************************************************************************

Parameters:
[in]pwrStepthe Tx power
Returns:
phyStatus_t

Definition at line 453 of file PhyPlmeData.c.

phyStatus_t PhyPlmeSetPwrState ( uint8_t  state )

Change the XCVR power state.

*********************************************************************************

Parameters:
[in]statethe new XCVR power state
Returns:
phyStatus_t
Precondition:
Before entering hibernate/reset states, the MCG clock source must be changed to use an input other than the one generated by the XCVR!
Postcondition:
When XCVR is in hibernate, indirect registers cannot be accessed in burst mode When XCVR is in reset, all registers are inaccessible!
Remarks:
Putting the XCVR into hibernate/reset will stop the generated clock signal!

Definition at line 1063 of file PhyPacketProcessor.c.

void PhyPlmeSetRxOnWhenIdle ( bool_t  state,
instanceId_t  instanceId 
)

This function sets the state of the PhyRxOnWhenIdle PIB.

*********************************************************************************

Parameters:
[in]instanceIdThe instance of the PHY
[in]stateThe PhyRxOnWhenIdle value

Definition at line 575 of file PhyStateMachine.c.

void PhyTimeDisableEventTimeout ( void   )

Disables the sequence timeout.

*********************************************************************************

Definition at line 218 of file PhyTime.c.

void PhyTimeDisableEventTrigger ( void   )

Disable the time trigger for a sequence.

*********************************************************************************

Remarks:
The sequence will start asap

Definition at line 130 of file PhyTime.c.

void PhyTimeDisableWaitTimeout ( void   )

Disable the TMR1 timeout.

*********************************************************************************

Definition at line 339 of file PhyTime.c.

uint32_t PhyTimeGetEventTimeout ( void   )

Return the timeout value for the current sequence.

*********************************************************************************

Returns:
uint32_t the timeout value

Definition at line 208 of file PhyTime.c.

void PhyTimeInitEventTimer ( uint32_t *  pAbsTime )

Initialize the Event Timer.

*********************************************************************************

Parameters:
[in]pAbsTimepointer to the location where the new time is stored

Definition at line 276 of file PhyTime.c.

bool_t PhyTimeIsWakeUpTimeExpired ( void   )

Check if TMR4 IRQ occured, and aknowledge it.

*********************************************************************************

Returns:
TRUE if TMR4 IRQ occured

Definition at line 399 of file PhyTime.c.

void PhyTimeSetWakeUpTime ( uint32_t *  pWakeUpTime )

Set TMR4 timeout value.

*********************************************************************************

Parameters:
[in]pWakeUpTimeabsolute time

Definition at line 366 of file PhyTime.c.

void Radio_Phy_PdDataConfirm ( instanceId_t  instanceId,
bool_t  framePending 
)

This function signals the PHY task that a TX operation completed successfully. If the received ACK has FP=1, then the radio will enter RX state for maxFrameWaitTime duration.

*********************************************************************************

Parameters:
[in]instanceIdThe instance of the PHY
[in]framePendingThe value of the framePending bit for the received ACK

Definition at line 641 of file PhyStateMachine.c.

void Radio_Phy_PdDataIndication ( instanceId_t  instanceId )

This function signals the PHY task that new data has been received.

*********************************************************************************

Parameters:
[in]instanceIdThe instance of the PHY

Definition at line 671 of file PhyStateMachine.c.

void Radio_Phy_PlmeCcaConfirm ( phyStatus_t  phyChannelStatus,
instanceId_t  instanceId 
)

This function signals the PHY task that a CCA sequence has finished.

*********************************************************************************

Parameters:
[in]instanceIdThe instance of the PHY
[in]phyChannelStatusThe status of the channel: Idle/Busy
Returns:
None.

Definition at line 699 of file PhyStateMachine.c.

void Radio_Phy_PlmeEdConfirm ( uint8_t  energyLeveldB,
instanceId_t  instanceId 
)

This function signals the PHY task that a ED sequence has finished.

*********************************************************************************

Parameters:
[in]instanceIdThe instance of the PHY
[in]energyLevelThe enetgy level on the channel.
[in]energyLeveldBThe energy level in DB

Definition at line 717 of file PhyStateMachine.c.

void Radio_Phy_PlmeFilterFailRx ( instanceId_t  instanceId )

This function signals the PHY task that a Filter Fail occured.

*********************************************************************************

Parameters:
[in]instanceIdThe instance of the PHY

Definition at line 827 of file PhyStateMachine.c.

void Radio_Phy_PlmeRxSfdDetect ( instanceId_t  instanceId,
uint32_t  frameLen 
)

This function signals the PHY task that a SFD was detected. Also, if there is not enough time to receive the entire packet, the RX timeout will be extended.

*********************************************************************************

Parameters:
[in]instanceIdThe instance of the PHY
[in]frameLenthe length of the PSDU

Definition at line 767 of file PhyStateMachine.c.

void Radio_Phy_PlmeSyncLossIndication ( instanceId_t  instanceId )

This function signals the PHY task that a Sync Loss occured (PLL unlock) The Radio is forced to Idle.

*********************************************************************************

Parameters:
[in]instanceIdThe instance of the PHY

Definition at line 812 of file PhyStateMachine.c.

void Radio_Phy_TimeRxTimeoutIndication ( instanceId_t  instanceId )

This function signals the PHY task that the programmed sequence has timed out The Radio is forced to Idle.

*********************************************************************************

Parameters:
[in]instanceIdThe instance of the PHY

Definition at line 734 of file PhyStateMachine.c.

void Radio_Phy_TimeStartEventIndication ( instanceId_t  instanceId )

This function signals the PHY task that the programmed sequence has started.

*********************************************************************************

Parameters:
[in]instanceIdThe instance of the PHY
Returns:
None.

Definition at line 750 of file PhyStateMachine.c.

void Radio_Phy_TimeWaitTimeoutIndication ( instanceId_t  instanceId )

This function signals the PHY task that timer1 compare match occured.

*********************************************************************************

Parameters:
[in]instanceIdThe instance of the PHY

Definition at line 685 of file PhyStateMachine.c.

void Radio_Phy_UnexpectedTransceiverReset ( instanceId_t  instanceId )

This function signals the PHY task that an unexpected Transceiver Reset occured and force the TRX to Off.

*********************************************************************************

Parameters:
[in]instanceIdThe instance of the PHY

Definition at line 842 of file PhyStateMachine.c.