NXP / fsl_phy_mcr20a

Fork of fsl_phy_mcr20a by Freescale

Embed: (wiki syntax)

« Back to documentation index

MPM.c File Reference

MPM.c File Reference

Go to the source code of this file.

Functions

static void MPM_SetPanSettingsInPhy (uint8_t panIndex)
 This function will store PAN settings in PHY.
static uint8_t MPM_AllocateResource (bool_t force, uint8_t panIdx)
 This function alocates a registry set to a PAN.
uint32_t MPM_GetMacInstanceFromRegSet (uint32_t regSet)
 This function determines the instance of the MAC associated with a PHY regSet.
uint32_t MPM_GetRegSet (uint8_t panIdx)
 This function determines the PHY regSet for the specified panIndex.
phyStatus_t MPM_SetPIB (phyPibId_t pibId, void *pValue, uint8_t panIdx)
 This function determines the PHY regSet for the specified panIndex.
void MPM_Init (void)
 This function initializes the MPM module.
phyStatus_t MPM_PrepareForTx (instanceId_t macInstance)
 This function prepare the Radio for a TX/CCA/ED operation.
phyStatus_t MPM_PrepareForRx (instanceId_t macInstance)
 This function checks if a PAN has the RxOnWhenIdle PIB set. If an Rx needs to be started, it makes the propper settings in PHY.
int32_t MPM_GetPanIndex (instanceId_t macInstance)
 This function returns the PAN index for a MAC instance.
void MPM_SetConfig (mpmConfig_t *pCfg)
 This function configures the MPM module.
void MPM_GetConfig (mpmConfig_t *pCfg)
 This function returns the MPM configuration.
phyStatus_t MPM_AcquirePAN (instanceId_t macInstance)
 This function Acquires a PAN for exclusive access.
phyStatus_t MPM_ReleasePAN (instanceId_t macInstance)
 This function Releases a PAN that was Acquired.

Detailed Description

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

This is the source file for the Multiple PAN Manager.

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


Function Documentation

phyStatus_t MPM_AcquirePAN ( instanceId_t  macInstance )

This function Acquires a PAN for exclusive access.

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

Parameters:
[in]macInstanceThe instance of the MAC
Returns:
The status of the operation

Definition at line 420 of file MPM.c.

static uint8_t MPM_AllocateResource ( bool_t  force,
uint8_t  panIdx 
) [static]

This function alocates a registry set to a PAN.

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

Parameters:
[in]forceIf this parameter is TRUE, then another PAN can be preempted.
[in]panIdxThe index into the MPM database
Returns:
The register set allocated for the specified PAN.

Definition at line 489 of file MPM.c.

void MPM_GetConfig ( mpmConfig_t *  pCfg )

This function returns the MPM configuration.

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

Parameters:
[in]pCfgpointer to a configuration structure
Returns:
None.

Definition at line 404 of file MPM.c.

uint32_t MPM_GetMacInstanceFromRegSet ( uint32_t  regSet )

This function determines the instance of the MAC associated with a PHY regSet.

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

Parameters:
[in]regSetThe PHY registry set
Returns:
The instance of the MAC associated with a PHY registry set.

Definition at line 96 of file MPM.c.

int32_t MPM_GetPanIndex ( instanceId_t  macInstance )

This function returns the PAN index for a MAC instance.

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

Parameters:
[in]macInstanceThe instance of the MAC
Returns:
The PAN index or -1 if it was not found

Definition at line 341 of file MPM.c.

uint32_t MPM_GetRegSet ( uint8_t  panIdx )

This function determines the PHY regSet for the specified panIndex.

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

Parameters:
[in]panIdxThe index in mPanInfo[] table
Returns:
The PHY registry set.

Definition at line 112 of file MPM.c.

void MPM_Init ( void   )

This function initializes the MPM module.

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

Parameters:
[in]None.
Returns:
None

Definition at line 231 of file MPM.c.

phyStatus_t MPM_PrepareForRx ( instanceId_t  macInstance )

This function checks if a PAN has the RxOnWhenIdle PIB set. If an Rx needs to be started, it makes the propper settings in PHY.

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

Parameters:
[in]None.
Returns:
phyStatus

Definition at line 286 of file MPM.c.

phyStatus_t MPM_PrepareForTx ( instanceId_t  macInstance )

This function prepare the Radio for a TX/CCA/ED operation.

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

Parameters:
[in]macInstanceThe instance of the MAC
Returns:
The status of the Operation

Definition at line 255 of file MPM.c.

phyStatus_t MPM_ReleasePAN ( instanceId_t  macInstance )

This function Releases a PAN that was Acquired.

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

Parameters:
[in]macInstanceThe instance of the MAC
Returns:
The status of the operation

Definition at line 455 of file MPM.c.

void MPM_SetConfig ( mpmConfig_t *  pCfg )

This function configures the MPM module.

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

Parameters:
[in]pCfgpointer to a configuration structure
Remarks:
The Dual PAN dwell time prescaller values: 0-3 The Dual PAN dwell time values 0-63. The (dwellTime+1) represents multiples of the prescaller time base.

Definition at line 383 of file MPM.c.

static void MPM_SetPanSettingsInPhy ( uint8_t  panIndex ) [static]

This function will store PAN settings in PHY.

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

Parameters:
[in]panIdxThe index into the MPM database
Returns:
None.
Remarks:
Function assumes that the PAN is active!

Definition at line 535 of file MPM.c.

phyStatus_t MPM_SetPIB ( phyPibId_t  pibId,
void *  pValue,
uint8_t  panIdx 
)

This function determines the PHY regSet for the specified panIndex.

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

Parameters:
[in]pibIdThe id of the PHY PIB
[in]pValueThe value of the PHY PIB
[in]panIdxThe index in mPanInfo[] table
Returns:
The status of the operation.

Definition at line 127 of file MPM.c.