NXP / fsl_phy_mcr20a

Fork of fsl_phy_mcr20a by Freescale

Embed: (wiki syntax)

« Back to documentation index

PhyStateMachine.c File Reference

PhyStateMachine.c File Reference

Go to the source code of this file.

Functions

static void Phy24Task (Phy_PhyLocalStruct_t *pPhyStruct)
 This function represents the PHY's task.
static phyStatus_t Phy_HandlePdDataReq (Phy_PhyLocalStruct_t *pPhyData, macToPdDataMessage_t *pMsg)
 This function programs a new TX sequence.
static void Phy_EnterIdle (Phy_PhyLocalStruct_t *pPhyData)
 This function starts the IdleRX if the PhyRxOnWhenIdle PIB is set.
static void PLME_SendMessage (Phy_PhyLocalStruct_t *pPhyStruct, phyMessageId_t msgType)
 Senf a PLME message to upper layer.
static void PD_SendMessage (Phy_PhyLocalStruct_t *pPhyStruct, phyMessageId_t msgType)
 Senf a PD message to upper layer.
void Phy_Init (void)
 This function creates the PHY task.
instanceId_t BindToPHY (instanceId_t macInstance)
 This function binds a MAC instance to a PHY instance.
void Phy_RegisterSapHandlers (PD_MAC_SapHandler_t pPD_MAC_SapHandler, PLME_MAC_SapHandler_t pPLME_MAC_SapHandler, instanceId_t instanceId)
 This function registers the MAC PD and PLME SAP handlers.
phyStatus_t MAC_PD_SapHandler (macToPdDataMessage_t *pMsg, instanceId_t phyInstance)
 This is the PD SAP message handler.
phyStatus_t MAC_PLME_SapHandler (macToPlmeMessage_t *pMsg, instanceId_t phyInstance)
 This is the PLME SAP message handler.
void Phy_SetSequenceTiming (uint32_t startTime, uint32_t seqDuration)
 This function sets the start time and the timeout value for a sequence.
void PhyPlmeSetFrameWaitTime (uint32_t time, instanceId_t instanceId)
 This function sets the value of the maxFrameWaitTime PIB.
void PhyPlmeSetRxOnWhenIdle (bool_t state, instanceId_t instanceId)
 This function sets the state of the PhyRxOnWhenIdle PIB.
bool_t PhyIsIdleRx (instanceId_t instanceId)
 This function starts the IdleRX if the PhyRxOnWhenIdle PIB is set.
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_PdDataIndication (instanceId_t instanceId)
 This function signals the PHY task that new data has been received.
void Radio_Phy_TimeWaitTimeoutIndication (instanceId_t instanceId)
 This function signals the PHY task that timer1 compare match occured.
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_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_TimeStartEventIndication (instanceId_t instanceId)
 This function signals the PHY task that the programmed sequence has started.
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.
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_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.

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 PhyStateMachine.c.


Function Documentation

instanceId_t BindToPHY ( instanceId_t  macInstance )

This function binds a MAC instance to a PHY instance.

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

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

Definition at line 152 of file PhyStateMachine.c.

phyStatus_t MAC_PD_SapHandler ( macToPdDataMessage_t *  pMsg,
instanceId_t  phyInstance 
)

This is the PD SAP message handler.

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

Parameters:
[in]pMsgPointer to the PD request message
[in]instanceIdThe instance of the PHY
Returns:
The status of the operation.

Definition at line 308 of file PhyStateMachine.c.

phyStatus_t MAC_PLME_SapHandler ( macToPlmeMessage_t *  pMsg,
instanceId_t  phyInstance 
)

This is the PLME SAP message handler.

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

Parameters:
[in]pMsgPointer to the PLME request message
[in]instanceIdThe instance of the PHY
Returns:
phyStatus_t The status of the operation.

Definition at line 360 of file PhyStateMachine.c.

static void PD_SendMessage ( Phy_PhyLocalStruct_t *  pPhyStruct,
phyMessageId_t  msgType 
) [static]

Senf a PD message to upper layer.

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

Parameters:
[in]instanceIdThe instance of the PHY
[in]msgTypeThe type of message to be sent

Definition at line 897 of file PhyStateMachine.c.

static void Phy24Task ( Phy_PhyLocalStruct_t *  pPhyStruct ) [static]

This function represents the PHY's task.

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

Parameters:
[in]taskParamThe instance of the PHY

Definition at line 181 of file PhyStateMachine.c.

void Phy_EnterIdle ( Phy_PhyLocalStruct_t *  pPhyData ) [static]

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

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

Parameters:
[in]pPhyDatapointer to PHY data

Definition at line 537 of file PhyStateMachine.c.

static phyStatus_t Phy_HandlePdDataReq ( Phy_PhyLocalStruct_t *  pPhyData,
macToPdDataMessage_t *  pMsg 
) [static]

This function programs a new TX sequence.

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

Parameters:
[in]pMsgPointer to the PD request message
[in]pPhyDatapointer to PHY data
Returns:
The status of the operation.

Definition at line 454 of file PhyStateMachine.c.

void Phy_Init ( void   )

This function creates the PHY task.

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

Definition at line 123 of file PhyStateMachine.c.

void Phy_RegisterSapHandlers ( PD_MAC_SapHandler_t  pPD_MAC_SapHandler,
PLME_MAC_SapHandler_t  pPLME_MAC_SapHandler,
instanceId_t  instanceId 
)

This function registers the MAC PD and PLME SAP handlers.

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

Parameters:
[in]pPD_MAC_SapHandlerPointer to the MAC PD handler function
[in]pPLME_MAC_SapHandlerPointer to the MAC PLME handler function
[in]instanceIdThe instance of the PHY
Returns:
The status of the operation.

Definition at line 167 of file PhyStateMachine.c.

void Phy_SetSequenceTiming ( uint32_t  startTime,
uint32_t  seqDuration 
)

This function sets the start time and the timeout value for a sequence.

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

Parameters:
[in]startTimeThe absolute start time for the sequence. If startTime is gPhySeqStartAsap_c, the start timer is disabled.
[in]seqDurationThe duration of the sequence. If seqDuration is 0xFFFFFFFF, the timeout is disabled.

Definition at line 504 of file PhyStateMachine.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 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.

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.

static void PLME_SendMessage ( Phy_PhyLocalStruct_t *  pPhyStruct,
phyMessageId_t  msgType 
) [static]

Senf a PLME message to upper layer.

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

Parameters:
[in]instanceIdThe instance of the PHY
[in]msgTypeThe type of message to be sent

Definition at line 858 of file PhyStateMachine.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.