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:
Kojto
Date:
Tue Feb 14 11:24:20 2017 +0000
Revision:
136:ef9c61f8c49f
Parent:
128:9bcdf88f62b0
Child:
165:d1b4690b3f8b
Release 136 of the mbed library

Ports for Upcoming Targets


Fixes and Changes

3432: Target STM USBHOST support https://github.com/ARMmbed/mbed-os/pull/3432
3181: NUCLEO_F207ZG extending PeripheralPins.c: all available alternate functions can be used now https://github.com/ARMmbed/mbed-os/pull/3181
3626: NUCLEO_F412ZG : Add USB Device +Host https://github.com/ARMmbed/mbed-os/pull/3626
3628: Fix warnings https://github.com/ARMmbed/mbed-os/pull/3628
3629: STM32: L0 LL layer https://github.com/ARMmbed/mbed-os/pull/3629
3632: IDE Export support for platform VK_RZ_A1H https://github.com/ARMmbed/mbed-os/pull/3632
3642: Missing IRQ pin fix for platform VK_RZ_A1H https://github.com/ARMmbed/mbed-os/pull/3642
3664: Fix ncs36510 sleep definitions https://github.com/ARMmbed/mbed-os/pull/3664
3655: [STM32F4] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3655
3657: [STM32L4] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3657
3658: [STM32F3] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3658
3685: STM32: I2C: reset state machine https://github.com/ARMmbed/mbed-os/pull/3685
3692: uVisor: Standardize available legacy heap and stack https://github.com/ARMmbed/mbed-os/pull/3692
3621: Fix for #2884, LPC824: export to LPCXpresso, target running with wron https://github.com/ARMmbed/mbed-os/pull/3621
3649: [STM32F7] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3649
3695: Enforce device_name is valid in targets.json https://github.com/ARMmbed/mbed-os/pull/3695
3723: NCS36510: spi_format function bug fix https://github.com/ARMmbed/mbed-os/pull/3723

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 128:9bcdf88f62b0 1 /**
<> 128:9bcdf88f62b0 2 ******************************************************************************
<> 128:9bcdf88f62b0 3 * @file stm32l1xx_hal_comp.h
<> 128:9bcdf88f62b0 4 * @author MCD Application Team
<> 128:9bcdf88f62b0 5 * @version V1.2.0
<> 128:9bcdf88f62b0 6 * @date 01-July-2016
<> 128:9bcdf88f62b0 7 * @brief Header file of COMP HAL module.
<> 128:9bcdf88f62b0 8 ******************************************************************************
<> 128:9bcdf88f62b0 9 * @attention
<> 128:9bcdf88f62b0 10 *
<> 128:9bcdf88f62b0 11 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
<> 128:9bcdf88f62b0 12 *
<> 128:9bcdf88f62b0 13 * Redistribution and use in source and binary forms, with or without modification,
<> 128:9bcdf88f62b0 14 * are permitted provided that the following conditions are met:
<> 128:9bcdf88f62b0 15 * 1. Redistributions of source code must retain the above copyright notice,
<> 128:9bcdf88f62b0 16 * this list of conditions and the following disclaimer.
<> 128:9bcdf88f62b0 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
<> 128:9bcdf88f62b0 18 * this list of conditions and the following disclaimer in the documentation
<> 128:9bcdf88f62b0 19 * and/or other materials provided with the distribution.
<> 128:9bcdf88f62b0 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
<> 128:9bcdf88f62b0 21 * may be used to endorse or promote products derived from this software
<> 128:9bcdf88f62b0 22 * without specific prior written permission.
<> 128:9bcdf88f62b0 23 *
<> 128:9bcdf88f62b0 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
<> 128:9bcdf88f62b0 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
<> 128:9bcdf88f62b0 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
<> 128:9bcdf88f62b0 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
<> 128:9bcdf88f62b0 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
<> 128:9bcdf88f62b0 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
<> 128:9bcdf88f62b0 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
<> 128:9bcdf88f62b0 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
<> 128:9bcdf88f62b0 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
<> 128:9bcdf88f62b0 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<> 128:9bcdf88f62b0 34 *
<> 128:9bcdf88f62b0 35 ******************************************************************************
<> 128:9bcdf88f62b0 36 */
<> 128:9bcdf88f62b0 37
<> 128:9bcdf88f62b0 38 /* Define to prevent recursive inclusion -------------------------------------*/
<> 128:9bcdf88f62b0 39 #ifndef __STM32L1xx_HAL_COMP_H
<> 128:9bcdf88f62b0 40 #define __STM32L1xx_HAL_COMP_H
<> 128:9bcdf88f62b0 41
<> 128:9bcdf88f62b0 42 #ifdef __cplusplus
<> 128:9bcdf88f62b0 43 extern "C" {
<> 128:9bcdf88f62b0 44 #endif
<> 128:9bcdf88f62b0 45
<> 128:9bcdf88f62b0 46 /* Includes ------------------------------------------------------------------*/
<> 128:9bcdf88f62b0 47 #include "stm32l1xx_hal_def.h"
<> 128:9bcdf88f62b0 48
<> 128:9bcdf88f62b0 49 /** @addtogroup STM32L1xx_HAL_Driver
<> 128:9bcdf88f62b0 50 * @{
<> 128:9bcdf88f62b0 51 */
<> 128:9bcdf88f62b0 52
<> 128:9bcdf88f62b0 53 /** @addtogroup COMP
<> 128:9bcdf88f62b0 54 * @{
<> 128:9bcdf88f62b0 55 */
<> 128:9bcdf88f62b0 56
<> 128:9bcdf88f62b0 57 /* Exported types ------------------------------------------------------------*/
<> 128:9bcdf88f62b0 58 /** @defgroup COMP_Exported_Types COMP Exported Types
<> 128:9bcdf88f62b0 59 * @{
<> 128:9bcdf88f62b0 60 */
<> 128:9bcdf88f62b0 61
<> 128:9bcdf88f62b0 62 /**
<> 128:9bcdf88f62b0 63 * @brief COMP Init structure definition
<> 128:9bcdf88f62b0 64 */
<> 128:9bcdf88f62b0 65 typedef struct
<> 128:9bcdf88f62b0 66 {
<> 128:9bcdf88f62b0 67
<> 128:9bcdf88f62b0 68 uint32_t InvertingInput; /*!< Selects the inverting input of the comparator.
<> 128:9bcdf88f62b0 69 This parameter can be a value of @ref COMP_InvertingInput
<> 128:9bcdf88f62b0 70 Note: Inverting input can be changed on the fly, while comparator is running.
<> 128:9bcdf88f62b0 71 Note: This feature is available on COMP2 only. If COMP1 is selected, this parameter is discarded (On COMP1, inverting input is fixed to Vrefint). */
<> 128:9bcdf88f62b0 72
<> 128:9bcdf88f62b0 73 uint32_t NonInvertingInput; /*!< Selects the non inverting input of the comparator.
<> 128:9bcdf88f62b0 74 This parameter can be a value of @ref COMPEx_NonInvertingInput */
<> 128:9bcdf88f62b0 75
<> 128:9bcdf88f62b0 76 uint32_t Output; /*!< Selects the output redirection of the comparator.
<> 128:9bcdf88f62b0 77 This parameter can be a value of @ref COMP_Output
<> 128:9bcdf88f62b0 78 Note: This feature is available on COMP2 only. If COMP1 is selected, this parameter is discarded. */
<> 128:9bcdf88f62b0 79
<> 128:9bcdf88f62b0 80 uint32_t Mode; /*!< Selects the operating consumption mode of the comparator
<> 128:9bcdf88f62b0 81 to adjust the speed/consumption.
<> 128:9bcdf88f62b0 82 This parameter can be a value of @ref COMP_Mode
<> 128:9bcdf88f62b0 83 Note: This feature is available on COMP2 only. If COMP1 is selected, this parameter is discarded. */
<> 128:9bcdf88f62b0 84
<> 128:9bcdf88f62b0 85 uint32_t WindowMode; /*!< Selects the window mode of the 2 comparators.
<> 128:9bcdf88f62b0 86 If enabled, non-inverting inputs of the 2 comparators are connected together and are using inputs of COMP2 only (COMP1 non-inverting input is no more accessible, even from ADC channel VCOMP).
<> 128:9bcdf88f62b0 87 This parameter can be a value of @ref COMP_WindowMode
<> 128:9bcdf88f62b0 88 Note: This feature must be enabled from COMP2 instance. If COMP1 is selected, this parameter is discarded. */
<> 128:9bcdf88f62b0 89
<> 128:9bcdf88f62b0 90 uint32_t TriggerMode; /*!< Selects the trigger mode of the comparator when using interruption on EXTI line (interrupt mode).
<> 128:9bcdf88f62b0 91 This parameter can be a value of @ref COMP_TriggerMode
<> 128:9bcdf88f62b0 92 Note: This feature is used with function "HAL_COMP_Start_IT()". In all other functions, this parameter is discarded. */
<> 128:9bcdf88f62b0 93
<> 128:9bcdf88f62b0 94 uint32_t NonInvertingInputPull; /*!< Selects the internal pulling resistor connected on non inverting input.
<> 128:9bcdf88f62b0 95 This parameter can be a value of @ref COMP_NonInvertingInputPull
<> 128:9bcdf88f62b0 96 Note: To avoid extra power consumption, only one resistor should be enabled at a time.
<> 128:9bcdf88f62b0 97 Note: This feature is available on COMP1 only. If COMP2 is selected, this parameter is discarded. */
<> 128:9bcdf88f62b0 98
<> 128:9bcdf88f62b0 99 }COMP_InitTypeDef;
<> 128:9bcdf88f62b0 100
<> 128:9bcdf88f62b0 101 /**
<> 128:9bcdf88f62b0 102 * @brief HAL State structures definition
<> 128:9bcdf88f62b0 103 */
<> 128:9bcdf88f62b0 104 typedef enum
<> 128:9bcdf88f62b0 105 {
<> 128:9bcdf88f62b0 106 HAL_COMP_STATE_RESET = 0x00, /*!< COMP not yet initialized or disabled */
<> 128:9bcdf88f62b0 107 HAL_COMP_STATE_READY = 0x01, /*!< COMP initialized and ready for use */
<> 128:9bcdf88f62b0 108 HAL_COMP_STATE_READY_LOCKED = 0x11, /*!< COMP initialized but the configuration is locked */
<> 128:9bcdf88f62b0 109 HAL_COMP_STATE_BUSY = 0x02, /*!< COMP is running */
<> 128:9bcdf88f62b0 110 HAL_COMP_STATE_BUSY_LOCKED = 0x12 /*!< COMP is running and the configuration is locked */
<> 128:9bcdf88f62b0 111 }HAL_COMP_StateTypeDef;
<> 128:9bcdf88f62b0 112
<> 128:9bcdf88f62b0 113 /**
<> 128:9bcdf88f62b0 114 * @brief COMP Handle Structure definition
<> 128:9bcdf88f62b0 115 */
<> 128:9bcdf88f62b0 116 typedef struct
<> 128:9bcdf88f62b0 117 {
<> 128:9bcdf88f62b0 118 COMP_TypeDef *Instance; /*!< Register base address */
<> 128:9bcdf88f62b0 119 COMP_InitTypeDef Init; /*!< COMP required parameters */
<> 128:9bcdf88f62b0 120 HAL_LockTypeDef Lock; /*!< Locking object */
<> 128:9bcdf88f62b0 121 __IO HAL_COMP_StateTypeDef State; /*!< COMP communication state */
<> 128:9bcdf88f62b0 122 } COMP_HandleTypeDef;
<> 128:9bcdf88f62b0 123
<> 128:9bcdf88f62b0 124 /**
<> 128:9bcdf88f62b0 125 * @}
<> 128:9bcdf88f62b0 126 */
<> 128:9bcdf88f62b0 127
<> 128:9bcdf88f62b0 128 /* Exported constants --------------------------------------------------------*/
<> 128:9bcdf88f62b0 129 /** @defgroup COMP_Exported_Constants COMP Exported Constants
<> 128:9bcdf88f62b0 130 * @{
<> 128:9bcdf88f62b0 131 */
<> 128:9bcdf88f62b0 132
<> 128:9bcdf88f62b0 133 /** @defgroup COMP_Output COMP Output
<> 128:9bcdf88f62b0 134 * @{
<> 128:9bcdf88f62b0 135 */
<> 128:9bcdf88f62b0 136 #define COMP_OUTPUT_TIM2IC4 (0x00000000U) /*!< COMP2 output connected to TIM2 Input Capture 4 */
<> 128:9bcdf88f62b0 137 #define COMP_OUTPUT_TIM2OCREFCLR ( COMP_CSR_OUTSEL_0) /*!< COMP2 output connected to TIM2 OCREF Clear */
<> 128:9bcdf88f62b0 138 #define COMP_OUTPUT_TIM3IC4 ( COMP_CSR_OUTSEL_1 ) /*!< COMP2 output connected to TIM3 Input Capture 4 */
<> 128:9bcdf88f62b0 139 #define COMP_OUTPUT_TIM3OCREFCLR ( COMP_CSR_OUTSEL_1 | COMP_CSR_OUTSEL_0) /*!< COMP2 output connected to TIM3 OCREF Clear */
<> 128:9bcdf88f62b0 140 #define COMP_OUTPUT_TIM4IC4 (COMP_CSR_OUTSEL_2 ) /*!< COMP2 output connected to TIM4 Input Capture 4 */
<> 128:9bcdf88f62b0 141 #define COMP_OUTPUT_TIM4OCREFCLR (COMP_CSR_OUTSEL_2 | COMP_CSR_OUTSEL_0) /*!< COMP2 output connected to TIM4 OCREF Clear */
<> 128:9bcdf88f62b0 142 #define COMP_OUTPUT_TIM10IC1 (COMP_CSR_OUTSEL_2 | COMP_CSR_OUTSEL_1 ) /*!< COMP2 output connected to TIM10 Input Capture 1 */
<> 128:9bcdf88f62b0 143 #define COMP_OUTPUT_NONE (COMP_CSR_OUTSEL_2 | COMP_CSR_OUTSEL_1 | COMP_CSR_OUTSEL_0) /*!< COMP2 output is not connected to other peripherals */
<> 128:9bcdf88f62b0 144
<> 128:9bcdf88f62b0 145 #define IS_COMP_OUTPUT(OUTPUT) (((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
<> 128:9bcdf88f62b0 146 ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
<> 128:9bcdf88f62b0 147 ((OUTPUT) == COMP_OUTPUT_TIM3IC4) || \
<> 128:9bcdf88f62b0 148 ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR) || \
<> 128:9bcdf88f62b0 149 ((OUTPUT) == COMP_OUTPUT_TIM4IC4) || \
<> 128:9bcdf88f62b0 150 ((OUTPUT) == COMP_OUTPUT_TIM4OCREFCLR) || \
<> 128:9bcdf88f62b0 151 ((OUTPUT) == COMP_OUTPUT_TIM10IC1) || \
<> 128:9bcdf88f62b0 152 ((OUTPUT) == COMP_OUTPUT_NONE) )
<> 128:9bcdf88f62b0 153 /**
<> 128:9bcdf88f62b0 154 * @}
<> 128:9bcdf88f62b0 155 */
<> 128:9bcdf88f62b0 156
<> 128:9bcdf88f62b0 157 /** @defgroup COMP_InvertingInput COMP InvertingInput
<> 128:9bcdf88f62b0 158 * @{
<> 128:9bcdf88f62b0 159 */
<> 128:9bcdf88f62b0 160 /* Inverting Input specific to COMP2 */
<> 128:9bcdf88f62b0 161 #define COMP_INVERTINGINPUT_IO ( COMP_CSR_INSEL_0) /*!< External I/O (COMP2_INM connected to pin PB3) connected to comparator 2 inverting input */
<> 128:9bcdf88f62b0 162 #define COMP_INVERTINGINPUT_VREFINT ( COMP_CSR_INSEL_1 ) /*!< VREFINT connected to comparator 2 inverting input */
<> 128:9bcdf88f62b0 163 #define COMP_INVERTINGINPUT_3_4VREFINT ( COMP_CSR_INSEL_1 | COMP_CSR_INSEL_0) /*!< 3/4 VREFINT connected to comparator 2 inverting input */
<> 128:9bcdf88f62b0 164 #define COMP_INVERTINGINPUT_1_2VREFINT (COMP_CSR_INSEL_2 ) /*!< 1/2 VREFINT connected to comparator 2 inverting input */
<> 128:9bcdf88f62b0 165 #define COMP_INVERTINGINPUT_1_4VREFINT (COMP_CSR_INSEL_2 | COMP_CSR_INSEL_0) /*!< 1/4 VREFINT connected to comparator 2 inverting input */
<> 128:9bcdf88f62b0 166 #define COMP_INVERTINGINPUT_DAC1 (COMP_CSR_INSEL_2 | COMP_CSR_INSEL_1 ) /*!< DAC_OUT1 (PA4) connected to comparator 2 inverting input */
<> 128:9bcdf88f62b0 167 #define COMP_INVERTINGINPUT_DAC2 (COMP_CSR_INSEL_2 | COMP_CSR_INSEL_1 | COMP_CSR_INSEL_0) /*!< DAC2_OUT (PA5) connected to comparator 2 inverting input */
<> 128:9bcdf88f62b0 168
<> 128:9bcdf88f62b0 169 #define IS_COMP_INVERTINGINPUT(INPUT) (((INPUT) == COMP_INVERTINGINPUT_IO) || \
<> 128:9bcdf88f62b0 170 ((INPUT) == COMP_INVERTINGINPUT_VREFINT) || \
<> 128:9bcdf88f62b0 171 ((INPUT) == COMP_INVERTINGINPUT_3_4VREFINT) || \
<> 128:9bcdf88f62b0 172 ((INPUT) == COMP_INVERTINGINPUT_1_2VREFINT) || \
<> 128:9bcdf88f62b0 173 ((INPUT) == COMP_INVERTINGINPUT_1_4VREFINT) || \
<> 128:9bcdf88f62b0 174 ((INPUT) == COMP_INVERTINGINPUT_DAC1) || \
<> 128:9bcdf88f62b0 175 ((INPUT) == COMP_INVERTINGINPUT_DAC2) )
<> 128:9bcdf88f62b0 176 /**
<> 128:9bcdf88f62b0 177 * @}
<> 128:9bcdf88f62b0 178 */
<> 128:9bcdf88f62b0 179
<> 128:9bcdf88f62b0 180 /** @defgroup COMP_Mode COMP Mode
<> 128:9bcdf88f62b0 181 * @{
<> 128:9bcdf88f62b0 182 */
<> 128:9bcdf88f62b0 183 /* Please refer to the electrical characteristics in the device datasheet for
<> 128:9bcdf88f62b0 184 the power consumption values */
<> 128:9bcdf88f62b0 185 #define COMP_MODE_LOWSPEED (0x00000000U) /*!< Low Speed */
<> 128:9bcdf88f62b0 186 #define COMP_MODE_HIGHSPEED COMP_CSR_SPEED /*!< High Speed */
<> 128:9bcdf88f62b0 187
<> 128:9bcdf88f62b0 188 #define IS_COMP_MODE(SPEED) (((SPEED) == COMP_MODE_LOWSPEED) || \
<> 128:9bcdf88f62b0 189 ((SPEED) == COMP_MODE_HIGHSPEED))
<> 128:9bcdf88f62b0 190 /**
<> 128:9bcdf88f62b0 191 * @}
<> 128:9bcdf88f62b0 192 */
<> 128:9bcdf88f62b0 193
<> 128:9bcdf88f62b0 194 /** @defgroup COMP_WindowMode COMP WindowMode
<> 128:9bcdf88f62b0 195 * @{
<> 128:9bcdf88f62b0 196 */
<> 128:9bcdf88f62b0 197 #define COMP_WINDOWMODE_DISABLE (0x00000000U) /*!< Window mode disabled: COMP1 non-inverting input is independant */
<> 128:9bcdf88f62b0 198 #define COMP_WINDOWMODE_ENABLE COMP_CSR_WNDWE /*!< Window mode enabled: COMP1 non-inverting input is no more accessible, even from ADC channel VCOMP) (connected to COMP2 non-inverting input) */
<> 128:9bcdf88f62b0 199
<> 128:9bcdf88f62b0 200 #define IS_COMP_WINDOWMODE(WINDOWMODE) (((WINDOWMODE) == COMP_WINDOWMODE_DISABLE) || \
<> 128:9bcdf88f62b0 201 ((WINDOWMODE) == COMP_WINDOWMODE_ENABLE))
<> 128:9bcdf88f62b0 202 /**
<> 128:9bcdf88f62b0 203 * @}
<> 128:9bcdf88f62b0 204 */
<> 128:9bcdf88f62b0 205
<> 128:9bcdf88f62b0 206 /** @defgroup COMP_OutputLevel COMP OutputLevel
<> 128:9bcdf88f62b0 207 * @{
<> 128:9bcdf88f62b0 208 */
<> 128:9bcdf88f62b0 209 /* Comparator output is low when the non-inverting input is at a lower */
<> 128:9bcdf88f62b0 210 /* voltage than the inverting input. */
<> 128:9bcdf88f62b0 211 #define COMP_OUTPUTLEVEL_LOW (0x00000000U)
<> 128:9bcdf88f62b0 212
<> 128:9bcdf88f62b0 213 /* Comparator output is high when the non-inverting input is at a higher */
<> 128:9bcdf88f62b0 214 /* voltage than the inverting input. */
<> 128:9bcdf88f62b0 215 #define COMP_OUTPUTLEVEL_HIGH (0x00000001U)
<> 128:9bcdf88f62b0 216 /**
<> 128:9bcdf88f62b0 217 * @}
<> 128:9bcdf88f62b0 218 */
<> 128:9bcdf88f62b0 219
<> 128:9bcdf88f62b0 220 /** @defgroup COMP_TriggerMode COMP TriggerMode
<> 128:9bcdf88f62b0 221 * @{
<> 128:9bcdf88f62b0 222 */
<> 128:9bcdf88f62b0 223 #define COMP_TRIGGERMODE_NONE (0x00000000U) /*!< No External Interrupt trigger detection */
<> 128:9bcdf88f62b0 224 #define COMP_TRIGGERMODE_IT_RISING (0x00000001U) /*!< External Interrupt Mode with Rising edge trigger detection */
<> 128:9bcdf88f62b0 225 #define COMP_TRIGGERMODE_IT_FALLING (0x00000002U) /*!< External Interrupt Mode with Falling edge trigger detection */
<> 128:9bcdf88f62b0 226 #define COMP_TRIGGERMODE_IT_RISING_FALLING (0x00000003U) /*!< External Interrupt Mode with Rising/Falling edge trigger detection */
<> 128:9bcdf88f62b0 227
<> 128:9bcdf88f62b0 228 #define IS_COMP_TRIGGERMODE(MODE) (((MODE) == COMP_TRIGGERMODE_NONE) || \
<> 128:9bcdf88f62b0 229 ((MODE) == COMP_TRIGGERMODE_IT_RISING) || \
<> 128:9bcdf88f62b0 230 ((MODE) == COMP_TRIGGERMODE_IT_FALLING) || \
<> 128:9bcdf88f62b0 231 ((MODE) == COMP_TRIGGERMODE_IT_RISING_FALLING) )
<> 128:9bcdf88f62b0 232 /**
<> 128:9bcdf88f62b0 233 * @}
<> 128:9bcdf88f62b0 234 */
<> 128:9bcdf88f62b0 235
<> 128:9bcdf88f62b0 236 /** @defgroup COMP_ExtiLineEvent COMP ExtiLineEvent
<> 128:9bcdf88f62b0 237 * @{
<> 128:9bcdf88f62b0 238 */
<> 128:9bcdf88f62b0 239 #define COMP_EXTI_LINE_COMP1 EXTI_RTSR_TR21 /*!< External interrupt line 21 Connected to COMP1 */
<> 128:9bcdf88f62b0 240 #define COMP_EXTI_LINE_COMP2 EXTI_RTSR_TR22 /*!< External interrupt line 22 Connected to COMP2 */
<> 128:9bcdf88f62b0 241
<> 128:9bcdf88f62b0 242 /**
<> 128:9bcdf88f62b0 243 * @}
<> 128:9bcdf88f62b0 244 */
<> 128:9bcdf88f62b0 245
<> 128:9bcdf88f62b0 246 /** @defgroup COMP_NonInvertingInputPull COMP NonInvertingInputPull
<> 128:9bcdf88f62b0 247 * @{
<> 128:9bcdf88f62b0 248 */
<> 128:9bcdf88f62b0 249 #define COMP_NONINVERTINGINPUT_NOPULL (0x00000000U) /*!< No internal pull-up or pull-down resistor connected to comparator non inverting input */
<> 128:9bcdf88f62b0 250 #define COMP_NONINVERTINGINPUT_10KPU COMP_CSR_10KPU /*!< Internal 10kOhm pull-up resistor connected to comparator non inverting input */
<> 128:9bcdf88f62b0 251 #define COMP_NONINVERTINGINPUT_10KPD COMP_CSR_10KPD /*!< Internal 10kOhm pull-down resistor connected to comparator non inverting input */
<> 128:9bcdf88f62b0 252 #define COMP_NONINVERTINGINPUT_400KPU COMP_CSR_400KPU /*!< Internal 400kOhm pull-up resistor connected to comparator non inverting input */
<> 128:9bcdf88f62b0 253 #define COMP_NONINVERTINGINPUT_400KPD COMP_CSR_400KPD /*!< Internal 400kOhm pull-down resistor connected to comparator non inverting input */
<> 128:9bcdf88f62b0 254
<> 128:9bcdf88f62b0 255 #define IS_COMP_NONINVERTINGINPUTPULL(INPUT) (((INPUT) == COMP_NONINVERTINGINPUT_NOPULL) || \
<> 128:9bcdf88f62b0 256 ((INPUT) == COMP_NONINVERTINGINPUT_10KPU) || \
<> 128:9bcdf88f62b0 257 ((INPUT) == COMP_NONINVERTINGINPUT_10KPD) || \
<> 128:9bcdf88f62b0 258 ((INPUT) == COMP_NONINVERTINGINPUT_400KPU) || \
<> 128:9bcdf88f62b0 259 ((INPUT) == COMP_NONINVERTINGINPUT_400KPD) )
<> 128:9bcdf88f62b0 260 /**
<> 128:9bcdf88f62b0 261 * @}
<> 128:9bcdf88f62b0 262 */
<> 128:9bcdf88f62b0 263
<> 128:9bcdf88f62b0 264 /**
<> 128:9bcdf88f62b0 265 * @}
<> 128:9bcdf88f62b0 266 */
<> 128:9bcdf88f62b0 267
<> 128:9bcdf88f62b0 268
<> 128:9bcdf88f62b0 269 /* Exported macro ------------------------------------------------------------*/
<> 128:9bcdf88f62b0 270
<> 128:9bcdf88f62b0 271 /** @defgroup COMP_Exported_Macro COMP Exported Macro
<> 128:9bcdf88f62b0 272 * @{
<> 128:9bcdf88f62b0 273 */
<> 128:9bcdf88f62b0 274
<> 128:9bcdf88f62b0 275 /** @brief Reset COMP handle state
<> 128:9bcdf88f62b0 276 * @param __HANDLE__: COMP handle.
<> 128:9bcdf88f62b0 277 * @retval None
<> 128:9bcdf88f62b0 278 */
<> 128:9bcdf88f62b0 279 #define __HAL_COMP_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_COMP_STATE_RESET)
<> 128:9bcdf88f62b0 280
<> 128:9bcdf88f62b0 281 /**
<> 128:9bcdf88f62b0 282 * @brief Enables the specified comparator
<> 128:9bcdf88f62b0 283 * @param __HANDLE__: COMP handle.
<> 128:9bcdf88f62b0 284 * @retval None.
<> 128:9bcdf88f62b0 285 */
<> 128:9bcdf88f62b0 286 #define __HAL_COMP_ENABLE(__HANDLE__) \
<> 128:9bcdf88f62b0 287 ( ( ((__HANDLE__)->Instance == COMP1) \
<> 128:9bcdf88f62b0 288 )? \
<> 128:9bcdf88f62b0 289 SET_BIT(COMP->CSR, COMP_CSR_CMP1EN) \
<> 128:9bcdf88f62b0 290 : \
<> 128:9bcdf88f62b0 291 MODIFY_REG(COMP->CSR, COMP_CSR_INSEL, (__HANDLE__)->Init.InvertingInput ) \
<> 128:9bcdf88f62b0 292 )
<> 128:9bcdf88f62b0 293
<> 128:9bcdf88f62b0 294 /**
<> 128:9bcdf88f62b0 295 * @brief Disables the specified comparator
<> 128:9bcdf88f62b0 296 * @param __HANDLE__: COMP handle.
<> 128:9bcdf88f62b0 297 * @retval None.
<> 128:9bcdf88f62b0 298 */
<> 128:9bcdf88f62b0 299 #define __HAL_COMP_DISABLE(__HANDLE__) \
<> 128:9bcdf88f62b0 300 ( ( ((__HANDLE__)->Instance == COMP1) \
<> 128:9bcdf88f62b0 301 )? \
<> 128:9bcdf88f62b0 302 CLEAR_BIT(COMP->CSR, COMP_CSR_CMP1EN) \
<> 128:9bcdf88f62b0 303 : \
<> 128:9bcdf88f62b0 304 CLEAR_BIT(COMP->CSR, COMP_CSR_INSEL) \
<> 128:9bcdf88f62b0 305 )
<> 128:9bcdf88f62b0 306
<> 128:9bcdf88f62b0 307 /** @brief Checks whether the specified COMP flag is set or not.
<> 128:9bcdf88f62b0 308 * @param __HANDLE__: specifies the COMP Handle.
<> 128:9bcdf88f62b0 309 * @param __FLAG__: specifies the flag to check.
<> 128:9bcdf88f62b0 310 * This parameter can be one of the following values:
<> 128:9bcdf88f62b0 311 * @arg COMP_FLAG_LOCK: lock flag
<> 128:9bcdf88f62b0 312 * @retval The new state of __FLAG__ (TRUE or FALSE).
<> 128:9bcdf88f62b0 313 */
<> 128:9bcdf88f62b0 314 #define __HAL_COMP_GET_FLAG(__HANDLE__, __FLAG__) (READ_BIT((__HANDLE__)->Instance->CSR, (__FLAG__)) == (__FLAG__))
<> 128:9bcdf88f62b0 315
<> 128:9bcdf88f62b0 316 /**
<> 128:9bcdf88f62b0 317 * @brief Enable the COMP1 EXTI line rising edge trigger.
<> 128:9bcdf88f62b0 318 * @retval None
<> 128:9bcdf88f62b0 319 */
<> 128:9bcdf88f62b0 320 #define __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP1)
<> 128:9bcdf88f62b0 321
<> 128:9bcdf88f62b0 322 /**
<> 128:9bcdf88f62b0 323 * @brief Disable the COMP1 EXTI line rising edge trigger.
<> 128:9bcdf88f62b0 324 * @retval None
<> 128:9bcdf88f62b0 325 */
<> 128:9bcdf88f62b0 326 #define __HAL_COMP_COMP1_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP1)
<> 128:9bcdf88f62b0 327
<> 128:9bcdf88f62b0 328 /**
<> 128:9bcdf88f62b0 329 * @brief Enable the COMP1 EXTI line falling edge trigger.
<> 128:9bcdf88f62b0 330 * @retval None
<> 128:9bcdf88f62b0 331 */
<> 128:9bcdf88f62b0 332 #define __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP1)
<> 128:9bcdf88f62b0 333
<> 128:9bcdf88f62b0 334 /**
<> 128:9bcdf88f62b0 335 * @brief Disable the COMP1 EXTI line falling edge trigger.
<> 128:9bcdf88f62b0 336 * @retval None
<> 128:9bcdf88f62b0 337 */
<> 128:9bcdf88f62b0 338 #define __HAL_COMP_COMP1_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP1)
<> 128:9bcdf88f62b0 339
<> 128:9bcdf88f62b0 340 /**
<> 128:9bcdf88f62b0 341 * @brief Enable the COMP1 EXTI line rising & falling edge trigger.
<> 128:9bcdf88f62b0 342 * @retval None
<> 128:9bcdf88f62b0 343 */
<> 128:9bcdf88f62b0 344 #define __HAL_COMP_COMP1_EXTI_ENABLE_RISING_FALLING_EDGE() do { \
<> 128:9bcdf88f62b0 345 __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE(); \
<> 128:9bcdf88f62b0 346 __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE(); \
<> 128:9bcdf88f62b0 347 } while(0)
<> 128:9bcdf88f62b0 348
<> 128:9bcdf88f62b0 349 /**
<> 128:9bcdf88f62b0 350 * @brief Disable the COMP1 EXTI line rising & falling edge trigger.
<> 128:9bcdf88f62b0 351 * @retval None
<> 128:9bcdf88f62b0 352 */
<> 128:9bcdf88f62b0 353 #define __HAL_COMP_COMP1_EXTI_DISABLE_RISING_FALLING_EDGE() do { \
<> 128:9bcdf88f62b0 354 __HAL_COMP_COMP1_EXTI_DISABLE_RISING_EDGE(); \
<> 128:9bcdf88f62b0 355 __HAL_COMP_COMP1_EXTI_DISABLE_FALLING_EDGE(); \
<> 128:9bcdf88f62b0 356 } while(0)
<> 128:9bcdf88f62b0 357
<> 128:9bcdf88f62b0 358 /**
<> 128:9bcdf88f62b0 359 * @brief Enable the COMP1 EXTI line in interrupt mode.
<> 128:9bcdf88f62b0 360 * @retval None
<> 128:9bcdf88f62b0 361 */
<> 128:9bcdf88f62b0 362 #define __HAL_COMP_COMP1_EXTI_ENABLE_IT() SET_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP1)
<> 128:9bcdf88f62b0 363
<> 128:9bcdf88f62b0 364 /**
<> 128:9bcdf88f62b0 365 * @brief Disable the COMP1 EXTI line in interrupt mode.
<> 128:9bcdf88f62b0 366 * @retval None
<> 128:9bcdf88f62b0 367 */
<> 128:9bcdf88f62b0 368 #define __HAL_COMP_COMP1_EXTI_DISABLE_IT() CLEAR_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP1)
<> 128:9bcdf88f62b0 369
<> 128:9bcdf88f62b0 370 /**
<> 128:9bcdf88f62b0 371 * @brief Enable the COMP1 EXTI Line in event mode.
<> 128:9bcdf88f62b0 372 * @retval None
<> 128:9bcdf88f62b0 373 */
<> 128:9bcdf88f62b0 374 #define __HAL_COMP_COMP1_EXTI_ENABLE_EVENT() SET_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP1)
<> 128:9bcdf88f62b0 375
<> 128:9bcdf88f62b0 376 /**
<> 128:9bcdf88f62b0 377 * @brief Disable the COMP1 EXTI Line in event mode.
<> 128:9bcdf88f62b0 378 * @retval None
<> 128:9bcdf88f62b0 379 */
<> 128:9bcdf88f62b0 380 #define __HAL_COMP_COMP1_EXTI_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP1)
<> 128:9bcdf88f62b0 381
<> 128:9bcdf88f62b0 382 /**
<> 128:9bcdf88f62b0 383 * @brief Check whether the COMP1 EXTI line flag is set or not.
<> 128:9bcdf88f62b0 384 * @retval RESET or SET
<> 128:9bcdf88f62b0 385 */
<> 128:9bcdf88f62b0 386 #define __HAL_COMP_COMP1_EXTI_GET_FLAG() READ_BIT(EXTI->PR, COMP_EXTI_LINE_COMP1)
<> 128:9bcdf88f62b0 387
<> 128:9bcdf88f62b0 388 /**
<> 128:9bcdf88f62b0 389 * @brief Clear the the COMP1 EXTI flag.
<> 128:9bcdf88f62b0 390 * @retval None
<> 128:9bcdf88f62b0 391 */
<> 128:9bcdf88f62b0 392 #define __HAL_COMP_COMP1_EXTI_CLEAR_FLAG() WRITE_REG(EXTI->PR, COMP_EXTI_LINE_COMP1)
<> 128:9bcdf88f62b0 393
<> 128:9bcdf88f62b0 394 /**
<> 128:9bcdf88f62b0 395 * @brief Generates a Software interrupt on COMP1 EXTI Line.
<> 128:9bcdf88f62b0 396 * @retval None
<> 128:9bcdf88f62b0 397 */
<> 128:9bcdf88f62b0 398 #define __HAL_COMP_COMP1_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER, COMP_EXTI_LINE_COMP1)
<> 128:9bcdf88f62b0 399
<> 128:9bcdf88f62b0 400 /**
<> 128:9bcdf88f62b0 401 * @brief Enable the COMP2 EXTI line rising edge trigger.
<> 128:9bcdf88f62b0 402 * @retval None
<> 128:9bcdf88f62b0 403 */
<> 128:9bcdf88f62b0 404 #define __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP2)
<> 128:9bcdf88f62b0 405
<> 128:9bcdf88f62b0 406 /**
<> 128:9bcdf88f62b0 407 * @brief Disable the COMP2 EXTI line rising edge trigger.
<> 128:9bcdf88f62b0 408 * @retval None
<> 128:9bcdf88f62b0 409 */
<> 128:9bcdf88f62b0 410 #define __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP2)
<> 128:9bcdf88f62b0 411
<> 128:9bcdf88f62b0 412 /**
<> 128:9bcdf88f62b0 413 * @brief Enable the COMP2 EXTI line falling edge trigger.
<> 128:9bcdf88f62b0 414 * @retval None
<> 128:9bcdf88f62b0 415 */
<> 128:9bcdf88f62b0 416 #define __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP2)
<> 128:9bcdf88f62b0 417
<> 128:9bcdf88f62b0 418 /**
<> 128:9bcdf88f62b0 419 * @brief Disable the COMP2 EXTI line falling edge trigger.
<> 128:9bcdf88f62b0 420 * @retval None
<> 128:9bcdf88f62b0 421 */
<> 128:9bcdf88f62b0 422 #define __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP2)
<> 128:9bcdf88f62b0 423
<> 128:9bcdf88f62b0 424 /**
<> 128:9bcdf88f62b0 425 * @brief Enable the COMP2 EXTI line rising & falling edge trigger.
<> 128:9bcdf88f62b0 426 * @retval None
<> 128:9bcdf88f62b0 427 */
<> 128:9bcdf88f62b0 428 #define __HAL_COMP_COMP2_EXTI_ENABLE_RISING_FALLING_EDGE() do { \
<> 128:9bcdf88f62b0 429 __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE(); \
<> 128:9bcdf88f62b0 430 __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE(); \
<> 128:9bcdf88f62b0 431 } while(0)
<> 128:9bcdf88f62b0 432
<> 128:9bcdf88f62b0 433 /**
<> 128:9bcdf88f62b0 434 * @brief Disable the COMP2 EXTI line rising & falling edge trigger.
<> 128:9bcdf88f62b0 435 * @retval None
<> 128:9bcdf88f62b0 436 */
<> 128:9bcdf88f62b0 437 #define __HAL_COMP_COMP2_EXTI_DISABLE_RISING_FALLING_EDGE() do { \
<> 128:9bcdf88f62b0 438 __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE(); \
<> 128:9bcdf88f62b0 439 __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE(); \
<> 128:9bcdf88f62b0 440 } while(0)
<> 128:9bcdf88f62b0 441
<> 128:9bcdf88f62b0 442 /**
<> 128:9bcdf88f62b0 443 * @brief Enable the COMP2 EXTI line.
<> 128:9bcdf88f62b0 444 * @retval None
<> 128:9bcdf88f62b0 445 */
<> 128:9bcdf88f62b0 446 #define __HAL_COMP_COMP2_EXTI_ENABLE_IT() SET_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP2)
<> 128:9bcdf88f62b0 447
<> 128:9bcdf88f62b0 448 /**
<> 128:9bcdf88f62b0 449 * @brief Disable the COMP2 EXTI line.
<> 128:9bcdf88f62b0 450 * @retval None
<> 128:9bcdf88f62b0 451 */
<> 128:9bcdf88f62b0 452 #define __HAL_COMP_COMP2_EXTI_DISABLE_IT() CLEAR_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP2)
<> 128:9bcdf88f62b0 453
<> 128:9bcdf88f62b0 454 /**
<> 128:9bcdf88f62b0 455 * @brief Enable the COMP2 EXTI Line in event mode.
<> 128:9bcdf88f62b0 456 * @retval None
<> 128:9bcdf88f62b0 457 */
<> 128:9bcdf88f62b0 458 #define __HAL_COMP_COMP2_EXTI_ENABLE_EVENT() SET_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP2)
<> 128:9bcdf88f62b0 459
<> 128:9bcdf88f62b0 460 /**
<> 128:9bcdf88f62b0 461 * @brief Disable the COMP2 EXTI Line in event mode.
<> 128:9bcdf88f62b0 462 * @retval None
<> 128:9bcdf88f62b0 463 */
<> 128:9bcdf88f62b0 464 #define __HAL_COMP_COMP2_EXTI_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP2)
<> 128:9bcdf88f62b0 465
<> 128:9bcdf88f62b0 466 /**
<> 128:9bcdf88f62b0 467 * @brief Check whether the COMP2 EXTI line flag is set or not.
<> 128:9bcdf88f62b0 468 * @retval RESET or SET
<> 128:9bcdf88f62b0 469 */
<> 128:9bcdf88f62b0 470 #define __HAL_COMP_COMP2_EXTI_GET_FLAG() READ_BIT(EXTI->PR, COMP_EXTI_LINE_COMP2)
<> 128:9bcdf88f62b0 471
<> 128:9bcdf88f62b0 472 /**
<> 128:9bcdf88f62b0 473 * @brief Clear the the COMP2 EXTI flag.
<> 128:9bcdf88f62b0 474 * @retval None
<> 128:9bcdf88f62b0 475 */
<> 128:9bcdf88f62b0 476 #define __HAL_COMP_COMP2_EXTI_CLEAR_FLAG() WRITE_REG(EXTI->PR, COMP_EXTI_LINE_COMP2)
<> 128:9bcdf88f62b0 477
<> 128:9bcdf88f62b0 478 /**
<> 128:9bcdf88f62b0 479 * @brief Generates a Software interrupt on COMP1 EXTI Line.
<> 128:9bcdf88f62b0 480 * @retval None
<> 128:9bcdf88f62b0 481 */
<> 128:9bcdf88f62b0 482 #define __HAL_COMP_COMP2_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER, COMP_EXTI_LINE_COMP2)
<> 128:9bcdf88f62b0 483
<> 128:9bcdf88f62b0 484 /**
<> 128:9bcdf88f62b0 485 * @}
<> 128:9bcdf88f62b0 486 */
<> 128:9bcdf88f62b0 487
<> 128:9bcdf88f62b0 488 /* Private macro -------------------------------------------------------------*/
<> 128:9bcdf88f62b0 489
<> 128:9bcdf88f62b0 490 /** @defgroup COMP_Private_Macro COMP Private Macro
<> 128:9bcdf88f62b0 491 * @{
<> 128:9bcdf88f62b0 492 */
<> 128:9bcdf88f62b0 493
<> 128:9bcdf88f62b0 494 /**
<> 128:9bcdf88f62b0 495 * @brief Get the specified EXTI line for a comparator instance
<> 128:9bcdf88f62b0 496 * @param __INSTANCE__: specifies the COMP instance.
<> 128:9bcdf88f62b0 497 * @retval value of @ref COMP_ExtiLineEvent
<> 128:9bcdf88f62b0 498 */
<> 128:9bcdf88f62b0 499 #define COMP_GET_EXTI_LINE(__INSTANCE__) \
<> 128:9bcdf88f62b0 500 ( ( ((__INSTANCE__) == COMP1) \
<> 128:9bcdf88f62b0 501 )? \
<> 128:9bcdf88f62b0 502 (COMP_EXTI_LINE_COMP1) \
<> 128:9bcdf88f62b0 503 : \
<> 128:9bcdf88f62b0 504 (COMP_EXTI_LINE_COMP2) \
<> 128:9bcdf88f62b0 505 )
<> 128:9bcdf88f62b0 506
<> 128:9bcdf88f62b0 507 /**
<> 128:9bcdf88f62b0 508 * @brief Select the COMP register CSR bit CMPxOUT corresponding to the
<> 128:9bcdf88f62b0 509 * selected COMP instance.
<> 128:9bcdf88f62b0 510 * @param __HANDLE__: COMP handle
<> 128:9bcdf88f62b0 511 * @retval Comparator register CSR bit COMP_CSR_CMP1OUT or COMP_CSR_CMP2OUT
<> 128:9bcdf88f62b0 512 */
<> 128:9bcdf88f62b0 513 #define __COMP_CSR_CMPXOUT(__HANDLE__) \
<> 128:9bcdf88f62b0 514 ( ( ((__HANDLE__)->Instance == COMP1) \
<> 128:9bcdf88f62b0 515 )? \
<> 128:9bcdf88f62b0 516 (COMP_CSR_CMP1OUT) \
<> 128:9bcdf88f62b0 517 : \
<> 128:9bcdf88f62b0 518 (COMP_CSR_CMP2OUT) \
<> 128:9bcdf88f62b0 519 )
<> 128:9bcdf88f62b0 520
<> 128:9bcdf88f62b0 521 /**
<> 128:9bcdf88f62b0 522 * @brief Verification of COMP state: enabled or disabled
<> 128:9bcdf88f62b0 523 * @param __HANDLE__: COMP handle
<> 128:9bcdf88f62b0 524 * @retval SET (COMP enabled) or RESET (COMP disabled)
<> 128:9bcdf88f62b0 525 */
<> 128:9bcdf88f62b0 526 #define __COMP_IS_ENABLED(__HANDLE__) \
<> 128:9bcdf88f62b0 527 ( ( ((__HANDLE__)->Instance == COMP1) \
<> 128:9bcdf88f62b0 528 )? \
<> 128:9bcdf88f62b0 529 (((READ_BIT(COMP->CSR , COMP_CSR_CMP1EN) == COMP_CSR_CMP1EN) \
<> 128:9bcdf88f62b0 530 ) ? SET : RESET) \
<> 128:9bcdf88f62b0 531 : \
<> 128:9bcdf88f62b0 532 (((READ_BIT(COMP->CSR , COMP_CSR_INSEL) != RESET) \
<> 128:9bcdf88f62b0 533 ) ? SET : RESET) \
<> 128:9bcdf88f62b0 534 )
<> 128:9bcdf88f62b0 535
<> 128:9bcdf88f62b0 536 /**
<> 128:9bcdf88f62b0 537 * @}
<> 128:9bcdf88f62b0 538 */
<> 128:9bcdf88f62b0 539
<> 128:9bcdf88f62b0 540
<> 128:9bcdf88f62b0 541 /* Include COMP HAL Extension module */
<> 128:9bcdf88f62b0 542 #include "stm32l1xx_hal_comp_ex.h"
<> 128:9bcdf88f62b0 543
<> 128:9bcdf88f62b0 544 /* Exported functions --------------------------------------------------------*/
<> 128:9bcdf88f62b0 545 /** @addtogroup COMP_Exported_Functions
<> 128:9bcdf88f62b0 546 * @{
<> 128:9bcdf88f62b0 547 */
<> 128:9bcdf88f62b0 548
<> 128:9bcdf88f62b0 549 /* Initialization and de-initialization functions ******************************/
<> 128:9bcdf88f62b0 550 /** @addtogroup COMP_Exported_Functions_Group1
<> 128:9bcdf88f62b0 551 * @{
<> 128:9bcdf88f62b0 552 */
<> 128:9bcdf88f62b0 553 HAL_StatusTypeDef HAL_COMP_Init(COMP_HandleTypeDef *hcomp);
<> 128:9bcdf88f62b0 554 HAL_StatusTypeDef HAL_COMP_DeInit (COMP_HandleTypeDef *hcomp);
<> 128:9bcdf88f62b0 555 void HAL_COMP_MspInit(COMP_HandleTypeDef *hcomp);
<> 128:9bcdf88f62b0 556 void HAL_COMP_MspDeInit(COMP_HandleTypeDef *hcomp);
<> 128:9bcdf88f62b0 557 /**
<> 128:9bcdf88f62b0 558 * @}
<> 128:9bcdf88f62b0 559 */
<> 128:9bcdf88f62b0 560
<> 128:9bcdf88f62b0 561 /* I/O operation functions *****************************************************/
<> 128:9bcdf88f62b0 562 /** @addtogroup COMP_Exported_Functions_Group2
<> 128:9bcdf88f62b0 563 * @{
<> 128:9bcdf88f62b0 564 */
<> 128:9bcdf88f62b0 565 HAL_StatusTypeDef HAL_COMP_Start(COMP_HandleTypeDef *hcomp);
<> 128:9bcdf88f62b0 566 HAL_StatusTypeDef HAL_COMP_Stop(COMP_HandleTypeDef *hcomp);
<> 128:9bcdf88f62b0 567 HAL_StatusTypeDef HAL_COMP_Start_IT(COMP_HandleTypeDef *hcomp);
<> 128:9bcdf88f62b0 568 HAL_StatusTypeDef HAL_COMP_Stop_IT(COMP_HandleTypeDef *hcomp);
<> 128:9bcdf88f62b0 569 void HAL_COMP_IRQHandler(COMP_HandleTypeDef *hcomp);
<> 128:9bcdf88f62b0 570 /**
<> 128:9bcdf88f62b0 571 * @}
<> 128:9bcdf88f62b0 572 */
<> 128:9bcdf88f62b0 573
<> 128:9bcdf88f62b0 574 /* Peripheral Control functions ************************************************/
<> 128:9bcdf88f62b0 575 /** @addtogroup COMP_Exported_Functions_Group3
<> 128:9bcdf88f62b0 576 * @{
<> 128:9bcdf88f62b0 577 */
<> 128:9bcdf88f62b0 578 HAL_StatusTypeDef HAL_COMP_Lock(COMP_HandleTypeDef *hcomp);
<> 128:9bcdf88f62b0 579 uint32_t HAL_COMP_GetOutputLevel(COMP_HandleTypeDef *hcomp);
<> 128:9bcdf88f62b0 580
<> 128:9bcdf88f62b0 581 /* Callback in Interrupt mode */
<> 128:9bcdf88f62b0 582 void HAL_COMP_TriggerCallback(COMP_HandleTypeDef *hcomp);
<> 128:9bcdf88f62b0 583 /**
<> 128:9bcdf88f62b0 584 * @}
<> 128:9bcdf88f62b0 585 */
<> 128:9bcdf88f62b0 586
<> 128:9bcdf88f62b0 587 /* Peripheral State functions **************************************************/
<> 128:9bcdf88f62b0 588 /** @addtogroup COMP_Exported_Functions_Group4
<> 128:9bcdf88f62b0 589 * @{
<> 128:9bcdf88f62b0 590 */
<> 128:9bcdf88f62b0 591 HAL_COMP_StateTypeDef HAL_COMP_GetState(COMP_HandleTypeDef *hcomp);
<> 128:9bcdf88f62b0 592 /**
<> 128:9bcdf88f62b0 593 * @}
<> 128:9bcdf88f62b0 594 */
<> 128:9bcdf88f62b0 595
<> 128:9bcdf88f62b0 596 /**
<> 128:9bcdf88f62b0 597 * @}
<> 128:9bcdf88f62b0 598 */
<> 128:9bcdf88f62b0 599
<> 128:9bcdf88f62b0 600 /**
<> 128:9bcdf88f62b0 601 * @}
<> 128:9bcdf88f62b0 602 */
<> 128:9bcdf88f62b0 603
<> 128:9bcdf88f62b0 604 /**
<> 128:9bcdf88f62b0 605 * @}
<> 128:9bcdf88f62b0 606 */
<> 128:9bcdf88f62b0 607
<> 128:9bcdf88f62b0 608 #ifdef __cplusplus
<> 128:9bcdf88f62b0 609 }
<> 128:9bcdf88f62b0 610 #endif
<> 128:9bcdf88f62b0 611
<> 128:9bcdf88f62b0 612 #endif /* __STM32L1xx_HAL_COMP_H */
<> 128:9bcdf88f62b0 613
<> 128:9bcdf88f62b0 614 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/