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.
 
 
 

1383 lines
51 KiB

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