S2-LP Low Level API  v. 1.3.0
Functions
Timer Exported Functions

Functions

void S2LPTimerSetRxTimerStopCondition (RxTimeoutStopCondition xStopCondition)
 Set the RX timeout stop conditions. More...
 
void S2LPTimerLdcrMode (SFunctionalState xNewState)
 Enables or Disables the LDCR mode. More...
 
void S2LPTimerLdcrAutoReload (SFunctionalState xNewState)
 Enables or Disables the LDCR timer reloading with the value stored in the LDCR_RELOAD registers. More...
 
SFunctionalState S2LPTimerLdcrGetAutoReload (void)
 Return the LDCR timer reload bit. More...
 
void S2LpTimerFastRxTermTimer (SFunctionalState xNewState)
 Enables the Fast RX termination timer. More...
 
void S2LpSetTimerFastRxTermTimer (uint8_t fast_rx_word)
 Set the Fast RX termination timer word. When the timer counter will reach this word, the timer expires. The timer counter is clocked at frequency: fCLK/24/2^CHFLT_E
More...
 
void S2LpSetTimerFastRxTermTimerUs (uint32_t fast_rx_us)
 Set the Fast RX termination timer word starting from a us value. The timer counter is clocked at frequency: fCLK/24/2^CHFLT_E. More...
 
void S2LPTimerSetRxTimer (uint8_t cCounter, uint8_t cPrescaler)
 Set the RX timeout timer initialization registers with the values of COUNTER and PRESCALER according to the formula: Trx=PRESCALER*COUNTER*Tck. Remember that it is possible to have infinite RX_Timeout writing 0 in the RX_Timeout_Counter and/or RX_Timeout_Prescaler registers. More...
 
void S2LPTimerSetRxTimerUs (uint32_t lDesiredUsec)
 Set the RX timeout timer counter and prescaler from the desired value in ms. it is possible to fix the RX_Timeout to a minimum value of 50.417us to a maximum value of about 3.28 s. More...
 
void S2LPTimerSetRxTimerCounter (uint8_t cCounter)
 Set the RX timeout timer counter. If it is equal to 0 the timeout is infinite. More...
 
void S2LPTimerSetRxTimerPrescaler (uint8_t cPrescaler)
 Set the RX timeout timer prescaler. If it is equal to 0 the timeout is infinite. More...
 
void S2LPTimerGetRxTimerUs (uint32_t *plTimeoutUsec, uint8_t *pcCounter, uint8_t *pcPrescaler)
 Return the RX timeout timer. More...
 
void S2LPTimerSetWakeUpTimer (uint8_t cCounter, uint8_t cPrescaler)
 Set the LDCR wake up timer initialization registers with the values of COUNTER and PRESCALER according to the formula: Twu=(PRESCALER +1)*(COUNTER+1)*Tck, where Tck = 28.818 us. The minimum vale of the wakeup timeout is 28.818us (PRESCALER and COUNTER equals to 0) and the maximum value is about 1.89 s (PRESCALER anc COUNTER equals to 255). More...
 
void S2LPTimerSetWakeUpTimerUs (uint32_t lDesiredUsec)
 Set the LDCR wake up timer counter and prescaler from the desired value in ms, according to the formula: Twu=(PRESCALER +1)*(COUNTER+1)*Tck, where Tck = 28.818 us. The minimum vale of the wakeup timeout is 28.818us (PRESCALER and COUNTER equals to 0) and the maximum value is about 1.89 s (PRESCALER anc COUNTER equals to 255). More...
 
void S2LPTimerSetWakeUpTimerCounter (uint8_t cCounter)
 Set the LDCR wake up timer counter. Remember that this value is incresead by one in the Twu calculation. Twu=(PRESCALER +1)*(COUNTER+1)*Tck, where Tck = 28.818 us. More...
 
void S2LPTimerSetWakeUpTimerPrescaler (uint8_t cPrescaler)
 Set the LDCR wake up timer prescaler. Remember that this value is incresead by one in the Twu calculation. Twu=(PRESCALER +1)*(COUNTER+1)*Tck, where Tck = 28.818 us. More...
 
