You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

1393 line
50 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_ll_lptim.h
  4. * @author MCD Application Team
  5. * @brief Header file of LPTIM LL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) 2016 STMicroelectronics.
  10. * All rights reserved.
  11. *
  12. * This software is licensed under terms that can be found in the LICENSE file
  13. * in the root directory of this software component.
  14. * If no LICENSE file comes with this software, it is provided AS-IS.
  15. *
  16. ******************************************************************************
  17. */
  18. /* Define to prevent recursive inclusion -------------------------------------*/
  19. #ifndef STM32F4xx_LL_LPTIM_H
  20. #define STM32F4xx_LL_LPTIM_H
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. /* Includes ------------------------------------------------------------------*/
  25. #include "stm32f4xx.h"
  26. /** @addtogroup STM32F4xx_LL_Driver
  27. * @{
  28. */
  29. #if defined (LPTIM1)
  30. /** @defgroup LPTIM_LL LPTIM
  31. * @{
  32. */
  33. /* Private types -------------------------------------------------------------*/
  34. /* Private variables ---------------------------------------------------------*/
  35. /* Private constants ---------------------------------------------------------*/
  36. /* Private macros ------------------------------------------------------------*/
  37. #if defined(USE_FULL_LL_DRIVER)
  38. /** @defgroup LPTIM_LL_Private_Macros LPTIM Private Macros
  39. * @{
  40. */
  41. /**
  42. * @}
  43. */
  44. #endif /*USE_FULL_LL_DRIVER*/
  45. /* Exported types ------------------------------------------------------------*/
  46. #if defined(USE_FULL_LL_DRIVER)
  47. /** @defgroup LPTIM_LL_ES_INIT LPTIM Exported Init structure
  48. * @{
  49. */
  50. /**
  51. * @brief LPTIM Init structure definition
  52. */
  53. typedef struct
  54. {
  55. uint32_t ClockSource; /*!< Specifies the source of the clock used by the LPTIM instance.
  56. This parameter can be a value of @ref LPTIM_LL_EC_CLK_SOURCE.
  57. This feature can be modified afterwards using unitary
  58. function @ref LL_LPTIM_SetClockSource().*/
  59. uint32_t Prescaler; /*!< Specifies the prescaler division ratio.
  60. This parameter can be a value of @ref LPTIM_LL_EC_PRESCALER.
  61. This feature can be modified afterwards using using unitary
  62. function @ref LL_LPTIM_SetPrescaler().*/
  63. uint32_t Waveform; /*!< Specifies the waveform shape.
  64. This parameter can be a value of @ref LPTIM_LL_EC_OUTPUT_WAVEFORM.
  65. This feature can be modified afterwards using unitary
  66. function @ref LL_LPTIM_ConfigOutput().*/
  67. uint32_t Polarity; /*!< Specifies waveform polarity.
  68. This parameter can be a value of @ref LPTIM_LL_EC_OUTPUT_POLARITY.
  69. This feature can be modified afterwards using unitary
  70. function @ref LL_LPTIM_ConfigOutput().*/
  71. } LL_LPTIM_InitTypeDef;
  72. /**
  73. * @}
  74. */
  75. #endif /* USE_FULL_LL_DRIVER */
  76. /* Exported constants --------------------------------------------------------*/
  77. /** @defgroup LPTIM_LL_Exported_Constants LPTIM Exported Constants
  78. * @{
  79. */
  80. /** @defgroup LPTIM_LL_EC_GET_FLAG Get Flags Defines
  81. * @brief Flags defines which can be used with LL_LPTIM_ReadReg function
  82. * @{
  83. */
  84. #define LL_LPTIM_ISR_CMPM LPTIM_ISR_CMPM /*!< Compare match */
  85. #define LL_LPTIM_ISR_CMPOK LPTIM_ISR_CMPOK /*!< Compare register update OK */
  86. #define LL_LPTIM_ISR_ARRM LPTIM_ISR_ARRM /*!< Autoreload match */
  87. #define LL_LPTIM_ISR_EXTTRIG LPTIM_ISR_EXTTRIG /*!< External trigger edge event */
  88. #define LL_LPTIM_ISR_ARROK LPTIM_ISR_ARROK /*!< Autoreload register update OK */
  89. #define LL_LPTIM_ISR_UP LPTIM_ISR_UP /*!< Counter direction change down to up */
  90. #define LL_LPTIM_ISR_DOWN LPTIM_ISR_DOWN /*!< Counter direction change up to down */
  91. /**
  92. * @}
  93. */
  94. /** @defgroup LPTIM_LL_EC_IT IT Defines
  95. * @brief IT defines which can be used with LL_LPTIM_ReadReg and LL_LPTIM_WriteReg functions
  96. * @{
  97. */
  98. #define LL_LPTIM_IER_CMPMIE LPTIM_IER_CMPMIE /*!< Compare match */
  99. #define LL_LPTIM_IER_CMPOKIE LPTIM_IER_CMPOKIE /*!< Compare register update OK */
  100. #define LL_LPTIM_IER_ARRMIE LPTIM_IER_ARRMIE /*!< Autoreload match */
  101. #define LL_LPTIM_IER_EXTTRIGIE LPTIM_IER_EXTTRIGIE /*!< External trigger edge event */
  102. #define LL_LPTIM_IER_ARROKIE LPTIM_IER_ARROKIE /*!< Autoreload register update OK */
  103. #define LL_LPTIM_IER_UPIE LPTIM_IER_UPIE /*!< Counter direction change down to up */
  104. #define LL_LPTIM_IER_DOWNIE LPTIM_IER_DOWNIE /*!< Counter direction change up to down */
  105. /**
  106. * @}
  107. */
  108. /** @defgroup LPTIM_LL_EC_OPERATING_MODE Operating Mode
  109. * @{
  110. */
  111. #define LL_LPTIM_OPERATING_MODE_CONTINUOUS LPTIM_CR_CNTSTRT /*!<LP Timer starts in continuous mode*/
  112. #define LL_LPTIM_OPERATING_MODE_ONESHOT LPTIM_CR_SNGSTRT /*!<LP Tilmer starts in single mode*/
  113. /**
  114. * @}
  115. */
  116. /** @defgroup LPTIM_LL_EC_UPDATE_MODE Update Mode
  117. * @{
  118. */
  119. #define LL_LPTIM_UPDATE_MODE_IMMEDIATE 0x00000000U /*!<Preload is disabled: registers are updated after each APB bus write access*/
  120. #define LL_LPTIM_UPDATE_MODE_ENDOFPERIOD LPTIM_CFGR_PRELOAD /*!<preload is enabled: registers are updated at the end of the current LPTIM period*/
  121. /**
  122. * @}
  123. */
  124. /** @defgroup LPTIM_LL_EC_COUNTER_MODE Counter Mode
  125. * @{
  126. */
  127. #define LL_LPTIM_COUNTER_MODE_INTERNAL 0x00000000U /*!<The counter is incremented following each internal clock pulse*/
  128. #define LL_LPTIM_COUNTER_MODE_EXTERNAL LPTIM_CFGR_COUNTMODE /*!<The counter is incremented following each valid clock pulse on the LPTIM external Input1*/
  129. /**
  130. * @}
  131. */
  132. /** @defgroup LPTIM_LL_EC_OUTPUT_WAVEFORM Output Waveform Type
  133. * @{
  134. */
  135. #define LL_LPTIM_OUTPUT_WAVEFORM_PWM 0x00000000U /*!<LPTIM generates either a PWM waveform or a One pulse waveform depending on chosen operating mode CONTINUOUS or SINGLE*/
  136. #define LL_LPTIM_OUTPUT_WAVEFORM_SETONCE LPTIM_CFGR_WAVE /*!<LPTIM generates a Set Once waveform*/
  137. /**
  138. * @}
  139. */
  140. /** @defgroup LPTIM_LL_EC_OUTPUT_POLARITY Output Polarity
  141. * @{
  142. */
  143. #define LL_LPTIM_OUTPUT_POLARITY_REGULAR 0x00000000U /*!<The LPTIM output reflects the compare results between LPTIMx_ARR and LPTIMx_CMP registers*/
  144. #define LL_LPTIM_OUTPUT_POLARITY_INVERSE LPTIM_CFGR_WAVPOL /*!<The LPTIM output reflects the inverse of the compare results between LPTIMx_ARR and LPTIMx_CMP registers*/
  145. /**
  146. * @}
  147. */
  148. /** @defgroup LPTIM_LL_EC_PRESCALER Prescaler Value
  149. * @{
  150. */
  151. #define LL_LPTIM_PRESCALER_DIV1 0x00000000U /*!<Prescaler division factor is set to 1*/
  152. #define LL_LPTIM_PRESCALER_DIV2 LPTIM_CFGR_PRESC_0 /*!<Prescaler division factor is set to 2*/
  153. #define LL_LPTIM_PRESCALER_DIV4 LPTIM_CFGR_PRESC_1 /*!<Prescaler division factor is set to 4*/
  154. #define LL_LPTIM_PRESCALER_DIV8 (LPTIM_CFGR_PRESC_1 | LPTIM_CFGR_PRESC_0) /*!<Prescaler division factor is set to 8*/
  155. #define LL_LPTIM_PRESCALER_DIV16 LPTIM_CFGR_PRESC_2 /*!<Prescaler division factor is set to 16*/
  156. #define LL_LPTIM_PRESCALER_DIV32 (LPTIM_CFGR_PRESC_2 | LPTIM_CFGR_PRESC_0) /*!<Prescaler division factor is set to 32*/
  157. #define LL_LPTIM_PRESCALER_DIV64 (LPTIM_CFGR_PRESC_2 | LPTIM_CFGR_PRESC_1) /*!<Prescaler division factor is set to 64*/
  158. #define LL_LPTIM_PRESCALER_DIV128 LPTIM_CFGR_PRESC /*!<Prescaler division factor is set to 128*/
  159. /**
  160. * @}
  161. */
  162. /** @defgroup LPTIM_LL_EC_TRIG_SOURCE Trigger Source
  163. * @{
  164. */
  165. #define LL_LPTIM_TRIG_SOURCE_GPIO 0x00000000U /*!<External input trigger is connected to TIMx_ETR input*/
  166. #define LL_LPTIM_TRIG_SOURCE_RTCALARMA LPTIM_CFGR_TRIGSEL_0 /*!<External input trigger is connected to RTC Alarm A*/
  167. #define LL_LPTIM_TRIG_SOURCE_RTCALARMB LPTIM_CFGR_TRIGSEL_1 /*!<External input trigger is connected to RTC Alarm B*/
  168. #define LL_LPTIM_TRIG_SOURCE_RTCTAMP1 (LPTIM_CFGR_TRIGSEL_1 | LPTIM_CFGR_TRIGSEL_0) /*!<External input trigger is connected to RTC Tamper 1*/
  169. #define LL_LPTIM_TRIG_SOURCE_TIM1_TRGO LPTIM_CFGR_TRIGSEL_2 /*!<External input trigger is connected to TIM1*/
  170. #define LL_LPTIM_TRIG_SOURCE_TIM5_TRGO (LPTIM_CFGR_TRIGSEL_2 | LPTIM_CFGR_TRIGSEL_0) /*!<External input trigger is connected to TIM5*/
  171. /**
  172. * @}
  173. */
  174. /** @defgroup LPTIM_LL_EC_TRIG_FILTER Trigger Filter
  175. * @{
  176. */
  177. #define LL_LPTIM_TRIG_FILTER_NONE 0x00000000U /*!<Any trigger active level change is considered as a valid trigger*/
  178. #define LL_LPTIM_TRIG_FILTER_2 LPTIM_CFGR_TRGFLT_0 /*!<Trigger active level change must be stable for at least 2 clock periods before it is considered as valid trigger*/
  179. #define LL_LPTIM_TRIG_FILTER_4 LPTIM_CFGR_TRGFLT_1 /*!<Trigger active level change must be stable for at least 4 clock periods before it is considered as valid trigger*/
  180. #define LL_LPTIM_TRIG_FILTER_8 LPTIM_CFGR_TRGFLT /*!<Trigger active level change must be stable for at least 8 clock periods before it is considered as valid trigger*/
  181. /**
  182. * @}
  183. */
  184. /** @defgroup LPTIM_LL_EC_TRIG_POLARITY Trigger Polarity
  185. * @{
  186. */
  187. #define LL_LPTIM_TRIG_POLARITY_RISING LPTIM_CFGR_TRIGEN_0 /*!<LPTIM counter starts when a rising edge is detected*/
  188. #define LL_LPTIM_TRIG_POLARITY_FALLING LPTIM_CFGR_TRIGEN_1 /*!<LPTIM counter starts when a falling edge is detected*/
  189. #define LL_LPTIM_TRIG_POLARITY_RISING_FALLING LPTIM_CFGR_TRIGEN /*!<LPTIM counter starts when a rising or a falling edge is detected*/
  190. /**
  191. * @}
  192. */
  193. /** @defgroup LPTIM_LL_EC_CLK_SOURCE Clock Source
  194. * @{
  195. */
  196. #define LL_LPTIM_CLK_SOURCE_INTERNAL 0x00000000U /*!<LPTIM is clocked by internal clock source (APB clock or any of the embedded oscillators)*/
  197. #define LL_LPTIM_CLK_SOURCE_EXTERNAL LPTIM_CFGR_CKSEL /*!<LPTIM is clocked by an external clock source through the LPTIM external Input1*/
  198. /**
  199. * @}
  200. */
  201. /** @defgroup LPTIM_LL_EC_CLK_FILTER Clock Filter
  202. * @{
  203. */
  204. #define LL_LPTIM_CLK_FILTER_NONE 0x00000000U /*!<Any external clock signal level change is considered as a valid transition*/
  205. #define LL_LPTIM_CLK_FILTER_2 LPTIM_CFGR_CKFLT_0 /*!<External clock signal level change must be stable for at least 2 clock periods before it is considered as valid transition*/
  206. #define LL_LPTIM_CLK_FILTER_4 LPTIM_CFGR_CKFLT_1 /*!<External clock signal level change must be stable for at least 4 clock periods before it is considered as valid transition*/
  207. #define LL_LPTIM_CLK_FILTER_8 LPTIM_CFGR_CKFLT /*!<External clock signal level change must be stable for at least 8 clock periods before it is considered as valid transition*/
  208. /**
  209. * @}
  210. */
  211. /** @defgroup LPTIM_LL_EC_CLK_POLARITY Clock Polarity
  212. * @{
  213. */
  214. #define LL_LPTIM_CLK_POLARITY_RISING 0x00000000U /*!< The rising edge is the active edge used for counting*/
  215. #define LL_LPTIM_CLK_POLARITY_FALLING LPTIM_CFGR_CKPOL_0 /*!< The falling edge is the active edge used for counting*/
  216. #define LL_LPTIM_CLK_POLARITY_RISING_FALLING LPTIM_CFGR_CKPOL_1 /*!< Both edges are active edges*/
  217. /**
  218. * @}
  219. */
  220. /** @defgroup LPTIM_LL_EC_ENCODER_MODE Encoder Mode
  221. * @{
  222. */
  223. #define LL_LPTIM_ENCODER_MODE_RISING 0x00000000U /*!< The rising edge is the active edge used for counting*/
  224. #define LL_LPTIM_ENCODER_MODE_FALLING LPTIM_CFGR_CKPOL_0 /*!< The falling edge is the active edge used for counting*/
  225. #define LL_LPTIM_ENCODER_MODE_RISING_FALLING LPTIM_CFGR_CKPOL_1 /*!< Both edges are active edges*/
  226. /**
  227. * @}
  228. */
  229. /** @defgroup LPTIM_EC_INPUT1_SRC Input1 Source
  230. * @{
  231. */
  232. #define LL_LPTIM_INPUT1_SRC_PAD_AF 0x00000000U
  233. #define LL_LPTIM_INPUT1_SRC_PAD_PA4 LPTIM_OR_OR_0
  234. #define LL_LPTIM_INPUT1_SRC_PAD_PB9 LPTIM_OR_OR_1
  235. #define LL_LPTIM_INPUT1_SRC_TIM_DAC LPTIM_OR_OR
  236. /**
  237. * @}
  238. */
  239. /**
  240. * @}
  241. */
  242. /* Exported macro ------------------------------------------------------------*/
  243. /** @defgroup LPTIM_LL_Exported_Macros LPTIM Exported Macros
  244. * @{
  245. */
  246. /** @defgroup LPTIM_LL_EM_WRITE_READ Common Write and read registers Macros
  247. * @{
  248. */
  249. /**
  250. * @brief Write a value in LPTIM register
  251. * @param __INSTANCE__ LPTIM Instance
  252. * @param __REG__ Register to be written
  253. * @param __VALUE__ Value to be written in the register
  254. * @retval None
  255. */
  256. #define LL_LPTIM_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG((__INSTANCE__)->__REG__, (__VALUE__))
  257. /**
  258. * @brief Read a value in LPTIM register
  259. * @param __INSTANCE__ LPTIM Instance
  260. * @param __REG__ Register to be read
  261. * @retval Register value
  262. */
  263. #define LL_LPTIM_ReadReg(__INSTANCE__, __REG__) READ_REG((__INSTANCE__)->__REG__)
  264. /**
  265. * @}
  266. */
  267. /**
  268. * @}
  269. */
  270. /* Exported functions --------------------------------------------------------*/
  271. /** @defgroup LPTIM_LL_Exported_Functions LPTIM Exported Functions
  272. * @{
  273. */
  274. /** Legacy definitions for compatibility purpose
  275. @cond 0
  276. */
  277. #define LL_LPTIM_ClearFLAG_CMPM LL_LPTIM_ClearFlag_CMPM
  278. #define LL_LPTIM_ClearFLAG_CC1 LL_LPTIM_ClearFlag_CC1
  279. #define LL_LPTIM_ClearFLAG_CC2 LL_LPTIM_ClearFlag_CC2
  280. #define LL_LPTIM_ClearFLAG_CC1O LL_LPTIM_ClearFlag_CC1O
  281. #define LL_LPTIM_ClearFLAG_CC2O LL_LPTIM_ClearFlag_CC2O
  282. #define LL_LPTIM_ClearFLAG_ARRM LL_LPTIM_ClearFlag_ARRM
  283. /**
  284. @endcond
  285. */
  286. #if defined(USE_FULL_LL_DRIVER)
  287. /** @defgroup LPTIM_LL_EF_Init Initialisation and deinitialisation functions
  288. * @{
  289. */
  290. ErrorStatus LL_LPTIM_DeInit(const LPTIM_TypeDef *LPTIMx);
  291. void LL_LPTIM_StructInit(LL_LPTIM_InitTypeDef *LPTIM_InitStruct);
  292. ErrorStatus LL_LPTIM_Init(LPTIM_TypeDef *LPTIMx, const LL_LPTIM_InitTypeDef *LPTIM_InitStruct);
  293. void LL_LPTIM_Disable(LPTIM_TypeDef *LPTIMx);
  294. /**
  295. * @}
  296. */
  297. #endif /* USE_FULL_LL_DRIVER */
  298. /** @defgroup LPTIM_LL_EF_LPTIM_Configuration LPTIM Configuration
  299. * @{
  300. */
  301. /**
  302. * @brief Enable the LPTIM instance
  303. * @note After setting the ENABLE bit, a delay of two counter clock is needed
  304. * before the LPTIM instance is actually enabled.
  305. * @rmtoll CR ENABLE LL_LPTIM_Enable
  306. * @param LPTIMx Low-Power Timer instance
  307. * @retval None
  308. */
  309. __STATIC_INLINE void LL_LPTIM_Enable(LPTIM_TypeDef *LPTIMx)
  310. {
  311. SET_BIT(LPTIMx->CR, LPTIM_CR_ENABLE);
  312. }
  313. /**
  314. * @brief Indicates whether the LPTIM instance is enabled.
  315. * @rmtoll CR ENABLE LL_LPTIM_IsEnabled
  316. * @param LPTIMx Low-Power Timer instance
  317. * @retval State of bit (1 or 0).
  318. */
  319. __STATIC_INLINE uint32_t LL_LPTIM_IsEnabled(const LPTIM_TypeDef *LPTIMx)
  320. {
  321. return (((READ_BIT(LPTIMx->CR, LPTIM_CR_ENABLE) == LPTIM_CR_ENABLE) ? 1UL : 0UL));
  322. }
  323. /**
  324. * @brief Starts the LPTIM counter in the desired mode.
  325. * @note LPTIM instance must be enabled before starting the counter.
  326. * @note It is possible to change on the fly from One Shot mode to
  327. * Continuous mode.
  328. * @rmtoll CR CNTSTRT LL_LPTIM_StartCounter\n
  329. * CR SNGSTRT LL_LPTIM_StartCounter
  330. * @param LPTIMx Low-Power Timer instance
  331. * @param OperatingMode This parameter can be one of the following values:
  332. * @arg @ref LL_LPTIM_OPERATING_MODE_CONTINUOUS
  333. * @arg @ref LL_LPTIM_OPERATING_MODE_ONESHOT
  334. * @retval None
  335. */
  336. __STATIC_INLINE void LL_LPTIM_StartCounter(LPTIM_TypeDef *LPTIMx, uint32_t OperatingMode)
  337. {
  338. MODIFY_REG(LPTIMx->CR, LPTIM_CR_CNTSTRT | LPTIM_CR_SNGSTRT, OperatingMode);
  339. }
  340. /**
  341. * @brief Set the LPTIM registers update mode (enable/disable register preload)
  342. * @note This function must be called when the LPTIM instance is disabled.
  343. * @rmtoll CFGR PRELOAD LL_LPTIM_SetUpdateMode
  344. * @param LPTIMx Low-Power Timer instance
  345. * @param UpdateMode This parameter can be one of the following values:
  346. * @arg @ref LL_LPTIM_UPDATE_MODE_IMMEDIATE
  347. * @arg @ref LL_LPTIM_UPDATE_MODE_ENDOFPERIOD
  348. * @retval None
  349. */
  350. __STATIC_INLINE void LL_LPTIM_SetUpdateMode(LPTIM_TypeDef *LPTIMx, uint32_t UpdateMode)
  351. {
  352. MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_PRELOAD, UpdateMode);
  353. }
  354. /**
  355. * @brief Get the LPTIM registers update mode
  356. * @rmtoll CFGR PRELOAD LL_LPTIM_GetUpdateMode
  357. * @param LPTIMx Low-Power Timer instance
  358. * @retval Returned value can be one of the following values:
  359. * @arg @ref LL_LPTIM_UPDATE_MODE_IMMEDIATE
  360. * @arg @ref LL_LPTIM_UPDATE_MODE_ENDOFPERIOD
  361. */
  362. __STATIC_INLINE uint32_t LL_LPTIM_GetUpdateMode(const LPTIM_TypeDef *LPTIMx)
  363. {
  364. return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_PRELOAD));
  365. }
  366. /**
  367. * @brief Set the auto reload value
  368. * @note The LPTIMx_ARR register content must only be modified when the LPTIM is enabled
  369. * @note After a write to the LPTIMx_ARR register a new write operation to the
  370. * same register can only be performed when the previous write operation
  371. * is completed. Any successive write before the ARROK flag is set, will
  372. * lead to unpredictable results.
  373. * @note autoreload value be strictly greater than the compare value.
  374. * @rmtoll ARR ARR LL_LPTIM_SetAutoReload
  375. * @param LPTIMx Low-Power Timer instance
  376. * @param AutoReload Value between Min_Data=0x0001 and Max_Data=0xFFFF
  377. * @retval None
  378. */
  379. __STATIC_INLINE void LL_LPTIM_SetAutoReload(LPTIM_TypeDef *LPTIMx, uint32_t AutoReload)
  380. {
  381. MODIFY_REG(LPTIMx->ARR, LPTIM_ARR_ARR, AutoReload);
  382. }
  383. /**
  384. * @brief Get actual auto reload value
  385. * @rmtoll ARR ARR LL_LPTIM_GetAutoReload
  386. * @param LPTIMx Low-Power Timer instance
  387. * @retval AutoReload Value between Min_Data=0x0001 and Max_Data=0xFFFF
  388. */
  389. __STATIC_INLINE uint32_t LL_LPTIM_GetAutoReload(const LPTIM_TypeDef *LPTIMx)
  390. {
  391. return (uint32_t)(READ_BIT(LPTIMx->ARR, LPTIM_ARR_ARR));
  392. }
  393. /**
  394. * @brief Set the compare value
  395. * @note After a write to the LPTIMx_CMP register a new write operation to the
  396. * same register can only be performed when the previous write operation
  397. * is completed. Any successive write before the CMPOK flag is set, will
  398. * lead to unpredictable results.
  399. * @rmtoll CMP CMP LL_LPTIM_SetCompare
  400. * @param LPTIMx Low-Power Timer instance
  401. * @param CompareValue Value between Min_Data=0x00 and Max_Data=0xFFFF
  402. * @retval None
  403. */
  404. __STATIC_INLINE void LL_LPTIM_SetCompare(LPTIM_TypeDef *LPTIMx, uint32_t CompareValue)
  405. {
  406. MODIFY_REG(LPTIMx->CMP, LPTIM_CMP_CMP, CompareValue);
  407. }
  408. /**
  409. * @brief Get actual compare value
  410. * @rmtoll CMP CMP LL_LPTIM_GetCompare
  411. * @param LPTIMx Low-Power Timer instance
  412. * @retval CompareValue Value between Min_Data=0x00 and Max_Data=0xFFFF
  413. */
  414. __STATIC_INLINE uint32_t LL_LPTIM_GetCompare(const LPTIM_TypeDef *LPTIMx)
  415. {
  416. return (uint32_t)(READ_BIT(LPTIMx->CMP, LPTIM_CMP_CMP));
  417. }
  418. /**
  419. * @brief Get actual counter value
  420. * @note When the LPTIM instance is running with an asynchronous clock, reading
  421. * the LPTIMx_CNT register may return unreliable values. So in this case
  422. * it is necessary to perform two consecutive read accesses and verify
  423. * that the two returned values are identical.
  424. * @rmtoll CNT CNT LL_LPTIM_GetCounter
  425. * @param LPTIMx Low-Power Timer instance
  426. * @retval Counter value
  427. */
  428. __STATIC_INLINE uint32_t LL_LPTIM_GetCounter(const LPTIM_TypeDef *LPTIMx)
  429. {
  430. return (uint32_t)(READ_BIT(LPTIMx->CNT, LPTIM_CNT_CNT));
  431. }
  432. /**
  433. * @brief Set the counter mode (selection of the LPTIM counter clock source).
  434. * @note The counter mode can be set only when the LPTIM instance is disabled.
  435. * @rmtoll CFGR COUNTMODE LL_LPTIM_SetCounterMode
  436. * @param LPTIMx Low-Power Timer instance
  437. * @param CounterMode This parameter can be one of the following values:
  438. * @arg @ref LL_LPTIM_COUNTER_MODE_INTERNAL
  439. * @arg @ref LL_LPTIM_COUNTER_MODE_EXTERNAL
  440. * @retval None
  441. */
  442. __STATIC_INLINE void LL_LPTIM_SetCounterMode(LPTIM_TypeDef *LPTIMx, uint32_t CounterMode)
  443. {
  444. MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_COUNTMODE, CounterMode);
  445. }
  446. /**
  447. * @brief Get the counter mode
  448. * @rmtoll CFGR COUNTMODE LL_LPTIM_GetCounterMode
  449. * @param LPTIMx Low-Power Timer instance
  450. * @retval Returned value can be one of the following values:
  451. * @arg @ref LL_LPTIM_COUNTER_MODE_INTERNAL
  452. * @arg @ref LL_LPTIM_COUNTER_MODE_EXTERNAL
  453. */
  454. __STATIC_INLINE uint32_t LL_LPTIM_GetCounterMode(const LPTIM_TypeDef *LPTIMx)
  455. {
  456. return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_COUNTMODE));
  457. }
  458. /**
  459. * @brief Configure the LPTIM instance output (LPTIMx_OUT)
  460. * @note This function must be called when the LPTIM instance is disabled.
  461. * @note Regarding the LPTIM output polarity the change takes effect
  462. * immediately, so the output default value will change immediately after
  463. * the polarity is re-configured, even before the timer is enabled.
  464. * @rmtoll CFGR WAVE LL_LPTIM_ConfigOutput\n
  465. * CFGR WAVPOL LL_LPTIM_ConfigOutput
  466. * @param LPTIMx Low-Power Timer instance
  467. * @param Waveform This parameter can be one of the following values:
  468. * @arg @ref LL_LPTIM_OUTPUT_WAVEFORM_PWM
  469. * @arg @ref LL_LPTIM_OUTPUT_WAVEFORM_SETONCE
  470. * @param Polarity This parameter can be one of the following values:
  471. * @arg @ref LL_LPTIM_OUTPUT_POLARITY_REGULAR
  472. * @arg @ref LL_LPTIM_OUTPUT_POLARITY_INVERSE
  473. * @retval None
  474. */
  475. __STATIC_INLINE void LL_LPTIM_ConfigOutput(LPTIM_TypeDef *LPTIMx, uint32_t Waveform, uint32_t Polarity)
  476. {
  477. MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_WAVE | LPTIM_CFGR_WAVPOL, Waveform | Polarity);
  478. }
  479. /**
  480. * @brief Set waveform shape
  481. * @rmtoll CFGR WAVE LL_LPTIM_SetWaveform
  482. * @param LPTIMx Low-Power Timer instance
  483. * @param Waveform This parameter can be one of the following values:
  484. * @arg @ref LL_LPTIM_OUTPUT_WAVEFORM_PWM
  485. * @arg @ref LL_LPTIM_OUTPUT_WAVEFORM_SETONCE
  486. * @retval None
  487. */
  488. __STATIC_INLINE void LL_LPTIM_SetWaveform(LPTIM_TypeDef *LPTIMx, uint32_t Waveform)
  489. {
  490. MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_WAVE, Waveform);
  491. }
  492. /**
  493. * @brief Get actual waveform shape
  494. * @rmtoll CFGR WAVE LL_LPTIM_GetWaveform
  495. * @param LPTIMx Low-Power Timer instance
  496. * @retval Returned value can be one of the following values:
  497. * @arg @ref LL_LPTIM_OUTPUT_WAVEFORM_PWM
  498. * @arg @ref LL_LPTIM_OUTPUT_WAVEFORM_SETONCE
  499. */
  500. __STATIC_INLINE uint32_t LL_LPTIM_GetWaveform(const LPTIM_TypeDef *LPTIMx)
  501. {
  502. return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_WAVE));
  503. }
  504. /**
  505. * @brief Set output polarity
  506. * @rmtoll CFGR WAVPOL LL_LPTIM_SetPolarity
  507. * @param LPTIMx Low-Power Timer instance
  508. * @param Polarity This parameter can be one of the following values:
  509. * @arg @ref LL_LPTIM_OUTPUT_POLARITY_REGULAR
  510. * @arg @ref LL_LPTIM_OUTPUT_POLARITY_INVERSE
  511. * @retval None
  512. */
  513. __STATIC_INLINE void LL_LPTIM_SetPolarity(LPTIM_TypeDef *LPTIMx, uint32_t Polarity)
  514. {
  515. MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_WAVPOL, Polarity);
  516. }
  517. /**
  518. * @brief Get actual output polarity
  519. * @rmtoll CFGR WAVPOL LL_LPTIM_GetPolarity
  520. * @param LPTIMx Low-Power Timer instance
  521. * @retval Returned value can be one of the following values:
  522. * @arg @ref LL_LPTIM_OUTPUT_POLARITY_REGULAR
  523. * @arg @ref LL_LPTIM_OUTPUT_POLARITY_INVERSE
  524. */
  525. __STATIC_INLINE uint32_t LL_LPTIM_GetPolarity(const LPTIM_TypeDef *LPTIMx)
  526. {
  527. return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_WAVPOL));
  528. }
  529. /**
  530. * @brief Set actual prescaler division ratio.
  531. * @note This function must be called when the LPTIM instance is disabled.
  532. * @note When the LPTIM is configured to be clocked by an internal clock source
  533. * and the LPTIM counter is configured to be updated by active edges
  534. * detected on the LPTIM external Input1, the internal clock provided to
  535. * the LPTIM must be not be prescaled.
  536. * @rmtoll CFGR PRESC LL_LPTIM_SetPrescaler
  537. * @param LPTIMx Low-Power Timer instance
  538. * @param Prescaler This parameter can be one of the following values:
  539. * @arg @ref LL_LPTIM_PRESCALER_DIV1
  540. * @arg @ref LL_LPTIM_PRESCALER_DIV2
  541. * @arg @ref LL_LPTIM_PRESCALER_DIV4
  542. * @arg @ref LL_LPTIM_PRESCALER_DIV8
  543. * @arg @ref LL_LPTIM_PRESCALER_DIV16
  544. * @arg @ref LL_LPTIM_PRESCALER_DIV32
  545. * @arg @ref LL_LPTIM_PRESCALER_DIV64
  546. * @arg @ref LL_LPTIM_PRESCALER_DIV128
  547. * @retval None
  548. */
  549. __STATIC_INLINE void LL_LPTIM_SetPrescaler(LPTIM_TypeDef *LPTIMx, uint32_t Prescaler)
  550. {
  551. MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_PRESC, Prescaler);
  552. }
  553. /**
  554. * @brief Get actual prescaler division ratio.
  555. * @rmtoll CFGR PRESC LL_LPTIM_GetPrescaler
  556. * @param LPTIMx Low-Power Timer instance
  557. * @retval Returned value can be one of the following values:
  558. * @arg @ref LL_LPTIM_PRESCALER_DIV1
  559. * @arg @ref LL_LPTIM_PRESCALER_DIV2
  560. * @arg @ref LL_LPTIM_PRESCALER_DIV4
  561. * @arg @ref LL_LPTIM_PRESCALER_DIV8
  562. * @arg @ref LL_LPTIM_PRESCALER_DIV16
  563. * @arg @ref LL_LPTIM_PRESCALER_DIV32
  564. * @arg @ref LL_LPTIM_PRESCALER_DIV64
  565. * @arg @ref LL_LPTIM_PRESCALER_DIV128
  566. */
  567. __STATIC_INLINE uint32_t LL_LPTIM_GetPrescaler(const LPTIM_TypeDef *LPTIMx)
  568. {
  569. return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_PRESC));
  570. }
  571. /**
  572. * @brief Set LPTIM input 1 source (default GPIO).
  573. * @rmtoll OR OR LL_LPTIM_SetInput1Src
  574. * @param LPTIMx Low-Power Timer instance
  575. * @param Src This parameter can be one of the following values:
  576. * @arg @ref LL_LPTIM_INPUT1_SRC_PAD_AF
  577. * @arg @ref LL_LPTIM_INPUT1_SRC_PAD_PA4
  578. * @arg @ref LL_LPTIM_INPUT1_SRC_PAD_PB9
  579. * @arg @ref LL_LPTIM_INPUT1_SRC_TIM_DAC
  580. * @retval None
  581. */
  582. __STATIC_INLINE void LL_LPTIM_SetInput1Src(LPTIM_TypeDef *LPTIMx, uint32_t Src)
  583. {
  584. MODIFY_REG(LPTIMx->OR, LPTIM_OR_OR, Src);
  585. }
  586. /**
  587. * @}
  588. */
  589. /** @defgroup LPTIM_LL_EF_Trigger_Configuration Trigger Configuration
  590. * @{
  591. */
  592. /**
  593. * @brief Enable the timeout function
  594. * @note This function must be called when the LPTIM instance is disabled.
  595. * @note The first trigger event will start the timer, any successive trigger
  596. * event will reset the counter and the timer will restart.
  597. * @note The timeout value corresponds to the compare value; if no trigger
  598. * occurs within the expected time frame, the MCU is waked-up by the
  599. * compare match event.
  600. * @rmtoll CFGR TIMOUT LL_LPTIM_EnableTimeout
  601. * @param LPTIMx Low-Power Timer instance
  602. * @retval None
  603. */
  604. __STATIC_INLINE void LL_LPTIM_EnableTimeout(LPTIM_TypeDef *LPTIMx)
  605. {
  606. SET_BIT(LPTIMx->CFGR, LPTIM_CFGR_TIMOUT);
  607. }
  608. /**
  609. * @brief Disable the timeout function
  610. * @note This function must be called when the LPTIM instance is disabled.
  611. * @note A trigger event arriving when the timer is already started will be
  612. * ignored.
  613. * @rmtoll CFGR TIMOUT LL_LPTIM_DisableTimeout
  614. * @param LPTIMx Low-Power Timer instance
  615. * @retval None
  616. */
  617. __STATIC_INLINE void LL_LPTIM_DisableTimeout(LPTIM_TypeDef *LPTIMx)
  618. {
  619. CLEAR_BIT(LPTIMx->CFGR, LPTIM_CFGR_TIMOUT);
  620. }
  621. /**
  622. * @brief Indicate whether the timeout function is enabled.
  623. * @rmtoll CFGR TIMOUT LL_LPTIM_IsEnabledTimeout
  624. * @param LPTIMx Low-Power Timer instance
  625. * @retval State of bit (1 or 0).
  626. */
  627. __STATIC_INLINE uint32_t LL_LPTIM_IsEnabledTimeout(const LPTIM_TypeDef *LPTIMx)
  628. {
  629. return (((READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_TIMOUT) == LPTIM_CFGR_TIMOUT) ? 1UL : 0UL));
  630. }
  631. /**
  632. * @brief Start the LPTIM counter
  633. * @note This function must be called when the LPTIM instance is disabled.
  634. * @rmtoll CFGR TRIGEN LL_LPTIM_TrigSw
  635. * @param LPTIMx Low-Power Timer instance
  636. * @retval None
  637. */
  638. __STATIC_INLINE void LL_LPTIM_TrigSw(LPTIM_TypeDef *LPTIMx)
  639. {
  640. CLEAR_BIT(LPTIMx->CFGR, LPTIM_CFGR_TRIGEN);
  641. }
  642. /**
  643. * @brief Configure the external trigger used as a trigger event for the LPTIM.
  644. * @note This function must be called when the LPTIM instance is disabled.
  645. * @note An internal clock source must be present when a digital filter is
  646. * required for the trigger.
  647. * @rmtoll CFGR TRIGSEL LL_LPTIM_ConfigTrigger\n
  648. * CFGR TRGFLT LL_LPTIM_ConfigTrigger\n
  649. * CFGR TRIGEN LL_LPTIM_ConfigTrigger
  650. * @param LPTIMx Low-Power Timer instance
  651. * @param Source This parameter can be one of the following values:
  652. * @arg @ref LL_LPTIM_TRIG_SOURCE_GPIO
  653. * @arg @ref LL_LPTIM_TRIG_SOURCE_RTCALARMA
  654. * @arg @ref LL_LPTIM_TRIG_SOURCE_RTCALARMB
  655. * @arg @ref LL_LPTIM_TRIG_SOURCE_RTCTAMP1
  656. * @arg @ref LL_LPTIM_TRIG_SOURCE_TIM1_TRGO
  657. * @arg @ref LL_LPTIM_TRIG_SOURCE_TIM5_TRGO
  658. * @param Filter This parameter can be one of the following values:
  659. * @arg @ref LL_LPTIM_TRIG_FILTER_NONE
  660. * @arg @ref LL_LPTIM_TRIG_FILTER_2
  661. * @arg @ref LL_LPTIM_TRIG_FILTER_4
  662. * @arg @ref LL_LPTIM_TRIG_FILTER_8
  663. * @param Polarity This parameter can be one of the following values:
  664. * @arg @ref LL_LPTIM_TRIG_POLARITY_RISING
  665. * @arg @ref LL_LPTIM_TRIG_POLARITY_FALLING
  666. * @arg @ref LL_LPTIM_TRIG_POLARITY_RISING_FALLING
  667. * @retval None
  668. */
  669. __STATIC_INLINE void LL_LPTIM_ConfigTrigger(LPTIM_TypeDef *LPTIMx, uint32_t Source, uint32_t Filter, uint32_t Polarity)
  670. {
  671. MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_TRIGSEL | LPTIM_CFGR_TRGFLT | LPTIM_CFGR_TRIGEN, Source | Filter | Polarity);
  672. }
  673. /**
  674. * @brief Get actual external trigger source.
  675. * @rmtoll CFGR TRIGSEL LL_LPTIM_GetTriggerSource
  676. * @param LPTIMx Low-Power Timer instance
  677. * @retval Returned value can be one of the following values:
  678. * @arg @ref LL_LPTIM_TRIG_SOURCE_GPIO
  679. * @arg @ref LL_LPTIM_TRIG_SOURCE_RTCALARMA
  680. * @arg @ref LL_LPTIM_TRIG_SOURCE_RTCALARMB
  681. * @arg @ref LL_LPTIM_TRIG_SOURCE_RTCTAMP1
  682. * @arg @ref LL_LPTIM_TRIG_SOURCE_TIM1_TRGO
  683. * @arg @ref LL_LPTIM_TRIG_SOURCE_TIM5_TRGO
  684. */
  685. __STATIC_INLINE uint32_t LL_LPTIM_GetTriggerSource(const LPTIM_TypeDef *LPTIMx)
  686. {
  687. return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_TRIGSEL));
  688. }
  689. /**
  690. * @brief Get actual external trigger filter.
  691. * @rmtoll CFGR TRGFLT LL_LPTIM_GetTriggerFilter
  692. * @param LPTIMx Low-Power Timer instance
  693. * @retval Returned value can be one of the following values:
  694. * @arg @ref LL_LPTIM_TRIG_FILTER_NONE
  695. * @arg @ref LL_LPTIM_TRIG_FILTER_2
  696. * @arg @ref LL_LPTIM_TRIG_FILTER_4
  697. * @arg @ref LL_LPTIM_TRIG_FILTER_8
  698. */
  699. __STATIC_INLINE uint32_t LL_LPTIM_GetTriggerFilter(const LPTIM_TypeDef *LPTIMx)
  700. {
  701. return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_TRGFLT));
  702. }
  703. /**
  704. * @brief Get actual external trigger polarity.
  705. * @rmtoll CFGR TRIGEN LL_LPTIM_GetTriggerPolarity
  706. * @param LPTIMx Low-Power Timer instance
  707. * @retval Returned value can be one of the following values:
  708. * @arg @ref LL_LPTIM_TRIG_POLARITY_RISING
  709. * @arg @ref LL_LPTIM_TRIG_POLARITY_FALLING
  710. * @arg @ref LL_LPTIM_TRIG_POLARITY_RISING_FALLING
  711. */
  712. __STATIC_INLINE uint32_t LL_LPTIM_GetTriggerPolarity(const LPTIM_TypeDef *LPTIMx)
  713. {
  714. return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_TRIGEN));
  715. }
  716. /**
  717. * @}
  718. */
  719. /** @defgroup LPTIM_LL_EF_Clock_Configuration Clock Configuration
  720. * @{
  721. */
  722. /**
  723. * @brief Set the source of the clock used by the LPTIM instance.
  724. * @note This function must be called when the LPTIM instance is disabled.
  725. * @rmtoll CFGR CKSEL LL_LPTIM_SetClockSource
  726. * @param LPTIMx Low-Power Timer instance
  727. * @param ClockSource This parameter can be one of the following values:
  728. * @arg @ref LL_LPTIM_CLK_SOURCE_INTERNAL
  729. * @arg @ref LL_LPTIM_CLK_SOURCE_EXTERNAL
  730. * @retval None
  731. */
  732. __STATIC_INLINE void LL_LPTIM_SetClockSource(LPTIM_TypeDef *LPTIMx, uint32_t ClockSource)
  733. {
  734. MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_CKSEL, ClockSource);
  735. }
  736. /**
  737. * @brief Get actual LPTIM instance clock source.
  738. * @rmtoll CFGR CKSEL LL_LPTIM_GetClockSource
  739. * @param LPTIMx Low-Power Timer instance
  740. * @retval Returned value can be one of the following values:
  741. * @arg @ref LL_LPTIM_CLK_SOURCE_INTERNAL
  742. * @arg @ref LL_LPTIM_CLK_SOURCE_EXTERNAL
  743. */
  744. __STATIC_INLINE uint32_t LL_LPTIM_GetClockSource(const LPTIM_TypeDef *LPTIMx)
  745. {
  746. return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_CKSEL));
  747. }
  748. /**
  749. * @brief Configure the active edge or edges used by the counter when
  750. the LPTIM is clocked by an external clock source.
  751. * @note This function must be called when the LPTIM instance is disabled.
  752. * @note When both external clock signal edges are considered active ones,
  753. * the LPTIM must also be clocked by an internal clock source with a
  754. * frequency equal to at least four times the external clock frequency.
  755. * @note An internal clock source must be present when a digital filter is
  756. * required for external clock.
  757. * @rmtoll CFGR CKFLT LL_LPTIM_ConfigClock\n
  758. * CFGR CKPOL LL_LPTIM_ConfigClock
  759. * @param LPTIMx Low-Power Timer instance
  760. * @param ClockFilter This parameter can be one of the following values:
  761. * @arg @ref LL_LPTIM_CLK_FILTER_NONE
  762. * @arg @ref LL_LPTIM_CLK_FILTER_2
  763. * @arg @ref LL_LPTIM_CLK_FILTER_4
  764. * @arg @ref LL_LPTIM_CLK_FILTER_8
  765. * @param ClockPolarity This parameter can be one of the following values:
  766. * @arg @ref LL_LPTIM_CLK_POLARITY_RISING
  767. * @arg @ref LL_LPTIM_CLK_POLARITY_FALLING
  768. * @arg @ref LL_LPTIM_CLK_POLARITY_RISING_FALLING
  769. * @retval None
  770. */
  771. __STATIC_INLINE void LL_LPTIM_ConfigClock(LPTIM_TypeDef *LPTIMx, uint32_t ClockFilter, uint32_t ClockPolarity)
  772. {
  773. MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_CKFLT | LPTIM_CFGR_CKPOL, ClockFilter | ClockPolarity);
  774. }
  775. /**
  776. * @brief Get actual clock polarity
  777. * @rmtoll CFGR CKPOL LL_LPTIM_GetClockPolarity
  778. * @param LPTIMx Low-Power Timer instance
  779. * @retval Returned value can be one of the following values:
  780. * @arg @ref LL_LPTIM_CLK_POLARITY_RISING
  781. * @arg @ref LL_LPTIM_CLK_POLARITY_FALLING
  782. * @arg @ref LL_LPTIM_CLK_POLARITY_RISING_FALLING
  783. */
  784. __STATIC_INLINE uint32_t LL_LPTIM_GetClockPolarity(const LPTIM_TypeDef *LPTIMx)
  785. {
  786. return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_CKPOL));
  787. }
  788. /**
  789. * @brief Get actual clock digital filter
  790. * @rmtoll CFGR CKFLT LL_LPTIM_GetClockFilter
  791. * @param LPTIMx Low-Power Timer instance
  792. * @retval Returned value can be one of the following values:
  793. * @arg @ref LL_LPTIM_CLK_FILTER_NONE
  794. * @arg @ref LL_LPTIM_CLK_FILTER_2
  795. * @arg @ref LL_LPTIM_CLK_FILTER_4
  796. * @arg @ref LL_LPTIM_CLK_FILTER_8
  797. */
  798. __STATIC_INLINE uint32_t LL_LPTIM_GetClockFilter(const LPTIM_TypeDef *LPTIMx)
  799. {
  800. return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_CKFLT));
  801. }
  802. /**
  803. * @}
  804. */
  805. /** @defgroup LPTIM_LL_EF_Encoder_Mode Encoder Mode
  806. * @{
  807. */
  808. /**
  809. * @brief Configure the encoder mode.
  810. * @note This function must be called when the LPTIM instance is disabled.
  811. * @rmtoll CFGR CKPOL LL_LPTIM_SetEncoderMode
  812. * @param LPTIMx Low-Power Timer instance
  813. * @param EncoderMode This parameter can be one of the following values:
  814. * @arg @ref LL_LPTIM_ENCODER_MODE_RISING
  815. * @arg @ref LL_LPTIM_ENCODER_MODE_FALLING
  816. * @arg @ref LL_LPTIM_ENCODER_MODE_RISING_FALLING
  817. * @retval None
  818. */
  819. __STATIC_INLINE void LL_LPTIM_SetEncoderMode(LPTIM_TypeDef *LPTIMx, uint32_t EncoderMode)
  820. {
  821. MODIFY_REG(LPTIMx->CFGR, LPTIM_CFGR_CKPOL, EncoderMode);
  822. }
  823. /**
  824. * @brief Get actual encoder mode.
  825. * @rmtoll CFGR CKPOL LL_LPTIM_GetEncoderMode
  826. * @param LPTIMx Low-Power Timer instance
  827. * @retval Returned value can be one of the following values:
  828. * @arg @ref LL_LPTIM_ENCODER_MODE_RISING
  829. * @arg @ref LL_LPTIM_ENCODER_MODE_FALLING
  830. * @arg @ref LL_LPTIM_ENCODER_MODE_RISING_FALLING
  831. */
  832. __STATIC_INLINE uint32_t LL_LPTIM_GetEncoderMode(const LPTIM_TypeDef *LPTIMx)
  833. {
  834. return (uint32_t)(READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_CKPOL));
  835. }
  836. /**
  837. * @brief Enable the encoder mode
  838. * @note This function must be called when the LPTIM instance is disabled.
  839. * @note In this mode the LPTIM instance must be clocked by an internal clock
  840. * source. Also, the prescaler division ratio must be equal to 1.
  841. * @note LPTIM instance must be configured in continuous mode prior enabling
  842. * the encoder mode.
  843. * @rmtoll CFGR ENC LL_LPTIM_EnableEncoderMode
  844. * @param LPTIMx Low-Power Timer instance
  845. * @retval None
  846. */
  847. __STATIC_INLINE void LL_LPTIM_EnableEncoderMode(LPTIM_TypeDef *LPTIMx)
  848. {
  849. SET_BIT(LPTIMx->CFGR, LPTIM_CFGR_ENC);
  850. }
  851. /**
  852. * @brief Disable the encoder mode
  853. * @note This function must be called when the LPTIM instance is disabled.
  854. * @rmtoll CFGR ENC LL_LPTIM_DisableEncoderMode
  855. * @param LPTIMx Low-Power Timer instance
  856. * @retval None
  857. */
  858. __STATIC_INLINE void LL_LPTIM_DisableEncoderMode(LPTIM_TypeDef *LPTIMx)
  859. {
  860. CLEAR_BIT(LPTIMx->CFGR, LPTIM_CFGR_ENC);
  861. }
  862. /**
  863. * @brief Indicates whether the LPTIM operates in encoder mode.
  864. * @rmtoll CFGR ENC LL_LPTIM_IsEnabledEncoderMode
  865. * @param LPTIMx Low-Power Timer instance
  866. * @retval State of bit (1 or 0).
  867. */
  868. __STATIC_INLINE uint32_t LL_LPTIM_IsEnabledEncoderMode(const LPTIM_TypeDef *LPTIMx)
  869. {
  870. return (((READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_ENC) == LPTIM_CFGR_ENC) ? 1UL : 0UL));
  871. }
  872. /**
  873. * @}
  874. */
  875. /** @defgroup LPTIM_LL_EF_FLAG_Management FLAG Management
  876. * @{
  877. */
  878. /**
  879. * @brief Clear the compare match flag (CMPMCF)
  880. * @rmtoll ICR CMPMCF LL_LPTIM_ClearFlag_CMPM
  881. * @param LPTIMx Low-Power Timer instance
  882. * @retval None
  883. */
  884. __STATIC_INLINE void LL_LPTIM_ClearFlag_CMPM(LPTIM_TypeDef *LPTIMx)
  885. {
  886. SET_BIT(LPTIMx->ICR, LPTIM_ICR_CMPMCF);
  887. }
  888. /**
  889. * @brief Inform application whether a compare match interrupt has occurred.
  890. * @rmtoll ISR CMPM LL_LPTIM_IsActiveFlag_CMPM
  891. * @param LPTIMx Low-Power Timer instance
  892. * @retval State of bit (1 or 0).
  893. */
  894. __STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_CMPM(const LPTIM_TypeDef *LPTIMx)
  895. {
  896. return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_CMPM) == LPTIM_ISR_CMPM) ? 1UL : 0UL));
  897. }
  898. /**
  899. * @brief Clear the autoreload match flag (ARRMCF)
  900. * @rmtoll ICR ARRMCF LL_LPTIM_ClearFlag_ARRM
  901. * @param LPTIMx Low-Power Timer instance
  902. * @retval None
  903. */
  904. __STATIC_INLINE void LL_LPTIM_ClearFlag_ARRM(LPTIM_TypeDef *LPTIMx)
  905. {
  906. SET_BIT(LPTIMx->ICR, LPTIM_ICR_ARRMCF);
  907. }
  908. /**
  909. * @brief Inform application whether a autoreload match interrupt has occurred.
  910. * @rmtoll ISR ARRM LL_LPTIM_IsActiveFlag_ARRM
  911. * @param LPTIMx Low-Power Timer instance
  912. * @retval State of bit (1 or 0).
  913. */
  914. __STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_ARRM(const LPTIM_TypeDef *LPTIMx)
  915. {
  916. return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_ARRM) == LPTIM_ISR_ARRM) ? 1UL : 0UL));
  917. }
  918. /**
  919. * @brief Clear the external trigger valid edge flag(EXTTRIGCF).
  920. * @rmtoll ICR EXTTRIGCF LL_LPTIM_ClearFlag_EXTTRIG
  921. * @param LPTIMx Low-Power Timer instance
  922. * @retval None
  923. */
  924. __STATIC_INLINE void LL_LPTIM_ClearFlag_EXTTRIG(LPTIM_TypeDef *LPTIMx)
  925. {
  926. SET_BIT(LPTIMx->ICR, LPTIM_ICR_EXTTRIGCF);
  927. }
  928. /**
  929. * @brief Inform application whether a valid edge on the selected external trigger input has occurred.
  930. * @rmtoll ISR EXTTRIG LL_LPTIM_IsActiveFlag_EXTTRIG
  931. * @param LPTIMx Low-Power Timer instance
  932. * @retval State of bit (1 or 0).
  933. */
  934. __STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_EXTTRIG(const LPTIM_TypeDef *LPTIMx)
  935. {
  936. return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_EXTTRIG) == LPTIM_ISR_EXTTRIG) ? 1UL : 0UL));
  937. }
  938. /**
  939. * @brief Clear the compare register update interrupt flag (CMPOKCF).
  940. * @rmtoll ICR CMPOKCF LL_LPTIM_ClearFlag_CMPOK
  941. * @param LPTIMx Low-Power Timer instance
  942. * @retval None
  943. */
  944. __STATIC_INLINE void LL_LPTIM_ClearFlag_CMPOK(LPTIM_TypeDef *LPTIMx)
  945. {
  946. SET_BIT(LPTIMx->ICR, LPTIM_ICR_CMPOKCF);
  947. }
  948. /**
  949. * @brief Informs application whether the APB bus write operation to the LPTIMx_CMP register has been successfully
  950. completed. If so, a new one can be initiated.
  951. * @rmtoll ISR CMPOK LL_LPTIM_IsActiveFlag_CMPOK
  952. * @param LPTIMx Low-Power Timer instance
  953. * @retval State of bit (1 or 0).
  954. */
  955. __STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_CMPOK(const LPTIM_TypeDef *LPTIMx)
  956. {
  957. return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_CMPOK) == LPTIM_ISR_CMPOK) ? 1UL : 0UL));
  958. }
  959. /**
  960. * @brief Clear the autoreload register update interrupt flag (ARROKCF).
  961. * @rmtoll ICR ARROKCF LL_LPTIM_ClearFlag_ARROK
  962. * @param LPTIMx Low-Power Timer instance
  963. * @retval None
  964. */
  965. __STATIC_INLINE void LL_LPTIM_ClearFlag_ARROK(LPTIM_TypeDef *LPTIMx)
  966. {
  967. SET_BIT(LPTIMx->ICR, LPTIM_ICR_ARROKCF);
  968. }
  969. /**
  970. * @brief Informs application whether the APB bus write operation to the LPTIMx_ARR register has been successfully
  971. completed. If so, a new one can be initiated.
  972. * @rmtoll ISR ARROK LL_LPTIM_IsActiveFlag_ARROK
  973. * @param LPTIMx Low-Power Timer instance
  974. * @retval State of bit (1 or 0).
  975. */
  976. __STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_ARROK(const LPTIM_TypeDef *LPTIMx)
  977. {
  978. return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_ARROK) == LPTIM_ISR_ARROK) ? 1UL : 0UL));
  979. }
  980. /**
  981. * @brief Clear the counter direction change to up interrupt flag (UPCF).
  982. * @rmtoll ICR UPCF LL_LPTIM_ClearFlag_UP
  983. * @param LPTIMx Low-Power Timer instance
  984. * @retval None
  985. */
  986. __STATIC_INLINE void LL_LPTIM_ClearFlag_UP(LPTIM_TypeDef *LPTIMx)
  987. {
  988. SET_BIT(LPTIMx->ICR, LPTIM_ICR_UPCF);
  989. }
  990. /**
  991. * @brief Informs the application whether the counter direction has changed from down to up (when the LPTIM instance
  992. operates in encoder mode).
  993. * @rmtoll ISR UP LL_LPTIM_IsActiveFlag_UP
  994. * @param LPTIMx Low-Power Timer instance
  995. * @retval State of bit (1 or 0).
  996. */
  997. __STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_UP(const LPTIM_TypeDef *LPTIMx)
  998. {
  999. return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_UP) == LPTIM_ISR_UP) ? 1UL : 0UL));
  1000. }
  1001. /**
  1002. * @brief Clear the counter direction change to down interrupt flag (DOWNCF).
  1003. * @rmtoll ICR DOWNCF LL_LPTIM_ClearFlag_DOWN
  1004. * @param LPTIMx Low-Power Timer instance
  1005. * @retval None
  1006. */
  1007. __STATIC_INLINE void LL_LPTIM_ClearFlag_DOWN(LPTIM_TypeDef *LPTIMx)
  1008. {
  1009. SET_BIT(LPTIMx->ICR, LPTIM_ICR_DOWNCF);
  1010. }
  1011. /**
  1012. * @brief Informs the application whether the counter direction has changed from up to down (when the LPTIM instance
  1013. operates in encoder mode).
  1014. * @rmtoll ISR DOWN LL_LPTIM_IsActiveFlag_DOWN
  1015. * @param LPTIMx Low-Power Timer instance
  1016. * @retval State of bit (1 or 0).
  1017. */
  1018. __STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_DOWN(const LPTIM_TypeDef *LPTIMx)
  1019. {
  1020. return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_DOWN) == LPTIM_ISR_DOWN) ? 1UL : 0UL));
  1021. }
  1022. /**
  1023. * @}
  1024. */
  1025. /** @defgroup LPTIM_LL_EF_IT_Management Interrupt Management
  1026. * @{
  1027. */
  1028. /**
  1029. * @brief Enable compare match interrupt (CMPMIE).
  1030. * @rmtoll IER CMPMIE LL_LPTIM_EnableIT_CMPM
  1031. * @param LPTIMx Low-Power Timer instance
  1032. * @retval None
  1033. */
  1034. __STATIC_INLINE void LL_LPTIM_EnableIT_CMPM(LPTIM_TypeDef *LPTIMx)
  1035. {
  1036. SET_BIT(LPTIMx->IER, LPTIM_IER_CMPMIE);
  1037. }
  1038. /**
  1039. * @brief Disable compare match interrupt (CMPMIE).
  1040. * @rmtoll IER CMPMIE LL_LPTIM_DisableIT_CMPM
  1041. * @param LPTIMx Low-Power Timer instance
  1042. * @retval None
  1043. */
  1044. __STATIC_INLINE void LL_LPTIM_DisableIT_CMPM(LPTIM_TypeDef *LPTIMx)
  1045. {
  1046. CLEAR_BIT(LPTIMx->IER, LPTIM_IER_CMPMIE);
  1047. }
  1048. /**
  1049. * @brief Indicates whether the compare match interrupt (CMPMIE) is enabled.
  1050. * @rmtoll IER CMPMIE LL_LPTIM_IsEnabledIT_CMPM
  1051. * @param LPTIMx Low-Power Timer instance
  1052. * @retval State of bit (1 or 0).
  1053. */
  1054. __STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_CMPM(const LPTIM_TypeDef *LPTIMx)
  1055. {
  1056. return (((READ_BIT(LPTIMx->IER, LPTIM_IER_CMPMIE) == LPTIM_IER_CMPMIE) ? 1UL : 0UL));
  1057. }
  1058. /**
  1059. * @brief Enable autoreload match interrupt (ARRMIE).
  1060. * @rmtoll IER ARRMIE LL_LPTIM_EnableIT_ARRM
  1061. * @param LPTIMx Low-Power Timer instance
  1062. * @retval None
  1063. */
  1064. __STATIC_INLINE void LL_LPTIM_EnableIT_ARRM(LPTIM_TypeDef *LPTIMx)
  1065. {
  1066. SET_BIT(LPTIMx->IER, LPTIM_IER_ARRMIE);
  1067. }
  1068. /**
  1069. * @brief Disable autoreload match interrupt (ARRMIE).
  1070. * @rmtoll IER ARRMIE LL_LPTIM_DisableIT_ARRM
  1071. * @param LPTIMx Low-Power Timer instance
  1072. * @retval None
  1073. */
  1074. __STATIC_INLINE void LL_LPTIM_DisableIT_ARRM(LPTIM_TypeDef *LPTIMx)
  1075. {
  1076. CLEAR_BIT(LPTIMx->IER, LPTIM_IER_ARRMIE);
  1077. }
  1078. /**
  1079. * @brief Indicates whether the autoreload match interrupt (ARRMIE) is enabled.
  1080. * @rmtoll IER ARRMIE LL_LPTIM_IsEnabledIT_ARRM
  1081. * @param LPTIMx Low-Power Timer instance
  1082. * @retval State of bit (1 or 0).
  1083. */
  1084. __STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_ARRM(const LPTIM_TypeDef *LPTIMx)
  1085. {
  1086. return (((READ_BIT(LPTIMx->IER, LPTIM_IER_ARRMIE) == LPTIM_IER_ARRMIE) ? 1UL : 0UL));
  1087. }
  1088. /**
  1089. * @brief Enable external trigger valid edge interrupt (EXTTRIGIE).
  1090. * @rmtoll IER EXTTRIGIE LL_LPTIM_EnableIT_EXTTRIG
  1091. * @param LPTIMx Low-Power Timer instance
  1092. * @retval None
  1093. */
  1094. __STATIC_INLINE void LL_LPTIM_EnableIT_EXTTRIG(LPTIM_TypeDef *LPTIMx)
  1095. {
  1096. SET_BIT(LPTIMx->IER, LPTIM_IER_EXTTRIGIE);
  1097. }
  1098. /**
  1099. * @brief Disable external trigger valid edge interrupt (EXTTRIGIE).
  1100. * @rmtoll IER EXTTRIGIE LL_LPTIM_DisableIT_EXTTRIG
  1101. * @param LPTIMx Low-Power Timer instance
  1102. * @retval None
  1103. */
  1104. __STATIC_INLINE void LL_LPTIM_DisableIT_EXTTRIG(LPTIM_TypeDef *LPTIMx)
  1105. {
  1106. CLEAR_BIT(LPTIMx->IER, LPTIM_IER_EXTTRIGIE);
  1107. }
  1108. /**
  1109. * @brief Indicates external trigger valid edge interrupt (EXTTRIGIE) is enabled.
  1110. * @rmtoll IER EXTTRIGIE LL_LPTIM_IsEnabledIT_EXTTRIG
  1111. * @param LPTIMx Low-Power Timer instance
  1112. * @retval State of bit (1 or 0).
  1113. */
  1114. __STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_EXTTRIG(const LPTIM_TypeDef *LPTIMx)
  1115. {
  1116. return (((READ_BIT(LPTIMx->IER, LPTIM_IER_EXTTRIGIE) == LPTIM_IER_EXTTRIGIE) ? 1UL : 0UL));
  1117. }
  1118. /**
  1119. * @brief Enable compare register write completed interrupt (CMPOKIE).
  1120. * @rmtoll IER CMPOKIE LL_LPTIM_EnableIT_CMPOK
  1121. * @param LPTIMx Low-Power Timer instance
  1122. * @retval None
  1123. */
  1124. __STATIC_INLINE void LL_LPTIM_EnableIT_CMPOK(LPTIM_TypeDef *LPTIMx)
  1125. {
  1126. SET_BIT(LPTIMx->IER, LPTIM_IER_CMPOKIE);
  1127. }
  1128. /**
  1129. * @brief Disable compare register write completed interrupt (CMPOKIE).
  1130. * @rmtoll IER CMPOKIE LL_LPTIM_DisableIT_CMPOK
  1131. * @param LPTIMx Low-Power Timer instance
  1132. * @retval None
  1133. */
  1134. __STATIC_INLINE void LL_LPTIM_DisableIT_CMPOK(LPTIM_TypeDef *LPTIMx)
  1135. {
  1136. CLEAR_BIT(LPTIMx->IER, LPTIM_IER_CMPOKIE);
  1137. }
  1138. /**
  1139. * @brief Indicates whether the compare register write completed interrupt (CMPOKIE) is enabled.
  1140. * @rmtoll IER CMPOKIE LL_LPTIM_IsEnabledIT_CMPOK
  1141. * @param LPTIMx Low-Power Timer instance
  1142. * @retval State of bit (1 or 0).
  1143. */
  1144. __STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_CMPOK(const LPTIM_TypeDef *LPTIMx)
  1145. {
  1146. return (((READ_BIT(LPTIMx->IER, LPTIM_IER_CMPOKIE) == LPTIM_IER_CMPOKIE) ? 1UL : 0UL));
  1147. }
  1148. /**
  1149. * @brief Enable autoreload register write completed interrupt (ARROKIE).
  1150. * @rmtoll IER ARROKIE LL_LPTIM_EnableIT_ARROK
  1151. * @param LPTIMx Low-Power Timer instance
  1152. * @retval None
  1153. */
  1154. __STATIC_INLINE void LL_LPTIM_EnableIT_ARROK(LPTIM_TypeDef *LPTIMx)
  1155. {
  1156. SET_BIT(LPTIMx->IER, LPTIM_IER_ARROKIE);
  1157. }
  1158. /**
  1159. * @brief Disable autoreload register write completed interrupt (ARROKIE).
  1160. * @rmtoll IER ARROKIE LL_LPTIM_DisableIT_ARROK
  1161. * @param LPTIMx Low-Power Timer instance
  1162. * @retval None
  1163. */
  1164. __STATIC_INLINE void LL_LPTIM_DisableIT_ARROK(LPTIM_TypeDef *LPTIMx)
  1165. {
  1166. CLEAR_BIT(LPTIMx->IER, LPTIM_IER_ARROKIE);
  1167. }
  1168. /**
  1169. * @brief Indicates whether the autoreload register write completed interrupt (ARROKIE) is enabled.
  1170. * @rmtoll IER ARROKIE LL_LPTIM_IsEnabledIT_ARROK
  1171. * @param LPTIMx Low-Power Timer instance
  1172. * @retval State of bit(1 or 0).
  1173. */
  1174. __STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_ARROK(const LPTIM_TypeDef *LPTIMx)
  1175. {
  1176. return (((READ_BIT(LPTIMx->IER, LPTIM_IER_ARROKIE) == LPTIM_IER_ARROKIE) ? 1UL : 0UL));
  1177. }
  1178. /**
  1179. * @brief Enable direction change to up interrupt (UPIE).
  1180. * @rmtoll IER UPIE LL_LPTIM_EnableIT_UP
  1181. * @param LPTIMx Low-Power Timer instance
  1182. * @retval None
  1183. */
  1184. __STATIC_INLINE void LL_LPTIM_EnableIT_UP(LPTIM_TypeDef *LPTIMx)
  1185. {
  1186. SET_BIT(LPTIMx->IER, LPTIM_IER_UPIE);
  1187. }
  1188. /**
  1189. * @brief Disable direction change to up interrupt (UPIE).
  1190. * @rmtoll IER UPIE LL_LPTIM_DisableIT_UP
  1191. * @param LPTIMx Low-Power Timer instance
  1192. * @retval None
  1193. */
  1194. __STATIC_INLINE void LL_LPTIM_DisableIT_UP(LPTIM_TypeDef *LPTIMx)
  1195. {
  1196. CLEAR_BIT(LPTIMx->IER, LPTIM_IER_UPIE);
  1197. }
  1198. /**
  1199. * @brief Indicates whether the direction change to up interrupt (UPIE) is enabled.
  1200. * @rmtoll IER UPIE LL_LPTIM_IsEnabledIT_UP
  1201. * @param LPTIMx Low-Power Timer instance
  1202. * @retval State of bit(1 or 0).
  1203. */
  1204. __STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_UP(const LPTIM_TypeDef *LPTIMx)
  1205. {
  1206. return (((READ_BIT(LPTIMx->IER, LPTIM_IER_UPIE) == LPTIM_IER_UPIE) ? 1UL : 0UL));
  1207. }
  1208. /**
  1209. * @brief Enable direction change to down interrupt (DOWNIE).
  1210. * @rmtoll IER DOWNIE LL_LPTIM_EnableIT_DOWN
  1211. * @param LPTIMx Low-Power Timer instance
  1212. * @retval None
  1213. */
  1214. __STATIC_INLINE void LL_LPTIM_EnableIT_DOWN(LPTIM_TypeDef *LPTIMx)
  1215. {
  1216. SET_BIT(LPTIMx->IER, LPTIM_IER_DOWNIE);
  1217. }
  1218. /**
  1219. * @brief Disable direction change to down interrupt (DOWNIE).
  1220. * @rmtoll IER DOWNIE LL_LPTIM_DisableIT_DOWN
  1221. * @param LPTIMx Low-Power Timer instance
  1222. * @retval None
  1223. */
  1224. __STATIC_INLINE void LL_LPTIM_DisableIT_DOWN(LPTIM_TypeDef *LPTIMx)
  1225. {
  1226. CLEAR_BIT(LPTIMx->IER, LPTIM_IER_DOWNIE);
  1227. }
  1228. /**
  1229. * @brief Indicates whether the direction change to down interrupt (DOWNIE) is enabled.
  1230. * @rmtoll IER DOWNIE LL_LPTIM_IsEnabledIT_DOWN
  1231. * @param LPTIMx Low-Power Timer instance
  1232. * @retval State of bit(1 or 0).
  1233. */
  1234. __STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_DOWN(const LPTIM_TypeDef *LPTIMx)
  1235. {
  1236. return ((READ_BIT(LPTIMx->IER, LPTIM_IER_DOWNIE) == LPTIM_IER_DOWNIE) ? 1UL : 0UL);
  1237. }
  1238. /**
  1239. * @}
  1240. */
  1241. /**
  1242. * @}
  1243. */
  1244. /**
  1245. * @}
  1246. */
  1247. #endif /* LPTIM1 */
  1248. /**
  1249. * @}
  1250. */
  1251. #ifdef __cplusplus
  1252. }
  1253. #endif
  1254. #endif /* STM32F4xx_LL_LPTIM_H */