19 #if defined(USE_FULL_LL_DRIVER) 27 #ifdef USE_FULL_ASSERT 28 #include "stm32_assert.h" 30 #define assert_param(expr) ((void)0U) 37 #if defined (LPTIM1) || defined (LPTIM2) 50 #define IS_LL_LPTIM_CLOCK_SOURCE(__VALUE__) (((__VALUE__) == LL_LPTIM_CLK_SOURCE_INTERNAL) \ 51 || ((__VALUE__) == LL_LPTIM_CLK_SOURCE_EXTERNAL)) 53 #define IS_LL_LPTIM_CLOCK_PRESCALER(__VALUE__) (((__VALUE__) == LL_LPTIM_PRESCALER_DIV1) \ 54 || ((__VALUE__) == LL_LPTIM_PRESCALER_DIV2) \ 55 || ((__VALUE__) == LL_LPTIM_PRESCALER_DIV4) \ 56 || ((__VALUE__) == LL_LPTIM_PRESCALER_DIV8) \ 57 || ((__VALUE__) == LL_LPTIM_PRESCALER_DIV16) \ 58 || ((__VALUE__) == LL_LPTIM_PRESCALER_DIV32) \ 59 || ((__VALUE__) == LL_LPTIM_PRESCALER_DIV64) \ 60 || ((__VALUE__) == LL_LPTIM_PRESCALER_DIV128)) 62 #define IS_LL_LPTIM_WAVEFORM(__VALUE__) (((__VALUE__) == LL_LPTIM_OUTPUT_WAVEFORM_PWM) \ 63 || ((__VALUE__) == LL_LPTIM_OUTPUT_WAVEFORM_SETONCE)) 65 #define IS_LL_LPTIM_OUTPUT_POLARITY(__VALUE__) (((__VALUE__) == LL_LPTIM_OUTPUT_POLARITY_REGULAR) \ 66 || ((__VALUE__) == LL_LPTIM_OUTPUT_POLARITY_INVERSE)) 98 ErrorStatus result = SUCCESS;
103 if (LPTIMx == LPTIM1)
109 else if (LPTIMx == LPTIM2)
132 LPTIM_InitStruct->
ClockSource = LL_LPTIM_CLK_SOURCE_INTERNAL;
133 LPTIM_InitStruct->
Prescaler = LL_LPTIM_PRESCALER_DIV1;
134 LPTIM_InitStruct->
Waveform = LL_LPTIM_OUTPUT_WAVEFORM_PWM;
135 LPTIM_InitStruct->
Polarity = LL_LPTIM_OUTPUT_POLARITY_REGULAR;
150 ErrorStatus result = SUCCESS;
172 (LPTIM_CFGR_CKSEL | LPTIM_CFGR_PRESC | LPTIM_CFGR_WAVE | LPTIM_CFGR_WAVPOL),
202 uint32_t tmpclksource = 0;
208 #if defined(LPTIM_RCR_REP) 219 switch ((uint32_t)LPTIMx)
234 tmpIER = LPTIMx->IER;
235 tmpCFGR = LPTIMx->CFGR;
236 tmpCMP = LPTIMx->CMP;
237 tmpARR = LPTIMx->ARR;
239 #if defined(LPTIM_RCR_REP) 240 tmpRCR = LPTIMx->RCR;
249 #if defined(LPTIM_RCR_REP) 250 if ((tmpCMP != 0UL) || (tmpARR != 0UL) || (tmpRCR != 0UL))
252 if ((tmpCMP != 0UL) || (tmpARR != 0UL))
256 switch ((uint32_t)LPTIMx)
273 LPTIMx->CR |= LPTIM_CR_ENABLE;
274 LPTIMx->CMP = tmpCMP;
287 LPTIMx->CR |= LPTIM_CR_ENABLE;
288 LPTIMx->ARR = tmpARR;
300 #if defined(LPTIM_RCR_REP) 303 LPTIMx->CR |= LPTIM_CR_ENABLE;
304 LPTIMx->RCR = tmpRCR;
322 LPTIMx->CR &= ~(LPTIM_CR_ENABLE);
323 LPTIMx->IER = tmpIER;
324 LPTIMx->CFGR = tmpCFGR;
__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.
RCC Clocks Frequency Structure.
__STATIC_INLINE void LL_LPTIM_ClearFlag_CMPOK(LPTIM_TypeDef *LPTIMx)
Clear the compare register update interrupt flag (CMPOKCF). ICR CMPOKCF LL_LPTIM_ClearFlag_CMPOK.
Header file of LPTIM LL module.
void LL_LPTIM_Disable(LPTIM_TypeDef *LPTIMx)
Disable the LPTIM instance CR ENABLE LL_LPTIM_Disable.
Header file of RCC LL module.
__STATIC_INLINE void LL_RCC_SetLPTIMClockSource(uint32_t LPTIMxSource)
Configure LPTIMx clock source CCIPR LPTIMxSEL LL_RCC_SetLPTIMClockSource.
__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_APB1_GRP1_ReleaseReset(uint32_t Periphs)
Release APB1 peripherals reset. APB1RSTR1 TIM2RST LL_APB1_GRP1_ReleaseReset APB1RSTR1 TIM3RST LL_AP...
__STATIC_INLINE void LL_APB1_GRP2_ForceReset(uint32_t Periphs)
Force APB1 peripherals reset. APB1RSTR2 LPUART1RST LL_APB1_GRP2_ForceReset APB1RSTR2 I2C4RST LL_APB...
ErrorStatus LL_LPTIM_Init(LPTIM_TypeDef *LPTIMx, LL_LPTIM_InitTypeDef *LPTIM_InitStruct)
Configure the LPTIMx peripheral according to the specified parameters.
void LL_RCC_GetSystemClocksFreq(LL_RCC_ClocksTypeDef *RCC_Clocks)
Return the frequencies of different on chip clocks; System, AHB, APB1 and APB2 buses clocks...
__STATIC_INLINE void LL_APB1_GRP2_ReleaseReset(uint32_t Periphs)
Release APB1 peripherals reset. APB1RSTR2 LPUART1RST LL_APB1_GRP2_ReleaseReset APB1RSTR2 I2C4RST LL...
__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...
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_ClearFlag_REPOK(LPTIM_TypeDef *LPTIMx)
Clear the repetition register update interrupt flag (REPOKCF). ICR REPOKCF LL_LPTIM_ClearFlag_REPOK...
__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...
ErrorStatus LL_LPTIM_DeInit(LPTIM_TypeDef *LPTIMx)
Set LPTIMx registers to their reset values.
Header file of BUS LL module.
uint32_t SYSCLK_Frequency
__STATIC_INLINE void LL_APB1_GRP1_ForceReset(uint32_t Periphs)
Force APB1 peripherals reset. APB1RSTR1 TIM2RST LL_APB1_GRP1_ForceReset APB1RSTR1 TIM3RST LL_APB1_G...
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_RCC_GetLPTIMClockSource(uint32_t LPTIMx)
Get LPTIMx clock source CCIPR LPTIMxSEL LL_RCC_GetLPTIMClockSource.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))