void S2LPTimerSetWakeUpTimerReloadUs (uint32_t lDesiredUsec)
 Set the LDCR wake up reload timer counter and prescaler from the desired value in ms, according to the formula: Twu=(PRESCALER +1)*(COUNTER+1)*Tck, where Tck = 28.818 us. The minimum vale of the wakeup timeout is 28.818us (PRESCALER and COUNTER equals to 0) and the maximum value is about 1.89 s (PRESCALER anc COUNTER equals to 255). More...
 
void S2LPTimerGetWakeUpTimerUs (uint32_t *plWakeUpUsec, uint8_t *pcCounter, uint8_t *pcPrescaler, uint8_t *pcMulti)
 Return the LDCR wake up timer, according to the formula: Twu=(PRESCALER +1)*(COUNTER+1)*Tck, where Tck = 28.818 us. More...
 
void S2LPTimerSetWakeUpTimerReload (uint8_t cCounter, uint8_t cPrescaler, uint8_t cMulti)
 Set the LDCR wake up timer reloading registers with the values of COUNTER and PRESCALER according to the formula: Twu=(PRESCALER +1)*(COUNTER+1)*Tck, where Tck = 28.818 us. The minimum vale of the wakeup timeout is 28.818us (PRESCALER and COUNTER equals to 0) and the maximum value is about 1.89 s (PRESCALER anc COUNTER equals to 255). More...
 
void S2LPTimerSetWakeUpTimerReloadCounter (uint8_t cCounter)
 Set the LDCR wake up timer reload counter. Remember that this value is incresead by one in the Twu calculation. Twu=(PRESCALER +1)*(COUNTER+1)*Tck, where Tck = 28.818 us. More...
 
void S2LPTimerSetWakeUpTimerReloadPrescaler (uint8_t cPrescaler)
 Set the LDCR wake up timer reload prescaler. Remember that this value is incresead by one in the Twu calculation. Twu=(PRESCALER +1)*(COUNTER+1)*Tck, where Tck = 28.818 us. More...
 
void S2LPTimerGetWakeUpTimerReloadUs (uint32_t *plWakeUpReloadUsec, uint8_t *pcCounter, uint8_t *pcPrescaler, uint8_t *pcMulti)
 Return the LDCR wake up reload timer, according to the formula: Twu=(PRESCALER +1)*(COUNTER+1)*Tck, where Tck = 28.818 us. More...
 
uint16_t S2LPTimerGetRcoFrequency (void)
 Computes and Return the RCO frequency. This frequency depends on the xtal frequency and the XTAL bit in register 0x01. More...
 
void S2LPTimerCalibrationRco (SFunctionalState xCalibration)
 Enables the RCO autocalibration when the device make the transition READY -> SLEEP. More...
 
void S2LPTimerSleepB (SFunctionalState en)
 Enable the SLEEP_B mode. SLEEP_A and SLEEP_B are mutually exclusive. More...
 
void S2LPTimerLdcIrqWa (SFunctionalState en)
 

Detailed Description

Function Documentation

◆ S2LpSetTimerFastRxTermTimer()

void S2LpSetTimerFastRxTermTimer ( uint8_t  fast_rx_word)

Set the Fast RX termination timer word. When the timer counter will reach this word, the timer expires. The timer counter is clocked at frequency: fCLK/24/2^CHFLT_E

Parameters
fast_rx_word: the FAST_RX_TIMER word (register 0x54 value).
Return values
None

Definition at line 686 of file S2LP_Timer.c.

◆ S2LpSetTimerFastRxTermTimerUs()

void S2LpSetTimerFastRxTermTimerUs ( uint32_t  fast_rx_us)

Set the Fast RX termination timer word starting from a us value. The timer counter is clocked at frequency: fCLK/24/2^CHFLT_E.

Parameters
fast_rx_us: fast rx termination target value in us.
Return values
None
Note
: the user should care about the max value that can be set unless asserts are used.

Definition at line 699 of file S2LP_Timer.c.

◆ S2LPTimerCalibrationRco()

void S2LPTimerCalibrationRco ( SFunctionalState  xCalibration)

Enables the RCO autocalibration when the device make the transition READY -> SLEEP.

