Version of easy-connect with the u-blox cellular platforms C027 and C030 added.

Dependents:   HelloMQTT

Embed: (wiki syntax)

« Back to documentation index

CSMA Exported Functions

CSMA Exported Functions
[CSMA]

Functions

void SpiritCsmaInit (CsmaInit *pxCsmaInit)
 Initializes the SPIRIT CSMA according to the specified parameters in the CsmaInit.
void SpiritCsmaGetInfo (CsmaInit *pxCsmaInit)
 Returns the fitted structure CsmaInit starting from the registers values.
void SpiritCsma (SpiritFunctionalState xNewState)
 Enables or Disables the CSMA.
SpiritFunctionalState SpiritCsmaGetCsma (void)
 Gets the CSMA mode.
void SpiritCsmaPersistentMode (SpiritFunctionalState xNewState)
 Enables or Disables the persistent CSMA mode.
SpiritFunctionalState SpiritCsmaGetPersistentMode (void)
 Gets the persistent CSMA mode.
void SpiritCsmaSeedReloadMode (SpiritFunctionalState 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).
SpiritFunctionalState SpiritCsmaGetSeedReloadMode (void)
 Gets the seed reload mode.
void SpiritCsmaSetBuCounterSeed (uint16_t nBuCounterSeed)
 Sets the BU counter seed (BU_COUNTER_SEED register).
uint16_t SpiritCsmaGetBuCounterSeed (void)
 Returns the BU counter seed (BU_COUNTER_SEED register).
void SpiritCsmaSetBuPrescaler (uint8_t cBuPrescaler)
 Sets the BU prescaler.
uint8_t SpiritCsmaGetBuPrescaler (void)
 Returns the BU prescaler.
void SpiritCsmaSetCcaPeriod (CcaPeriod xMultiplierTbit)
 Sets the CCA period.
CcaPeriod SpiritCsmaGetCcaPeriod (void)
 Returns the CCA period.
void SpiritCsmaSetCcaLength (CsmaLength xCcaLength)
 Sets the CCA length.
uint8_t SpiritCsmaGetCcaLength (void)
 Returns the CCA length.
void SpiritCsmaSetMaxNumberBackoff (uint8_t cMaxNb)
 Sets the max number of back-off.
uint8_t SpiritCsmaGetMaxNumberBackoff (void)
 Returns the max number of back-off.

Function Documentation

void SpiritCsma ( SpiritFunctionalState  xNewState )

Enables or Disables the CSMA.

Parameters:
xNewStatethe state of the CSMA mode. This parameter can be: S_ENABLE or S_DISABLE.
Return values:
None.

Definition at line 208 of file SPIRIT_Csma.c.

uint16_t SpiritCsmaGetBuCounterSeed ( void   )

Returns the BU counter seed (BU_COUNTER_SEED register).

Parameters:
None.
Return values:
uint16_tSeed of the random number generator used to apply the BBE algorithm.

Definition at line 398 of file SPIRIT_Csma.c.

uint8_t SpiritCsmaGetBuPrescaler ( void   )

Returns the BU prescaler.

Parameters:
None.
Return values:
uint8_tValue back-off unit (BU).

Definition at line 442 of file SPIRIT_Csma.c.

uint8_t SpiritCsmaGetCcaLength ( void   )

Returns the CCA length.

Parameters:
None.
Return values:
uint8_tCCA length.

Definition at line 530 of file SPIRIT_Csma.c.

CcaPeriod SpiritCsmaGetCcaPeriod ( void   )

Returns the CCA period.

Parameters:
None.
Return values:
CcaPeriodCCA period.

Definition at line 486 of file SPIRIT_Csma.c.

SpiritFunctionalState SpiritCsmaGetCsma ( void   )

Gets the CSMA mode.

Says if it is enabled or disabled.

Parameters:
None.
Return values:
SpiritFunctionalState,:CSMA mode.

Definition at line 238 of file SPIRIT_Csma.c.

void SpiritCsmaGetInfo ( CsmaInit pxCsmaInit )

Returns the fitted structure CsmaInit starting from the registers values.

Parameters:
pxCsmaInitCsma structure to be fitted. This parameter is a pointer to CsmaInit.
Return values:
None.

Definition at line 171 of file SPIRIT_Csma.c.

uint8_t SpiritCsmaGetMaxNumberBackoff ( void   )

Returns the max number of back-off.

Parameters:
None.
Return values:
uint8_tMax number of back-off.

Definition at line 572 of file SPIRIT_Csma.c.

SpiritFunctionalState SpiritCsmaGetPersistentMode ( void   )

Gets the persistent CSMA mode.

Parameters:
None.
Return values:
SpiritFunctionalState,:CSMA persistent mode.

Definition at line 294 of file SPIRIT_Csma.c.

SpiritFunctionalState SpiritCsmaGetSeedReloadMode ( void   )

Gets the seed reload mode.

Parameters:
None.
Return values:
SpiritFunctionalState,:CSMA seed reload mode.

Definition at line 351 of file SPIRIT_Csma.c.

void SpiritCsmaInit ( CsmaInit pxCsmaInit )

Initializes the SPIRIT CSMA according to the specified parameters in the CsmaInit.

Parameters:
pxCsmaInitCsma init structure. This parameter is a pointer to CsmaInit.
Return values:
None.

Definition at line 119 of file SPIRIT_Csma.c.

void SpiritCsmaPersistentMode ( SpiritFunctionalState  xNewState )

Enables or Disables the persistent CSMA mode.

Parameters:
xNewStatethe state of the persistent CSMA mode. This parameter can be: S_ENABLE or S_DISABLE.
Return values:
None.

Definition at line 263 of file SPIRIT_Csma.c.

void SpiritCsmaSeedReloadMode ( SpiritFunctionalState  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).

Parameters:
xNewStatethe state of the seed reload mode. This parameter can be: S_ENABLE or S_DISABLE.
Return values:
None.

Definition at line 320 of file SPIRIT_Csma.c.

void SpiritCsmaSetBuCounterSeed ( uint16_t  nBuCounterSeed )

Sets the BU counter seed (BU_COUNTER_SEED register).

The CSMA back off time is given by the formula: BO = rand(2^NB)*BU.

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 376 of file SPIRIT_Csma.c.

void SpiritCsmaSetBuPrescaler ( uint8_t  cBuPrescaler )

Sets the BU prescaler.

The CSMA back off time is given by the formula: BO = rand(2^NB)*BU.

Parameters:
cBuPrescalerused to program the back-off unit BU. This parameter is an uint8_t.
Return values:
None.

Definition at line 417 of file SPIRIT_Csma.c.

void SpiritCsmaSetCcaLength ( CsmaLength  xCcaLength )

Sets the CCA length.

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 505 of file SPIRIT_Csma.c.

void SpiritCsmaSetCcaPeriod ( CcaPeriod  xMultiplierTbit )

Sets the CCA period.

Parameters:
xMultiplierTbitvalue of CCA period to store. This parameter can be a value of CcaPeriod.
Return values:
None.

Definition at line 461 of file SPIRIT_Csma.c.

void SpiritCsmaSetMaxNumberBackoff ( uint8_t  cMaxNb )

Sets the max number of back-off.

If reached Spirit stops the transmission.

Parameters:
cMaxNbthe max number of back-off. This parameter is an uint8_t.
Return values:
None.

Definition at line 549 of file SPIRIT_Csma.c.