stm32l4xx_hal_comp.h 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790
  1. /**
  2. ******************************************************************************
  3. * @file stm32l4xx_hal_comp.h
  4. * @author MCD Application Team
  5. * @version V1.7.2
  6. * @date 16-June-2017
  7. * @brief Header file of COMP HAL 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 __STM32L4xx_HAL_COMP_H
  39. #define __STM32L4xx_HAL_COMP_H
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43. /* Includes ------------------------------------------------------------------*/
  44. #include "stm32l4xx_hal_def.h"
  45. /** @addtogroup STM32L4xx_HAL_Driver
  46. * @{
  47. */
  48. /** @addtogroup COMP
  49. * @{
  50. */
  51. /* Exported types ------------------------------------------------------------*/
  52. /** @defgroup COMP_Exported_Types COMP Exported Types
  53. * @{
  54. */
  55. /**
  56. * @brief COMP Init structure definition
  57. */
  58. typedef struct
  59. {
  60. uint32_t WindowMode; /*!< Set window mode of a pair of comparators instances
  61. (2 consecutive instances odd and even COMP<x> and COMP<x+1>).
  62. Note: HAL COMP driver allows to set window mode from any COMP instance of the pair of COMP instances composing window mode.
  63. This parameter can be a value of @ref COMP_WindowMode */
  64. uint32_t Mode; /*!< Set comparator operating mode to adjust power and speed.
  65. Note: For the characteritics of comparator power modes
  66. (propagation delay and power consumption), refer to device datasheet.
  67. This parameter can be a value of @ref COMP_PowerMode */
  68. uint32_t NonInvertingInput; /*!< Set comparator input plus (non-inverting input).
  69. This parameter can be a value of @ref COMP_InputPlus */
  70. uint32_t InvertingInput; /*!< Set comparator input minus (inverting input).
  71. This parameter can be a value of @ref COMP_InputMinus */
  72. uint32_t Hysteresis; /*!< Set comparator hysteresis mode of the input minus.
  73. This parameter can be a value of @ref COMP_Hysteresis */
  74. uint32_t OutputPol; /*!< Set comparator output polarity.
  75. This parameter can be a value of @ref COMP_OutputPolarity */
  76. uint32_t BlankingSrce; /*!< Set comparator blanking source.
  77. This parameter can be a value of @ref COMP_BlankingSrce */
  78. uint32_t TriggerMode; /*!< Set the comparator output triggering External Interrupt Line (EXTI).
  79. This parameter can be a value of @ref COMP_EXTI_TriggerMode */
  80. }COMP_InitTypeDef;
  81. /**
  82. * @brief HAL COMP state machine: HAL COMP states definition
  83. */
  84. #define COMP_STATE_BITFIELD_LOCK ((uint32_t)0x10)
  85. typedef enum
  86. {
  87. HAL_COMP_STATE_RESET = 0x00, /*!< COMP not yet initialized */
  88. HAL_COMP_STATE_RESET_LOCKED = (HAL_COMP_STATE_RESET | COMP_STATE_BITFIELD_LOCK), /*!< COMP not yet initialized and configuration is locked */
  89. HAL_COMP_STATE_READY = 0x01, /*!< COMP initialized and ready for use */
  90. HAL_COMP_STATE_READY_LOCKED = (HAL_COMP_STATE_READY | COMP_STATE_BITFIELD_LOCK), /*!< COMP initialized but configuration is locked */
  91. HAL_COMP_STATE_BUSY = 0x02, /*!< COMP is running */
  92. HAL_COMP_STATE_BUSY_LOCKED = (HAL_COMP_STATE_BUSY | COMP_STATE_BITFIELD_LOCK) /*!< COMP is running and configuration is locked */
  93. }HAL_COMP_StateTypeDef;
  94. /**
  95. * @brief COMP Handle Structure definition
  96. */
  97. typedef struct
  98. {
  99. COMP_TypeDef *Instance; /*!< Register base address */
  100. COMP_InitTypeDef Init; /*!< COMP required parameters */
  101. HAL_LockTypeDef Lock; /*!< Locking object */
  102. __IO HAL_COMP_StateTypeDef State; /*!< COMP communication state */
  103. } COMP_HandleTypeDef;
  104. /**
  105. * @}
  106. */
  107. /* Exported constants --------------------------------------------------------*/
  108. /** @defgroup COMP_Exported_Constants COMP Exported Constants
  109. * @{
  110. */
  111. /** @defgroup COMP_WindowMode COMP Window Mode
  112. * @{
  113. */
  114. #define COMP_WINDOWMODE_DISABLE ((uint32_t)0x00000000) /*!< Window mode disable: Comparators instances pair COMP1 and COMP2 are independent */
  115. #define 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). */
  116. /**
  117. * @}
  118. */
  119. /** @defgroup COMP_PowerMode COMP power mode
  120. * @{
  121. */
  122. /* Note: For the characteritics of comparator power modes */
  123. /* (propagation delay and power consumption), */
  124. /* refer to device datasheet. */
  125. #define COMP_POWERMODE_HIGHSPEED ((uint32_t)0x00000000) /*!< High Speed */
  126. #define COMP_POWERMODE_MEDIUMSPEED (COMP_CSR_PWRMODE_0) /*!< Medium Speed */
  127. #define COMP_POWERMODE_ULTRALOWPOWER (COMP_CSR_PWRMODE) /*!< Ultra-low power mode */
  128. /**
  129. * @}
  130. */
  131. /** @defgroup COMP_InputPlus COMP input plus (non-inverting input)
  132. * @{
  133. */
  134. #define COMP_INPUT_PLUS_IO1 ((uint32_t)0x00000000) /*!< Comparator input plus connected to IO1 (pin PC5 for COMP1, pin PB4 for COMP2) */
  135. #define COMP_INPUT_PLUS_IO2 (COMP_CSR_INPSEL_0) /*!< Comparator input plus connected to IO2 (pin PB2 for COMP1, pin PB6 for COMP2) */
  136. #if defined(COMP_CSR_INPSEL_1)
  137. #define COMP_INPUT_PLUS_IO3 (COMP_CSR_INPSEL_1) /*!< Comparator input plus connected to IO3 (pin PA1 for COMP1, pin PA3 for COMP2) */
  138. #endif
  139. /**
  140. * @}
  141. */
  142. /** @defgroup COMP_InputMinus COMP input minus (inverting input)
  143. * @{
  144. */
  145. #define COMP_INPUT_MINUS_1_4VREFINT ( COMP_CSR_SCALEN | COMP_CSR_BRGEN) /*!< Comparator input minus connected to 1/4 VrefInt */
  146. #define COMP_INPUT_MINUS_1_2VREFINT ( COMP_CSR_INMSEL_0 | COMP_CSR_SCALEN | COMP_CSR_BRGEN) /*!< Comparator input minus connected to 1/2 VrefInt */
  147. #define COMP_INPUT_MINUS_3_4VREFINT ( COMP_CSR_INMSEL_1 | COMP_CSR_SCALEN | COMP_CSR_BRGEN) /*!< Comparator input minus connected to 3/4 VrefInt */
  148. #define COMP_INPUT_MINUS_VREFINT ( COMP_CSR_INMSEL_1 | COMP_CSR_INMSEL_0 | COMP_CSR_SCALEN ) /*!< Comparator input minus connected to VrefInt */
  149. #define COMP_INPUT_MINUS_DAC1_CH1 (COMP_CSR_INMSEL_2 ) /*!< Comparator input minus connected to DAC1 channel 1 (DAC_OUT1) */
  150. #if defined(DAC_CHANNEL2_SUPPORT)
  151. #define COMP_INPUT_MINUS_DAC1_CH2 (COMP_CSR_INMSEL_2 | COMP_CSR_INMSEL_0) /*!< Comparator input minus connected to DAC1 channel 2 (DAC_OUT2) */
  152. #endif
  153. #define 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) */
  154. #define 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) */
  155. #if defined(COMP_CSR_INMESEL_1)
  156. #define 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) */
  157. #define 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) */
  158. #define 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) */
  159. #endif
  160. /**
  161. * @}
  162. */
  163. /** @defgroup COMP_Hysteresis COMP hysteresis
  164. * @{
  165. */
  166. #define COMP_HYSTERESIS_NONE ((uint32_t)0x00000000) /*!< No hysteresis */
  167. #define COMP_HYSTERESIS_LOW (COMP_CSR_HYST_0) /*!< Hysteresis level low */
  168. #define COMP_HYSTERESIS_MEDIUM (COMP_CSR_HYST_1) /*!< Hysteresis level medium */
  169. #define COMP_HYSTERESIS_HIGH (COMP_CSR_HYST) /*!< Hysteresis level high */
  170. /**
  171. * @}
  172. */
  173. /** @defgroup COMP_OutputPolarity COMP output Polarity
  174. * @{
  175. */
  176. #define COMP_OUTPUTPOL_NONINVERTED ((uint32_t)0x00000000) /*!< COMP output level is not inverted (comparator output is high when the input plus is at a higher voltage than the input minus) */
  177. #define COMP_OUTPUTPOL_INVERTED (COMP_CSR_POLARITY) /*!< COMP output level is inverted (comparator output is low when the input plus is at a higher voltage than the input minus) */
  178. /**
  179. * @}
  180. */
  181. /** @defgroup COMP_BlankingSrce COMP blanking source
  182. * @{
  183. */
  184. /* Note: Some blanking sources are not available depending on timer */
  185. /* availability or devices specificities */
  186. /* (STM32L43xx, STM32L44xx, STM32L45xx, STM32L46xx) */
  187. #define COMP_BLANKINGSRC_NONE ((uint32_t)0x00000000) /*!< No blanking source */
  188. /* Blanking sources for COMP instance: COMP1 */
  189. #define COMP_BLANKINGSRC_TIM1_OC5_COMP1 (COMP_CSR_BLANKING_0) /*!< Blanking source for COMP1: TIM1 OC5 selected as blanking source for comparator */
  190. #define COMP_BLANKINGSRC_TIM2_OC3_COMP1 (COMP_CSR_BLANKING_1) /*!< Blanking source for COMP1: TIM2 OC3 selected as blanking source for comparator */
  191. #if defined(STM32L451xx) || defined(STM32L452xx) || defined(STM32L462xx) || \
  192. defined(STM32L471xx) || defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx) || \
  193. defined(STM32L496xx) || defined(STM32L4A6xx)
  194. #define COMP_BLANKINGSRC_TIM3_OC3_COMP1 (COMP_CSR_BLANKING_2) /*!< Blanking source for COMP1: TIM3 OC3 selected as blanking source for comparator */
  195. #endif /* STM32L451xx || STM32L452xx || STM32L462xx */
  196. /* STM32L471xx || STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */
  197. /* STM32L496xx || STM32L4A6xx */
  198. /* Blanking sources for COMP instance: COMP2 */
  199. #if defined(STM32L451xx) || defined(STM32L452xx) || defined(STM32L462xx) || \
  200. defined(STM32L471xx) || defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx) || \
  201. defined(STM32L496xx) || defined(STM32L4A6xx)
  202. #define COMP_BLANKINGSRC_TIM3_OC4_COMP2 (COMP_CSR_BLANKING_0) /*!< Blanking source for COMP2: TIM3 OC4 selected as blanking source for comparator */
  203. #endif /* STM32L451xx || STM32L452xx || STM32L462xx */
  204. /* STM32L471xx || STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */
  205. /* STM32L496xx || STM32L4A6xx */
  206. #if defined(STM32L471xx) || defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx) || \
  207. defined(STM32L496xx) || defined(STM32L4A6xx)
  208. #define COMP_BLANKINGSRC_TIM8_OC5_COMP2 (COMP_CSR_BLANKING_1) /*!< Blanking source for COMP2: TIM8 OC5 selected as blanking source for comparator */
  209. #endif /* STM32L471xx || STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */
  210. /* STM32L496xx || STM32L4A6xx */
  211. #define COMP_BLANKINGSRC_TIM15_OC1_COMP2 (COMP_CSR_BLANKING_2) /*!< Blanking source for COMP2: TIM15 OC1 selected as blanking source for comparator */
  212. /**
  213. * @}
  214. */
  215. /** @defgroup COMP_OutputLevel COMP Output Level
  216. * @{
  217. */
  218. /* Note: Comparator output level values are fixed to "0" and "1", */
  219. /* corresponding COMP register bit is managed by HAL function to match */
  220. /* with these values (independently of bit position in register). */
  221. /* When output polarity is not inverted, comparator output is low when
  222. the input plus is at a lower voltage than the input minus */
  223. #define COMP_OUTPUT_LEVEL_LOW ((uint32_t)0x00000000)
  224. /* When output polarity is not inverted, comparator output is high when
  225. the input plus is at a higher voltage than the input minus */
  226. #define COMP_OUTPUT_LEVEL_HIGH ((uint32_t)0x00000001)
  227. /**
  228. * @}
  229. */
  230. /** @defgroup COMP_EXTI_TriggerMode COMP output to EXTI
  231. * @{
  232. */
  233. #define COMP_TRIGGERMODE_NONE ((uint32_t)0x00000000) /*!< Comparator output triggering no External Interrupt Line */
  234. #define COMP_TRIGGERMODE_IT_RISING (COMP_EXTI_IT | COMP_EXTI_RISING) /*!< Comparator output triggering External Interrupt Line event with interruption, on rising edge */
  235. #define COMP_TRIGGERMODE_IT_FALLING (COMP_EXTI_IT | COMP_EXTI_FALLING) /*!< Comparator output triggering External Interrupt Line event with interruption, on falling edge */
  236. #define COMP_TRIGGERMODE_IT_RISING_FALLING (COMP_EXTI_IT | COMP_EXTI_RISING | COMP_EXTI_FALLING) /*!< Comparator output triggering External Interrupt Line event with interruption, on both rising and falling edges */
  237. #define COMP_TRIGGERMODE_EVENT_RISING (COMP_EXTI_EVENT | COMP_EXTI_RISING) /*!< Comparator output triggering External Interrupt Line event only (without interruption), on rising edge */
  238. #define COMP_TRIGGERMODE_EVENT_FALLING (COMP_EXTI_EVENT | COMP_EXTI_FALLING) /*!< Comparator output triggering External Interrupt Line event only (without interruption), on falling edge */
  239. #define COMP_TRIGGERMODE_EVENT_RISING_FALLING (COMP_EXTI_EVENT | COMP_EXTI_RISING | COMP_EXTI_FALLING) /*!< Comparator output triggering External Interrupt Line event only (without interruption), on both rising and falling edges */
  240. /**
  241. * @}
  242. */
  243. /**
  244. * @}
  245. */
  246. /* Exported macro ------------------------------------------------------------*/
  247. /** @defgroup COMP_Exported_Macros COMP Exported Macros
  248. * @{
  249. */
  250. /** @defgroup COMP_Handle_Management COMP Handle Management
  251. * @{
  252. */
  253. /** @brief Reset COMP handle state.
  254. * @param __HANDLE__ COMP handle
  255. * @retval None
  256. */
  257. #define __HAL_COMP_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_COMP_STATE_RESET)
  258. /**
  259. * @brief Enable the specified comparator.
  260. * @param __HANDLE__ COMP handle
  261. * @retval None
  262. */
  263. #define __HAL_COMP_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_EN)
  264. /**
  265. * @brief Disable the specified comparator.
  266. * @param __HANDLE__ COMP handle
  267. * @retval None
  268. */
  269. #define __HAL_COMP_DISABLE(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_EN)
  270. /**
  271. * @brief Lock the specified comparator configuration.
  272. * @note Using this macro induce HAL COMP handle state machine being no
  273. * more in line with COMP instance state.
  274. * To keep HAL COMP handle state machine updated, it is recommended
  275. * to use function "HAL_COMP_Lock')".
  276. * @param __HANDLE__ COMP handle
  277. * @retval None
  278. */
  279. #define __HAL_COMP_LOCK(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_LOCK)
  280. /**
  281. * @brief Check whether the specified comparator is locked.
  282. * @param __HANDLE__ COMP handle
  283. * @retval Value 0 if COMP instance is not locked, value 1 if COMP instance is locked
  284. */
  285. #define __HAL_COMP_IS_LOCKED(__HANDLE__) (READ_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_LOCK) == COMP_CSR_LOCK)
  286. /**
  287. * @}
  288. */
  289. /** @defgroup COMP_Exti_Management COMP external interrupt line management
  290. * @{
  291. */
  292. /**
  293. * @brief Enable the COMP1 EXTI line rising edge trigger.
  294. * @retval None
  295. */
  296. #define __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR1, COMP_EXTI_LINE_COMP1)
  297. /**
  298. * @brief Disable the COMP1 EXTI line rising edge trigger.
  299. * @retval None
  300. */
  301. #define __HAL_COMP_COMP1_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR1, COMP_EXTI_LINE_COMP1)
  302. /**
  303. * @brief Enable the COMP1 EXTI line falling edge trigger.
  304. * @retval None
  305. */
  306. #define __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR1, COMP_EXTI_LINE_COMP1)
  307. /**
  308. * @brief Disable the COMP1 EXTI line falling edge trigger.
  309. * @retval None
  310. */
  311. #define __HAL_COMP_COMP1_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR1, COMP_EXTI_LINE_COMP1)
  312. /**
  313. * @brief Enable the COMP1 EXTI line rising & falling edge trigger.
  314. * @retval None
  315. */
  316. #define __HAL_COMP_COMP1_EXTI_ENABLE_RISING_FALLING_EDGE() do { \
  317. __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE(); \
  318. __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE(); \
  319. } while(0)
  320. /**
  321. * @brief Disable the COMP1 EXTI line rising & falling edge trigger.
  322. * @retval None
  323. */
  324. #define __HAL_COMP_COMP1_EXTI_DISABLE_RISING_FALLING_EDGE() do { \
  325. __HAL_COMP_COMP1_EXTI_DISABLE_RISING_EDGE(); \
  326. __HAL_COMP_COMP1_EXTI_DISABLE_FALLING_EDGE(); \
  327. } while(0)
  328. /**
  329. * @brief Enable the COMP1 EXTI line in interrupt mode.
  330. * @retval None
  331. */
  332. #define __HAL_COMP_COMP1_EXTI_ENABLE_IT() SET_BIT(EXTI->IMR1, COMP_EXTI_LINE_COMP1)
  333. /**
  334. * @brief Disable the COMP1 EXTI line in interrupt mode.
  335. * @retval None
  336. */
  337. #define __HAL_COMP_COMP1_EXTI_DISABLE_IT() CLEAR_BIT(EXTI->IMR1, COMP_EXTI_LINE_COMP1)
  338. /**
  339. * @brief Generate a software interrupt on the COMP1 EXTI line.
  340. * @retval None
  341. */
  342. #define __HAL_COMP_COMP1_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER1, COMP_EXTI_LINE_COMP1)
  343. /**
  344. * @brief Enable the COMP1 EXTI line in event mode.
  345. * @retval None
  346. */
  347. #define __HAL_COMP_COMP1_EXTI_ENABLE_EVENT() SET_BIT(EXTI->EMR1, COMP_EXTI_LINE_COMP1)
  348. /**
  349. * @brief Disable the COMP1 EXTI line in event mode.
  350. * @retval None
  351. */
  352. #define __HAL_COMP_COMP1_EXTI_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR1, COMP_EXTI_LINE_COMP1)
  353. /**
  354. * @brief Check whether the COMP1 EXTI line flag is set.
  355. * @retval RESET or SET
  356. */
  357. #define __HAL_COMP_COMP1_EXTI_GET_FLAG() READ_BIT(EXTI->PR1, COMP_EXTI_LINE_COMP1)
  358. /**
  359. * @brief Clear the COMP1 EXTI flag.
  360. * @retval None
  361. */
  362. #define __HAL_COMP_COMP1_EXTI_CLEAR_FLAG() WRITE_REG(EXTI->PR1, COMP_EXTI_LINE_COMP1)
  363. /**
  364. * @brief Enable the COMP2 EXTI line rising edge trigger.
  365. * @retval None
  366. */
  367. #define __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR1, COMP_EXTI_LINE_COMP2)
  368. /**
  369. * @brief Disable the COMP2 EXTI line rising edge trigger.
  370. * @retval None
  371. */
  372. #define __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR1, COMP_EXTI_LINE_COMP2)
  373. /**
  374. * @brief Enable the COMP2 EXTI line falling edge trigger.
  375. * @retval None
  376. */
  377. #define __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR1, COMP_EXTI_LINE_COMP2)
  378. /**
  379. * @brief Disable the COMP2 EXTI line falling edge trigger.
  380. * @retval None
  381. */
  382. #define __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR1, COMP_EXTI_LINE_COMP2)
  383. /**
  384. * @brief Enable the COMP2 EXTI line rising & falling edge trigger.
  385. * @retval None
  386. */
  387. #define __HAL_COMP_COMP2_EXTI_ENABLE_RISING_FALLING_EDGE() do { \
  388. __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE(); \
  389. __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE(); \
  390. } while(0)
  391. /**
  392. * @brief Disable the COMP2 EXTI line rising & falling edge trigger.
  393. * @retval None
  394. */
  395. #define __HAL_COMP_COMP2_EXTI_DISABLE_RISING_FALLING_EDGE() do { \
  396. __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE(); \
  397. __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE(); \
  398. } while(0)
  399. /**
  400. * @brief Enable the COMP2 EXTI line in interrupt mode.
  401. * @retval None
  402. */
  403. #define __HAL_COMP_COMP2_EXTI_ENABLE_IT() SET_BIT(EXTI->IMR1, COMP_EXTI_LINE_COMP2)
  404. /**
  405. * @brief Disable the COMP2 EXTI line in interrupt mode.
  406. * @retval None
  407. */
  408. #define __HAL_COMP_COMP2_EXTI_DISABLE_IT() CLEAR_BIT(EXTI->IMR1, COMP_EXTI_LINE_COMP2)
  409. /**
  410. * @brief Generate a software interrupt on the COMP2 EXTI line.
  411. * @retval None
  412. */
  413. #define __HAL_COMP_COMP2_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER1, COMP_EXTI_LINE_COMP2)
  414. /**
  415. * @brief Enable the COMP2 EXTI line in event mode.
  416. * @retval None
  417. */
  418. #define __HAL_COMP_COMP2_EXTI_ENABLE_EVENT() SET_BIT(EXTI->EMR1, COMP_EXTI_LINE_COMP2)
  419. /**
  420. * @brief Disable the COMP2 EXTI line in event mode.
  421. * @retval None
  422. */
  423. #define __HAL_COMP_COMP2_EXTI_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR1, COMP_EXTI_LINE_COMP2)
  424. /**
  425. * @brief Check whether the COMP2 EXTI line flag is set.
  426. * @retval RESET or SET
  427. */
  428. #define __HAL_COMP_COMP2_EXTI_GET_FLAG() READ_BIT(EXTI->PR1, COMP_EXTI_LINE_COMP2)
  429. /**
  430. * @brief Clear the COMP2 EXTI flag.
  431. * @retval None
  432. */
  433. #define __HAL_COMP_COMP2_EXTI_CLEAR_FLAG() WRITE_REG(EXTI->PR1, COMP_EXTI_LINE_COMP2)
  434. /**
  435. * @}
  436. */
  437. /**
  438. * @}
  439. */
  440. /* Private types -------------------------------------------------------------*/
  441. /* Private constants ---------------------------------------------------------*/
  442. /** @defgroup COMP_Private_Constants COMP Private Constants
  443. * @{
  444. */
  445. /** @defgroup COMP_ExtiLine COMP EXTI Lines
  446. * @{
  447. */
  448. #define COMP_EXTI_LINE_COMP1 (EXTI_IMR1_IM21) /*!< EXTI line 21 connected to COMP1 output */
  449. #define COMP_EXTI_LINE_COMP2 (EXTI_IMR1_IM22) /*!< EXTI line 22 connected to COMP2 output */
  450. /**
  451. * @}
  452. */
  453. /** @defgroup COMP_ExtiLine COMP EXTI Lines
  454. * @{
  455. */
  456. #define COMP_EXTI_IT ((uint32_t) 0x01) /*!< EXTI line event with interruption */
  457. #define COMP_EXTI_EVENT ((uint32_t) 0x02) /*!< EXTI line event only (without interruption) */
  458. #define COMP_EXTI_RISING ((uint32_t) 0x10) /*!< EXTI line event on rising edge */
  459. #define COMP_EXTI_FALLING ((uint32_t) 0x20) /*!< EXTI line event on falling edge */
  460. /**
  461. * @}
  462. */
  463. /**
  464. * @}
  465. */
  466. /* Private macros ------------------------------------------------------------*/
  467. /** @defgroup COMP_Private_Macros COMP Private Macros
  468. * @{
  469. */
  470. /** @defgroup COMP_GET_EXTI_LINE COMP private macros to get EXTI line associated with comparators
  471. * @{
  472. */
  473. /**
  474. * @brief Get the specified EXTI line for a comparator instance.
  475. * @param __INSTANCE__ specifies the COMP instance.
  476. * @retval value of @ref COMP_ExtiLine
  477. */
  478. #define COMP_GET_EXTI_LINE(__INSTANCE__) (((__INSTANCE__) == COMP1) ? \
  479. COMP_EXTI_LINE_COMP1 : COMP_EXTI_LINE_COMP2)
  480. /**
  481. * @}
  482. */
  483. /** @defgroup COMP_IS_COMP_Definitions COMP private macros to check input parameters
  484. * @{
  485. */
  486. #define IS_COMP_WINDOWMODE(__WINDOWMODE__) (((__WINDOWMODE__) == COMP_WINDOWMODE_DISABLE) || \
  487. ((__WINDOWMODE__) == COMP_WINDOWMODE_COMP1_INPUT_PLUS_COMMON) )
  488. #define IS_COMP_POWERMODE(__POWERMODE__) (((__POWERMODE__) == COMP_POWERMODE_HIGHSPEED) || \
  489. ((__POWERMODE__) == COMP_POWERMODE_MEDIUMSPEED) || \
  490. ((__POWERMODE__) == COMP_POWERMODE_ULTRALOWPOWER) )
  491. #if defined(COMP_CSR_INPSEL_1)
  492. #define IS_COMP_INPUT_PLUS(__COMP_INSTANCE__, __INPUT_PLUS__) (((__INPUT_PLUS__) == COMP_INPUT_PLUS_IO1) || \
  493. ((__INPUT_PLUS__) == COMP_INPUT_PLUS_IO2) || \
  494. ((__INPUT_PLUS__) == COMP_INPUT_PLUS_IO3))
  495. #else
  496. #define IS_COMP_INPUT_PLUS(__COMP_INSTANCE__, __INPUT_PLUS__) (((__INPUT_PLUS__) == COMP_INPUT_PLUS_IO1) || \
  497. ((__INPUT_PLUS__) == COMP_INPUT_PLUS_IO2))
  498. #endif
  499. /* Note: On this STM32 family, comparator input minus parameters are */
  500. /* the same on all COMP instances. */
  501. /* However, comparator instance kept as macro parameter for */
  502. /* compatibility with other STM32 families. */
  503. #if defined(COMP_CSR_INMESEL_1) && defined(DAC_CHANNEL2_SUPPORT)
  504. #define IS_COMP_INPUT_MINUS(__COMP_INSTANCE__, __INPUT_MINUS__) (((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_4VREFINT) || \
  505. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_2VREFINT) || \
  506. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_3_4VREFINT) || \
  507. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_VREFINT) || \
  508. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_DAC1_CH1) || \
  509. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_DAC1_CH2) || \
  510. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO1) || \
  511. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO2) || \
  512. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO3) || \
  513. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO4) || \
  514. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO5))
  515. #elif defined(COMP_CSR_INMESEL_1)
  516. #define IS_COMP_INPUT_MINUS(__COMP_INSTANCE__, __INPUT_MINUS__) (((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_4VREFINT) || \
  517. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_2VREFINT) || \
  518. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_3_4VREFINT) || \
  519. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_VREFINT) || \
  520. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_DAC1_CH1) || \
  521. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO1) || \
  522. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO2) || \
  523. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO3) || \
  524. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO4) || \
  525. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO5))
  526. #elif defined(DAC_CHANNEL2_SUPPORT)
  527. #define IS_COMP_INPUT_MINUS(__COMP_INSTANCE__, __INPUT_MINUS__) (((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_4VREFINT) || \
  528. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_2VREFINT) || \
  529. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_3_4VREFINT) || \
  530. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_VREFINT) || \
  531. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_DAC1_CH1) || \
  532. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_DAC1_CH2) || \
  533. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO1) || \
  534. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO2))
  535. #else
  536. #define IS_COMP_INPUT_MINUS(__COMP_INSTANCE__, __INPUT_MINUS__) (((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_4VREFINT) || \
  537. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_2VREFINT) || \
  538. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_3_4VREFINT) || \
  539. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_VREFINT) || \
  540. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_DAC1_CH1) || \
  541. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO1) || \
  542. ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO2))
  543. #endif
  544. #define IS_COMP_HYSTERESIS(__HYSTERESIS__) (((__HYSTERESIS__) == COMP_HYSTERESIS_NONE) || \
  545. ((__HYSTERESIS__) == COMP_HYSTERESIS_LOW) || \
  546. ((__HYSTERESIS__) == COMP_HYSTERESIS_MEDIUM) || \
  547. ((__HYSTERESIS__) == COMP_HYSTERESIS_HIGH))
  548. #define IS_COMP_OUTPUTPOL(__POL__) (((__POL__) == COMP_OUTPUTPOL_NONINVERTED) || \
  549. ((__POL__) == COMP_OUTPUTPOL_INVERTED))
  550. #if defined(STM32L431xx) || defined(STM32L432xx) || defined(STM32L433xx) || defined(STM32L442xx) || defined(STM32L443xx)
  551. #define IS_COMP_BLANKINGSRCE(__SOURCE__) (((__SOURCE__) == COMP_BLANKINGSRC_NONE) || \
  552. ((__SOURCE__) == COMP_BLANKINGSRC_TIM1_OC5_COMP1) || \
  553. ((__SOURCE__) == COMP_BLANKINGSRC_TIM2_OC3_COMP1) || \
  554. ((__SOURCE__) == COMP_BLANKINGSRC_TIM15_OC1_COMP2))
  555. #define IS_COMP_BLANKINGSRC_INSTANCE(__INSTANCE__, __BLANKINGSRCE__) \
  556. ((((__INSTANCE__) == COMP1) && \
  557. (((__BLANKINGSRCE__) == COMP_BLANKINGSRC_NONE) || \
  558. ((__BLANKINGSRCE__) == COMP_BLANKINGSRC_TIM1_OC5_COMP1) || \
  559. ((__BLANKINGSRCE__) == COMP_BLANKINGSRC_TIM2_OC3_COMP1))) \
  560. || \
  561. (((__INSTANCE__) == COMP2) && \
  562. (((__BLANKINGSRCE__) == COMP_BLANKINGSRC_NONE) || \
  563. ((__BLANKINGSRCE__) == COMP_BLANKINGSRC_TIM15_OC1_COMP2))))
  564. #endif /* STM32L431xx || STM32L432xx || STM32L433xx || STM32L442xx || STM32L443xx */
  565. #if defined(STM32L451xx) || defined(STM32L452xx) || defined(STM32L462xx)
  566. #define IS_COMP_BLANKINGSRCE(__SOURCE__) (((__SOURCE__) == COMP_BLANKINGSRC_NONE) || \
  567. ((__SOURCE__) == COMP_BLANKINGSRC_TIM1_OC5_COMP1) || \
  568. ((__SOURCE__) == COMP_BLANKINGSRC_TIM2_OC3_COMP1) || \
  569. ((__SOURCE__) == COMP_BLANKINGSRC_TIM3_OC3_COMP1) || \
  570. ((__SOURCE__) == COMP_BLANKINGSRC_TIM3_OC4_COMP2) || \
  571. ((__SOURCE__) == COMP_BLANKINGSRC_TIM15_OC1_COMP2))
  572. #define IS_COMP_BLANKINGSRC_INSTANCE(__INSTANCE__, __BLANKINGSRCE__) \
  573. ((((__INSTANCE__) == COMP1) && \
  574. (((__BLANKINGSRCE__) == COMP_BLANKINGSRC_NONE) || \
  575. ((__BLANKINGSRCE__) == COMP_BLANKINGSRC_TIM1_OC5_COMP1) || \
  576. ((__BLANKINGSRCE__) == COMP_BLANKINGSRC_TIM2_OC3_COMP1) || \
  577. ((__BLANKINGSRCE__) == COMP_BLANKINGSRC_TIM3_OC3_COMP1))) \
  578. || \
  579. (((__INSTANCE__) == COMP2) && \
  580. (((__BLANKINGSRCE__) == COMP_BLANKINGSRC_NONE) || \
  581. ((__BLANKINGSRCE__) == COMP_BLANKINGSRC_TIM3_OC4_COMP2) || \
  582. ((__BLANKINGSRCE__) == COMP_BLANKINGSRC_TIM15_OC1_COMP2))))
  583. #endif /* STM32L451xx || STM32L452xx || STM32L462xx */
  584. #if defined(STM32L471xx) || defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx) || \
  585. defined(STM32L496xx) || defined(STM32L4A6xx)
  586. #define IS_COMP_BLANKINGSRCE(__SOURCE__) (((__SOURCE__) == COMP_BLANKINGSRC_NONE) || \
  587. ((__SOURCE__) == COMP_BLANKINGSRC_TIM1_OC5_COMP1) || \
  588. ((__SOURCE__) == COMP_BLANKINGSRC_TIM2_OC3_COMP1) || \
  589. ((__SOURCE__) == COMP_BLANKINGSRC_TIM3_OC3_COMP1) || \
  590. ((__SOURCE__) == COMP_BLANKINGSRC_TIM3_OC4_COMP2) || \
  591. ((__SOURCE__) == COMP_BLANKINGSRC_TIM8_OC5_COMP2) || \
  592. ((__SOURCE__) == COMP_BLANKINGSRC_TIM15_OC1_COMP2))
  593. #define IS_COMP_BLANKINGSRC_INSTANCE(__INSTANCE__, __BLANKINGSRCE__) \
  594. ((((__INSTANCE__) == COMP1) && \
  595. (((__BLANKINGSRCE__) == COMP_BLANKINGSRC_NONE) || \
  596. ((__BLANKINGSRCE__) == COMP_BLANKINGSRC_TIM1_OC5_COMP1) || \
  597. ((__BLANKINGSRCE__) == COMP_BLANKINGSRC_TIM2_OC3_COMP1) || \
  598. ((__BLANKINGSRCE__) == COMP_BLANKINGSRC_TIM3_OC3_COMP1))) \
  599. || \
  600. (((__INSTANCE__) == COMP2) && \
  601. (((__BLANKINGSRCE__) == COMP_BLANKINGSRC_NONE) || \
  602. ((__BLANKINGSRCE__) == COMP_BLANKINGSRC_TIM3_OC4_COMP2) || \
  603. ((__BLANKINGSRCE__) == COMP_BLANKINGSRC_TIM8_OC5_COMP2) || \
  604. ((__BLANKINGSRCE__) == COMP_BLANKINGSRC_TIM15_OC1_COMP2))))
  605. #endif /* STM32L471xx || STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */
  606. /* STM32L496xx || STM32L4A6xx */
  607. #define IS_COMP_TRIGGERMODE(__MODE__) (((__MODE__) == COMP_TRIGGERMODE_NONE) || \
  608. ((__MODE__) == COMP_TRIGGERMODE_IT_RISING) || \
  609. ((__MODE__) == COMP_TRIGGERMODE_IT_FALLING) || \
  610. ((__MODE__) == COMP_TRIGGERMODE_IT_RISING_FALLING) || \
  611. ((__MODE__) == COMP_TRIGGERMODE_EVENT_RISING) || \
  612. ((__MODE__) == COMP_TRIGGERMODE_EVENT_FALLING) || \
  613. ((__MODE__) == COMP_TRIGGERMODE_EVENT_RISING_FALLING))
  614. #define IS_COMP_OUTPUT_LEVEL(__OUTPUT_LEVEL__) (((__OUTPUT_LEVEL__) == COMP_OUTPUT_LEVEL_LOW) || \
  615. ((__OUTPUT_LEVEL__) == COMP_OUTPUT_LEVEL_HIGH))
  616. /**
  617. * @}
  618. */
  619. /**
  620. * @}
  621. */
  622. /* Exported functions --------------------------------------------------------*/
  623. /** @addtogroup COMP_Exported_Functions
  624. * @{
  625. */
  626. /** @addtogroup COMP_Exported_Functions_Group1
  627. * @{
  628. */
  629. /* Initialization and de-initialization functions **********************************/
  630. HAL_StatusTypeDef HAL_COMP_Init(COMP_HandleTypeDef *hcomp);
  631. HAL_StatusTypeDef HAL_COMP_DeInit (COMP_HandleTypeDef *hcomp);
  632. void HAL_COMP_MspInit(COMP_HandleTypeDef *hcomp);
  633. void HAL_COMP_MspDeInit(COMP_HandleTypeDef *hcomp);
  634. /**
  635. * @}
  636. */
  637. /* IO operation functions *****************************************************/
  638. /** @addtogroup COMP_Exported_Functions_Group2
  639. * @{
  640. */
  641. HAL_StatusTypeDef HAL_COMP_Start(COMP_HandleTypeDef *hcomp);
  642. HAL_StatusTypeDef HAL_COMP_Stop(COMP_HandleTypeDef *hcomp);
  643. void HAL_COMP_IRQHandler(COMP_HandleTypeDef *hcomp);
  644. /**
  645. * @}
  646. */
  647. /* Peripheral Control functions ************************************************/
  648. /** @addtogroup COMP_Exported_Functions_Group3
  649. * @{
  650. */
  651. HAL_StatusTypeDef HAL_COMP_Lock(COMP_HandleTypeDef *hcomp);
  652. uint32_t HAL_COMP_GetOutputLevel(COMP_HandleTypeDef *hcomp);
  653. /* Callback in interrupt mode */
  654. void HAL_COMP_TriggerCallback(COMP_HandleTypeDef *hcomp);
  655. /**
  656. * @}
  657. */
  658. /* Peripheral State functions **************************************************/
  659. /** @addtogroup COMP_Exported_Functions_Group4
  660. * @{
  661. */
  662. HAL_COMP_StateTypeDef HAL_COMP_GetState(COMP_HandleTypeDef *hcomp);
  663. /**
  664. * @}
  665. */
  666. /**
  667. * @}
  668. */
  669. /**
  670. * @}
  671. */
  672. /**
  673. * @}
  674. */
  675. #ifdef __cplusplus
  676. }
  677. #endif
  678. #endif /* __STM32L4xx_HAL_COMP_H */
  679. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/