Parameters
enif it is S_ENABLE: RCO calibration is enabled. if it is S_DISABLE: RCO calibration is disabled.
Return values
None

Definition at line 725 of file S2LP_Timer.c.

◆ S2LpTimerFastRxTermTimer()

void S2LpTimerFastRxTermTimer ( SFunctionalState  xNewState)

Enables the Fast RX termination timer.

Parameters
None
Return values
None

Definition at line 663 of file S2LP_Timer.c.

◆ S2LPTimerGetRcoFrequency()

uint16_t S2LPTimerGetRcoFrequency ( void  )

Computes and Return the RCO frequency. This frequency depends on the xtal frequency and the XTAL bit in register 0x01.

Return values
RCOfrequency in Hz as an uint16_t.

Definition at line 641 of file S2LP_Timer.c.

◆ S2LPTimerGetRxTimerUs()

void S2LPTimerGetRxTimerUs ( uint32_t *  plTimeoutUsec,
uint8_t *  pcCounter,
uint8_t *  pcPrescaler 
)

Return the RX timeout timer.

Parameters
plTimeoutUsecpointer to the variable in which the timeout expressed in microseconds has to be stored. If the returned value is 0, it means that the RX_Timeout is infinite. This parameter must be a uint32_t*.
pcCounterpointer to the variable in which the timer counter has to be stored. This parameter must be an uint8_t*.
pcPrescalerpointer to the variable in which the timer prescaler has to be stored. This parameter must be an uint8_t*.
Return values
None.

Definition at line 404 of file S2LP_Timer.c.

◆ S2LPTimerGetWakeUpTimerReloadUs()

void S2LPTimerGetWakeUpTimerReloadUs ( uint32_t *  plWakeUpReloadUsec,
uint8_t *  pcCounter,
uint8_t *  pcPrescaler,
uint8_t *  pcMulti 
)

Return the LDCR wake up reload timer, according to the formula: Twu=(PRESCALER +1)*(COUNTER+1)*Tck, where Tck = 28.818 us.

Parameters
plWakeUpReloadUsecpointer to the variable in which the wake-up reload time expressed in milliseconds has to be stored. This parameter must be a uint32_t*.
pcCounterpointer to the variable in which the timer counter has to be stored. This parameter must be an uint8_t*.
pcPrescalerpointer to the variable in which the timer prescaler has to be stored. This parameter must be an uint8_t*.
Return values
None.

Definition at line 597 of file S2LP_Timer.c.

◆ S2LPTimerGetWakeUpTimerUs()

void S2LPTimerGetWakeUpTimerUs ( uint32_t *  plWakeUpUsec,
uint8_t *  pcCounter,
uint8_t *  pcPrescaler,
uint8_t *  pcMulti 
)

Return the LDCR wake up timer, according to the formula: Twu=(PRESCALER +1)*(COUNTER+1)*Tck, where Tck = 28.818 us.

Parameters
plWakeUpUsecpointer to the variable in which the wake-up time expressed in milliseconds has to be stored. This parameter must be a uint32_t*.
pcCounterpointer to the variable in which the timer counter has to be stored. This parameter must be an uint8_t*.
pcPrescalerpointer to the variable in which the timer prescaler has to be stored. This parameter must be an uint8_t*.
Return values
None.

Definition at line 496 of file S2LP_Timer.c.

◆ S2LPTimerLdcIrqWa()

void S2LPTimerLdcIrqWa ( SFunctionalState  en)

Definition at line 764 of file S2LP_Timer.c.

◆ S2LPTimerLdcrAutoReload()

void S2LPTimerLdcrAutoReload ( SFunctionalState  xNewState)

Enables or Disables the LDCR timer reloading with the value stored in the LDCR_RELOAD registers.

Parameters
xNewStatenew state for LDCR reloading. This parameter can be: S_ENABLE or S_DISABLE.
Return values
None.

Definition at line 310 of file S2LP_Timer.c.

◆ S2LPTimerLdcrGetAutoReload()

SFunctionalState S2LPTimerLdcrGetAutoReload ( void  )

Return the LDCR timer reload bit.

