Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: WNC14A2AInterface
Fork of easy-connect by
| 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:
- 
  xNewState the 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_t Seed 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_t Value 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_t CCA length. 
Definition at line 530 of file SPIRIT_Csma.c.
| CcaPeriod SpiritCsmaGetCcaPeriod | ( | void | ) | 
Returns the CCA period.
- Parameters:
- 
  None. 
- Return values:
- 
  CcaPeriod CCA 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:
- 
  pxCsmaInit Csma 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_t Max 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:
- 
  pxCsmaInit Csma 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:
- 
  xNewState the 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:
- 
  xNewState the 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:
- 
  nBuCounterSeed seed 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:
- 
  cBuPrescaler used 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:
- 
  xCcaLength the 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:
- 
  xMultiplierTbit value 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:
- 
  cMaxNb the max number of back-off. This parameter is an uint8_t. 
- Return values:
- 
  None. 
Definition at line 549 of file SPIRIT_Csma.c.
Generated on Tue Jul 12 2022 20:20:47 by
 1.7.2
 1.7.2 
    