Appiko
Functions
CSMA Private Functions

Functions

void S2LPCsmaInit (SCsmaInit *pxCsmaInit)
 Initialize the S2LP CSMA according to the specified parameters in the SCsmaInit. More...
 
void S2LPCsmaGetInfo (SCsmaInit *pxSCsmaInit)
 Return the fitted structure SCsmaInit starting from the registers values. More...
 
void S2LPCsma (SFunctionalState xNewState)
 Enable or Disables the CSMA. More...
 
SFunctionalState S2LPCsmaGetCsma (void)
 Gets the CSMA mode. Says if it is enabled or disabled. More...
 
void S2LPCsmaPersistentMode (SFunctionalState xNewState)
 Enables or Disables the persistent CSMA mode. More...
 
SFunctionalState S2LPCsmaGetPersistentMode (void)
 Gets the persistent CSMA mode. More...
 
void S2LPCsmaSeedReloadMode (SFunctionalState xNewState)
 Enables or Disables the seed reload mode (if enabled it reloads the back-off generator seed using the value written in the BU_COUNTER_SEED register). More...
 
SFunctionalState S2LPCsmaGetSeedReloadMode (void)
 Gets the seed reload mode. More...
 
void S2LPCsmaSetBuCounterSeed (uint16_t nBuCounterSeed)
 Set the BU counter seed (BU_COUNTER_SEED register). The CSMA back off time is given by the formula: BO = rand(2^NB)*BU. More...
 
uint16_t S2LPCsmaGetBuCounterSeed (void)
 Return the BU counter seed (BU_COUNTER_SEED register). More...
 
void S2LPCsmaSetBuPrescaler (uint8_t cBuPrescaler)
 Set the BU prescaler. The CSMA back off time is given by the formula: BO = rand(2^NB)*BU. More...
 
uint8_t S2LPCsmaGetBuPrescaler (void)
 Return the BU prescaler. More...
 
void S2LPCsmaSetCcaPeriod (SCsmaPeriod xMultiplierTbit)
 Set the CCA period. More...
 
uint8_t S2LPCsmaGetCcaPeriod (void)
 Return the CCA period. More...
 
void S2LPCsmaSetCcaLength (uint8_t xCcaLength)
 Set the CCA length. More...
 
uint8_t S2LPCsmaGetCcaLength (void)
 Return the CCA length. More...
 
void S2LPCsmaSetMaxNumberBackoff (uint8_t cMaxNb)
 Set the max number of back-off. If reached S2LP stops the transmission. More...
 
uint8_t S2LPCsmaGetMaxNumberBackoff (void)
 Return the max number of back-off. More...
 

Detailed Description

Function Documentation

◆ S2LPCsma()

void S2LPCsma ( SFunctionalState  xNewState)
Parameters
xNewStatethe state of the CSMA mode. This parameter can be: S_ENABLE or S_DISABLE.
Return values
None.

Definition at line 201 of file S2LP_Csma.c.

◆ S2LPCsmaGetBuCounterSeed()

uint16_t S2LPCsmaGetBuCounterSeed ( void  )
Parameters
None.
Return values
uint16_tSeed of the random number generator used to apply the BBE algorithm.

Definition at line 365 of file S2LP_Csma.c.

References g_xStatus.

◆ S2LPCsmaGetBuPrescaler()

uint8_t S2LPCsmaGetBuPrescaler ( void  )
Parameters
None.
Return values
uint8_tValue back-off unit (BU).

Definition at line 400 of file S2LP_Csma.c.

References g_xStatus.

◆ S2LPCsmaGetCcaLength()

uint8_t S2LPCsmaGetCcaLength ( void  )
Parameters
None.
Return values
uint8_tCCA length.

Definition at line 472 of file S2LP_Csma.c.

References g_xStatus.

◆ S2LPCsmaGetCcaPeriod()

uint8_t S2LPCsmaGetCcaPeriod ( void  )
Parameters
None.
Return values
CcaPeriodCCA period.

Definition at line 436 of file S2LP_Csma.c.

