The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
AnnaBridge
Date:
Wed Jun 21 17:31:38 2017 +0100
Revision:
145:64910690c574
Parent:
128:9bcdf88f62b0
Release 145 of the mbed library.

Who changed what in which revision?

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