21 #ifndef STM32L4xx_LL_LPTIM_H 22 #define STM32L4xx_LL_LPTIM_H 29 #include "stm32l4xx.h" 35 #if defined (LPTIM1) || defined (LPTIM2) 47 #if defined(USE_FULL_LL_DRIVER) 57 #if defined(USE_FULL_LL_DRIVER) 102 #define LL_LPTIM_ISR_CMPM LPTIM_ISR_CMPM 103 #define LL_LPTIM_ISR_ARRM LPTIM_ISR_ARRM 104 #define LL_LPTIM_ISR_EXTTRIG LPTIM_ISR_EXTTRIG 105 #define LL_LPTIM_ISR_CMPOK LPTIM_ISR_CMPOK 106 #define LL_LPTIM_ISR_ARROK LPTIM_ISR_ARROK 107 #define LL_LPTIM_ISR_UP LPTIM_ISR_UP 108 #define LL_LPTIM_ISR_DOWN LPTIM_ISR_DOWN 109 #if defined(LPTIM_RCR_REP) 110 #define LL_LPTIM_ISR_UE LPTIM_ISR_UE 111 #define LL_LPTIM_ISR_REPOK LPTIM_ISR_REPOK 121 #define LL_LPTIM_IER_CMPMIE LPTIM_IER_CMPMIE 122 #define LL_LPTIM_IER_ARRMIE LPTIM_IER_ARRMIE 123 #define LL_LPTIM_IER_EXTTRIGIE LPTIM_IER_EXTTRIGIE 124 #define LL_LPTIM_IER_CMPOKIE LPTIM_IER_CMPOKIE 125 #define LL_LPTIM_IER_ARROKIE LPTIM_IER_ARROKIE 126 #define LL_LPTIM_IER_UPIE LPTIM_IER_UPIE 127 #define LL_LPTIM_IER_DOWNIE LPTIM_IER_DOWNIE 128 #if defined(LPTIM_RCR_REP) 129 #define LL_LPTIM_IER_UEIE LPTIM_IER_UEIE 130 #define LL_LPTIM_IER_REPOKIE LPTIM_IER_REPOKIE 139 #define LL_LPTIM_OPERATING_MODE_CONTINUOUS LPTIM_CR_CNTSTRT 140 #define LL_LPTIM_OPERATING_MODE_ONESHOT LPTIM_CR_SNGSTRT 148 #define LL_LPTIM_UPDATE_MODE_IMMEDIATE 0x00000000U 149 #define LL_LPTIM_UPDATE_MODE_ENDOFPERIOD LPTIM_CFGR_PRELOAD 157 #define LL_LPTIM_COUNTER_MODE_INTERNAL 0x00000000U 158 #define LL_LPTIM_COUNTER_MODE_EXTERNAL LPTIM_CFGR_COUNTMODE 166 #define LL_LPTIM_OUTPUT_WAVEFORM_PWM 0x00000000U 167 #define LL_LPTIM_OUTPUT_WAVEFORM_SETONCE LPTIM_CFGR_WAVE 175 #define LL_LPTIM_OUTPUT_POLARITY_REGULAR 0x00000000U 176 #define LL_LPTIM_OUTPUT_POLARITY_INVERSE LPTIM_CFGR_WAVPOL 184 #define LL_LPTIM_PRESCALER_DIV1 0x00000000U 185 #define LL_LPTIM_PRESCALER_DIV2 LPTIM_CFGR_PRESC_0 186 #define LL_LPTIM_PRESCALER_DIV4 LPTIM_CFGR_PRESC_1 187 #define LL_LPTIM_PRESCALER_DIV8 (LPTIM_CFGR_PRESC_1 | LPTIM_CFGR_PRESC_0) 188 #define LL_LPTIM_PRESCALER_DIV16 LPTIM_CFGR_PRESC_2 189 #define LL_LPTIM_PRESCALER_DIV32 (LPTIM_CFGR_PRESC_2 | LPTIM_CFGR_PRESC_0) 190 #define LL_LPTIM_PRESCALER_DIV64 (LPTIM_CFGR_PRESC_2 | LPTIM_CFGR_PRESC_1) 191 #define LL_LPTIM_PRESCALER_DIV128 LPTIM_CFGR_PRESC 199 #define LL_LPTIM_TRIG_SOURCE_GPIO 0x00000000U 200 #define LL_LPTIM_TRIG_SOURCE_RTCALARMA LPTIM_CFGR_TRIGSEL_0 201 #define LL_LPTIM_TRIG_SOURCE_RTCALARMB LPTIM_CFGR_TRIGSEL_1 202 #if defined(RTC_TAMPER1_SUPPORT) 203 #define LL_LPTIM_TRIG_SOURCE_RTCTAMP1 (LPTIM_CFGR_TRIGSEL_1 | LPTIM_CFGR_TRIGSEL_0) 205 #define LL_LPTIM_TRIG_SOURCE_RTCTAMP2 LPTIM_CFGR_TRIGSEL_2 206 #if defined(RTC_TAMPER3_SUPPORT) 207 #define LL_LPTIM_TRIG_SOURCE_RTCTAMP3 (LPTIM_CFGR_TRIGSEL_2 | LPTIM_CFGR_TRIGSEL_0) 209 #define LL_LPTIM_TRIG_SOURCE_COMP1 (LPTIM_CFGR_TRIGSEL_2 | LPTIM_CFGR_TRIGSEL_1) 210 #define LL_LPTIM_TRIG_SOURCE_COMP2 LPTIM_CFGR_TRIGSEL 218 #define LL_LPTIM_TRIG_FILTER_NONE 0x00000000U 219 #define LL_LPTIM_TRIG_FILTER_2 LPTIM_CFGR_TRGFLT_0 220 #define LL_LPTIM_TRIG_FILTER_4 LPTIM_CFGR_TRGFLT_1 221 #define LL_LPTIM_TRIG_FILTER_8 LPTIM_CFGR_TRGFLT 229 #define LL_LPTIM_TRIG_POLARITY_RISING LPTIM_CFGR_TRIGEN_0 230 #define LL_LPTIM_TRIG_POLARITY_FALLING LPTIM_CFGR_TRIGEN_1 231 #define LL_LPTIM_TRIG_POLARITY_RISING_FALLING LPTIM_CFGR_TRIGEN 239 #define LL_LPTIM_CLK_SOURCE_INTERNAL 0x00000000U 240 #define LL_LPTIM_CLK_SOURCE_EXTERNAL LPTIM_CFGR_CKSEL 248 #define LL_LPTIM_CLK_FILTER_NONE 0x00000000U 249 #define LL_LPTIM_CLK_FILTER_2 LPTIM_CFGR_CKFLT_0 250 #define LL_LPTIM_CLK_FILTER_4 LPTIM_CFGR_CKFLT_1 251 #define LL_LPTIM_CLK_FILTER_8 LPTIM_CFGR_CKFLT 259 #define LL_LPTIM_CLK_POLARITY_RISING 0x00000000U 260 #define LL_LPTIM_CLK_POLARITY_FALLING LPTIM_CFGR_CKPOL_0 261 #define LL_LPTIM_CLK_POLARITY_RISING_FALLING LPTIM_CFGR_CKPOL_1 269 #define LL_LPTIM_ENCODER_MODE_RISING 0x00000000U 270 #define LL_LPTIM_ENCODER_MODE_FALLING LPTIM_CFGR_CKPOL_0 271 #define LL_LPTIM_ENCODER_MODE_RISING_FALLING LPTIM_CFGR_CKPOL_1 279 #define LL_LPTIM_INPUT1_SRC_GPIO 0x00000000U 280 #define LL_LPTIM_INPUT1_SRC_COMP1 LPTIM_OR_OR_0 281 #define LL_LPTIM_INPUT1_SRC_COMP2 LPTIM_OR_OR_1 282 #define LL_LPTIM_INPUT1_SRC_COMP1_COMP2 LPTIM_OR_OR 290 #define LL_LPTIM_INPUT2_SRC_GPIO 0x00000000U 291 #define LL_LPTIM_INPUT2_SRC_COMP2 LPTIM_OR_OR_1 317 #define LL_LPTIM_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__)) 325 #define LL_LPTIM_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__) 339 #if defined(USE_FULL_LL_DRIVER) 367 SET_BIT(LPTIMx->CR, LPTIM_CR_ENABLE);
378 return ((READ_BIT(LPTIMx->CR, LPTIM_CR_ENABLE) == LPTIM_CR_ENABLE) ? 1UL : 0UL);
396 MODIFY_REG(LPTIMx->CR, LPTIM_CR_CNTSTRT | LPTIM_CR_SNGSTRT, OperatingMode);
399 #if defined(LPTIM_CR_RSTARE) 410 SET_BIT(LPTIMx->CR, LPTIM_CR_RSTARE);
432 return ((READ_BIT(LPTIMx->CR, LPTIM_CR_RSTARE) == LPTIM_CR_RSTARE) ? 1UL : 0UL);
436 #if defined(LPTIM_CR_COUNTRST) 449 SET_BIT(LPTIMx->CR, LPTIM_CR_COUNTRST);
465 MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_PRELOAD, UpdateMode);
478 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_PRELOAD));
496 MODIFY_REG(LPTIMx->ARR, LPTIM_ARR_ARR, AutoReload);
507 return (uint32_t)(READ_BIT(LPTIMx->ARR, LPTIM_ARR_ARR));
510 #if defined(LPTIM_RCR_REP) 521 MODIFY_REG(LPTIMx->RCR, LPTIM_RCR_REP, Repetition);
532 return (uint32_t)(READ_BIT(LPTIMx->RCR, LPTIM_RCR_REP));
549 MODIFY_REG(LPTIMx->CMP, LPTIM_CMP_CMP, CompareValue);
560 return (uint32_t)(READ_BIT(LPTIMx->CMP, LPTIM_CMP_CMP));
575 return (uint32_t)(READ_BIT(LPTIMx->CNT, LPTIM_CNT_CNT));
590 MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_COUNTMODE, CounterMode);
603 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_COUNTMODE));
625 MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_WAVE | LPTIM_CFGR_WAVPOL, Waveform | Polarity);
639 MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_WAVE, Waveform);
652 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_WAVE));
666 MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_WAVPOL, Polarity);
679 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_WAVPOL));
704 MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_PRESC, Prescaler);
723 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_PRESC));
740 WRITE_REG(LPTIMx->OR, Src);
754 WRITE_REG(LPTIMx->OR, Src);
779 SET_BIT(LPTIMx->CFGR, LPTIM_CFGR_TIMOUT);
793 CLEAR_BIT(LPTIMx->CFGR, LPTIM_CFGR_TIMOUT);
804 return (((READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_TIMOUT) == LPTIM_CFGR_TIMOUT)? 1UL : 0UL));
816 CLEAR_BIT(LPTIMx->CFGR, LPTIM_CFGR_TRIGEN);
850 MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_TRIGSEL | LPTIM_CFGR_TRGFLT | LPTIM_CFGR_TRIGEN, Source | Filter | Polarity);
869 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_TRIGSEL));
884 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_TRGFLT));
898 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_TRIGEN));
921 MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_CKSEL, ClockSource);
934 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_CKSEL));
961 MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_CKFLT | LPTIM_CFGR_CKPOL, ClockFilter | ClockPolarity);
975 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_CKPOL));
990 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_CKFLT));
1014 MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_CKPOL, EncoderMode);
1028 return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_CKPOL));
1044 SET_BIT(LPTIMx->CFGR, LPTIM_CFGR_ENC);
1056 CLEAR_BIT(LPTIMx->CFGR, LPTIM_CFGR_ENC);
1067 return (((READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_ENC) == LPTIM_CFGR_ENC)? 1UL : 0UL));
1086 SET_BIT(LPTIMx->ICR, LPTIM_ICR_CMPMCF);
1097 return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_CMPM) == LPTIM_ISR_CMPM)? 1UL : 0UL));
1108 SET_BIT(LPTIMx->ICR, LPTIM_ICR_ARRMCF);
1119 return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_ARRM) == LPTIM_ISR_ARRM)? 1UL : 0UL));
1130 SET_BIT(LPTIMx->ICR, LPTIM_ICR_EXTTRIGCF);
1141 return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_EXTTRIG) == LPTIM_ISR_EXTTRIG)? 1UL : 0UL));
1152 SET_BIT(LPTIMx->ICR, LPTIM_ICR_CMPOKCF);
1163 return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_CMPOK) == LPTIM_ISR_CMPOK)? 1UL : 0UL));
1174 SET_BIT(LPTIMx->ICR, LPTIM_ICR_ARROKCF);
1185 return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_ARROK) == LPTIM_ISR_ARROK)? 1UL : 0UL));
1196 SET_BIT(LPTIMx->ICR, LPTIM_ICR_UPCF);
1207 return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_UP) == LPTIM_ISR_UP)? 1UL : 0UL));
1218 SET_BIT(LPTIMx->ICR, LPTIM_ICR_DOWNCF);
1229 return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_DOWN) == LPTIM_ISR_DOWN)? 1UL : 0UL));
1232 #if defined(LPTIM_RCR_REP) 1241 SET_BIT(LPTIMx->ICR, LPTIM_ICR_REPOKCF);
1252 return ((READ_BIT(LPTIMx->ISR, LPTIM_ISR_REPOK) == LPTIM_ISR_REPOK) ? 1UL : 0UL);
1263 SET_BIT(LPTIMx->ICR, LPTIM_ICR_UECF);
1274 return ((READ_BIT(LPTIMx->ISR, LPTIM_ISR_UE) == LPTIM_ISR_UE) ? 1UL : 0UL);
1294 SET_BIT(LPTIMx->IER, LPTIM_IER_CMPMIE);
1305 CLEAR_BIT(LPTIMx->IER, LPTIM_IER_CMPMIE);
1316 return (((READ_BIT(LPTIMx->IER, LPTIM_IER_CMPMIE) == LPTIM_IER_CMPMIE)? 1UL : 0UL));
1327 SET_BIT(LPTIMx->IER, LPTIM_IER_ARRMIE);
1338 CLEAR_BIT(LPTIMx->IER, LPTIM_IER_ARRMIE);
1349 return (((READ_BIT(LPTIMx->IER, LPTIM_IER_ARRMIE) == LPTIM_IER_ARRMIE)? 1UL : 0UL));
1360 SET_BIT(LPTIMx->IER, LPTIM_IER_EXTTRIGIE);
1371 CLEAR_BIT(LPTIMx->IER, LPTIM_IER_EXTTRIGIE);
1382 return (((READ_BIT(LPTIMx->IER, LPTIM_IER_EXTTRIGIE) == LPTIM_IER_EXTTRIGIE)? 1UL : 0UL));
1393 SET_BIT(LPTIMx->IER, LPTIM_IER_CMPOKIE);
1404 CLEAR_BIT(LPTIMx->IER, LPTIM_IER_CMPOKIE);
1415 return (((READ_BIT(LPTIMx->IER, LPTIM_IER_CMPOKIE) == LPTIM_IER_CMPOKIE)? 1UL : 0UL));
1426 SET_BIT(LPTIMx->IER, LPTIM_IER_ARROKIE);
1437 CLEAR_BIT(LPTIMx->IER, LPTIM_IER_ARROKIE);
1448 return (((READ_BIT(LPTIMx->IER, LPTIM_IER_ARROKIE) == LPTIM_IER_ARROKIE)? 1UL : 0UL));
1459 SET_BIT(LPTIMx->IER, LPTIM_IER_UPIE);
1481 return (((READ_BIT(LPTIMx->IER, LPTIM_IER_UPIE) == LPTIM_IER_UPIE)? 1UL : 0UL));
1492 SET_BIT(LPTIMx->IER, LPTIM_IER_DOWNIE);
1503 CLEAR_BIT(LPTIMx->IER, LPTIM_IER_DOWNIE);
1514 return ((READ_BIT(LPTIMx->IER, LPTIM_IER_DOWNIE) == LPTIM_IER_DOWNIE) ? 1UL : 0UL);
1517 #if defined(LPTIM_RCR_REP) 1526 SET_BIT(LPTIMx->IER, LPTIM_IER_REPOKIE);
1537 CLEAR_BIT(LPTIMx->IER, LPTIM_IER_REPOKIE);
1548 return ((READ_BIT(LPTIMx->IER, LPTIM_IER_REPOKIE) == LPTIM_IER_REPOKIE) ? 1UL : 0UL);
1559 SET_BIT(LPTIMx->IER, LPTIM_IER_UEIE);
1581 return ((READ_BIT(LPTIMx->IER, LPTIM_IER_UEIE) == LPTIM_IER_UEIE) ? 1UL : 0UL);
__STATIC_INLINE uint32_t LL_LPTIM_GetRepetition(LPTIM_TypeDef *LPTIMx)
Get the repetition value RCR REP LL_LPTIM_GetRepetition.
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_ARROK(LPTIM_TypeDef *LPTIMx)
Indicates whether the autoreload register write completed interrupt (ARROKIE) is enabled. IER ARROKIE LL_LPTIM_IsEnabledIT_ARROK.
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledResetAfterRead(LPTIM_TypeDef *LPTIMx)
Indicate whether the reset after read feature is enabled. CR RSTARE LL_LPTIM_DisableResetAfterRead.
__STATIC_INLINE void LL_LPTIM_SetPolarity(LPTIM_TypeDef *LPTIMx, uint32_t Polarity)
Set output polarity CFGR WAVPOL LL_LPTIM_SetPolarity.
__STATIC_INLINE uint32_t LL_LPTIM_GetTriggerFilter(LPTIM_TypeDef *LPTIMx)
Get actual external trigger filter. CFGR TRGFLT LL_LPTIM_GetTriggerFilter.
__STATIC_INLINE void LL_LPTIM_DisableIT_ARROK(LPTIM_TypeDef *LPTIMx)
Disable autoreload register write completed interrupt (ARROKIE). IER ARROKIE LL_LPTIM_DisableIT_ARRO...
__STATIC_INLINE void LL_LPTIM_DisableEncoderMode(LPTIM_TypeDef *LPTIMx)
Disable the encoder mode.
__STATIC_INLINE void LL_LPTIM_ClearFlag_ARROK(LPTIM_TypeDef *LPTIMx)
Clear the autoreload register update interrupt flag (ARROKCF). ICR ARROKCF LL_LPTIM_ClearFlag_ARROK...
LPTIM Init structure definition.
__STATIC_INLINE void LL_LPTIM_SetClockSource(LPTIM_TypeDef *LPTIMx, uint32_t ClockSource)
Set the source of the clock used by the LPTIM instance.
__STATIC_INLINE void LL_LPTIM_SetAutoReload(LPTIM_TypeDef *LPTIMx, uint32_t AutoReload)
Set the auto reload value.
__STATIC_INLINE void LL_LPTIM_ClearFlag_CMPOK(LPTIM_TypeDef *LPTIMx)
Clear the compare register update interrupt flag (CMPOKCF). ICR CMPOKCF LL_LPTIM_ClearFlag_CMPOK.
__STATIC_INLINE void LL_LPTIM_SetInput1Src(LPTIM_TypeDef *LPTIMx, uint32_t Src)
Set LPTIM input 1 source (default GPIO). OR OR_0 LL_LPTIM_SetInput1Src OR OR_1 LL_LPTIM_SetInput1Sr...
__STATIC_INLINE void LL_LPTIM_SetCounterMode(LPTIM_TypeDef *LPTIMx, uint32_t CounterMode)
Set the counter mode (selection of the LPTIM counter clock source).
__STATIC_INLINE void LL_LPTIM_ClearFlag_EXTTRIG(LPTIM_TypeDef *LPTIMx)
Clear the external trigger valid edge flag(EXTTRIGCF). ICR EXTTRIGCF LL_LPTIM_ClearFlag_EXTTRIG.
__STATIC_INLINE void LL_LPTIM_DisableIT_ARRM(LPTIM_TypeDef *LPTIMx)
Disable autoreload match interrupt (ARRMIE). IER ARRMIE LL_LPTIM_DisableIT_ARRM. ...
__STATIC_INLINE void LL_LPTIM_EnableResetAfterRead(LPTIM_TypeDef *LPTIMx)
Enable reset after read.
__STATIC_INLINE void LL_LPTIM_EnableIT_ARROK(LPTIM_TypeDef *LPTIMx)
Enable autoreload register write completed interrupt (ARROKIE). IER ARROKIE LL_LPTIM_EnableIT_ARROK...
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_ARRM(LPTIM_TypeDef *LPTIMx)
Inform application whether a autoreload match interrupt has occured. ISR ARRM LL_LPTIM_IsActiveFlag_...
__STATIC_INLINE uint32_t LL_LPTIM_GetUpdateMode(LPTIM_TypeDef *LPTIMx)
Get the LPTIM registers update mode CFGR PRELOAD LL_LPTIM_GetUpdateMode.
__STATIC_INLINE void LL_LPTIM_ClearFlag_DOWN(LPTIM_TypeDef *LPTIMx)
Clear the counter direction change to down interrupt flag (DOWNCF). ICR DOWNCF LL_LPTIM_ClearFlag_DO...
__STATIC_INLINE void LL_LPTIM_DisableResetAfterRead(LPTIM_TypeDef *LPTIMx)
Disable reset after read. CR RSTARE LL_LPTIM_DisableResetAfterRead.
__STATIC_INLINE void LL_LPTIM_SetEncoderMode(LPTIM_TypeDef *LPTIMx, uint32_t EncoderMode)
Configure the encoder mode.
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_ARRM(LPTIM_TypeDef *LPTIMx)
Indicates whether the autoreload match interrupt (ARRMIE) is enabled. IER ARRMIE LL_LPTIM_IsEnabledI...
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_REPOK(LPTIM_TypeDef *LPTIMx)
Indicates whether the repetition register update successfully completed interrupt (REPOKIE) is enable...
__STATIC_INLINE void LL_LPTIM_SetPrescaler(LPTIM_TypeDef *LPTIMx, uint32_t Prescaler)
Set actual prescaler division ratio.
__STATIC_INLINE void LL_LPTIM_ConfigClock(LPTIM_TypeDef *LPTIMx, uint32_t ClockFilter, uint32_t ClockPolarity)
Configure the active edge or edges used by the counter when the LPTIM is clocked by an external clock...
__STATIC_INLINE uint32_t LL_LPTIM_GetCounter(LPTIM_TypeDef *LPTIMx)
Get actual counter value.
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabled(LPTIM_TypeDef *LPTIMx)
Indicates whether the LPTIM instance is enabled. CR ENABLE LL_LPTIM_IsEnabled.
__STATIC_INLINE void LL_LPTIM_SetInput2Src(LPTIM_TypeDef *LPTIMx, uint32_t Src)
Set LPTIM input 2 source (default GPIO). OR OR_0 LL_LPTIM_SetInput2Src.
__STATIC_INLINE void LL_LPTIM_EnableTimeout(LPTIM_TypeDef *LPTIMx)
Enable the timeout function.
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_CMPM(LPTIM_TypeDef *LPTIMx)
Indicates whether the compare match interrupt (CMPMIE) is enabled. IER CMPMIE LL_LPTIM_IsEnabledIT_C...
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)
__STATIC_INLINE uint32_t LL_LPTIM_GetWaveform(LPTIM_TypeDef *LPTIMx)
Get actual waveform shape CFGR WAVE LL_LPTIM_GetWaveform.
__STATIC_INLINE uint32_t LL_LPTIM_GetPolarity(LPTIM_TypeDef *LPTIMx)
Get actual output polarity CFGR WAVPOL LL_LPTIM_GetPolarity.
__STATIC_INLINE void LL_LPTIM_SetUpdateMode(LPTIM_TypeDef *LPTIMx, uint32_t UpdateMode)
Set the LPTIM registers update mode (enable/disable register preload)
void LL_LPTIM_Disable(LPTIM_TypeDef *LPTIMx)
Disable the LPTIM instance CR ENABLE LL_LPTIM_Disable.
__STATIC_INLINE void LL_LPTIM_DisableIT_CMPOK(LPTIM_TypeDef *LPTIMx)
Disable compare register write completed interrupt (CMPOKIE). IER CMPOKIE LL_LPTIM_DisableIT_CMPOK.
ErrorStatus LL_LPTIM_Init(LPTIM_TypeDef *LPTIMx, LL_LPTIM_InitTypeDef *LPTIM_InitStruct)
Configure the LPTIMx peripheral according to the specified parameters.
__STATIC_INLINE void LL_LPTIM_DisableTimeout(LPTIM_TypeDef *LPTIMx)
Disable the timeout function.
__STATIC_INLINE void LL_LPTIM_EnableIT_CMPM(LPTIM_TypeDef *LPTIMx)
Enable compare match interrupt (CMPMIE). IER CMPMIE LL_LPTIM_EnableIT_CMPM.
__STATIC_INLINE void LL_LPTIM_EnableIT_CMPOK(LPTIM_TypeDef *LPTIMx)
Enable compare register write completed interrupt (CMPOKIE). IER CMPOKIE LL_LPTIM_EnableIT_CMPOK.
__STATIC_INLINE void LL_LPTIM_EnableIT_UE(LPTIM_TypeDef *LPTIMx)
Enable update event interrupt (UEIE). IER UEIE LL_LPTIM_EnableIT_UE.
__STATIC_INLINE uint32_t LL_LPTIM_GetTriggerSource(LPTIM_TypeDef *LPTIMx)
Get actual external trigger source. CFGR TRIGSEL LL_LPTIM_GetTriggerSource.
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_UP(LPTIM_TypeDef *LPTIMx)
Informs the application whether the counter direction has changed from down to up (when the LPTIM ins...
__STATIC_INLINE uint32_t LL_LPTIM_GetPrescaler(LPTIM_TypeDef *LPTIMx)
Get actual prescaler division ratio. CFGR PRESC LL_LPTIM_GetPrescaler.
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_CMPOK(LPTIM_TypeDef *LPTIMx)
Informs application whether the APB bus write operation to the LPTIMx_CMP register has been successfu...
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_UE(LPTIM_TypeDef *LPTIMx)
Indicates whether the update event interrupt (UEIE) is enabled. IER UEIE LL_LPTIM_IsEnabledIT_UE.
__STATIC_INLINE uint32_t LL_LPTIM_GetClockPolarity(LPTIM_TypeDef *LPTIMx)
Get actual clock polarity CFGR CKPOL LL_LPTIM_GetClockPolarity.
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledTimeout(LPTIM_TypeDef *LPTIMx)
Indicate whether the timeout function is enabled. CFGR TIMOUT LL_LPTIM_IsEnabledTimeout.
void LL_LPTIM_StructInit(LL_LPTIM_InitTypeDef *LPTIM_InitStruct)
Set each fields of the LPTIM_InitStruct structure to its default value.
__STATIC_INLINE void LL_LPTIM_SetWaveform(LPTIM_TypeDef *LPTIMx, uint32_t Waveform)
Set waveform shape CFGR WAVE LL_LPTIM_SetWaveform.
__STATIC_INLINE void LL_LPTIM_ClearFlag_REPOK(LPTIM_TypeDef *LPTIMx)
Clear the repetition register update interrupt flag (REPOKCF). ICR REPOKCF LL_LPTIM_ClearFlag_REPOK...
__STATIC_INLINE void LL_LPTIM_EnableIT_EXTTRIG(LPTIM_TypeDef *LPTIMx)
Enable external trigger valid edge interrupt (EXTTRIGIE). IER EXTTRIGIE LL_LPTIM_EnableIT_EXTTRIG.
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_CMPOK(LPTIM_TypeDef *LPTIMx)
Indicates whether the compare register write completed interrupt (CMPOKIE) is enabled. IER CMPOKIE LL_LPTIM_IsEnabledIT_CMPOK.
__STATIC_INLINE void LL_LPTIM_DisableIT_DOWN(LPTIM_TypeDef *LPTIMx)
Disable direction change to down interrupt (DOWNIE). IER DOWNIE LL_LPTIM_DisableIT_DOWN.
__STATIC_INLINE void LL_LPTIM_ClearFLAG_CMPM(LPTIM_TypeDef *LPTIMx)
Clear the compare match flag (CMPMCF) ICR CMPMCF LL_LPTIM_ClearFLAG_CMPM.
__STATIC_INLINE uint32_t LL_LPTIM_GetClockFilter(LPTIM_TypeDef *LPTIMx)
Get actual clock digital filter CFGR CKFLT LL_LPTIM_GetClockFilter.
__STATIC_INLINE void LL_LPTIM_EnableIT_DOWN(LPTIM_TypeDef *LPTIMx)
Enable direction change to down interrupt (DOWNIE). IER DOWNIE LL_LPTIM_EnableIT_DOWN.
__STATIC_INLINE void LL_LPTIM_ConfigTrigger(LPTIM_TypeDef *LPTIMx, uint32_t Source, uint32_t Filter, uint32_t Polarity)
Configure the external trigger used as a trigger event for the LPTIM.
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_ARROK(LPTIM_TypeDef *LPTIMx)
Informs application whether the APB bus write operation to the LPTIMx_ARR register has been successfu...
__STATIC_INLINE void LL_LPTIM_SetCompare(LPTIM_TypeDef *LPTIMx, uint32_t CompareValue)
Set the compare value.
ErrorStatus LL_LPTIM_DeInit(LPTIM_TypeDef *LPTIMx)
Set LPTIMx registers to their reset values.
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_UE(LPTIM_TypeDef *LPTIMx)
Informs application whether the LPTIMx update event has occurred. ISR UE LL_LPTIM_IsActiveFlag_UE.
__STATIC_INLINE void LL_LPTIM_DisableIT_UP(LPTIM_TypeDef *LPTIMx)
Disable direction change to up interrupt (UPIE). IER UPIE LL_LPTIM_DisableIT_UP. ...
__STATIC_INLINE void LL_LPTIM_EnableIT_UP(LPTIM_TypeDef *LPTIMx)
Enable direction change to up interrupt (UPIE). IER UPIE LL_LPTIM_EnableIT_UP.
__STATIC_INLINE void LL_LPTIM_TrigSw(LPTIM_TypeDef *LPTIMx)
Start the LPTIM counter.
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_EXTTRIG(LPTIM_TypeDef *LPTIMx)
Indicates external trigger valid edge interrupt (EXTTRIGIE) is enabled. IER EXTTRIGIE LL_LPTIM_IsEna...
__STATIC_INLINE void LL_LPTIM_EnableEncoderMode(LPTIM_TypeDef *LPTIMx)
Enable the encoder mode.
__STATIC_INLINE void LL_LPTIM_DisableIT_UE(LPTIM_TypeDef *LPTIMx)
Disable update event interrupt (UEIE). IER UEIE LL_LPTIM_DisableIT_UE.
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_DOWN(LPTIM_TypeDef *LPTIMx)
Informs the application whether the counter direction has changed from up to down (when the LPTIM ins...
__STATIC_INLINE void LL_LPTIM_SetRepetition(LPTIM_TypeDef *LPTIMx, uint32_t Repetition)
Set the repetition value.
__STATIC_INLINE uint32_t LL_LPTIM_GetCompare(LPTIM_TypeDef *LPTIMx)
Get actual compare value CMP CMP LL_LPTIM_GetCompare.
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_EXTTRIG(LPTIM_TypeDef *LPTIMx)
Inform application whether a valid edge on the selected external trigger input has occurred...
__STATIC_INLINE void LL_LPTIM_ClearFLAG_ARRM(LPTIM_TypeDef *LPTIMx)
Clear the autoreload match flag (ARRMCF) ICR ARRMCF LL_LPTIM_ClearFLAG_ARRM.
__STATIC_INLINE uint32_t LL_LPTIM_GetClockSource(LPTIM_TypeDef *LPTIMx)
Get actual LPTIM instance clock source. CFGR CKSEL LL_LPTIM_GetClockSource.
__STATIC_INLINE void LL_LPTIM_DisableIT_REPOK(LPTIM_TypeDef *LPTIMx)
Disable repetition register update successfully completed interrupt (REPOKIE). IER REPOKIE LL_LPTIM_...
__STATIC_INLINE uint32_t LL_LPTIM_GetAutoReload(LPTIM_TypeDef *LPTIMx)
Get actual auto reload value ARR ARR LL_LPTIM_GetAutoReload.
__STATIC_INLINE void LL_LPTIM_EnableIT_REPOK(LPTIM_TypeDef *LPTIMx)
Enable repetition register update successfully completed interrupt (REPOKIE). IER REPOKIE LL_LPTIM_E...
__STATIC_INLINE void LL_LPTIM_ConfigOutput(LPTIM_TypeDef *LPTIMx, uint32_t Waveform, uint32_t Polarity)
Configure the LPTIM instance output (LPTIMx_OUT)
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_REPOK(LPTIM_TypeDef *LPTIMx)
Informs application whether the APB bus write operation to the LPTIMx_RCR register has been successfu...
__STATIC_INLINE uint32_t LL_LPTIM_GetCounterMode(LPTIM_TypeDef *LPTIMx)
Get the counter mode CFGR COUNTMODE LL_LPTIM_GetCounterMode.
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_DOWN(LPTIM_TypeDef *LPTIMx)
Indicates whether the direction change to down interrupt (DOWNIE) is enabled. IER DOWNIE LL_LPTIM_Is...
__STATIC_INLINE void LL_LPTIM_ClearFlag_UP(LPTIM_TypeDef *LPTIMx)
Clear the counter direction change to up interrupt flag (UPCF). ICR UPCF LL_LPTIM_ClearFlag_UP.
__STATIC_INLINE void LL_LPTIM_ClearFlag_UE(LPTIM_TypeDef *LPTIMx)
Clear the update event flag (UECF). ICR UECF LL_LPTIM_ClearFlag_UE.
__STATIC_INLINE void LL_LPTIM_DisableIT_EXTTRIG(LPTIM_TypeDef *LPTIMx)
Disable external trigger valid edge interrupt (EXTTRIGIE). IER EXTTRIGIE LL_LPTIM_DisableIT_EXTTRIG...
__STATIC_INLINE uint32_t LL_LPTIM_GetEncoderMode(LPTIM_TypeDef *LPTIMx)
Get actual encoder mode. CFGR CKPOL LL_LPTIM_GetEncoderMode.
__STATIC_INLINE void LL_LPTIM_ResetCounter(LPTIM_TypeDef *LPTIMx)
Reset of the LPTIM_CNT counter register (synchronous).
__STATIC_INLINE void LL_LPTIM_StartCounter(LPTIM_TypeDef *LPTIMx, uint32_t OperatingMode)
Starts the LPTIM counter in the desired mode.
__STATIC_INLINE uint32_t LL_LPTIM_GetTriggerPolarity(LPTIM_TypeDef *LPTIMx)
Get actual external trigger polarity. CFGR TRIGEN LL_LPTIM_GetTriggerPolarity.
__STATIC_INLINE void LL_LPTIM_Enable(LPTIM_TypeDef *LPTIMx)
Enable the LPTIM instance.
__STATIC_INLINE void LL_LPTIM_DisableIT_CMPM(LPTIM_TypeDef *LPTIMx)
Disable compare match interrupt (CMPMIE). IER CMPMIE LL_LPTIM_DisableIT_CMPM.
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_CMPM(LPTIM_TypeDef *LPTIMx)
Inform application whether a compare match interrupt has occurred. ISR CMPM LL_LPTIM_IsActiveFlag_CM...
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledEncoderMode(LPTIM_TypeDef *LPTIMx)
Indicates whether the LPTIM operates in encoder mode. CFGR ENC LL_LPTIM_IsEnabledEncoderMode.
__STATIC_INLINE void LL_LPTIM_EnableIT_ARRM(LPTIM_TypeDef *LPTIMx)
Enable autoreload match interrupt (ARRMIE). IER ARRMIE LL_LPTIM_EnableIT_ARRM.
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_UP(LPTIM_TypeDef *LPTIMx)
Indicates whether the direction change to up interrupt (UPIE) is enabled. IER UPIE LL_LPTIM_IsEnable...