STM32L443xx HAL User Manual
|
00001 /** 00002 ****************************************************************************** 00003 * @file stm32l4xx_hal_comp.h 00004 * @author MCD Application Team 00005 * @brief Header file of COMP HAL module. 00006 ****************************************************************************** 00007 * @attention 00008 * 00009 * Copyright (c) 2017 STMicroelectronics. 00010 * All rights reserved. 00011 * 00012 * This software is licensed under terms that can be found in the LICENSE file 00013 * in the root directory of this software component. 00014 * If no LICENSE file comes with this software, it is provided AS-IS. 00015 * 00016 ****************************************************************************** 00017 */ 00018 00019 /* Define to prevent recursive inclusion -------------------------------------*/ 00020 #ifndef STM32L4xx_HAL_COMP_H 00021 #define STM32L4xx_HAL_COMP_H 00022 00023 #ifdef __cplusplus 00024 extern "C" { 00025 #endif 00026 00027 /* Includes ------------------------------------------------------------------*/ 00028 #include "stm32l4xx_hal_def.h" 00029 #include "stm32l4xx_ll_exti.h" 00030 00031 /** @addtogroup STM32L4xx_HAL_Driver 00032 * @{ 00033 */ 00034 #if defined (COMP1) || defined (COMP2) 00035 00036 /** @addtogroup COMP 00037 * @{ 00038 */ 00039 00040 /* Exported types ------------------------------------------------------------*/ 00041 /** @defgroup COMP_Exported_Types COMP Exported Types 00042 * @{ 00043 */ 00044 00045 /** 00046 * @brief COMP Init structure definition 00047 */ 00048 typedef struct 00049 { 00050 00051 #if defined(COMP2) 00052 uint32_t WindowMode; /*!< Set window mode of a pair of comparators instances 00053 (2 consecutive instances odd and even COMP<x> and COMP<x+1>). 00054 Note: HAL COMP driver allows to set window mode from any COMP instance of the pair of COMP instances composing window mode. 00055 This parameter can be a value of @ref COMP_WindowMode */ 00056 #endif /* COMP2 */ 00057 00058 uint32_t Mode; /*!< Set comparator operating mode to adjust power and speed. 00059 Note: For the characteristics of comparator power modes 00060 (propagation delay and power consumption), refer to device datasheet. 00061 This parameter can be a value of @ref COMP_PowerMode */ 00062 00063 uint32_t NonInvertingInput; /*!< Set comparator input plus (non-inverting input). 00064 This parameter can be a value of @ref COMP_InputPlus */ 00065 00066 uint32_t InvertingInput; /*!< Set comparator input minus (inverting input). 00067 This parameter can be a value of @ref COMP_InputMinus */ 00068 00069 uint32_t Hysteresis; /*!< Set comparator hysteresis mode of the input minus. 00070 This parameter can be a value of @ref COMP_Hysteresis */ 00071 00072 uint32_t OutputPol; /*!< Set comparator output polarity. 00073 This parameter can be a value of @ref COMP_OutputPolarity */ 00074 00075 uint32_t BlankingSrce; /*!< Set comparator blanking source. 00076 This parameter can be a value of @ref COMP_BlankingSrce */ 00077 00078 uint32_t TriggerMode; /*!< Set the comparator output triggering External Interrupt Line (EXTI). 00079 This parameter can be a value of @ref COMP_EXTI_TriggerMode */ 00080 00081 } COMP_InitTypeDef; 00082 00083 /** 00084 * @brief HAL COMP state machine: HAL COMP states definition 00085 */ 00086 #define COMP_STATE_BITFIELD_LOCK (0x10U) 00087 typedef enum 00088 { 00089 HAL_COMP_STATE_RESET = 0x00U, /*!< COMP not yet initialized */ 00090 HAL_COMP_STATE_RESET_LOCKED = (HAL_COMP_STATE_RESET | COMP_STATE_BITFIELD_LOCK), /*!< COMP not yet initialized and configuration is locked */ 00091 HAL_COMP_STATE_READY = 0x01U, /*!< COMP initialized and ready for use */ 00092 HAL_COMP_STATE_READY_LOCKED = (HAL_COMP_STATE_READY | COMP_STATE_BITFIELD_LOCK), /*!< COMP initialized but configuration is locked */ 00093 HAL_COMP_STATE_BUSY = 0x02U, /*!< COMP is running */ 00094 HAL_COMP_STATE_BUSY_LOCKED = (HAL_COMP_STATE_BUSY | COMP_STATE_BITFIELD_LOCK) /*!< COMP is running and configuration is locked */ 00095 } HAL_COMP_StateTypeDef; 00096 00097 /** 00098 * @brief COMP Handle Structure definition 00099 */ 00100 #if (USE_HAL_COMP_REGISTER_CALLBACKS == 1) 00101 typedef struct __COMP_HandleTypeDef 00102 #else 00103 typedef struct 00104 #endif /* USE_HAL_COMP_REGISTER_CALLBACKS */ 00105 { 00106 COMP_TypeDef *Instance; /*!< Register base address */ 00107 COMP_InitTypeDef Init; /*!< COMP required parameters */ 00108 HAL_LockTypeDef Lock; /*!< Locking object */ 00109 __IO HAL_COMP_StateTypeDef State; /*!< COMP communication state */ 00110 __IO uint32_t ErrorCode; /*!< COMP error code */ 00111 #if (USE_HAL_COMP_REGISTER_CALLBACKS == 1) 00112 void (* TriggerCallback)(struct __COMP_HandleTypeDef *hcomp); /*!< COMP trigger callback */ 00113 void (* MspInitCallback)(struct __COMP_HandleTypeDef *hcomp); /*!< COMP Msp Init callback */ 00114 void (* MspDeInitCallback)(struct __COMP_HandleTypeDef *hcomp); /*!< COMP Msp DeInit callback */ 00115 #endif /* USE_HAL_COMP_REGISTER_CALLBACKS */ 00116 } COMP_HandleTypeDef; 00117 00118 #if (USE_HAL_COMP_REGISTER_CALLBACKS == 1) 00119 /** 00120 * @brief HAL COMP Callback ID enumeration definition 00121 */ 00122 typedef enum 00123 { 00124 HAL_COMP_TRIGGER_CB_ID = 0x00U, /*!< COMP trigger callback ID */ 00125 HAL_COMP_MSPINIT_CB_ID = 0x01U, /*!< COMP Msp Init callback ID */ 00126 HAL_COMP_MSPDEINIT_CB_ID = 0x02U /*!< COMP Msp DeInit callback ID */ 00127 } HAL_COMP_CallbackIDTypeDef; 00128 00129 /** 00130 * @brief HAL COMP Callback pointer definition 00131 */ 00132 typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer to a COMP callback function */ 00133 00134 #endif /* USE_HAL_COMP_REGISTER_CALLBACKS */ 00135 00136 /** 00137 * @} 00138 */ 00139 00140 /* Exported constants --------------------------------------------------------*/ 00141 /** @defgroup COMP_Exported_Constants COMP Exported Constants 00142 * @{ 00143 */ 00144 00145 /** @defgroup COMP_Error_Code COMP Error Code 00146 * @{ 00147 */ 00148 #define HAL_COMP_ERROR_NONE (0x00UL) /*!< No error */ 00149 #if (USE_HAL_COMP_REGISTER_CALLBACKS == 1) 00150 #define HAL_COMP_ERROR_INVALID_CALLBACK (0x01UL) /*!< Invalid Callback error */ 00151 #endif /* USE_HAL_COMP_REGISTER_CALLBACKS */ 00152 /** 00153 * @} 00154 */ 00155 00156 #if defined(COMP2) 00157 /** @defgroup COMP_WindowMode COMP Window Mode 00158 * @{ 00159 */ 00160 #define COMP_WINDOWMODE_DISABLE (0x00000000UL) /*!< Window mode disable: Comparators instances pair COMP1 and COMP2 are independent */ 00161 #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). */ 00162 /** 00163 * @} 00164 */ 00165 #endif /* COMP2 */ 00166 00167 /** @defgroup COMP_PowerMode COMP power mode 00168 * @{ 00169 */ 00170 /* Note: For the characteristics of comparator power modes */ 00171 /* (propagation delay and power consumption), */ 00172 /* refer to device datasheet. */ 00173 #define COMP_POWERMODE_HIGHSPEED (0x00000000UL) /*!< High Speed */ 00174 #define COMP_POWERMODE_MEDIUMSPEED (COMP_CSR_PWRMODE_0) /*!< Medium Speed */ 00175 #define COMP_POWERMODE_ULTRALOWPOWER (COMP_CSR_PWRMODE) /*!< Ultra-low power mode */ 00176 /** 00177 * @} 00178 */ 00179 00180 /** @defgroup COMP_InputPlus COMP input plus (non-inverting input) 00181 * @{ 00182 */ 00183 #define COMP_INPUT_PLUS_IO1 (0x00000000UL) /*!< Comparator input plus connected to IO1 (pin PC5 for COMP1, pin PB4 for COMP2) */ 00184 #define COMP_INPUT_PLUS_IO2 (COMP_CSR_INPSEL_0) /*!< Comparator input plus connected to IO2 (pin PB2 for COMP1, pin PB6 for COMP2) */ 00185 #if defined(COMP_CSR_INPSEL_1) 00186 #define COMP_INPUT_PLUS_IO3 (COMP_CSR_INPSEL_1) /*!< Comparator input plus connected to IO3 (pin PA1 for COMP1, pin PA3 for COMP2) */ 00187 #endif 00188 /** 00189 * @} 00190 */ 00191 00192 /** @defgroup COMP_InputMinus COMP input minus (inverting input) 00193 * @{ 00194 */ 00195 #define COMP_INPUT_MINUS_1_4VREFINT ( COMP_CSR_SCALEN | COMP_CSR_BRGEN) /*!< Comparator input minus connected to 1/4 VrefInt */ 00196 #define COMP_INPUT_MINUS_1_2VREFINT ( COMP_CSR_INMSEL_0 | COMP_CSR_SCALEN | COMP_CSR_BRGEN) /*!< Comparator input minus connected to 1/2 VrefInt */ 00197 #define COMP_INPUT_MINUS_3_4VREFINT ( COMP_CSR_INMSEL_1 | COMP_CSR_SCALEN | COMP_CSR_BRGEN) /*!< Comparator input minus connected to 3/4 VrefInt */ 00198 #define COMP_INPUT_MINUS_VREFINT ( COMP_CSR_INMSEL_1 | COMP_CSR_INMSEL_0 | COMP_CSR_SCALEN ) /*!< Comparator input minus connected to VrefInt */ 00199 #define COMP_INPUT_MINUS_DAC1_CH1 (COMP_CSR_INMSEL_2 ) /*!< Comparator input minus connected to DAC1 channel 1 (DAC_OUT1) */ 00200 #if defined(DAC_CHANNEL2_SUPPORT) 00201 #define COMP_INPUT_MINUS_DAC1_CH2 (COMP_CSR_INMSEL_2 | COMP_CSR_INMSEL_0) /*!< Comparator input minus connected to DAC1 channel 2 (DAC_OUT2) */ 00202 #endif /* DAC_CHANNEL2_SUPPORT */ 00203 #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) */ 00204 #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) */ 00205 #if defined(COMP_CSR_INMESEL_1) 00206 #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) */ 00207 #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) */ 00208 #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) */ 00209 #endif /* COMP_CSR_INMESEL_1 */ 00210 /** 00211 * @} 00212 */ 00213 00214 /** @defgroup COMP_Hysteresis COMP hysteresis 00215 * @{ 00216 */ 00217 #define COMP_HYSTERESIS_NONE (0x00000000UL) /*!< No hysteresis */ 00218 #define COMP_HYSTERESIS_LOW ( COMP_CSR_HYST_0) /*!< Hysteresis level low */ 00219 #define COMP_HYSTERESIS_MEDIUM (COMP_CSR_HYST_1 ) /*!< Hysteresis level medium */ 00220 #define COMP_HYSTERESIS_HIGH (COMP_CSR_HYST_1 | COMP_CSR_HYST_0) /*!< Hysteresis level high */ 00221 /** 00222 * @} 00223 */ 00224 00225 /** @defgroup COMP_OutputPolarity COMP output Polarity 00226 * @{ 00227 */ 00228 #define COMP_OUTPUTPOL_NONINVERTED (0x00000000UL) /*!< COMP output level is not inverted (comparator output is high when the input plus is at a higher voltage than the input minus) */ 00229 #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) */ 00230 /** 00231 * @} 00232 */ 00233 00234 /** @defgroup COMP_BlankingSrce COMP blanking source 00235 * @{ 00236 */ 00237 #define COMP_BLANKINGSRC_NONE (0x00000000UL) /*!<Comparator output without blanking */ 00238 #define COMP_BLANKINGSRC_TIM1_OC5_COMP1 (COMP_CSR_BLANKING_0) /*!< Comparator output blanking source TIM1 OC5 (specific to COMP instance: COMP1) */ 00239 #define COMP_BLANKINGSRC_TIM2_OC3_COMP1 (COMP_CSR_BLANKING_1) /*!< Comparator output blanking source TIM2 OC3 (specific to COMP instance: COMP1) */ 00240 #define COMP_BLANKINGSRC_TIM3_OC3_COMP1 (COMP_CSR_BLANKING_2) /*!< Comparator output blanking source TIM3 OC3 (specific to COMP instance: COMP1) */ 00241 #define COMP_BLANKINGSRC_TIM3_OC4_COMP2 (COMP_CSR_BLANKING_0) /*!< Comparator output blanking source TIM3 OC4 (specific to COMP instance: COMP2) */ 00242 #define COMP_BLANKINGSRC_TIM8_OC5_COMP2 (COMP_CSR_BLANKING_1) /*!< Comparator output blanking source TIM8 OC5 (specific to COMP instance: COMP2) */ 00243 #define COMP_BLANKINGSRC_TIM15_OC1_COMP2 (COMP_CSR_BLANKING_2) /*!< Comparator output blanking source TIM15 OC1 (specific to COMP instance: COMP2) */ 00244 /** 00245 * @} 00246 */ 00247 00248 /** @defgroup COMP_OutputLevel COMP Output Level 00249 * @{ 00250 */ 00251 /* Note: Comparator output level values are fixed to "0" and "1", */ 00252 /* corresponding COMP register bit is managed by HAL function to match */ 00253 /* with these values (independently of bit position in register). */ 00254 00255 /* When output polarity is not inverted, comparator output is low when 00256 the input plus is at a lower voltage than the input minus */ 00257 #define COMP_OUTPUT_LEVEL_LOW (0x00000000UL) 00258 /* When output polarity is not inverted, comparator output is high when 00259 the input plus is at a higher voltage than the input minus */ 00260 #define COMP_OUTPUT_LEVEL_HIGH (0x00000001UL) 00261 /** 00262 * @} 00263 */ 00264 00265 /** @defgroup COMP_EXTI_TriggerMode COMP output to EXTI 00266 * @{ 00267 */ 00268 #define COMP_TRIGGERMODE_NONE (0x00000000UL) /*!< Comparator output triggering no External Interrupt Line */ 00269 #define COMP_TRIGGERMODE_IT_RISING (COMP_EXTI_IT | COMP_EXTI_RISING) /*!< Comparator output triggering External Interrupt Line event with interruption, on rising edge */ 00270 #define COMP_TRIGGERMODE_IT_FALLING (COMP_EXTI_IT | COMP_EXTI_FALLING) /*!< Comparator output triggering External Interrupt Line event with interruption, on falling edge */ 00271 #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 */ 00272 #define COMP_TRIGGERMODE_EVENT_RISING (COMP_EXTI_EVENT | COMP_EXTI_RISING) /*!< Comparator output triggering External Interrupt Line event only (without interruption), on rising edge */ 00273 #define COMP_TRIGGERMODE_EVENT_FALLING (COMP_EXTI_EVENT | COMP_EXTI_FALLING) /*!< Comparator output triggering External Interrupt Line event only (without interruption), on falling edge */ 00274 #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 */ 00275 /** 00276 * @} 00277 */ 00278 00279 /** 00280 * @} 00281 */ 00282 00283 /* Exported macro ------------------------------------------------------------*/ 00284 /** @defgroup COMP_Exported_Macros COMP Exported Macros 00285 * @{ 00286 */ 00287 00288 /** @defgroup COMP_Handle_Management COMP Handle Management 00289 * @{ 00290 */ 00291 00292 /** @brief Reset COMP handle state. 00293 * @param __HANDLE__ COMP handle 00294 * @retval None 00295 */ 00296 #if (USE_HAL_COMP_REGISTER_CALLBACKS == 1) 00297 #define __HAL_COMP_RESET_HANDLE_STATE(__HANDLE__) do{ \ 00298 (__HANDLE__)->State = HAL_COMP_STATE_RESET; \ 00299 (__HANDLE__)->MspInitCallback = NULL; \ 00300 (__HANDLE__)->MspDeInitCallback = NULL; \ 00301 } while(0) 00302 #else 00303 #define __HAL_COMP_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_COMP_STATE_RESET) 00304 #endif /* USE_HAL_COMP_REGISTER_CALLBACKS */ 00305 00306 /** 00307 * @brief Clear COMP error code (set it to no error code "HAL_COMP_ERROR_NONE"). 00308 * @param __HANDLE__ COMP handle 00309 * @retval None 00310 */ 00311 #define COMP_CLEAR_ERRORCODE(__HANDLE__) ((__HANDLE__)->ErrorCode = HAL_COMP_ERROR_NONE) 00312 00313 /** 00314 * @brief Enable the specified comparator. 00315 * @param __HANDLE__ COMP handle 00316 * @retval None 00317 */ 00318 #define __HAL_COMP_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_EN) 00319 00320 /** 00321 * @brief Disable the specified comparator. 00322 * @param __HANDLE__ COMP handle 00323 * @retval None 00324 */ 00325 #define __HAL_COMP_DISABLE(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_EN) 00326 00327 /** 00328 * @brief Lock the specified comparator configuration. 00329 * @note Using this macro induce HAL COMP handle state machine being no 00330 * more in line with COMP instance state. 00331 * To keep HAL COMP handle state machine updated, it is recommended 00332 * to use function "HAL_COMP_Lock')". 00333 * @param __HANDLE__ COMP handle 00334 * @retval None 00335 */ 00336 #define __HAL_COMP_LOCK(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_LOCK) 00337 00338 /** 00339 * @brief Check whether the specified comparator is locked. 00340 * @param __HANDLE__ COMP handle 00341 * @retval Value 0 if COMP instance is not locked, value 1 if COMP instance is locked 00342 */ 00343 #define __HAL_COMP_IS_LOCKED(__HANDLE__) (READ_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_LOCK) == COMP_CSR_LOCK) 00344 00345 /** 00346 * @} 00347 */ 00348 00349 /** @defgroup COMP_Exti_Management COMP external interrupt line management 00350 * @{ 00351 */ 00352 00353 /** 00354 * @brief Enable the COMP1 EXTI line rising edge trigger. 00355 * @retval None 00356 */ 00357 #define __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE() LL_EXTI_EnableRisingTrig_0_31(COMP_EXTI_LINE_COMP1) 00358 00359 /** 00360 * @brief Disable the COMP1 EXTI line rising edge trigger. 00361 * @retval None 00362 */ 00363 #define __HAL_COMP_COMP1_EXTI_DISABLE_RISING_EDGE() LL_EXTI_DisableRisingTrig_0_31(COMP_EXTI_LINE_COMP1) 00364 00365 /** 00366 * @brief Enable the COMP1 EXTI line falling edge trigger. 00367 * @retval None 00368 */ 00369 #define __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE() LL_EXTI_EnableFallingTrig_0_31(COMP_EXTI_LINE_COMP1) 00370 00371 /** 00372 * @brief Disable the COMP1 EXTI line falling edge trigger. 00373 * @retval None 00374 */ 00375 #define __HAL_COMP_COMP1_EXTI_DISABLE_FALLING_EDGE() LL_EXTI_DisableFallingTrig_0_31(COMP_EXTI_LINE_COMP1) 00376 00377 /** 00378 * @brief Enable the COMP1 EXTI line rising & falling edge trigger. 00379 * @retval None 00380 */ 00381 #define __HAL_COMP_COMP1_EXTI_ENABLE_RISING_FALLING_EDGE() do { \ 00382 LL_EXTI_EnableRisingTrig_0_31(COMP_EXTI_LINE_COMP1); \ 00383 LL_EXTI_EnableFallingTrig_0_31(COMP_EXTI_LINE_COMP1); \ 00384 } while(0) 00385 00386 /** 00387 * @brief Disable the COMP1 EXTI line rising & falling edge trigger. 00388 * @retval None 00389 */ 00390 #define __HAL_COMP_COMP1_EXTI_DISABLE_RISING_FALLING_EDGE() do { \ 00391 LL_EXTI_DisableRisingTrig_0_31(COMP_EXTI_LINE_COMP1); \ 00392 LL_EXTI_DisableFallingTrig_0_31(COMP_EXTI_LINE_COMP1); \ 00393 } while(0) 00394 00395 /** 00396 * @brief Enable the COMP1 EXTI line in interrupt mode. 00397 * @retval None 00398 */ 00399 #define __HAL_COMP_COMP1_EXTI_ENABLE_IT() LL_EXTI_EnableIT_0_31(COMP_EXTI_LINE_COMP1) 00400 00401 /** 00402 * @brief Disable the COMP1 EXTI line in interrupt mode. 00403 * @retval None 00404 */ 00405 #define __HAL_COMP_COMP1_EXTI_DISABLE_IT() LL_EXTI_DisableIT_0_31(COMP_EXTI_LINE_COMP1) 00406 00407 /** 00408 * @brief Generate a software interrupt on the COMP1 EXTI line. 00409 * @retval None 00410 */ 00411 #define __HAL_COMP_COMP1_EXTI_GENERATE_SWIT() LL_EXTI_GenerateSWI_0_31(COMP_EXTI_LINE_COMP1) 00412 00413 /** 00414 * @brief Enable the COMP1 EXTI line in event mode. 00415 * @retval None 00416 */ 00417 #define __HAL_COMP_COMP1_EXTI_ENABLE_EVENT() LL_EXTI_EnableEvent_0_31(COMP_EXTI_LINE_COMP1) 00418 00419 /** 00420 * @brief Disable the COMP1 EXTI line in event mode. 00421 * @retval None 00422 */ 00423 #define __HAL_COMP_COMP1_EXTI_DISABLE_EVENT() LL_EXTI_DisableEvent_0_31(COMP_EXTI_LINE_COMP1) 00424 00425 /** 00426 * @brief Check whether the COMP1 EXTI line flag is set. 00427 * @retval RESET or SET 00428 */ 00429 #define __HAL_COMP_COMP1_EXTI_GET_FLAG() LL_EXTI_IsActiveFlag_0_31(COMP_EXTI_LINE_COMP1) 00430 00431 /** 00432 * @brief Clear the COMP1 EXTI flag. 00433 * @retval None 00434 */ 00435 #define __HAL_COMP_COMP1_EXTI_CLEAR_FLAG() LL_EXTI_ClearFlag_0_31(COMP_EXTI_LINE_COMP1) 00436 00437 #if defined(COMP2) 00438 /** 00439 * @brief Enable the COMP2 EXTI line rising edge trigger. 00440 * @retval None 00441 */ 00442 #define __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE() LL_EXTI_EnableRisingTrig_0_31(COMP_EXTI_LINE_COMP2) 00443 00444 /** 00445 * @brief Disable the COMP2 EXTI line rising edge trigger. 00446 * @retval None 00447 */ 00448 #define __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE() LL_EXTI_DisableRisingTrig_0_31(COMP_EXTI_LINE_COMP2) 00449 00450 /** 00451 * @brief Enable the COMP2 EXTI line falling edge trigger. 00452 * @retval None 00453 */ 00454 #define __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE() LL_EXTI_EnableFallingTrig_0_31(COMP_EXTI_LINE_COMP2) 00455 00456 /** 00457 * @brief Disable the COMP2 EXTI line falling edge trigger. 00458 * @retval None 00459 */ 00460 #define __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE() LL_EXTI_DisableFallingTrig_0_31(COMP_EXTI_LINE_COMP2) 00461 00462 /** 00463 * @brief Enable the COMP2 EXTI line rising & falling edge trigger. 00464 * @retval None 00465 */ 00466 #define __HAL_COMP_COMP2_EXTI_ENABLE_RISING_FALLING_EDGE() do { \ 00467 LL_EXTI_EnableRisingTrig_0_31(COMP_EXTI_LINE_COMP2); \ 00468 LL_EXTI_EnableFallingTrig_0_31(COMP_EXTI_LINE_COMP2); \ 00469 } while(0) 00470 00471 /** 00472 * @brief Disable the COMP2 EXTI line rising & falling edge trigger. 00473 * @retval None 00474 */ 00475 #define __HAL_COMP_COMP2_EXTI_DISABLE_RISING_FALLING_EDGE() do { \ 00476 LL_EXTI_DisableRisingTrig_0_31(COMP_EXTI_LINE_COMP2); \ 00477 LL_EXTI_DisableFallingTrig_0_31(COMP_EXTI_LINE_COMP2); \ 00478 } while(0) 00479 00480 /** 00481 * @brief Enable the COMP2 EXTI line in interrupt mode. 00482 * @retval None 00483 */ 00484 #define __HAL_COMP_COMP2_EXTI_ENABLE_IT() LL_EXTI_EnableIT_0_31(COMP_EXTI_LINE_COMP2) 00485 00486 /** 00487 * @brief Disable the COMP2 EXTI line in interrupt mode. 00488 * @retval None 00489 */ 00490 #define __HAL_COMP_COMP2_EXTI_DISABLE_IT() LL_EXTI_DisableIT_0_31(COMP_EXTI_LINE_COMP2) 00491 00492 /** 00493 * @brief Generate a software interrupt on the COMP2 EXTI line. 00494 * @retval None 00495 */ 00496 #define __HAL_COMP_COMP2_EXTI_GENERATE_SWIT() LL_EXTI_GenerateSWI_0_31(COMP_EXTI_LINE_COMP2) 00497 00498 /** 00499 * @brief Enable the COMP2 EXTI line in event mode. 00500 * @retval None 00501 */ 00502 #define __HAL_COMP_COMP2_EXTI_ENABLE_EVENT() LL_EXTI_EnableEvent_0_31(COMP_EXTI_LINE_COMP2) 00503 00504 /** 00505 * @brief Disable the COMP2 EXTI line in event mode. 00506 * @retval None 00507 */ 00508 #define __HAL_COMP_COMP2_EXTI_DISABLE_EVENT() LL_EXTI_DisableEvent_0_31(COMP_EXTI_LINE_COMP2) 00509 00510 /** 00511 * @brief Check whether the COMP2 EXTI line flag is set. 00512 * @retval RESET or SET 00513 */ 00514 #define __HAL_COMP_COMP2_EXTI_GET_FLAG() LL_EXTI_IsActiveFlag_0_31(COMP_EXTI_LINE_COMP2) 00515 00516 /** 00517 * @brief Clear the COMP2 EXTI flag. 00518 * @retval None 00519 */ 00520 #define __HAL_COMP_COMP2_EXTI_CLEAR_FLAG() LL_EXTI_ClearFlag_0_31(COMP_EXTI_LINE_COMP2) 00521 00522 #endif /* COMP2 */ 00523 /** 00524 * @} 00525 */ 00526 00527 /** 00528 * @} 00529 */ 00530 00531 00532 /* Private types -------------------------------------------------------------*/ 00533 /* Private constants ---------------------------------------------------------*/ 00534 /** @defgroup COMP_Private_Constants COMP Private Constants 00535 * @{ 00536 */ 00537 00538 /** @defgroup COMP_ExtiLine COMP EXTI Lines 00539 * @{ 00540 */ 00541 #define COMP_EXTI_LINE_COMP1 (LL_EXTI_LINE_21) /*!< EXTI line 21 connected to COMP1 output */ 00542 #if defined(COMP2) 00543 #define COMP_EXTI_LINE_COMP2 (LL_EXTI_LINE_22) /*!< EXTI line 22 connected to COMP2 output */ 00544 #endif /* COMP2 */ 00545 /** 00546 * @} 00547 */ 00548 00549 /** @defgroup COMP_ExtiLine COMP EXTI Lines 00550 * @{ 00551 */ 00552 #define COMP_EXTI_IT (0x00000001UL) /*!< EXTI line event with interruption */ 00553 #define COMP_EXTI_EVENT (0x00000002UL) /*!< EXTI line event only (without interruption) */ 00554 #define COMP_EXTI_RISING (0x00000010UL) /*!< EXTI line event on rising edge */ 00555 #define COMP_EXTI_FALLING (0x00000020UL) /*!< EXTI line event on falling edge */ 00556 /** 00557 * @} 00558 */ 00559 00560 /** 00561 * @} 00562 */ 00563 00564 /* Private macros ------------------------------------------------------------*/ 00565 /** @defgroup COMP_Private_Macros COMP Private Macros 00566 * @{ 00567 */ 00568 00569 /** @defgroup COMP_GET_EXTI_LINE COMP private macros to get EXTI line associated with comparators 00570 * @{ 00571 */ 00572 /** 00573 * @brief Get the specified EXTI line for a comparator instance. 00574 * @param __INSTANCE__ specifies the COMP instance. 00575 * @retval value of @ref COMP_ExtiLine 00576 */ 00577 #if defined(COMP2) 00578 #define COMP_GET_EXTI_LINE(__INSTANCE__) (((__INSTANCE__) == COMP1) ? COMP_EXTI_LINE_COMP1 \ 00579 : COMP_EXTI_LINE_COMP2) 00580 #else 00581 #define COMP_GET_EXTI_LINE(__INSTANCE__) COMP_EXTI_LINE_COMP1 00582 #endif /* COMP2 */ 00583 /** 00584 * @} 00585 */ 00586 00587 /** @defgroup COMP_IS_COMP_Private_Definitions COMP private macros to check input parameters 00588 * @{ 00589 */ 00590 #if defined(COMP2) 00591 #define IS_COMP_WINDOWMODE(__WINDOWMODE__) (((__WINDOWMODE__) == COMP_WINDOWMODE_DISABLE) || \ 00592 ((__WINDOWMODE__) == COMP_WINDOWMODE_COMP1_INPUT_PLUS_COMMON) ) 00593 #endif /* COMP2 */ 00594 00595 #define IS_COMP_POWERMODE(__POWERMODE__) (((__POWERMODE__) == COMP_POWERMODE_HIGHSPEED) || \ 00596 ((__POWERMODE__) == COMP_POWERMODE_MEDIUMSPEED) || \ 00597 ((__POWERMODE__) == COMP_POWERMODE_ULTRALOWPOWER) ) 00598 00599 #if defined(COMP_CSR_INPSEL_1) 00600 #define IS_COMP_INPUT_PLUS(__COMP_INSTANCE__, __INPUT_PLUS__) (((__INPUT_PLUS__) == COMP_INPUT_PLUS_IO1) || \ 00601 ((__INPUT_PLUS__) == COMP_INPUT_PLUS_IO2) || \ 00602 ((__INPUT_PLUS__) == COMP_INPUT_PLUS_IO3)) 00603 #else 00604 #define IS_COMP_INPUT_PLUS(__COMP_INSTANCE__, __INPUT_PLUS__) (((__INPUT_PLUS__) == COMP_INPUT_PLUS_IO1) || \ 00605 ((__INPUT_PLUS__) == COMP_INPUT_PLUS_IO2)) 00606 #endif 00607 00608 /* Note: On this STM32 series, comparator input minus parameters are */ 00609 /* the same on all COMP instances. */ 00610 /* However, comparator instance kept as macro parameter for */ 00611 /* compatibility with other STM32 families. */ 00612 #if defined(COMP_CSR_INMESEL_1) && defined(DAC_CHANNEL2_SUPPORT) 00613 #define IS_COMP_INPUT_MINUS(__COMP_INSTANCE__, __INPUT_MINUS__) (((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_4VREFINT) || \ 00614 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_2VREFINT) || \ 00615 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_3_4VREFINT) || \ 00616 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_VREFINT) || \ 00617 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_DAC1_CH1) || \ 00618 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_DAC1_CH2) || \ 00619 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO1) || \ 00620 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO2) || \ 00621 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO3) || \ 00622 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO4) || \ 00623 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO5)) 00624 #elif defined(COMP_CSR_INMESEL_1) 00625 #define IS_COMP_INPUT_MINUS(__COMP_INSTANCE__, __INPUT_MINUS__) (((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_4VREFINT) || \ 00626 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_2VREFINT) || \ 00627 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_3_4VREFINT) || \ 00628 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_VREFINT) || \ 00629 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_DAC1_CH1) || \ 00630 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO1) || \ 00631 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO2) || \ 00632 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO3) || \ 00633 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO4) || \ 00634 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO5)) 00635 #elif defined(DAC_CHANNEL2_SUPPORT) 00636 #define IS_COMP_INPUT_MINUS(__COMP_INSTANCE__, __INPUT_MINUS__) (((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_4VREFINT) || \ 00637 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_2VREFINT) || \ 00638 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_3_4VREFINT) || \ 00639 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_VREFINT) || \ 00640 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_DAC1_CH1) || \ 00641 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_DAC1_CH2) || \ 00642 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO1) || \ 00643 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO2)) 00644 #else 00645 #define IS_COMP_INPUT_MINUS(__COMP_INSTANCE__, __INPUT_MINUS__) (((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_4VREFINT) || \ 00646 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_2VREFINT) || \ 00647 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_3_4VREFINT) || \ 00648 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_VREFINT) || \ 00649 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_DAC1_CH1) || \ 00650 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO1) || \ 00651 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO2)) 00652 #endif /* COMP_CSR_INMESEL_1 && DAC_CHANNEL2_SUPPORT */ 00653 00654 #define IS_COMP_HYSTERESIS(__HYSTERESIS__) (((__HYSTERESIS__) == COMP_HYSTERESIS_NONE) || \ 00655 ((__HYSTERESIS__) == COMP_HYSTERESIS_LOW) || \ 00656 ((__HYSTERESIS__) == COMP_HYSTERESIS_MEDIUM) || \ 00657 ((__HYSTERESIS__) == COMP_HYSTERESIS_HIGH)) 00658 00659 #define IS_COMP_OUTPUTPOL(__POL__) (((__POL__) == COMP_OUTPUTPOL_NONINVERTED) || \ 00660 ((__POL__) == COMP_OUTPUTPOL_INVERTED)) 00661 00662 #if defined(COMP2) 00663 #define IS_COMP_BLANKINGSRCE(__OUTPUT_BLANKING_SOURCE__) \ 00664 ( ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_NONE) \ 00665 || ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM1_OC5_COMP1) \ 00666 || ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM2_OC3_COMP1) \ 00667 || ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM3_OC3_COMP1) \ 00668 || ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM3_OC4_COMP2) \ 00669 || ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM8_OC5_COMP2) \ 00670 || ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM15_OC1_COMP2) \ 00671 ) 00672 #else 00673 #if defined(TIM3) 00674 #define IS_COMP_BLANKINGSRCE(__OUTPUT_BLANKING_SOURCE__) \ 00675 ( ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_NONE) \ 00676 || ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM1_OC5_COMP1) \ 00677 || ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM2_OC3_COMP1) \ 00678 || ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM3_OC3_COMP1) \ 00679 ) 00680 #else 00681 #define IS_COMP_BLANKINGSRCE(__OUTPUT_BLANKING_SOURCE__) \ 00682 ( ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_NONE) \ 00683 || ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM1_OC5_COMP1) \ 00684 || ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM2_OC3_COMP1) \ 00685 ) 00686 #endif /* TIM3 */ 00687 #endif /* COMP2 */ 00688 00689 #if defined(COMP2) 00690 #define IS_COMP_BLANKINGSRC_INSTANCE(__INSTANCE__, __OUTPUT_BLANKING_SOURCE__) \ 00691 ((((__INSTANCE__) == COMP1) && \ 00692 (((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_NONE) || \ 00693 ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM1_OC5_COMP1) || \ 00694 ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM2_OC3_COMP1) || \ 00695 ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM3_OC3_COMP1))) \ 00696 || \ 00697 (((__INSTANCE__) == COMP2) && \ 00698 (((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_NONE) || \ 00699 ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM3_OC4_COMP2) || \ 00700 ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM8_OC5_COMP2) || \ 00701 ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM15_OC1_COMP2)))) 00702 #else 00703 #if defined(TIM3) 00704 #define IS_COMP_BLANKINGSRC_INSTANCE(__INSTANCE__, __OUTPUT_BLANKING_SOURCE__) \ 00705 (((__INSTANCE__) == COMP1) && \ 00706 (((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_NONE) || \ 00707 ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM1_OC5_COMP1) || \ 00708 ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM2_OC3_COMP1) || \ 00709 ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM3_OC3_COMP1))) 00710 #else 00711 #define IS_COMP_BLANKINGSRC_INSTANCE(__INSTANCE__, __OUTPUT_BLANKING_SOURCE__) \ 00712 (((__INSTANCE__) == COMP1) && \ 00713 (((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_NONE) || \ 00714 ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM1_OC5_COMP1) || \ 00715 ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM2_OC3_COMP1) )) 00716 #endif /* TIM3 */ 00717 #endif /* COMP2 */ 00718 00719 #define IS_COMP_TRIGGERMODE(__MODE__) (((__MODE__) == COMP_TRIGGERMODE_NONE) || \ 00720 ((__MODE__) == COMP_TRIGGERMODE_IT_RISING) || \ 00721 ((__MODE__) == COMP_TRIGGERMODE_IT_FALLING) || \ 00722 ((__MODE__) == COMP_TRIGGERMODE_IT_RISING_FALLING) || \ 00723 ((__MODE__) == COMP_TRIGGERMODE_EVENT_RISING) || \ 00724 ((__MODE__) == COMP_TRIGGERMODE_EVENT_FALLING) || \ 00725 ((__MODE__) == COMP_TRIGGERMODE_EVENT_RISING_FALLING)) 00726 00727 #define IS_COMP_OUTPUT_LEVEL(__OUTPUT_LEVEL__) (((__OUTPUT_LEVEL__) == COMP_OUTPUT_LEVEL_LOW) || \ 00728 ((__OUTPUT_LEVEL__) == COMP_OUTPUT_LEVEL_HIGH)) 00729 00730 /** 00731 * @} 00732 */ 00733 00734 /** 00735 * @} 00736 */ 00737 00738 00739 /* Exported functions --------------------------------------------------------*/ 00740 /** @addtogroup COMP_Exported_Functions 00741 * @{ 00742 */ 00743 00744 /** @addtogroup COMP_Exported_Functions_Group1 00745 * @{ 00746 */ 00747 00748 /* Initialization and de-initialization functions **********************************/ 00749 HAL_StatusTypeDef HAL_COMP_Init(COMP_HandleTypeDef *hcomp); 00750 HAL_StatusTypeDef HAL_COMP_DeInit(COMP_HandleTypeDef *hcomp); 00751 void HAL_COMP_MspInit(COMP_HandleTypeDef *hcomp); 00752 void HAL_COMP_MspDeInit(COMP_HandleTypeDef *hcomp); 00753 00754 #if (USE_HAL_COMP_REGISTER_CALLBACKS == 1) 00755 /* Callbacks Register/UnRegister functions ***********************************/ 00756 HAL_StatusTypeDef HAL_COMP_RegisterCallback(COMP_HandleTypeDef *hcomp, HAL_COMP_CallbackIDTypeDef CallbackID, 00757 pCOMP_CallbackTypeDef pCallback); 00758 HAL_StatusTypeDef HAL_COMP_UnRegisterCallback(COMP_HandleTypeDef *hcomp, HAL_COMP_CallbackIDTypeDef CallbackID); 00759 #endif /* USE_HAL_COMP_REGISTER_CALLBACKS */ 00760 /** 00761 * @} 00762 */ 00763 00764 /* IO operation functions *****************************************************/ 00765 /** @addtogroup COMP_Exported_Functions_Group2 00766 * @{ 00767 */ 00768 HAL_StatusTypeDef HAL_COMP_Start(COMP_HandleTypeDef *hcomp); 00769 HAL_StatusTypeDef HAL_COMP_Stop(COMP_HandleTypeDef *hcomp); 00770 void HAL_COMP_IRQHandler(COMP_HandleTypeDef *hcomp); 00771 /** 00772 * @} 00773 */ 00774 00775 /* Peripheral Control functions ************************************************/ 00776 /** @addtogroup COMP_Exported_Functions_Group3 00777 * @{ 00778 */ 00779 HAL_StatusTypeDef HAL_COMP_Lock(COMP_HandleTypeDef *hcomp); 00780 uint32_t HAL_COMP_GetOutputLevel(COMP_HandleTypeDef *hcomp); 00781 /* Callback in interrupt mode */ 00782 void HAL_COMP_TriggerCallback(COMP_HandleTypeDef *hcomp); 00783 /** 00784 * @} 00785 */ 00786 00787 /* Peripheral State functions **************************************************/ 00788 /** @addtogroup COMP_Exported_Functions_Group4 00789 * @{ 00790 */ 00791 HAL_COMP_StateTypeDef HAL_COMP_GetState(COMP_HandleTypeDef *hcomp); 00792 uint32_t HAL_COMP_GetError(COMP_HandleTypeDef *hcomp); 00793 /** 00794 * @} 00795 */ 00796 00797 /** 00798 * @} 00799 */ 00800 00801 /** 00802 * @} 00803 */ 00804 #endif /* COMP1 || COMP2 */ 00805 /** 00806 * @} 00807 */ 00808 00809 #ifdef __cplusplus 00810 } 00811 #endif 00812 00813 #endif /* STM32L4xx_HAL_COMP_H */