Parameters
None.
Return values
SFunctionalStatevalue of the reload bit.

Definition at line 331 of file S2LP_Timer.c.

◆ S2LPTimerLdcrMode()

void S2LPTimerLdcrMode ( SFunctionalState  xNewState)

Enables or Disables the LDCR mode.

Parameters
xNewStatenew state for LDCR mode. This parameter can be: S_ENABLE or S_DISABLE.
Return values
None.

Definition at line 288 of file S2LP_Timer.c.

◆ S2LPTimerSetRxTimer()

void S2LPTimerSetRxTimer ( uint8_t  cCounter,
uint8_t  cPrescaler 
)

Set the RX timeout timer initialization registers with the values of COUNTER and PRESCALER according to the formula: Trx=PRESCALER*COUNTER*Tck. Remember that it is possible to have infinite RX_Timeout writing 0 in the RX_Timeout_Counter and/or RX_Timeout_Prescaler registers.

Parameters
cCountervalue for the timer counter. This parameter must be an uint8_t.
cPrescalervalue for the timer prescaler. This parameter must be an uint8_t.
Return values
None.

Definition at line 347 of file S2LP_Timer.c.

◆ S2LPTimerSetRxTimerCounter()

void S2LPTimerSetRxTimerCounter ( uint8_t  cCounter)

Set the RX timeout timer counter. If it is equal to 0 the timeout is infinite.

Parameters
cCountervalue for the timer counter. This parameter must be an uint8_t.
Return values
None.

Definition at line 375 of file S2LP_Timer.c.

◆ S2LPTimerSetRxTimerPrescaler()

void S2LPTimerSetRxTimerPrescaler ( uint8_t  cPrescaler)

Set the RX timeout timer prescaler. If it is equal to 0 the timeout is infinite.

Parameters
cPrescalervalue for the timer prescaler. This parameter must be an uint8_t.
Return values
None

Definition at line 387 of file S2LP_Timer.c.

◆ S2LPTimerSetRxTimerStopCondition()

void S2LPTimerSetRxTimerStopCondition ( RxTimeoutStopCondition  xStopCondition)

Set the RX timeout stop conditions.

Parameters
xStopConditionnew stop condition. This parameter can be any value of RxTimeoutStopCondition.
Return values
None

Definition at line 619 of file S2LP_Timer.c.

◆ S2LPTimerSetRxTimerUs()

void S2LPTimerSetRxTimerUs ( uint32_t  lDesiredUsec)

Set the RX timeout timer counter and prescaler from the desired value in ms. it is possible to fix the RX_Timeout to a minimum value of 50.417us to a maximum value of about 3.28 s.

Parameters
lDesiredUsecdesired timer value. This parameter must be a uint32_t.
Return values
None

Definition at line 361 of file S2LP_Timer.c.

◆ S2LPTimerSetWakeUpTimer()

void S2LPTimerSetWakeUpTimer ( uint8_t  cCounter,
uint8_t  cPrescaler 
)

Set the LDCR wake up timer initialization registers with the values of COUNTER and PRESCALER according to the formula: Twu=(PRESCALER +1)*(COUNTER+1)*Tck, where Tck = 28.818 us. The minimum vale of the wakeup timeout is 28.818us (PRESCALER and COUNTER equals to 0) and the maximum value is about 1.89 s (PRESCALER anc COUNTER equals to 255).

Parameters
cCountervalue for the timer counter. This parameter must be an uint8_t.
cPrescalervalue for the timer prescaler. This parameter must be an uint8_t.
Return values
None.

Definition at line 427 of file S2LP_Timer.c.

◆ S2LPTimerSetWakeUpTimerCounter()

void S2LPTimerSetWakeUpTimerCounter ( uint8_t  cCounter)

Set the LDCR wake up timer counter. Remember that this value is incresead by one in the Twu calculation. Twu=(PRESCALER +1)*(COUNTER+1)*Tck, where Tck = 28.818 us.

Parameters
cCountervalue for the timer counter. This parameter must be an uint8_t.
Return values
None.

Definition at line 467 of file S2LP_Timer.c.

◆ S2LPTimerSetWakeUpTimerPrescaler()

