stm32l4xx_ll_comp.h 37 KB

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