References g_xStatus.

◆ S2LPCsmaGetCsma()

SFunctionalState S2LPCsmaGetCsma ( void  )
Parameters
None.
Return values
SFunctionalStateCSMA mode.

Definition at line 231 of file S2LP_Csma.c.

References g_xStatus.

◆ S2LPCsmaGetInfo()

void S2LPCsmaGetInfo ( SCsmaInit pxSCsmaInit)
Parameters
pxCsmaInitCsma structure to be fitted. This parameter is a pointer to SCsmaInit.
Return values
None.

Definition at line 164 of file S2LP_Csma.c.

◆ S2LPCsmaGetMaxNumberBackoff()

uint8_t S2LPCsmaGetMaxNumberBackoff ( void  )
Parameters
None.
Return values
uint8_tMax number of back-off.

Definition at line 506 of file S2LP_Csma.c.

References g_xStatus.

◆ S2LPCsmaGetPersistentMode()

SFunctionalState S2LPCsmaGetPersistentMode ( void  )
Parameters
None.
Return values
SFunctionalStateCSMA persistent mode.

Definition at line 279 of file S2LP_Csma.c.

References g_xStatus.

◆ S2LPCsmaGetSeedReloadMode()

SFunctionalState S2LPCsmaGetSeedReloadMode ( void  )
Parameters
None.
Return values
SFunctionalStateCSMA seed reload mode.

Definition at line 326 of file S2LP_Csma.c.

References g_xStatus.

◆ S2LPCsmaInit()

void S2LPCsmaInit ( SCsmaInit pxCsmaInit)
Parameters
pxCsmaInitCsma init structure. This parameter is a pointer to SCsmaInit.
Return values
None.

Definition at line 114 of file S2LP_Csma.c.

◆ S2LPCsmaPersistentMode()

void S2LPCsmaPersistentMode ( SFunctionalState  xNewState)
Parameters
xNewStatethe state of the persistent CSMA mode. This parameter can be: S_ENABLE or S_DISABLE.
Return values
None.

Definition at line 254 of file S2LP_Csma.c.

◆ S2LPCsmaSeedReloadMode()

void S2LPCsmaSeedReloadMode ( SFunctionalState  xNewState)
Parameters
xNewStatethe state of the seed reload mode. This parameter can be: S_ENABLE or S_DISABLE.
Return values
None.

Definition at line 301 of file S2LP_Csma.c.

◆ S2LPCsmaSetBuCounterSeed()

void S2LPCsmaSetBuCounterSeed ( uint16_t  nBuCounterSeed)
Parameters
nBuCounterSeedseed of the random number generator used to apply the BBE algorithm. This parameter is an uint16_t.
Return values
None.

Definition at line 348 of file S2LP_Csma.c.

◆ S2LPCsmaSetBuPrescaler()

void S2LPCsmaSetBuPrescaler ( uint8_t  cBuPrescaler)
Parameters
cBuPrescalerused to program the back-off unit BU. This parameter is an uint8_t.
Return values
None.

Definition at line 381 of file S2LP_Csma.c.

◆ S2LPCsmaSetCcaLength()

void S2LPCsmaSetCcaLength ( uint8_t  xCcaLength)
Parameters
xCcaLengththe CCA length (a value between 1 and 15 that multiplies the CCA period). This parameter can be any value of CsmaLength.
Return values
None.

Definition at line 452 of file S2LP_Csma.c.

◆ S2LPCsmaSetCcaPeriod()

void S2LPCsmaSetCcaPeriod ( SCsmaPeriod  xMultiplierTbit)
Parameters
xMultiplierTbitvalue of CCA period to store. This parameter can be a value of CcaPeriod.
Return values
None.

Definition at line 416 of file S2LP_Csma.c.

◆ S2LPCsmaSetMaxNumberBackoff()

void S2LPCsmaSetMaxNumberBackoff ( uint8_t  cMaxNb)
Parameters
cMaxNbthe max number of back-off. This parameter is an uint8_t.
Return values
None.

Definition at line 488 of file S2LP_Csma.c.