stm32l4xx_ll_comp.h 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888
  1. /**
  2. ******************************************************************************
  3. * @file stm32l4xx_ll_comp.h
  4. * @author MCD Application Team
  5. * @brief Header file of COMP LL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) 2017 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 STM32L4xx_LL_COMP_H
  20. #define STM32L4xx_LL_COMP_H
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. /* Includes ------------------------------------------------------------------*/
  25. #include "stm32l4xx.h"
  26. /** @addtogroup STM32L4xx_LL_Driver
  27. * @{
  28. */
  29. #if defined (COMP1) || defined (COMP2)
  30. /** @defgroup COMP_LL COMP
  31. * @{
  32. */
  33. /* Private types -------------------------------------------------------------*/
  34. /* Private variables ---------------------------------------------------------*/
  35. /* Private constants ---------------------------------------------------------*/
  36. /** @defgroup COMP_LL_Private_Constants COMP Private Constants
  37. * @{
  38. */
  39. /* COMP registers bits positions */
  40. #define LL_COMP_OUTPUT_LEVEL_BITOFFSET_POS (30UL) /* Value equivalent to POSITION_VAL(COMP_CSR_VALUE) */
  41. /**
  42. * @}
  43. */
  44. /* Private macros ------------------------------------------------------------*/
  45. /** @defgroup COMP_LL_Private_Macros COMP Private Macros
  46. * @{
  47. */
  48. /**
  49. * @}
  50. */
  51. /* Exported types ------------------------------------------------------------*/
  52. #if defined(USE_FULL_LL_DRIVER)
  53. /** @defgroup COMP_LL_ES_INIT COMP Exported Init structure
  54. * @{
  55. */
  56. /**
  57. * @brief Structure definition of some features of COMP instance.
  58. */
  59. typedef struct
  60. {
  61. uint32_t PowerMode; /*!< Set comparator operating mode to adjust power and speed.
  62. This parameter can be a value of @ref COMP_LL_EC_POWERMODE
  63. This feature can be modified afterwards using unitary function @ref LL_COMP_SetPowerMode(). */
  64. uint32_t InputPlus; /*!< Set comparator input plus (non-inverting input).
  65. This parameter can be a value of @ref COMP_LL_EC_INPUT_PLUS
  66. This feature can be modified afterwards using unitary function @ref LL_COMP_SetInputPlus(). */
  67. uint32_t InputMinus; /*!< Set comparator input minus (inverting input).
  68. This parameter can be a value of @ref COMP_LL_EC_INPUT_MINUS
  69. This feature can be modified afterwards using unitary function @ref LL_COMP_SetInputMinus(). */
  70. uint32_t InputHysteresis; /*!< Set comparator hysteresis mode of the input minus.
  71. This parameter can be a value of @ref COMP_LL_EC_INPUT_HYSTERESIS
  72. This feature can be modified afterwards using unitary function @ref LL_COMP_SetInputHysteresis(). */
  73. uint32_t OutputPolarity; /*!< Set comparator output polarity.
  74. This parameter can be a value of @ref COMP_LL_EC_OUTPUT_POLARITY
  75. This feature can be modified afterwards using unitary function @ref LL_COMP_SetOutputPolarity(). */
  76. uint32_t OutputBlankingSource; /*!< Set comparator blanking source.
  77. This parameter can be a value of @ref COMP_LL_EC_OUTPUT_BLANKING_SOURCE
  78. This feature can be modified afterwards using unitary function @ref LL_COMP_SetOutputBlankingSource(). */
  79. } LL_COMP_InitTypeDef;
  80. /**
  81. * @}
  82. */
  83. #endif /* USE_FULL_LL_DRIVER */
  84. /* Exported constants --------------------------------------------------------*/
  85. /** @defgroup COMP_LL_Exported_Constants COMP Exported Constants
  86. * @{
  87. */
  88. /** @defgroup COMP_LL_EC_COMMON_WINDOWMODE Comparator common modes - Window mode
  89. * @{
  90. */
  91. #if defined(COMP2)
  92. #define LL_COMP_WINDOWMODE_DISABLE (0x00000000UL) /*!< Window mode disable: Comparators 1 and 2 are independent */
  93. #define LL_COMP_WINDOWMODE_COMP1_INPUT_PLUS_COMMON (COMP_CSR_WINMODE) /*!< Window mode enable: Comparators instances pair COMP1 and COMP2 have their input plus connected together. The common input is COMP1 input plus (COMP2 input plus is no more accessible). */
  94. #endif /* COMP2 */
  95. /**
  96. * @}
  97. */
  98. /** @defgroup COMP_LL_EC_POWERMODE Comparator modes - Power mode
  99. * @{
  100. */
  101. #define LL_COMP_POWERMODE_HIGHSPEED (0x00000000UL) /*!< COMP power mode to high speed */
  102. #define LL_COMP_POWERMODE_MEDIUMSPEED (COMP_CSR_PWRMODE_0) /*!< COMP power mode to medium speed */
  103. #define LL_COMP_POWERMODE_ULTRALOWPOWER (COMP_CSR_PWRMODE_1 | COMP_CSR_PWRMODE_0) /*!< COMP power mode to ultra-low power */
  104. /**
  105. * @}
  106. */
  107. /** @defgroup COMP_LL_EC_INPUT_PLUS Comparator inputs - Input plus (input non-inverting) selection
  108. * @{
  109. */
  110. #define LL_COMP_INPUT_PLUS_IO1 (0x00000000UL) /*!< Comparator input plus connected to IO1 (pin PC5 for COMP1, pin PB4 for COMP2) */
  111. #define LL_COMP_INPUT_PLUS_IO2 (COMP_CSR_INPSEL_0) /*!< Comparator input plus connected to IO2 (pin PB2 for COMP1, pin PB6 for COMP2) */
  112. #if defined(COMP_CSR_INPSEL_1)
  113. #define LL_COMP_INPUT_PLUS_IO3 (COMP_CSR_INPSEL_1) /*!< Comparator input plus connected to IO3 (pin PA1 for COMP1, pin PA3 for COMP2) */
  114. #endif /* COMP_CSR_INPSEL_1 */
  115. /**
  116. * @}
  117. */
  118. /** @defgroup COMP_LL_EC_INPUT_MINUS Comparator inputs - Input minus (input inverting) selection
  119. * @{
  120. */
  121. #define LL_COMP_INPUT_MINUS_1_4VREFINT ( COMP_CSR_SCALEN | COMP_CSR_BRGEN) /*!< Comparator input minus connected to 1/4 VrefInt */
  122. #define LL_COMP_INPUT_MINUS_1_2VREFINT ( COMP_CSR_INMSEL_0 | COMP_CSR_SCALEN | COMP_CSR_BRGEN) /*!< Comparator input minus connected to 1/2 VrefInt */
  123. #define LL_COMP_INPUT_MINUS_3_4VREFINT ( COMP_CSR_INMSEL_1 | COMP_CSR_SCALEN | COMP_CSR_BRGEN) /*!< Comparator input minus connected to 3/4 VrefInt */
  124. #define LL_COMP_INPUT_MINUS_VREFINT ( COMP_CSR_INMSEL_1 | COMP_CSR_INMSEL_0 | COMP_CSR_SCALEN ) /*!< Comparator input minus connected to VrefInt */
  125. #define LL_COMP_INPUT_MINUS_DAC1_CH1 (COMP_CSR_INMSEL_2 ) /*!< Comparator input minus connected to DAC1 channel 1 (DAC_OUT1) */
  126. #define LL_COMP_INPUT_MINUS_DAC1_CH2 (COMP_CSR_INMSEL_2 | COMP_CSR_INMSEL_0) /*!< Comparator input minus connected to DAC1 channel 2 (DAC_OUT2) */
  127. #define LL_COMP_INPUT_MINUS_IO1 (COMP_CSR_INMSEL_2 | COMP_CSR_INMSEL_1 ) /*!< Comparator input minus connected to IO1 (pin PB1 for COMP1, pin PB3 for COMP2) */
  128. #define LL_COMP_INPUT_MINUS_IO2 (COMP_CSR_INMSEL_2 | COMP_CSR_INMSEL_1 | COMP_CSR_INMSEL_0) /*!< Comparator input minus connected to IO2 (pin PC4 for COMP1, pin PB7 for COMP2) */
  129. #if defined(COMP_CSR_INMESEL_1)
  130. #define LL_COMP_INPUT_MINUS_IO3 ( COMP_CSR_INMESEL_0 | COMP_CSR_INMSEL_2 | COMP_CSR_INMSEL_1 | COMP_CSR_INMSEL_0) /*!< Comparator input minus connected to IO3 (pin PA0 for COMP1, pin PA2 for COMP2) */
  131. #define LL_COMP_INPUT_MINUS_IO4 (COMP_CSR_INMESEL_1 | COMP_CSR_INMSEL_2 | COMP_CSR_INMSEL_1 | COMP_CSR_INMSEL_0) /*!< Comparator input minus connected to IO4 (pin PA4 for COMP1, pin PA4 for COMP2) */
  132. #define LL_COMP_INPUT_MINUS_IO5 (COMP_CSR_INMESEL_1 | COMP_CSR_INMESEL_0 | COMP_CSR_INMSEL_2 | COMP_CSR_INMSEL_1 | COMP_CSR_INMSEL_0) /*!< Comparator input minus connected to IO5 (pin PA5 for COMP1, pin PA5 for COMP2) */
  133. #endif
  134. /**
  135. * @}
  136. */
  137. /** @defgroup COMP_LL_EC_INPUT_LEGACY Comparator inputs legacy literals name
  138. * @{
  139. */
  140. #define LL_COMP_WINDOWMODE_ENABLE LL_COMP_WINDOWMODE_COMP1_INPUT_PLUS_COMMON
  141. #define LL_COMP_INVERTINGINPUT_1_4VREFINT LL_COMP_INPUT_MINUS_1_4VREFINT
  142. #define LL_COMP_INVERTINGINPUT_1_2VREFINT LL_COMP_INPUT_MINUS_1_2VREFINT
  143. #define LL_COMP_INVERTINGINPUT_3_4VREFINT LL_COMP_INPUT_MINUS_3_4VREFINT
  144. #define LL_COMP_INVERTINGINPUT_VREFINT LL_COMP_INPUT_MINUS_VREFINT
  145. #define LL_COMP_INVERTINGINPUT_DAC1 LL_COMP_INPUT_MINUS_DAC1_CH1
  146. #define LL_COMP_INVERTINGINPUT_DAC2 LL_COMP_INPUT_MINUS_DAC1_CH2
  147. #define LL_COMP_INVERTINGINPUT_IO1 LL_COMP_INPUT_MINUS_IO1
  148. #define LL_COMP_INVERTINGINPUT_IO2 LL_COMP_INPUT_MINUS_IO2
  149. #if defined(COMP_CSR_INMESEL_1)
  150. #define LL_COMP_INVERTINGINPUT_IO3 LL_COMP_INPUT_MINUS_IO3
  151. #define LL_COMP_INVERTINGINPUT_IO4 LL_COMP_INPUT_MINUS_IO4
  152. #define LL_COMP_INVERTINGINPUT_IO5 LL_COMP_INPUT_MINUS_IO5
  153. #endif /* COMP_CSR_INMESEL_1 */
  154. #define LL_COMP_NONINVERTINGINPUT_IO1 LL_COMP_INPUT_PLUS_IO1
  155. #define LL_COMP_NONINVERTINGINPUT_IO2 LL_COMP_INPUT_PLUS_IO2
  156. #if defined(COMP_CSR_INPSEL_1)
  157. #define LL_COMP_NONINVERTINGINPUT_IO3 LL_COMP_INPUT_PLUS_IO3
  158. #endif /* COMP_CSR_INPSEL_1 */
  159. /**
  160. * @}
  161. */
  162. /** @defgroup COMP_LL_EC_INPUT_HYSTERESIS Comparator input - Hysteresis
  163. * @{
  164. */
  165. #define LL_COMP_HYSTERESIS_NONE (0x00000000UL) /*!< No hysteresis */
  166. #define LL_COMP_HYSTERESIS_LOW ( COMP_CSR_HYST_0) /*!< Hysteresis level low */
  167. #define LL_COMP_HYSTERESIS_MEDIUM (COMP_CSR_HYST_1 ) /*!< Hysteresis level medium */
  168. #define LL_COMP_HYSTERESIS_HIGH (COMP_CSR_HYST_1 | COMP_CSR_HYST_0) /*!< Hysteresis level high */
  169. /**
  170. * @}
  171. */
  172. /** @defgroup COMP_LL_EC_OUTPUT_POLARITY Comparator output - Output polarity
  173. * @{
  174. */
  175. #define LL_COMP_OUTPUTPOL_NONINVERTED (0x00000000UL) /*!< COMP output polarity is not inverted: comparator output is high when the plus (non-inverting) input is at a higher voltage than the minus (inverting) input */
  176. #define LL_COMP_OUTPUTPOL_INVERTED (COMP_CSR_POLARITY) /*!< COMP output polarity is inverted: comparator output is low when the plus (non-inverting) input is at a lower voltage than the minus (inverting) input */
  177. /**
  178. * @}
  179. */
  180. /** @defgroup COMP_LL_EC_OUTPUT_BLANKING_SOURCE Comparator output - Blanking source
  181. * @{
  182. */
  183. #define LL_COMP_BLANKINGSRC_NONE (0x00000000UL) /*!<Comparator output without blanking */
  184. #define LL_COMP_BLANKINGSRC_TIM1_OC5_COMP1 (COMP_CSR_BLANKING_0) /*!< Comparator output blanking source TIM1 OC5 (specific to COMP instance: COMP1) */
  185. #define LL_COMP_BLANKINGSRC_TIM2_OC3_COMP1 (COMP_CSR_BLANKING_1) /*!< Comparator output blanking source TIM2 OC3 (specific to COMP instance: COMP1) */
  186. #define LL_COMP_BLANKINGSRC_TIM3_OC3_COMP1 (COMP_CSR_BLANKING_2) /*!< Comparator output blanking source TIM3 OC3 (specific to COMP instance: COMP1) */
  187. #define LL_COMP_BLANKINGSRC_TIM3_OC4_COMP2 (COMP_CSR_BLANKING_0) /*!< Comparator output blanking source TIM3 OC4 (specific to COMP instance: COMP2) */
  188. #define LL_COMP_BLANKINGSRC_TIM8_OC5_COMP2 (COMP_CSR_BLANKING_1) /*!< Comparator output blanking source TIM8 OC5 (specific to COMP instance: COMP2) */
  189. #define LL_COMP_BLANKINGSRC_TIM15_OC1_COMP2 (COMP_CSR_BLANKING_2) /*!< Comparator output blanking source TIM15 OC1 (specific to COMP instance: COMP2) */
  190. /**
  191. * @}
  192. */
  193. /** @defgroup COMP_LL_EC_OUTPUT_BLANKING_SOURCE_LEGACY Comparator output blanking source legacy literals name
  194. * @{
  195. */
  196. #define LL_COMP_BLANKINGSRC_TIM1_OC5 (LL_COMP_BLANKINGSRC_TIM1_OC5_COMP1)
  197. #define LL_COMP_BLANKINGSRC_TIM2_OC3 (LL_COMP_BLANKINGSRC_TIM2_OC3_COMP1)
  198. #define LL_COMP_BLANKINGSRC_TIM3_OC3 (LL_COMP_BLANKINGSRC_TIM3_OC3_COMP1)
  199. #define LL_COMP_BLANKINGSRC_TIM3_OC4 (LL_COMP_BLANKINGSRC_TIM3_OC4_COMP2)
  200. #define LL_COMP_BLANKINGSRC_TIM8_OC5 (LL_COMP_BLANKINGSRC_TIM8_OC5_COMP2)
  201. #define LL_COMP_BLANKINGSRC_TIM15_OC1 (LL_COMP_BLANKINGSRC_TIM15_OC1_COMP2)
  202. /**
  203. * @}
  204. */
  205. /** @defgroup COMP_LL_EC_OUTPUT_LEVEL Comparator output - Output level
  206. * @{
  207. */
  208. #define LL_COMP_OUTPUT_LEVEL_LOW (0x00000000UL) /*!< Comparator output level low (if the polarity is not inverted, otherwise to be complemented) */
  209. #define LL_COMP_OUTPUT_LEVEL_HIGH (0x00000001UL) /*!< Comparator output level high (if the polarity is not inverted, otherwise to be complemented) */
  210. /**
  211. * @}
  212. */
  213. /** @defgroup COMP_LL_EC_HW_DELAYS Definitions of COMP hardware constraints delays
  214. * @note Only COMP peripheral HW delays are defined in COMP LL driver driver,
  215. * not timeout values.
  216. * For details on delays values, refer to descriptions in source code
  217. * above each literal definition.
  218. * @{
  219. */
  220. /* Delay for comparator startup time. */
  221. /* Note: Delay required to reach propagation delay specification. */
  222. /* Literal set to maximum value (refer to device datasheet, */
  223. /* parameter "tSTART"). */
  224. /* Unit: us */
  225. #define LL_COMP_DELAY_STARTUP_US ( 80UL) /*!< Delay for COMP startup time */
  226. /* Delay for comparator voltage scaler stabilization time. */
  227. /* Note: Voltage scaler is used when selecting comparator input */
  228. /* based on VrefInt: VrefInt or subdivision of VrefInt. */
  229. /* Literal set to maximum value (refer to device datasheet, */
  230. /* parameter "tSTART_SCALER"). */
  231. /* Unit: us */
  232. #define LL_COMP_DELAY_VOLTAGE_SCALER_STAB_US ( 200UL) /*!< Delay for COMP voltage scaler stabilization time */
  233. /**
  234. * @}
  235. */
  236. /**
  237. * @}
  238. */
  239. /* Exported macro ------------------------------------------------------------*/
  240. /** @defgroup COMP_LL_Exported_Macros COMP Exported Macros
  241. * @{
  242. */
  243. /** @defgroup COMP_LL_EM_WRITE_READ Common write and read registers macro
  244. * @{
  245. */
  246. /**
  247. * @brief Write a value in COMP register
  248. * @param __INSTANCE__ comparator instance
  249. * @param __REG__ Register to be written
  250. * @param __VALUE__ Value to be written in the register
  251. * @retval None
  252. */
  253. #define LL_COMP_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG((__INSTANCE__)->__REG__, (__VALUE__))
  254. /**
  255. * @brief Read a value in COMP register
  256. * @param __INSTANCE__ comparator instance
  257. * @param __REG__ Register to be read
  258. * @retval Register value
  259. */
  260. #define LL_COMP_ReadReg(__INSTANCE__, __REG__) READ_REG((__INSTANCE__)->__REG__)
  261. /**
  262. * @}
  263. */
  264. /** @defgroup COMP_LL_EM_HELPER_MACRO COMP helper macro
  265. * @{
  266. */
  267. /**
  268. * @brief Helper macro to select the COMP common instance
  269. * to which is belonging the selected COMP instance.
  270. * @note COMP common register instance can be used to
  271. * set parameters common to several COMP instances.
  272. * Refer to functions having argument "COMPxy_COMMON" as parameter.
  273. * @param __COMPx__ COMP instance
  274. * @retval COMP common instance or value "0" if there is no COMP common instance.
  275. */
  276. #define __LL_COMP_COMMON_INSTANCE(__COMPx__) \
  277. (COMP12_COMMON)
  278. /**
  279. * @}
  280. */
  281. /**
  282. * @}
  283. */
  284. /* Exported functions --------------------------------------------------------*/
  285. /** @defgroup COMP_LL_Exported_Functions COMP Exported Functions
  286. * @{
  287. */
  288. #if defined(COMP2)
  289. /** @defgroup COMP_LL_EF_Configuration_comparator_common Configuration of COMP hierarchical scope: common to several COMP instances
  290. * @{
  291. */
  292. /**
  293. * @brief Set window mode of a pair of comparators instances
  294. * (2 consecutive COMP instances COMP<x> and COMP<x+1>).
  295. * @rmtoll CSR WINMODE LL_COMP_SetCommonWindowMode
  296. * @param COMPxy_COMMON Comparator common instance
  297. * (can be set directly from CMSIS definition or by using helper macro @ref __LL_COMP_COMMON_INSTANCE() )
  298. * @param WindowMode This parameter can be one of the following values:
  299. * @arg @ref LL_COMP_WINDOWMODE_DISABLE
  300. * @arg @ref LL_COMP_WINDOWMODE_COMP1_INPUT_PLUS_COMMON
  301. * @retval None
  302. */
  303. __STATIC_INLINE void LL_COMP_SetCommonWindowMode(COMP_Common_TypeDef *COMPxy_COMMON, uint32_t WindowMode)
  304. {
  305. /* Note: On this STM32 series, window mode can be set only */
  306. /* from COMP instance: COMP2. */
  307. MODIFY_REG(COMPxy_COMMON->CSR, COMP_CSR_WINMODE, WindowMode);
  308. }
  309. /**
  310. * @brief Get window mode of a pair of comparators instances
  311. * (2 consecutive COMP instances COMP<x> and COMP<x+1>).
  312. * @rmtoll CSR WINMODE LL_COMP_GetCommonWindowMode
  313. * @param COMPxy_COMMON Comparator common instance
  314. * (can be set directly from CMSIS definition or by using helper macro @ref __LL_COMP_COMMON_INSTANCE() )
  315. * @retval Returned value can be one of the following values:
  316. * @arg @ref LL_COMP_WINDOWMODE_DISABLE
  317. * @arg @ref LL_COMP_WINDOWMODE_COMP1_INPUT_PLUS_COMMON
  318. */
  319. __STATIC_INLINE uint32_t LL_COMP_GetCommonWindowMode(COMP_Common_TypeDef *COMPxy_COMMON)
  320. {
  321. return (uint32_t)(READ_BIT(COMPxy_COMMON->CSR, COMP_CSR_WINMODE));
  322. }
  323. /**
  324. * @}
  325. */
  326. #endif /* COMP2 */
  327. /** @defgroup COMP_LL_EF_Configuration_comparator_modes Configuration of comparator modes
  328. * @{
  329. */
  330. /**
  331. * @brief Set comparator instance operating mode to adjust power and speed.
  332. * @rmtoll CSR PWRMODE LL_COMP_SetPowerMode
  333. * @param COMPx Comparator instance
  334. * @param PowerMode This parameter can be one of the following values:
  335. * @arg @ref LL_COMP_POWERMODE_HIGHSPEED
  336. * @arg @ref LL_COMP_POWERMODE_MEDIUMSPEED
  337. * @arg @ref LL_COMP_POWERMODE_ULTRALOWPOWER
  338. * @retval None
  339. */
  340. __STATIC_INLINE void LL_COMP_SetPowerMode(COMP_TypeDef *COMPx, uint32_t PowerMode)
  341. {
  342. MODIFY_REG(COMPx->CSR, COMP_CSR_PWRMODE, PowerMode);
  343. }
  344. /**
  345. * @brief Get comparator instance operating mode to adjust power and speed.
  346. * @rmtoll CSR PWRMODE LL_COMP_GetPowerMode
  347. * @param COMPx Comparator instance
  348. * @retval Returned value can be one of the following values:
  349. * @arg @ref LL_COMP_POWERMODE_HIGHSPEED
  350. * @arg @ref LL_COMP_POWERMODE_MEDIUMSPEED
  351. * @arg @ref LL_COMP_POWERMODE_ULTRALOWPOWER
  352. */
  353. __STATIC_INLINE uint32_t LL_COMP_GetPowerMode(COMP_TypeDef *COMPx)
  354. {
  355. return (uint32_t)(READ_BIT(COMPx->CSR, COMP_CSR_PWRMODE));
  356. }
  357. /**
  358. * @}
  359. */
  360. /** @defgroup COMP_LL_EF_Configuration_comparator_inputs Configuration of comparator inputs
  361. * @{
  362. */
  363. /**
  364. * @brief Set comparator inputs minus (inverting) and plus (non-inverting).
  365. * @note In case of comparator input selected to be connected to IO:
  366. * GPIO pins are specific to each comparator instance.
  367. * Refer to description of parameters or to reference manual.
  368. * @note On this STM32 series, scaler bridge is configurable:
  369. * to optimize power consumption, this function enables the
  370. * voltage scaler bridge only when required
  371. * (when selecting comparator input based on VrefInt: VrefInt or
  372. * subdivision of VrefInt).
  373. * - For scaler bridge power consumption values,
  374. * refer to device datasheet, parameter "IDDA(SCALER)".
  375. * - Voltage scaler requires a delay for voltage stabilization.
  376. * Refer to device datasheet, parameter "tSTART_SCALER".
  377. * - Scaler bridge is common for all comparator instances,
  378. * therefore if at least one of the comparator instance
  379. * is requiring the scaler bridge, it remains enabled.
  380. * @rmtoll CSR INMSEL LL_COMP_ConfigInputs\n
  381. * CSR INPSEL LL_COMP_ConfigInputs\n
  382. * CSR BRGEN LL_COMP_ConfigInputs\n
  383. * CSR SCALEN LL_COMP_ConfigInputs
  384. * @param COMPx Comparator instance
  385. * @param InputMinus This parameter can be one of the following values:
  386. * @arg @ref LL_COMP_INPUT_MINUS_1_4VREFINT
  387. * @arg @ref LL_COMP_INPUT_MINUS_1_2VREFINT
  388. * @arg @ref LL_COMP_INPUT_MINUS_3_4VREFINT
  389. * @arg @ref LL_COMP_INPUT_MINUS_VREFINT
  390. * @arg @ref LL_COMP_INPUT_MINUS_DAC1_CH1
  391. * @arg @ref LL_COMP_INPUT_MINUS_DAC1_CH2 (*)
  392. * @arg @ref LL_COMP_INPUT_MINUS_IO1
  393. * @arg @ref LL_COMP_INPUT_MINUS_IO2
  394. * @arg @ref LL_COMP_INPUT_MINUS_IO3 (*)
  395. * @arg @ref LL_COMP_INPUT_MINUS_IO4 (*)
  396. * @arg @ref LL_COMP_INPUT_MINUS_IO5 (*)
  397. *
  398. * (*) Parameter not available on all devices.
  399. * @param InputPlus This parameter can be one of the following values:
  400. * @arg @ref LL_COMP_INPUT_PLUS_IO1
  401. * @arg @ref LL_COMP_INPUT_PLUS_IO2
  402. * @arg @ref LL_COMP_INPUT_PLUS_IO3 (*)
  403. *
  404. * (*) Parameter not available on all devices.
  405. * @retval None
  406. */
  407. __STATIC_INLINE void LL_COMP_ConfigInputs(COMP_TypeDef *COMPx, uint32_t InputMinus, uint32_t InputPlus)
  408. {
  409. #if defined(COMP_CSR_INMESEL_1)
  410. MODIFY_REG(COMPx->CSR,
  411. COMP_CSR_INMESEL | COMP_CSR_INMSEL | COMP_CSR_INPSEL | COMP_CSR_SCALEN | COMP_CSR_BRGEN,
  412. InputMinus | InputPlus);
  413. #else
  414. MODIFY_REG(COMPx->CSR,
  415. COMP_CSR_INMSEL | COMP_CSR_INPSEL | COMP_CSR_SCALEN | COMP_CSR_BRGEN,
  416. InputMinus | InputPlus);
  417. #endif
  418. }
  419. /**
  420. * @brief Set comparator input plus (non-inverting).
  421. * @note In case of comparator input selected to be connected to IO:
  422. * GPIO pins are specific to each comparator instance.
  423. * Refer to description of parameters or to reference manual.
  424. * @rmtoll CSR INPSEL LL_COMP_SetInputPlus
  425. * @param COMPx Comparator instance
  426. * @param InputPlus This parameter can be one of the following values:
  427. * @arg @ref LL_COMP_INPUT_PLUS_IO1
  428. * @arg @ref LL_COMP_INPUT_PLUS_IO2
  429. * @arg @ref LL_COMP_INPUT_PLUS_IO3 (*)
  430. *
  431. * (*) Parameter not available on all devices.
  432. * @retval None
  433. */
  434. __STATIC_INLINE void LL_COMP_SetInputPlus(COMP_TypeDef *COMPx, uint32_t InputPlus)
  435. {
  436. MODIFY_REG(COMPx->CSR, COMP_CSR_INPSEL, InputPlus);
  437. }
  438. /**
  439. * @brief Get comparator input plus (non-inverting).
  440. * @note In case of comparator input selected to be connected to IO:
  441. * GPIO pins are specific to each comparator instance.
  442. * Refer to description of parameters or to reference manual.
  443. * @rmtoll CSR INPSEL LL_COMP_GetInputPlus
  444. * @param COMPx Comparator instance
  445. * @retval Returned value can be one of the following values:
  446. * @arg @ref LL_COMP_INPUT_PLUS_IO1
  447. * @arg @ref LL_COMP_INPUT_PLUS_IO2
  448. * @arg @ref LL_COMP_INPUT_PLUS_IO3 (*)
  449. *
  450. * (*) Parameter not available on all devices.
  451. */
  452. __STATIC_INLINE uint32_t LL_COMP_GetInputPlus(COMP_TypeDef *COMPx)
  453. {
  454. return (uint32_t)(READ_BIT(COMPx->CSR, COMP_CSR_INPSEL));
  455. }
  456. /**
  457. * @brief Set comparator input minus (inverting).
  458. * @note In case of comparator input selected to be connected to IO:
  459. * GPIO pins are specific to each comparator instance.
  460. * Refer to description of parameters or to reference manual.
  461. * @note On this STM32 series, scaler bridge is configurable:
  462. * to optimize power consumption, this function enables the
  463. * voltage scaler bridge only when required
  464. * (when selecting comparator input based on VrefInt: VrefInt or
  465. * subdivision of VrefInt).
  466. * - For scaler bridge power consumption values,
  467. * refer to device datasheet, parameter "IDDA(SCALER)".
  468. * - Voltage scaler requires a delay for voltage stabilization.
  469. * Refer to device datasheet, parameter "tSTART_SCALER".
  470. * - Scaler bridge is common for all comparator instances,
  471. * therefore if at least one of the comparator instance
  472. * is requiring the scaler bridge, it remains enabled.
  473. * @rmtoll CSR INMSEL LL_COMP_SetInputMinus\n
  474. * CSR BRGEN LL_COMP_SetInputMinus\n
  475. * CSR SCALEN LL_COMP_SetInputMinus
  476. * @param COMPx Comparator instance
  477. * @param InputMinus This parameter can be one of the following values:
  478. * @arg @ref LL_COMP_INPUT_MINUS_1_4VREFINT
  479. * @arg @ref LL_COMP_INPUT_MINUS_1_2VREFINT
  480. * @arg @ref LL_COMP_INPUT_MINUS_3_4VREFINT
  481. * @arg @ref LL_COMP_INPUT_MINUS_VREFINT
  482. * @arg @ref LL_COMP_INPUT_MINUS_DAC1_CH1
  483. * @arg @ref LL_COMP_INPUT_MINUS_DAC1_CH2 (*)
  484. * @arg @ref LL_COMP_INPUT_MINUS_IO1
  485. * @arg @ref LL_COMP_INPUT_MINUS_IO2
  486. * @arg @ref LL_COMP_INPUT_MINUS_IO3 (*)
  487. * @arg @ref LL_COMP_INPUT_MINUS_IO4 (*)
  488. * @arg @ref LL_COMP_INPUT_MINUS_IO5 (*)
  489. *
  490. * (*) Parameter not available on all devices.
  491. * @retval None
  492. */
  493. __STATIC_INLINE void LL_COMP_SetInputMinus(COMP_TypeDef *COMPx, uint32_t InputMinus)
  494. {
  495. #if defined(COMP_CSR_INMESEL_1)
  496. MODIFY_REG(COMPx->CSR, COMP_CSR_INMESEL | COMP_CSR_INMSEL | COMP_CSR_SCALEN | COMP_CSR_BRGEN, InputMinus);
  497. #else
  498. MODIFY_REG(COMPx->CSR, COMP_CSR_INMSEL | COMP_CSR_SCALEN | COMP_CSR_BRGEN, InputMinus);
  499. #endif /* COMP_CSR_INMESEL_1 */
  500. }
  501. /**
  502. * @brief Get comparator input minus (inverting).
  503. * @note In case of comparator input selected to be connected to IO:
  504. * GPIO pins are specific to each comparator instance.
  505. * Refer to description of parameters or to reference manual.
  506. * @rmtoll CSR INMSEL LL_COMP_GetInputMinus\n
  507. * CSR BRGEN LL_COMP_GetInputMinus\n
  508. * CSR SCALEN LL_COMP_GetInputMinus
  509. * @param COMPx Comparator instance
  510. * @retval Returned value can be one of the following values:
  511. * @arg @ref LL_COMP_INPUT_MINUS_1_4VREFINT
  512. * @arg @ref LL_COMP_INPUT_MINUS_1_2VREFINT
  513. * @arg @ref LL_COMP_INPUT_MINUS_3_4VREFINT
  514. * @arg @ref LL_COMP_INPUT_MINUS_VREFINT
  515. * @arg @ref LL_COMP_INPUT_MINUS_DAC1_CH1
  516. * @arg @ref LL_COMP_INPUT_MINUS_DAC1_CH2 (*)
  517. * @arg @ref LL_COMP_INPUT_MINUS_IO1
  518. * @arg @ref LL_COMP_INPUT_MINUS_IO2
  519. * @arg @ref LL_COMP_INPUT_MINUS_IO3 (*)
  520. * @arg @ref LL_COMP_INPUT_MINUS_IO4 (*)
  521. * @arg @ref LL_COMP_INPUT_MINUS_IO5 (*)
  522. *
  523. * (*) Parameter not available on all devices.
  524. */
  525. __STATIC_INLINE uint32_t LL_COMP_GetInputMinus(COMP_TypeDef *COMPx)
  526. {
  527. #if defined(COMP_CSR_INMESEL_1)
  528. return (uint32_t)(READ_BIT(COMPx->CSR, COMP_CSR_INMESEL | COMP_CSR_INMSEL | COMP_CSR_SCALEN | COMP_CSR_BRGEN));
  529. #else
  530. return (uint32_t)(READ_BIT(COMPx->CSR, COMP_CSR_INMSEL | COMP_CSR_SCALEN | COMP_CSR_BRGEN));
  531. #endif /* COMP_CSR_INMESEL_1 */
  532. }
  533. /**
  534. * @brief Set comparator instance hysteresis mode of the input minus (inverting input).
  535. * @rmtoll CSR HYST LL_COMP_SetInputHysteresis
  536. * @param COMPx Comparator instance
  537. * @param InputHysteresis This parameter can be one of the following values:
  538. * @arg @ref LL_COMP_HYSTERESIS_NONE
  539. * @arg @ref LL_COMP_HYSTERESIS_LOW
  540. * @arg @ref LL_COMP_HYSTERESIS_MEDIUM
  541. * @arg @ref LL_COMP_HYSTERESIS_HIGH
  542. * @retval None
  543. */
  544. __STATIC_INLINE void LL_COMP_SetInputHysteresis(COMP_TypeDef *COMPx, uint32_t InputHysteresis)
  545. {
  546. MODIFY_REG(COMPx->CSR, COMP_CSR_HYST, InputHysteresis);
  547. }
  548. /**
  549. * @brief Get comparator instance hysteresis mode of the minus (inverting) input.
  550. * @rmtoll CSR HYST LL_COMP_GetInputHysteresis
  551. * @param COMPx Comparator instance
  552. * @retval Returned value can be one of the following values:
  553. * @arg @ref LL_COMP_HYSTERESIS_NONE
  554. * @arg @ref LL_COMP_HYSTERESIS_LOW
  555. * @arg @ref LL_COMP_HYSTERESIS_MEDIUM
  556. * @arg @ref LL_COMP_HYSTERESIS_HIGH
  557. */
  558. __STATIC_INLINE uint32_t LL_COMP_GetInputHysteresis(COMP_TypeDef *COMPx)
  559. {
  560. return (uint32_t)(READ_BIT(COMPx->CSR, COMP_CSR_HYST));
  561. }
  562. /**
  563. * @}
  564. */
  565. /** @defgroup COMP_LL_EF_Configuration_comparator_output Configuration of comparator output
  566. * @{
  567. */
  568. /**
  569. * @brief Set comparator instance output polarity.
  570. * @rmtoll CSR POLARITY LL_COMP_SetOutputPolarity
  571. * @param COMPx Comparator instance
  572. * @param OutputPolarity This parameter can be one of the following values:
  573. * @arg @ref LL_COMP_OUTPUTPOL_NONINVERTED
  574. * @arg @ref LL_COMP_OUTPUTPOL_INVERTED
  575. * @retval None
  576. */
  577. __STATIC_INLINE void LL_COMP_SetOutputPolarity(COMP_TypeDef *COMPx, uint32_t OutputPolarity)
  578. {
  579. MODIFY_REG(COMPx->CSR, COMP_CSR_POLARITY, OutputPolarity);
  580. }
  581. /**
  582. * @brief Get comparator instance output polarity.
  583. * @rmtoll CSR POLARITY LL_COMP_GetOutputPolarity
  584. * @param COMPx Comparator instance
  585. * @retval Returned value can be one of the following values:
  586. * @arg @ref LL_COMP_OUTPUTPOL_NONINVERTED
  587. * @arg @ref LL_COMP_OUTPUTPOL_INVERTED
  588. */
  589. __STATIC_INLINE uint32_t LL_COMP_GetOutputPolarity(COMP_TypeDef *COMPx)
  590. {
  591. return (uint32_t)(READ_BIT(COMPx->CSR, COMP_CSR_POLARITY));
  592. }
  593. /**
  594. * @brief Set comparator instance blanking source.
  595. * @note Blanking source may be specific to each comparator instance.
  596. * Refer to description of parameters or to reference manual.
  597. * @note Availability of parameters of blanking source from timer
  598. * depends on timers availability on the selected device.
  599. * @rmtoll CSR BLANKING LL_COMP_SetOutputBlankingSource
  600. * @param COMPx Comparator instance
  601. * @param BlankingSource This parameter can be one of the following values:
  602. * @arg @ref LL_COMP_BLANKINGSRC_NONE
  603. * @arg @ref LL_COMP_BLANKINGSRC_TIM1_OC5_COMP1 (1)(2)
  604. * @arg @ref LL_COMP_BLANKINGSRC_TIM2_OC3_COMP1 (1)(2)
  605. * @arg @ref LL_COMP_BLANKINGSRC_TIM3_OC3_COMP1 (1)(2)
  606. * @arg @ref LL_COMP_BLANKINGSRC_TIM3_OC4_COMP2 (1)(3)
  607. * @arg @ref LL_COMP_BLANKINGSRC_TIM8_OC5_COMP2 (1)(3)
  608. * @arg @ref LL_COMP_BLANKINGSRC_TIM15_OC1_COMP2 (1)(3)
  609. *
  610. * (1) Parameter availability depending on timer availability
  611. * on the selected device.
  612. * (2) On STM32L4, parameter available only on comparator instance: COMP1.
  613. * (3) On STM32L4, parameter available only on comparator instance: COMP2.
  614. * @retval None
  615. */
  616. __STATIC_INLINE void LL_COMP_SetOutputBlankingSource(COMP_TypeDef *COMPx, uint32_t BlankingSource)
  617. {
  618. MODIFY_REG(COMPx->CSR, COMP_CSR_BLANKING, BlankingSource);
  619. }
  620. /**
  621. * @brief Get comparator instance blanking source.
  622. * @note Availability of parameters of blanking source from timer
  623. * depends on timers availability on the selected device.
  624. * @note Blanking source may be specific to each comparator instance.
  625. * Refer to description of parameters or to reference manual.
  626. * @rmtoll CSR BLANKING LL_COMP_GetOutputBlankingSource
  627. * @param COMPx Comparator instance
  628. * @retval Returned value can be one of the following values:
  629. * @arg @ref LL_COMP_BLANKINGSRC_NONE
  630. * @arg @ref LL_COMP_BLANKINGSRC_TIM1_OC5_COMP1 (1)(2)
  631. * @arg @ref LL_COMP_BLANKINGSRC_TIM2_OC3_COMP1 (1)(2)
  632. * @arg @ref LL_COMP_BLANKINGSRC_TIM3_OC3_COMP1 (1)(2)
  633. * @arg @ref LL_COMP_BLANKINGSRC_TIM3_OC4_COMP2 (1)(3)
  634. * @arg @ref LL_COMP_BLANKINGSRC_TIM8_OC5_COMP2 (1)(3)
  635. * @arg @ref LL_COMP_BLANKINGSRC_TIM15_OC1_COMP2 (1)(3)
  636. *
  637. * (1) Parameter availability depending on timer availability
  638. * on the selected device.
  639. * (2) On STM32L4, parameter available only on comparator instance: COMP1.
  640. * (3) On STM32L4, parameter available only on comparator instance: COMP2.
  641. */
  642. __STATIC_INLINE uint32_t LL_COMP_GetOutputBlankingSource(COMP_TypeDef *COMPx)
  643. {
  644. return (uint32_t)(READ_BIT(COMPx->CSR, COMP_CSR_BLANKING));
  645. }
  646. /**
  647. * @}
  648. */
  649. /** @defgroup COMP_LL_EF_Configuration_Legacy_Functions Configuration of COMP, legacy functions name
  650. * @{
  651. */
  652. /* Old functions name kept for legacy purpose, to be replaced by the */
  653. /* current functions name. */
  654. __STATIC_INLINE void LL_COMP_SetInputNonInverting(COMP_TypeDef *COMPx, uint32_t InputNonInverting)
  655. {
  656. LL_COMP_SetInputPlus(COMPx, InputNonInverting);
  657. }
  658. __STATIC_INLINE uint32_t LL_COMP_GetInputNonInverting(COMP_TypeDef *COMPx)
  659. {
  660. return LL_COMP_GetInputPlus(COMPx);
  661. }
  662. __STATIC_INLINE void LL_COMP_SetInputInverting(COMP_TypeDef *COMPx, uint32_t InputInverting)
  663. {
  664. LL_COMP_SetInputMinus(COMPx, InputInverting);
  665. }
  666. __STATIC_INLINE uint32_t LL_COMP_GetInputInverting(COMP_TypeDef *COMPx)
  667. {
  668. return LL_COMP_GetInputMinus(COMPx);
  669. }
  670. /**
  671. * @}
  672. */
  673. /** @defgroup COMP_LL_EF_Operation Operation on comparator instance
  674. * @{
  675. */
  676. /**
  677. * @brief Enable comparator instance.
  678. * @note After enable from off state, comparator requires a delay
  679. * to reach reach propagation delay specification.
  680. * Refer to device datasheet, parameter "tSTART".
  681. * @rmtoll CSR EN LL_COMP_Enable
  682. * @param COMPx Comparator instance
  683. * @retval None
  684. */
  685. __STATIC_INLINE void LL_COMP_Enable(COMP_TypeDef *COMPx)
  686. {
  687. SET_BIT(COMPx->CSR, COMP_CSR_EN);
  688. }
  689. /**
  690. * @brief Disable comparator instance.
  691. * @rmtoll CSR EN LL_COMP_Disable
  692. * @param COMPx Comparator instance
  693. * @retval None
  694. */
  695. __STATIC_INLINE void LL_COMP_Disable(COMP_TypeDef *COMPx)
  696. {
  697. CLEAR_BIT(COMPx->CSR, COMP_CSR_EN);
  698. }
  699. /**
  700. * @brief Get comparator enable state
  701. * (0: COMP is disabled, 1: COMP is enabled)
  702. * @rmtoll CSR EN LL_COMP_IsEnabled
  703. * @param COMPx Comparator instance
  704. * @retval State of bit (1 or 0).
  705. */
  706. __STATIC_INLINE uint32_t LL_COMP_IsEnabled(COMP_TypeDef *COMPx)
  707. {
  708. return ((READ_BIT(COMPx->CSR, COMP_CSR_EN) == (COMP_CSR_EN)) ? 1UL : 0UL);
  709. }
  710. /**
  711. * @brief Lock comparator instance.
  712. * @note Once locked, comparator configuration can be accessed in read-only.
  713. * @note The only way to unlock the comparator is a device hardware reset.
  714. * @rmtoll CSR LOCK LL_COMP_Lock
  715. * @param COMPx Comparator instance
  716. * @retval None
  717. */
  718. __STATIC_INLINE void LL_COMP_Lock(COMP_TypeDef *COMPx)
  719. {
  720. SET_BIT(COMPx->CSR, COMP_CSR_LOCK);
  721. }
  722. /**
  723. * @brief Get comparator lock state
  724. * (0: COMP is unlocked, 1: COMP is locked).
  725. * @note Once locked, comparator configuration can be accessed in read-only.
  726. * @note The only way to unlock the comparator is a device hardware reset.
  727. * @rmtoll CSR LOCK LL_COMP_IsLocked
  728. * @param COMPx Comparator instance
  729. * @retval State of bit (1 or 0).
  730. */
  731. __STATIC_INLINE uint32_t LL_COMP_IsLocked(COMP_TypeDef *COMPx)
  732. {
  733. return ((READ_BIT(COMPx->CSR, COMP_CSR_LOCK) == (COMP_CSR_LOCK)) ? 1UL : 0UL);
  734. }
  735. /**
  736. * @brief Read comparator instance output level.
  737. * @note The comparator output level depends on the selected polarity
  738. * (Refer to function @ref LL_COMP_SetOutputPolarity()).
  739. * If the comparator polarity is not inverted:
  740. * - Comparator output is low when the input plus
  741. * is at a lower voltage than the input minus
  742. * - Comparator output is high when the input plus
  743. * is at a higher voltage than the input minus
  744. * If the comparator polarity is inverted:
  745. * - Comparator output is high when the input plus
  746. * is at a lower voltage than the input minus
  747. * - Comparator output is low when the input plus
  748. * is at a higher voltage than the input minus
  749. * @rmtoll CSR VALUE LL_COMP_ReadOutputLevel
  750. * @param COMPx Comparator instance
  751. * @retval Returned value can be one of the following values:
  752. * @arg @ref LL_COMP_OUTPUT_LEVEL_LOW
  753. * @arg @ref LL_COMP_OUTPUT_LEVEL_HIGH
  754. */
  755. __STATIC_INLINE uint32_t LL_COMP_ReadOutputLevel(COMP_TypeDef *COMPx)
  756. {
  757. return (uint32_t)(READ_BIT(COMPx->CSR, COMP_CSR_VALUE)
  758. >> LL_COMP_OUTPUT_LEVEL_BITOFFSET_POS);
  759. }
  760. /**
  761. * @}
  762. */
  763. #if defined(USE_FULL_LL_DRIVER)
  764. /** @defgroup COMP_LL_EF_Init Initialization and de-initialization functions
  765. * @{
  766. */
  767. ErrorStatus LL_COMP_DeInit(COMP_TypeDef *COMPx);
  768. ErrorStatus LL_COMP_Init(COMP_TypeDef *COMPx, LL_COMP_InitTypeDef *COMP_InitStruct);
  769. void LL_COMP_StructInit(LL_COMP_InitTypeDef *COMP_InitStruct);
  770. /**
  771. * @}
  772. */
  773. #endif /* USE_FULL_LL_DRIVER */
  774. /**
  775. * @}
  776. */
  777. /**
  778. * @}
  779. */
  780. /**
  781. * @}
  782. */
  783. #endif /* COMP1 || COMP2 */
  784. /**
  785. * @}
  786. */
  787. #ifdef __cplusplus
  788. }
  789. #endif
  790. #endif /* STM32L4xx_LL_COMP_H */