Appiko
S2LP_Timer.h
Go to the documentation of this file.
1 
47 /* Define to prevent recursive inclusion -------------------------------------*/
48 #ifndef __S2LP1_TIMER_H
49 #define __S2LP1_TIMER_H
50 
51 
52 /* Includes ------------------------------------------------------------------*/
53 #include "S2LP_Regs.h"
54 #include "S2LP_Types.h"
55 
56 
57 #ifdef __cplusplus
58  extern "C" {
59 #endif
60 
83 typedef enum {
84  NO_TIMEOUT_STOP = 0x00,
98 
99 
121 #define SET_INFINITE_RX_TIMEOUT() S2LPTimerSetRxTimerCounter(0)
122 
134 
135 void S2LPTimerLdcrMode(SFunctionalState xNewState);
139 void S2LpSetTimerFastRxTermTimer(uint8_t fast_rx_word);
140 void S2LpSetTimerFastRxTermTimerUs(uint32_t fast_rx_us);
141 
142 void S2LPTimerLdcrMode(SFunctionalState xNewState);
145 
146 void S2LPTimerSetRxTimer(uint8_t cCounter , uint8_t cPrescaler);
147 void S2LPTimerSetRxTimerUs(uint32_t lDesiredUsec);
148 void S2LPTimerSetRxTimerCounter(uint8_t cCounter);
149 void S2LPTimerSetRxTimerPrescaler(uint8_t cPrescaler);
150 void S2LPTimerGetRxTimerUs(uint32_t* plTimeoutUsec, uint8_t* pcCounter , uint8_t* pcPrescaler);
151 
152 void S2LPTimerSetWakeUpTimer(uint8_t cCounter , uint8_t cPrescaler);
153 void S2LPTimerSetWakeUpTimerUs(uint32_t lDesiredUsec);
154 void S2LPTimerSetWakeUpTimerCounter(uint8_t cCounter);
155 void S2LPTimerSetWakeUpTimerPrescaler(uint8_t cPrescaler);
156 void S2LPTimerSetWakeUpTimerReloadUs(uint32_t lDesiredUsec);
157 void S2LPTimerGetWakeUpTimerUs(uint32_t* plWakeUpUsec, uint8_t* pcCounter, uint8_t* pcPrescaler, uint8_t* pcMulti);
158 void S2LPTimerSetWakeUpTimerReload(uint8_t cCounter , uint8_t cPrescaler, uint8_t cMulti);
159 void S2LPTimerSetWakeUpTimerReloadCounter(uint8_t cCounter);
160 void S2LPTimerSetWakeUpTimerReloadPrescaler(uint8_t cPrescaler);
161 void S2LPTimerGetWakeUpTimerReloadUs(uint32_t* plWakeUpReloadUsec, uint8_t* pcCounter, uint8_t* pcPrescaler, uint8_t* pcMulti);
162 
163 uint16_t S2LPTimerGetRcoFrequency(void);
164 void S2LPTimerCalibrationRco(SFunctionalState xCalibration);
166 void S2LPTimerLdcIrqWa(SFunctionalState en);
167 
181 #ifdef __cplusplus
182 }
183 #endif
184 
185 #endif
186 
187 /******************* (C) COPYRIGHT 2016 STMicroelectronics *****END OF FILE****/
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,...
Definition: S2LP_Timer.c:598
void S2LPTimerSetRxTimer(uint8_t cCounter, uint8_t cPrescaler)
Set the RX timeout timer initialization registers with the values of COUNTER and PRESCALER according ...
Definition: S2LP_Timer.c:348
void S2LPTimerSetWakeUpTimerReloadUs(uint32_t lDesiredUsec)
Set the LDCR wake up reload timer counter and prescaler from the desired value in ms,...
Definition: S2LP_Timer.c:546
SFunctionalState
S2LP Functional state. Used to enable or disable a specific option.
Definition: S2LP_Types.h:67
void S2LPTimerSetWakeUpTimerCounter(uint8_t cCounter)
Set the LDCR wake up timer counter. Remember that this value is incresead by one in the Twu calculati...
Definition: S2LP_Timer.c:468
void S2LPTimerSleepB(SFunctionalState en)
Enable the SLEEP_B mode. SLEEP_A and SLEEP_B are mutually exclusive.
Definition: S2LP_Timer.c:749
void S2LpTimerFastRxTermTimer(SFunctionalState xNewState)
Enables the Fast RX termination timer.
Definition: S2LP_Timer.c:664
void S2LPTimerSetWakeUpTimer(uint8_t cCounter, uint8_t cPrescaler)
Set the LDCR wake up timer initialization registers with the values of COUNTER and PRESCALER accordin...
Definition: S2LP_Timer.c:428
void S2LPTimerLdcrMode(SFunctionalState xNewState)
Enables or Disables the LDCR mode.
Definition: S2LP_Timer.c:289
This file contains all the registers address and masks.
void S2LPTimerSetWakeUpTimerPrescaler(uint8_t cPrescaler)
Set the LDCR wake up timer prescaler. Remember that this value is incresead by one in the Twu calcula...
Definition: S2LP_Timer.c:481
void S2LPTimerSetWakeUpTimerReloadCounter(uint8_t cCounter)
Set the LDCR wake up timer reload counter. Remember that this value is incresead by one in the Twu ca...
Definition: S2LP_Timer.c:569
uint16_t S2LPTimerGetRcoFrequency(void)
Computes and Return the RCO frequency. This frequency depends on the xtal frequency and the XTAL bit ...
Definition: S2LP_Timer.c:642
void S2LPTimerGetRxTimerUs(uint32_t *plTimeoutUsec, uint8_t *pcCounter, uint8_t *pcPrescaler)
Return the RX timeout timer.
Definition: S2LP_Timer.c:405
void S2LPTimerSetRxTimerCounter(uint8_t cCounter)
Set the RX timeout timer counter. If it is equal to 0 the timeout is infinite.
Definition: S2LP_Timer.c:376
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 freq...
Definition: S2LP_Timer.c:700
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 ...
Definition: S2LP_Timer.c:525
void S2LPTimerLdcrAutoReload(SFunctionalState xNewState)
Enables or Disables the LDCR timer reloading with the value stored in the LDCR_RELOAD registers.
Definition: S2LP_Timer.c:311
void S2LPTimerCalibrationRco(SFunctionalState xCalibration)
Enables the RCO autocalibration when the device make the transition READY -> SLEEP.
Definition: S2LP_Timer.c:726
RxTimeoutStopCondition
All the possible RX timeout stop conditions enumeration.
Definition: S2LP_Timer.h:83
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,...
Definition: S2LP_Timer.c:497
void S2LPTimerSetRxTimerStopCondition(RxTimeoutStopCondition xStopCondition)
Set the RX timeout stop conditions.
Definition: S2LP_Timer.c:620
void S2LpSetTimerFastRxTermTimer(uint8_t fast_rx_word)
Set the Fast RX termination timer word. When the timer counter will reach this word,...
Definition: S2LP_Timer.c:687
SFunctionalState S2LPTimerLdcrGetAutoReload(void)
Return the LDCR timer reload bit.
Definition: S2LP_Timer.c:332
void S2LPTimerSetRxTimerPrescaler(uint8_t cPrescaler)
Set the RX timeout timer prescaler. If it is equal to 0 the timeout is infinite.
Definition: S2LP_Timer.c:388
void S2LPTimerSetWakeUpTimerUs(uint32_t lDesiredUsec)
Set the LDCR wake up timer counter and prescaler from the desired value in ms, according to the formu...
Definition: S2LP_Timer.c:444
Header file for S2-LP types.
void S2LPTimerSetWakeUpTimerReloadPrescaler(uint8_t cPrescaler)
Set the LDCR wake up timer reload prescaler. Remember that this value is incresead by one in the Twu ...
Definition: S2LP_Timer.c:582
void S2LPTimerSetRxTimerUs(uint32_t lDesiredUsec)
Set the RX timeout timer counter and prescaler from the desired value in ms. it is possible to fix th...
Definition: S2LP_Timer.c:362