void S2LPTimerSetWakeUpTimerPrescaler ( uint8_t  cPrescaler)

Set the LDCR wake up timer prescaler. Remember that this value is incresead by one in the Twu calculation. Twu=(PRESCALER +1)*(COUNTER+1)*Tck, where Tck = 28.818 us.

Parameters
cPrescalervalue for the timer prescaler. This parameter must be an uint8_t.
Return values
None.

Definition at line 480 of file S2LP_Timer.c.

◆ S2LPTimerSetWakeUpTimerReload()

void S2LPTimerSetWakeUpTimerReload ( uint8_t  cCounter,
uint8_t  cPrescaler,
uint8_t  cMulti 
)

Set the LDCR wake up timer reloading registers with the values of COUNTER and PRESCALER according to the formula: Twu=(PRESCALER +1)*(COUNTER+1)*Tck, where Tck = 28.818 us. The minimum vale of the wakeup timeout is 28.818us (PRESCALER and COUNTER equals to 0) and the maximum value is about 1.89 s (PRESCALER anc COUNTER equals to 255).

Parameters
cCounterreload value for the timer counter. This parameter must be an uint8_t.
cPrescalerreload value for the timer prescaler. This parameter must be an uint8_t.
Return values
None.

Definition at line 524 of file S2LP_Timer.c.

◆ S2LPTimerSetWakeUpTimerReloadCounter()

void S2LPTimerSetWakeUpTimerReloadCounter ( uint8_t  cCounter)

Set the LDCR wake up timer reload counter. Remember that this value is incresead by one in the Twu calculation. Twu=(PRESCALER +1)*(COUNTER+1)*Tck, where Tck = 28.818 us.

Parameters
cCountervalue for the timer counter. This parameter must be an uint8_t.
Return values
None

Definition at line 568 of file S2LP_Timer.c.

◆ S2LPTimerSetWakeUpTimerReloadPrescaler()

void S2LPTimerSetWakeUpTimerReloadPrescaler ( uint8_t  cPrescaler)

Set the LDCR wake up timer reload prescaler. Remember that this value is incresead by one in the Twu calculation. Twu=(PRESCALER +1)*(COUNTER+1)*Tck, where Tck = 28.818 us.

Parameters
cPrescalervalue for the timer prescaler. This parameter must be an uint8_t.
Return values
None

Definition at line 581 of file S2LP_Timer.c.

◆ S2LPTimerSetWakeUpTimerReloadUs()

void S2LPTimerSetWakeUpTimerReloadUs ( uint32_t  lDesiredUsec)

Set the LDCR wake up reload timer counter and prescaler from the desired value in ms, according to the formula: Twu=(PRESCALER +1)*(COUNTER+1)*Tck, where Tck = 28.818 us. The minimum vale of the wakeup timeout is 28.818us (PRESCALER and COUNTER equals to 0) and the maximum value is about 1.89 s (PRESCALER anc COUNTER equals to 255).

Parameters
lDesiredUsecdesired timer value in us.
Return values
None.

Definition at line 545 of file S2LP_Timer.c.

◆ S2LPTimerSetWakeUpTimerUs()

void S2LPTimerSetWakeUpTimerUs ( uint32_t  lDesiredUsec)

Set the LDCR wake up timer counter and prescaler from the desired value in ms, according to the formula: Twu=(PRESCALER +1)*(COUNTER+1)*Tck, where Tck = 28.818 us. The minimum vale of the wakeup timeout is 28.818us (PRESCALER and COUNTER equals to 0) and the maximum value is about 1.89 s (PRESCALER anc COUNTER equals to 255).

Parameters
fDesiredMsecdesired timer value. This parameter must be a float.
Return values
None.

Definition at line 443 of file S2LP_Timer.c.

◆ S2LPTimerSleepB()

void S2LPTimerSleepB ( SFunctionalState  en)

Enable the SLEEP_B mode. SLEEP_A and SLEEP_B are mutually exclusive.

Parameters
enif it is S_ENABLE: SLEEP_B will be set if it is S_DISABLE: SLEEP_A will be set
Return values
None

Definition at line 748 of file S2LP_Timer.c.