Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.
Dependents: 1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB
Fork of mbed by
TARGET_NUCLEO_L073RZ/stm32l0xx_hal_comp.h@120:2eb10e18b8d7, 2016-04-13 (annotated)
- Committer:
- elijahorr
- Date:
- Wed Apr 13 12:29:27 2016 +0000
- Revision:
- 120:2eb10e18b8d7
- Parent:
- 116:c0f6e94411f5
V1.1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 116:c0f6e94411f5 | 1 | /** |
Kojto | 116:c0f6e94411f5 | 2 | ****************************************************************************** |
Kojto | 116:c0f6e94411f5 | 3 | * @file stm32l0xx_hal_comp.h |
Kojto | 116:c0f6e94411f5 | 4 | * @author MCD Application Team |
Kojto | 116:c0f6e94411f5 | 5 | * @version V1.2.0 |
Kojto | 116:c0f6e94411f5 | 6 | * @date 06-February-2015 |
Kojto | 116:c0f6e94411f5 | 7 | * @brief Header file of COMP HAL module. |
Kojto | 116:c0f6e94411f5 | 8 | ****************************************************************************** |
Kojto | 116:c0f6e94411f5 | 9 | * @attention |
Kojto | 116:c0f6e94411f5 | 10 | * |
Kojto | 116:c0f6e94411f5 | 11 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
Kojto | 116:c0f6e94411f5 | 12 | * |
Kojto | 116:c0f6e94411f5 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
Kojto | 116:c0f6e94411f5 | 14 | * are permitted provided that the following conditions are met: |
Kojto | 116:c0f6e94411f5 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
Kojto | 116:c0f6e94411f5 | 16 | * this list of conditions and the following disclaimer. |
Kojto | 116:c0f6e94411f5 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
Kojto | 116:c0f6e94411f5 | 18 | * this list of conditions and the following disclaimer in the documentation |
Kojto | 116:c0f6e94411f5 | 19 | * and/or other materials provided with the distribution. |
Kojto | 116:c0f6e94411f5 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
Kojto | 116:c0f6e94411f5 | 21 | * may be used to endorse or promote products derived from this software |
Kojto | 116:c0f6e94411f5 | 22 | * without specific prior written permission. |
Kojto | 116:c0f6e94411f5 | 23 | * |
Kojto | 116:c0f6e94411f5 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
Kojto | 116:c0f6e94411f5 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
Kojto | 116:c0f6e94411f5 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Kojto | 116:c0f6e94411f5 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
Kojto | 116:c0f6e94411f5 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
Kojto | 116:c0f6e94411f5 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
Kojto | 116:c0f6e94411f5 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
Kojto | 116:c0f6e94411f5 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
Kojto | 116:c0f6e94411f5 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
Kojto | 116:c0f6e94411f5 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Kojto | 116:c0f6e94411f5 | 34 | * |
Kojto | 116:c0f6e94411f5 | 35 | ****************************************************************************** |
Kojto | 116:c0f6e94411f5 | 36 | */ |
Kojto | 116:c0f6e94411f5 | 37 | |
Kojto | 116:c0f6e94411f5 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
Kojto | 116:c0f6e94411f5 | 39 | #ifndef __STM32L0xx_HAL_COMP_H |
Kojto | 116:c0f6e94411f5 | 40 | #define __STM32L0xx_HAL_COMP_H |
Kojto | 116:c0f6e94411f5 | 41 | |
Kojto | 116:c0f6e94411f5 | 42 | #ifdef __cplusplus |
Kojto | 116:c0f6e94411f5 | 43 | extern "C" { |
Kojto | 116:c0f6e94411f5 | 44 | #endif |
Kojto | 116:c0f6e94411f5 | 45 | |
Kojto | 116:c0f6e94411f5 | 46 | /* Includes ------------------------------------------------------------------*/ |
Kojto | 116:c0f6e94411f5 | 47 | #include "stm32l0xx_hal_def.h" |
Kojto | 116:c0f6e94411f5 | 48 | |
Kojto | 116:c0f6e94411f5 | 49 | /** @addtogroup STM32L0xx_HAL_Driver |
Kojto | 116:c0f6e94411f5 | 50 | * @{ |
Kojto | 116:c0f6e94411f5 | 51 | */ |
Kojto | 116:c0f6e94411f5 | 52 | |
Kojto | 116:c0f6e94411f5 | 53 | /** @defgroup COMP COMP |
Kojto | 116:c0f6e94411f5 | 54 | * @{ |
Kojto | 116:c0f6e94411f5 | 55 | */ |
Kojto | 116:c0f6e94411f5 | 56 | |
Kojto | 116:c0f6e94411f5 | 57 | /* Exported types ------------------------------------------------------------*/ |
Kojto | 116:c0f6e94411f5 | 58 | |
Kojto | 116:c0f6e94411f5 | 59 | /** @defgroup COMP_Exported_Types COMP Exported Types |
Kojto | 116:c0f6e94411f5 | 60 | * @{ |
Kojto | 116:c0f6e94411f5 | 61 | */ |
Kojto | 116:c0f6e94411f5 | 62 | |
Kojto | 116:c0f6e94411f5 | 63 | /** @defgroup COMP_Init COMP init configuration structure |
Kojto | 116:c0f6e94411f5 | 64 | * @{ |
Kojto | 116:c0f6e94411f5 | 65 | */ |
Kojto | 116:c0f6e94411f5 | 66 | /** |
Kojto | 116:c0f6e94411f5 | 67 | * @brief COMP Init structure definition |
Kojto | 116:c0f6e94411f5 | 68 | */ |
Kojto | 116:c0f6e94411f5 | 69 | |
Kojto | 116:c0f6e94411f5 | 70 | typedef struct |
Kojto | 116:c0f6e94411f5 | 71 | { |
Kojto | 116:c0f6e94411f5 | 72 | |
Kojto | 116:c0f6e94411f5 | 73 | uint32_t InvertingInput; /*!< Selects the inverting input of the comparator. |
Kojto | 116:c0f6e94411f5 | 74 | This parameter can be a value of @ref COMP_InvertingInput */ |
Kojto | 116:c0f6e94411f5 | 75 | |
Kojto | 116:c0f6e94411f5 | 76 | uint32_t NonInvertingInput; /*!< Selects the non inverting input of the comparator. |
Kojto | 116:c0f6e94411f5 | 77 | This parameter can be a value of @ref COMP_NonInvertingInput */ |
Kojto | 116:c0f6e94411f5 | 78 | |
Kojto | 116:c0f6e94411f5 | 79 | uint32_t LPTIMConnection; /*!< Selects if the COMP connection to the LPTIM is established or not. |
Kojto | 116:c0f6e94411f5 | 80 | This parameter can be a value of @ref COMP_LPTIMConnection */ |
Kojto | 116:c0f6e94411f5 | 81 | |
Kojto | 116:c0f6e94411f5 | 82 | uint32_t OutputPol; /*!< Selects the output polarity of the comparator. |
Kojto | 116:c0f6e94411f5 | 83 | This parameter can be a value of @ref COMP_OutputPolarity */ |
Kojto | 116:c0f6e94411f5 | 84 | |
Kojto | 116:c0f6e94411f5 | 85 | uint32_t Mode; /*!< Selects the operating comsumption mode of the comparator |
Kojto | 116:c0f6e94411f5 | 86 | to adjust the speed/consumption. |
Kojto | 116:c0f6e94411f5 | 87 | This parameter can be a value of @ref COMP_Mode */ |
Kojto | 116:c0f6e94411f5 | 88 | |
Kojto | 116:c0f6e94411f5 | 89 | uint32_t WindowMode; /*!< Selects the window mode of the comparator 2. |
Kojto | 116:c0f6e94411f5 | 90 | This parameter can be a value of @ref COMP_WindowMode */ |
Kojto | 116:c0f6e94411f5 | 91 | |
Kojto | 116:c0f6e94411f5 | 92 | uint32_t TriggerMode; /*!< Selects the trigger mode of the comparator (interrupt mode). |
Kojto | 116:c0f6e94411f5 | 93 | This parameter can be a value of @ref COMP_TriggerMode */ |
Kojto | 116:c0f6e94411f5 | 94 | |
Kojto | 116:c0f6e94411f5 | 95 | }COMP_InitTypeDef; |
Kojto | 116:c0f6e94411f5 | 96 | |
Kojto | 116:c0f6e94411f5 | 97 | /** |
Kojto | 116:c0f6e94411f5 | 98 | * @} |
Kojto | 116:c0f6e94411f5 | 99 | */ |
Kojto | 116:c0f6e94411f5 | 100 | |
Kojto | 116:c0f6e94411f5 | 101 | /** @defgroup COMP_state COMP state definition |
Kojto | 116:c0f6e94411f5 | 102 | * @{ |
Kojto | 116:c0f6e94411f5 | 103 | */ |
Kojto | 116:c0f6e94411f5 | 104 | /** |
Kojto | 116:c0f6e94411f5 | 105 | * @brief HAL State structures definition |
Kojto | 116:c0f6e94411f5 | 106 | */ |
Kojto | 116:c0f6e94411f5 | 107 | typedef enum |
Kojto | 116:c0f6e94411f5 | 108 | { |
Kojto | 116:c0f6e94411f5 | 109 | HAL_COMP_STATE_RESET = 0x00, /*!< COMP not yet initialized or disabled */ |
Kojto | 116:c0f6e94411f5 | 110 | HAL_COMP_STATE_READY = 0x01, /*!< COMP initialized and ready for use */ |
Kojto | 116:c0f6e94411f5 | 111 | HAL_COMP_STATE_READY_LOCKED = 0x11, /*!< COMP initialized but the configuration is locked */ |
Kojto | 116:c0f6e94411f5 | 112 | HAL_COMP_STATE_BUSY = 0x02, /*!< COMP is running */ |
Kojto | 116:c0f6e94411f5 | 113 | HAL_COMP_STATE_BUSY_LOCKED = 0x12 /*!< COMP is running and the configuration is locked */ |
Kojto | 116:c0f6e94411f5 | 114 | }HAL_COMP_StateTypeDef; |
Kojto | 116:c0f6e94411f5 | 115 | /** |
Kojto | 116:c0f6e94411f5 | 116 | * @} |
Kojto | 116:c0f6e94411f5 | 117 | */ |
Kojto | 116:c0f6e94411f5 | 118 | |
Kojto | 116:c0f6e94411f5 | 119 | /** @defgroup COMP_handle COMP handler |
Kojto | 116:c0f6e94411f5 | 120 | * @{ |
Kojto | 116:c0f6e94411f5 | 121 | */ |
Kojto | 116:c0f6e94411f5 | 122 | /** |
Kojto | 116:c0f6e94411f5 | 123 | * @brief COMP Handle Structure definition |
Kojto | 116:c0f6e94411f5 | 124 | */ |
Kojto | 116:c0f6e94411f5 | 125 | typedef struct |
Kojto | 116:c0f6e94411f5 | 126 | { |
Kojto | 116:c0f6e94411f5 | 127 | COMP_TypeDef *Instance; /*!< Register base address */ |
Kojto | 116:c0f6e94411f5 | 128 | COMP_InitTypeDef Init; /*!< COMP required parameters */ |
Kojto | 116:c0f6e94411f5 | 129 | HAL_LockTypeDef Lock; /*!< Locking object */ |
Kojto | 116:c0f6e94411f5 | 130 | __IO HAL_COMP_StateTypeDef State; /*!< COMP communication state */ |
Kojto | 116:c0f6e94411f5 | 131 | } COMP_HandleTypeDef; |
Kojto | 116:c0f6e94411f5 | 132 | |
Kojto | 116:c0f6e94411f5 | 133 | /** |
Kojto | 116:c0f6e94411f5 | 134 | * @} |
Kojto | 116:c0f6e94411f5 | 135 | */ |
Kojto | 116:c0f6e94411f5 | 136 | /** |
Kojto | 116:c0f6e94411f5 | 137 | * @} |
Kojto | 116:c0f6e94411f5 | 138 | */ |
Kojto | 116:c0f6e94411f5 | 139 | |
Kojto | 116:c0f6e94411f5 | 140 | /* Exported constants --------------------------------------------------------*/ |
Kojto | 116:c0f6e94411f5 | 141 | /** @defgroup COMP_Exported_Constants COMP Exported Constants |
Kojto | 116:c0f6e94411f5 | 142 | * @{ |
Kojto | 116:c0f6e94411f5 | 143 | */ |
Kojto | 116:c0f6e94411f5 | 144 | |
Kojto | 116:c0f6e94411f5 | 145 | /** @defgroup COMP_OutputPolarity COMP output polarity definitions |
Kojto | 116:c0f6e94411f5 | 146 | * @{ |
Kojto | 116:c0f6e94411f5 | 147 | */ |
Kojto | 116:c0f6e94411f5 | 148 | #define COMP_OUTPUTPOL_NONINVERTED ((uint32_t)0x00000000) /*!< COMP output on GPIO isn't inverted */ |
Kojto | 116:c0f6e94411f5 | 149 | #define COMP_OUTPUTPOL_INVERTED COMP_CSR_COMPxPOLARITY /*!< COMP output on GPIO is inverted */ |
Kojto | 116:c0f6e94411f5 | 150 | #define IS_COMP_OUTPUTPOL(POL) (((POL) == COMP_OUTPUTPOL_NONINVERTED) || \ |
Kojto | 116:c0f6e94411f5 | 151 | ((POL) == COMP_OUTPUTPOL_INVERTED)) |
Kojto | 116:c0f6e94411f5 | 152 | /** |
Kojto | 116:c0f6e94411f5 | 153 | * @} |
Kojto | 116:c0f6e94411f5 | 154 | */ |
Kojto | 116:c0f6e94411f5 | 155 | |
Kojto | 116:c0f6e94411f5 | 156 | |
Kojto | 116:c0f6e94411f5 | 157 | /** @defgroup COMP_InvertingInput COMP inverting input definitions |
Kojto | 116:c0f6e94411f5 | 158 | * @{ |
Kojto | 116:c0f6e94411f5 | 159 | */ |
Kojto | 116:c0f6e94411f5 | 160 | |
Kojto | 116:c0f6e94411f5 | 161 | /* Inverting Input specific to COMP1 */ |
Kojto | 116:c0f6e94411f5 | 162 | #define COMP_INVERTINGINPUT_VREFINT ((uint32_t)0x00000000) /*!< VREFINT connected to comparator1 inverting input */ |
Kojto | 116:c0f6e94411f5 | 163 | #define COMP_INVERTINGINPUT_IO1 ((uint32_t)0x00000010) /*!< I/O1 connected to comparator inverting input (PA0) for COMP1 and (PA2) for COMP2*/ |
Kojto | 116:c0f6e94411f5 | 164 | #define COMP_INVERTINGINPUT_DAC1 ((uint32_t)0x00000020) /*!< DAC1_OUT (PA4) connected to comparator inverting input */ |
Kojto | 116:c0f6e94411f5 | 165 | #define COMP_INVERTINGINPUT_IO2 ((uint32_t)0x00000030) /*!< I/O2 (PA5) connected to comparator inverting input */ |
Kojto | 116:c0f6e94411f5 | 166 | |
Kojto | 116:c0f6e94411f5 | 167 | /* Inverting Input specific to COMP2 */ |
Kojto | 116:c0f6e94411f5 | 168 | #define COMP_INVERTINGINPUT_1_4VREFINT ((uint32_t)0x00000040) /*!< 1/4 VREFINT connected to comparator inverting input */ |
Kojto | 116:c0f6e94411f5 | 169 | #define COMP_INVERTINGINPUT_1_2VREFINT ((uint32_t)0x00000050) /*!< 1/2 VREFINT connected to comparator inverting input */ |
Kojto | 116:c0f6e94411f5 | 170 | #define COMP_INVERTINGINPUT_3_4VREFINT ((uint32_t)0x00000060) /*!< 3/4 VREFINT connected to comparator inverting input */ |
Kojto | 116:c0f6e94411f5 | 171 | #define COMP_INVERTINGINPUT_IO3 ((uint32_t)0x00000070) /*!< I/O3 (PB3) for COMP2 connected to comparator inverting input */ |
Kojto | 116:c0f6e94411f5 | 172 | |
Kojto | 116:c0f6e94411f5 | 173 | |
Kojto | 116:c0f6e94411f5 | 174 | #define IS_COMP_INVERTINGINPUT(INPUT) (((INPUT) == COMP_INVERTINGINPUT_VREFINT) || \ |
Kojto | 116:c0f6e94411f5 | 175 | ((INPUT) == COMP_INVERTINGINPUT_IO1) || \ |
Kojto | 116:c0f6e94411f5 | 176 | ((INPUT) == COMP_INVERTINGINPUT_DAC1) || \ |
Kojto | 116:c0f6e94411f5 | 177 | ((INPUT) == COMP_INVERTINGINPUT_IO2) || \ |
Kojto | 116:c0f6e94411f5 | 178 | ((INPUT) == COMP_INVERTINGINPUT_1_4VREFINT) || \ |
Kojto | 116:c0f6e94411f5 | 179 | ((INPUT) == COMP_INVERTINGINPUT_1_2VREFINT) || \ |
Kojto | 116:c0f6e94411f5 | 180 | ((INPUT) == COMP_INVERTINGINPUT_3_4VREFINT) || \ |
Kojto | 116:c0f6e94411f5 | 181 | ((INPUT) == COMP_INVERTINGINPUT_IO3)) |
Kojto | 116:c0f6e94411f5 | 182 | |
Kojto | 116:c0f6e94411f5 | 183 | /** |
Kojto | 116:c0f6e94411f5 | 184 | * @} |
Kojto | 116:c0f6e94411f5 | 185 | */ |
Kojto | 116:c0f6e94411f5 | 186 | |
Kojto | 116:c0f6e94411f5 | 187 | |
Kojto | 116:c0f6e94411f5 | 188 | /** @defgroup COMP_NonInvertingInput COMP non inverting input definitions |
Kojto | 116:c0f6e94411f5 | 189 | * @{ |
Kojto | 116:c0f6e94411f5 | 190 | */ |
Kojto | 116:c0f6e94411f5 | 191 | |
Kojto | 116:c0f6e94411f5 | 192 | #define COMP_NONINVERTINGINPUT_IO1 ((uint32_t)0x00000000) /*!< I/O1 (PA3) connected to comparator non inverting input */ |
Kojto | 116:c0f6e94411f5 | 193 | #define COMP_NONINVERTINGINPUT_IO2 ((uint32_t)0x00000100) /*!< I/O2 (PB4) connected to comparator non inverting input */ |
Kojto | 116:c0f6e94411f5 | 194 | #define COMP_NONINVERTINGINPUT_IO3 ((uint32_t)0x00000200) /*!< I/O3 (PB5) connected to comparator non inverting input */ |
Kojto | 116:c0f6e94411f5 | 195 | #define COMP_NONINVERTINGINPUT_IO4 ((uint32_t)0x00000300) /*!< I/O1 (PB6) connected to comparator non inverting input */ |
Kojto | 116:c0f6e94411f5 | 196 | #define COMP_NONINVERTINGINPUT_IO5 ((uint32_t)0x00000400) /*!< I/O3 (PB7) connected to comparator non inverting input */ |
Kojto | 116:c0f6e94411f5 | 197 | #define COMP_NONINVERTINGINPUT_IO6 ((uint32_t)0x00000500) /*!< I/O3 (PB7) connected to comparator non inverting input */ |
Kojto | 116:c0f6e94411f5 | 198 | #define COMP_NONINVERTINGINPUT_IO7 ((uint32_t)0x00000600) /*!< I/O3 (PB7) connected to comparator non inverting input */ |
Kojto | 116:c0f6e94411f5 | 199 | #define COMP_NONINVERTINGINPUT_IO8 ((uint32_t)0x00000700) /*!< I/O3 (PB7) connected to comparator non inverting input */ |
Kojto | 116:c0f6e94411f5 | 200 | |
Kojto | 116:c0f6e94411f5 | 201 | #define IS_COMP_NONINVERTINGINPUT(INPUT) (((INPUT) == COMP_NONINVERTINGINPUT_IO1) || \ |
Kojto | 116:c0f6e94411f5 | 202 | ((INPUT) == COMP_NONINVERTINGINPUT_IO2) || \ |
Kojto | 116:c0f6e94411f5 | 203 | ((INPUT) == COMP_NONINVERTINGINPUT_IO3) || \ |
Kojto | 116:c0f6e94411f5 | 204 | ((INPUT) == COMP_NONINVERTINGINPUT_IO4) || \ |
Kojto | 116:c0f6e94411f5 | 205 | ((INPUT) == COMP_NONINVERTINGINPUT_IO5) || \ |
Kojto | 116:c0f6e94411f5 | 206 | ((INPUT) == COMP_NONINVERTINGINPUT_IO6) || \ |
Kojto | 116:c0f6e94411f5 | 207 | ((INPUT) == COMP_NONINVERTINGINPUT_IO7) || \ |
Kojto | 116:c0f6e94411f5 | 208 | ((INPUT) == COMP_NONINVERTINGINPUT_IO8)) |
Kojto | 116:c0f6e94411f5 | 209 | /** |
Kojto | 116:c0f6e94411f5 | 210 | * @} |
Kojto | 116:c0f6e94411f5 | 211 | */ |
Kojto | 116:c0f6e94411f5 | 212 | |
Kojto | 116:c0f6e94411f5 | 213 | |
Kojto | 116:c0f6e94411f5 | 214 | /** @defgroup COMP_Mode COMP mode definition |
Kojto | 116:c0f6e94411f5 | 215 | * @{ |
Kojto | 116:c0f6e94411f5 | 216 | */ |
Kojto | 116:c0f6e94411f5 | 217 | /* Please refer to the electrical characteristics in the device datasheet for |
Kojto | 116:c0f6e94411f5 | 218 | the power consumption values */ |
Kojto | 116:c0f6e94411f5 | 219 | #define COMP_MODE_HIGHSPEED COMP_CSR_COMP2SPEED /*!< High Speed */ |
Kojto | 116:c0f6e94411f5 | 220 | #define COMP_MODE_LOWSPEED ((uint32_t)0x00000000) /*!< Low Speed */ |
Kojto | 116:c0f6e94411f5 | 221 | |
Kojto | 116:c0f6e94411f5 | 222 | #define IS_COMP_MODE(SPEED) (((SPEED) == COMP_MODE_HIGHSPEED) || \ |
Kojto | 116:c0f6e94411f5 | 223 | ((SPEED) == COMP_MODE_LOWSPEED)) |
Kojto | 116:c0f6e94411f5 | 224 | /** |
Kojto | 116:c0f6e94411f5 | 225 | * @} |
Kojto | 116:c0f6e94411f5 | 226 | */ |
Kojto | 116:c0f6e94411f5 | 227 | |
Kojto | 116:c0f6e94411f5 | 228 | /** @defgroup COMP_WindowMode COMP window mode definition |
Kojto | 116:c0f6e94411f5 | 229 | * @{ |
Kojto | 116:c0f6e94411f5 | 230 | */ |
Kojto | 116:c0f6e94411f5 | 231 | #define COMP_WINDOWMODE_DISABLE ((uint32_t)0x00000000) /*!< Window mode disabled (Plus input of comparator 1 connected to PA1)*/ |
Kojto | 116:c0f6e94411f5 | 232 | #define COMP_WINDOWMODE_ENABLE COMP_CSR_COMP1WM /*!< Window mode enabled: Plus input of comparator 1 shorted with Plus input of comparator 2 */ |
Kojto | 116:c0f6e94411f5 | 233 | #define IS_COMP_WINDOWMODE(WINDOWMODE) (((WINDOWMODE) == COMP_WINDOWMODE_DISABLE) || \ |
Kojto | 116:c0f6e94411f5 | 234 | ((WINDOWMODE) == COMP_WINDOWMODE_ENABLE)) |
Kojto | 116:c0f6e94411f5 | 235 | |
Kojto | 116:c0f6e94411f5 | 236 | #if defined (STM32L072xx) || defined (STM32L073xx) || defined (STM32L082xx) || defined (STM32L083xx) |
Kojto | 116:c0f6e94411f5 | 237 | #define IS_COMP_WINDOWMODE_INSTANCE(INSTANCE) (((INSTANCE) == COMP1) ||\ |
Kojto | 116:c0f6e94411f5 | 238 | ((INSTANCE) == COMP2)) |
Kojto | 116:c0f6e94411f5 | 239 | #else |
Kojto | 116:c0f6e94411f5 | 240 | #define IS_COMP_WINDOWMODE_INSTANCE(INSTANCE) ((INSTANCE) == COMP1) |
Kojto | 116:c0f6e94411f5 | 241 | #endif |
Kojto | 116:c0f6e94411f5 | 242 | /** |
Kojto | 116:c0f6e94411f5 | 243 | * @} |
Kojto | 116:c0f6e94411f5 | 244 | */ |
Kojto | 116:c0f6e94411f5 | 245 | |
Kojto | 116:c0f6e94411f5 | 246 | /** @defgroup COMP_LPTIMConnection COMP Low power timer connection definition |
Kojto | 116:c0f6e94411f5 | 247 | * @{ |
Kojto | 116:c0f6e94411f5 | 248 | */ |
Kojto | 116:c0f6e94411f5 | 249 | #define COMP_LPTIMCONNECTION_DISABLED ((uint32_t)0x00000000) /*!< COMPx signal is gated */ |
Kojto | 116:c0f6e94411f5 | 250 | #define COMP_LPTIMCONNECTION_ENABLED COMP_CSR_COMP1LPTIM1IN1 /*!< COMPx signal is connected to LPTIM */ |
Kojto | 116:c0f6e94411f5 | 251 | #define IS_COMP_LPTIMCONNECTION(LPTIMCONNECTION) (((LPTIMCONNECTION) == COMP_LPTIMCONNECTION_DISABLED) || \ |
Kojto | 116:c0f6e94411f5 | 252 | ((LPTIMCONNECTION) == COMP_LPTIMCONNECTION_ENABLED)) |
Kojto | 116:c0f6e94411f5 | 253 | |
Kojto | 116:c0f6e94411f5 | 254 | /** |
Kojto | 116:c0f6e94411f5 | 255 | * @} |
Kojto | 116:c0f6e94411f5 | 256 | */ |
Kojto | 116:c0f6e94411f5 | 257 | |
Kojto | 116:c0f6e94411f5 | 258 | /** @defgroup COMP_OutputLevel COMP output level definition |
Kojto | 116:c0f6e94411f5 | 259 | * @{ |
Kojto | 116:c0f6e94411f5 | 260 | */ |
Kojto | 116:c0f6e94411f5 | 261 | /* When output polarity is not inverted, comparator output is low when |
Kojto | 116:c0f6e94411f5 | 262 | the non-inverting input is at a lower voltage than the inverting input*/ |
Kojto | 116:c0f6e94411f5 | 263 | #define COMP_OUTPUTLEVEL_LOW ((uint32_t)0x00000000) |
Kojto | 116:c0f6e94411f5 | 264 | /* When output polarity is not inverted, comparator output is high when |
Kojto | 116:c0f6e94411f5 | 265 | the non-inverting input is at a higher voltage than the inverting input */ |
Kojto | 116:c0f6e94411f5 | 266 | #define COMP_OUTPUTLEVEL_HIGH COMP_CSR_COMPxOUTVALUE |
Kojto | 116:c0f6e94411f5 | 267 | /** |
Kojto | 116:c0f6e94411f5 | 268 | * @} |
Kojto | 116:c0f6e94411f5 | 269 | */ |
Kojto | 116:c0f6e94411f5 | 270 | |
Kojto | 116:c0f6e94411f5 | 271 | /* CSR register Mask */ |
Kojto | 116:c0f6e94411f5 | 272 | #define COMP_CSR_UPDATE_PARAMETERS_MASK ((uint32_t)0xC0008779) |
Kojto | 116:c0f6e94411f5 | 273 | |
Kojto | 116:c0f6e94411f5 | 274 | #define COMP_LOCK_DISABLE ((uint32_t)0x00000000) |
Kojto | 116:c0f6e94411f5 | 275 | #define COMP_LOCK_ENABLE COMP_CSR_COMPxLOCK |
Kojto | 116:c0f6e94411f5 | 276 | |
Kojto | 116:c0f6e94411f5 | 277 | #define COMP_STATE_BIT_LOCK ((uint32_t)0x10) |
Kojto | 116:c0f6e94411f5 | 278 | |
Kojto | 116:c0f6e94411f5 | 279 | /** @defgroup COMP_TriggerMode COMP trigger mode definition |
Kojto | 116:c0f6e94411f5 | 280 | * @{ |
Kojto | 116:c0f6e94411f5 | 281 | */ |
Kojto | 116:c0f6e94411f5 | 282 | #define COMP_TRIGGERMODE_IT_RISING ((uint32_t)0x00000001) /*!< External Interrupt Mode with Rising edge trigger detection */ |
Kojto | 116:c0f6e94411f5 | 283 | #define COMP_TRIGGERMODE_IT_FALLING ((uint32_t)0x00000002) /*!< External Interrupt Mode with Falling edge trigger detection */ |
Kojto | 116:c0f6e94411f5 | 284 | #define COMP_TRIGGERMODE_IT_RISING_FALLING ((uint32_t)0x00000003) /*!< External Interrupt Mode with Rising/Falling edge trigger detection */ |
Kojto | 116:c0f6e94411f5 | 285 | #define IS_COMP_TRIGGERMODE(MODE) (((MODE) == COMP_TRIGGERMODE_IT_RISING) || \ |
Kojto | 116:c0f6e94411f5 | 286 | ((MODE) == COMP_TRIGGERMODE_IT_FALLING) || \ |
Kojto | 116:c0f6e94411f5 | 287 | ((MODE) == COMP_TRIGGERMODE_IT_RISING_FALLING)) |
Kojto | 116:c0f6e94411f5 | 288 | /** |
Kojto | 116:c0f6e94411f5 | 289 | * @} |
Kojto | 116:c0f6e94411f5 | 290 | */ |
Kojto | 116:c0f6e94411f5 | 291 | |
Kojto | 116:c0f6e94411f5 | 292 | /** @defgroup COMP_ExtiLineEvent COMP EXTI line definition |
Kojto | 116:c0f6e94411f5 | 293 | * @{ |
Kojto | 116:c0f6e94411f5 | 294 | */ |
Kojto | 116:c0f6e94411f5 | 295 | |
Kojto | 116:c0f6e94411f5 | 296 | #define COMP_EXTI_LINE_COMP2 ((uint32_t)0x00400000) /*!< External interrupt line 22 Connected to COMP2 */ |
Kojto | 116:c0f6e94411f5 | 297 | #define COMP_EXTI_LINE_COMP1 ((uint32_t)0x00200000) /*!< External interrupt line 21 Connected to COMP1 */ |
Kojto | 116:c0f6e94411f5 | 298 | |
Kojto | 116:c0f6e94411f5 | 299 | |
Kojto | 116:c0f6e94411f5 | 300 | /** |
Kojto | 116:c0f6e94411f5 | 301 | * @} |
Kojto | 116:c0f6e94411f5 | 302 | */ |
Kojto | 116:c0f6e94411f5 | 303 | /** |
Kojto | 116:c0f6e94411f5 | 304 | * @} |
Kojto | 116:c0f6e94411f5 | 305 | */ |
Kojto | 116:c0f6e94411f5 | 306 | |
Kojto | 116:c0f6e94411f5 | 307 | /* Exported macro ------------------------------------------------------------*/ |
Kojto | 116:c0f6e94411f5 | 308 | /** @brief Reset COMP handle state |
Kojto | 116:c0f6e94411f5 | 309 | * @param __HANDLE__: COMP handle. |
Kojto | 116:c0f6e94411f5 | 310 | * @retval None |
Kojto | 116:c0f6e94411f5 | 311 | */ |
Kojto | 116:c0f6e94411f5 | 312 | |
Kojto | 116:c0f6e94411f5 | 313 | /** @defgroup COMP_Exported_Macro COMP Exported Macro |
Kojto | 116:c0f6e94411f5 | 314 | * @{ |
Kojto | 116:c0f6e94411f5 | 315 | */ |
Kojto | 116:c0f6e94411f5 | 316 | /** |
Kojto | 116:c0f6e94411f5 | 317 | * @brief Reset the state machine associated to the handler |
Kojto | 116:c0f6e94411f5 | 318 | * @param __HANDLE__: COMP handle. |
Kojto | 116:c0f6e94411f5 | 319 | * @retval None. |
Kojto | 116:c0f6e94411f5 | 320 | */ |
Kojto | 116:c0f6e94411f5 | 321 | |
Kojto | 116:c0f6e94411f5 | 322 | #define __HAL_COMP_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_COMP_STATE_RESET) |
Kojto | 116:c0f6e94411f5 | 323 | |
Kojto | 116:c0f6e94411f5 | 324 | /** |
Kojto | 116:c0f6e94411f5 | 325 | * @brief Enables the specified comparator |
Kojto | 116:c0f6e94411f5 | 326 | * @param __HANDLE__: COMP handle. |
Kojto | 116:c0f6e94411f5 | 327 | * @retval None. |
Kojto | 116:c0f6e94411f5 | 328 | */ |
Kojto | 116:c0f6e94411f5 | 329 | #define __HAL_COMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CSR |= (COMP_CSR_COMPxEN)) |
Kojto | 116:c0f6e94411f5 | 330 | |
Kojto | 116:c0f6e94411f5 | 331 | /** |
Kojto | 116:c0f6e94411f5 | 332 | * @brief Disables the specified comparator |
Kojto | 116:c0f6e94411f5 | 333 | * @param __HANDLE__: COMP handle. |
Kojto | 116:c0f6e94411f5 | 334 | * @retval None. |
Kojto | 116:c0f6e94411f5 | 335 | */ |
Kojto | 116:c0f6e94411f5 | 336 | #define __HAL_COMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CSR &= ~(COMP_CSR_COMPxEN)) |
Kojto | 116:c0f6e94411f5 | 337 | |
Kojto | 116:c0f6e94411f5 | 338 | /** |
Kojto | 116:c0f6e94411f5 | 339 | * @brief Lock the specified comparator configuration |
Kojto | 116:c0f6e94411f5 | 340 | * @param __HANDLE__: COMP handle. |
Kojto | 116:c0f6e94411f5 | 341 | * @retval None. |
Kojto | 116:c0f6e94411f5 | 342 | */ |
Kojto | 116:c0f6e94411f5 | 343 | #define __HAL_COMP_LOCK(__HANDLE__) ((__HANDLE__)->Instance->CSR |= COMP_CSR_COMPxLOCK) |
Kojto | 116:c0f6e94411f5 | 344 | |
Kojto | 116:c0f6e94411f5 | 345 | /** @brief Checks whether the specified COMP flag is set or not. |
Kojto | 116:c0f6e94411f5 | 346 | * @param __HANDLE__: COMP handle. |
Kojto | 116:c0f6e94411f5 | 347 | * @param __FLAG__: specifies the flag to check. |
Kojto | 116:c0f6e94411f5 | 348 | * This parameter can be one of the following values: |
Kojto | 116:c0f6e94411f5 | 349 | * @arg COMP_FLAG_LOCK: lock flag |
Kojto | 116:c0f6e94411f5 | 350 | * @retval The new state of __FLAG__ (TRUE or FALSE). |
Kojto | 116:c0f6e94411f5 | 351 | */ |
Kojto | 116:c0f6e94411f5 | 352 | #define __HAL_COMP_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->CSR & (__FLAG__)) == (__FLAG__)) |
Kojto | 116:c0f6e94411f5 | 353 | |
Kojto | 116:c0f6e94411f5 | 354 | /** |
Kojto | 116:c0f6e94411f5 | 355 | * @brief Enable the Exti Line rising edge trigger. |
Kojto | 116:c0f6e94411f5 | 356 | */ |
Kojto | 116:c0f6e94411f5 | 357 | #define __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP1) |
Kojto | 116:c0f6e94411f5 | 358 | #define __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP2) |
Kojto | 116:c0f6e94411f5 | 359 | |
Kojto | 116:c0f6e94411f5 | 360 | /** |
Kojto | 116:c0f6e94411f5 | 361 | * @brief Disable the Exti Line rising edge trigger. |
Kojto | 116:c0f6e94411f5 | 362 | */ |
Kojto | 116:c0f6e94411f5 | 363 | #define __HAL_COMP_COMP1_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP1) |
Kojto | 116:c0f6e94411f5 | 364 | #define __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP2) |
Kojto | 116:c0f6e94411f5 | 365 | |
Kojto | 116:c0f6e94411f5 | 366 | /** |
Kojto | 116:c0f6e94411f5 | 367 | * @brief Enable the Exti Line falling edge trigger. |
Kojto | 116:c0f6e94411f5 | 368 | * @retval None. |
Kojto | 116:c0f6e94411f5 | 369 | */ |
Kojto | 116:c0f6e94411f5 | 370 | #define __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP1) |
Kojto | 116:c0f6e94411f5 | 371 | #define __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP2) |
Kojto | 116:c0f6e94411f5 | 372 | |
Kojto | 116:c0f6e94411f5 | 373 | /** |
Kojto | 116:c0f6e94411f5 | 374 | * @brief Disable the Exti Line falling edge trigger. |
Kojto | 116:c0f6e94411f5 | 375 | */ |
Kojto | 116:c0f6e94411f5 | 376 | #define __HAL_COMP_COMP1_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP1) |
Kojto | 116:c0f6e94411f5 | 377 | #define __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP2) |
Kojto | 116:c0f6e94411f5 | 378 | |
Kojto | 116:c0f6e94411f5 | 379 | /** |
Kojto | 116:c0f6e94411f5 | 380 | * @brief Enable the COMP1 EXTI line rising & falling edge trigger. |
Kojto | 116:c0f6e94411f5 | 381 | * @retval None. |
Kojto | 116:c0f6e94411f5 | 382 | */ |
Kojto | 116:c0f6e94411f5 | 383 | #define __HAL_COMP_COMP1_EXTI_ENABLE_RISING_FALLING_EDGE() do { \ |
Kojto | 116:c0f6e94411f5 | 384 | __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE(); \ |
Kojto | 116:c0f6e94411f5 | 385 | __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE(); \ |
Kojto | 116:c0f6e94411f5 | 386 | } while(0) |
Kojto | 116:c0f6e94411f5 | 387 | |
Kojto | 116:c0f6e94411f5 | 388 | /** |
Kojto | 116:c0f6e94411f5 | 389 | * @brief Disable the COMP1 EXTI line rising & falling edge trigger. |
Kojto | 116:c0f6e94411f5 | 390 | * @retval None. |
Kojto | 116:c0f6e94411f5 | 391 | */ |
Kojto | 116:c0f6e94411f5 | 392 | #define __HAL_COMP_COMP1_EXTI_DISABLE_RISING_FALLING_EDGE() do { \ |
Kojto | 116:c0f6e94411f5 | 393 | __HAL_COMP_COMP1_EXTI_DISABLE_RISING_EDGE(); \ |
Kojto | 116:c0f6e94411f5 | 394 | __HAL_COMP_COMP1_EXTI_DISABLE_FALLING_EDGE(); \ |
Kojto | 116:c0f6e94411f5 | 395 | } while(0) |
Kojto | 116:c0f6e94411f5 | 396 | |
Kojto | 116:c0f6e94411f5 | 397 | /** |
Kojto | 116:c0f6e94411f5 | 398 | * @brief Enable the COMP2 EXTI line rising & falling edge trigger. |
Kojto | 116:c0f6e94411f5 | 399 | * @retval None. |
Kojto | 116:c0f6e94411f5 | 400 | */ |
Kojto | 116:c0f6e94411f5 | 401 | #define __HAL_COMP_COMP2_EXTI_ENABLE_RISING_FALLING_EDGE() do { \ |
Kojto | 116:c0f6e94411f5 | 402 | __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE(); \ |
Kojto | 116:c0f6e94411f5 | 403 | __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE(); \ |
Kojto | 116:c0f6e94411f5 | 404 | } while(0) |
Kojto | 116:c0f6e94411f5 | 405 | |
Kojto | 116:c0f6e94411f5 | 406 | /** |
Kojto | 116:c0f6e94411f5 | 407 | * @brief Disable the COMP2 EXTI line rising & falling edge trigger. |
Kojto | 116:c0f6e94411f5 | 408 | * @retval None. |
Kojto | 116:c0f6e94411f5 | 409 | */ |
Kojto | 116:c0f6e94411f5 | 410 | #define __HAL_COMP_COMP2_EXTI_DISABLE_RISING_FALLING_EDGE() do { \ |
Kojto | 116:c0f6e94411f5 | 411 | __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE(); \ |
Kojto | 116:c0f6e94411f5 | 412 | __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE(); \ |
Kojto | 116:c0f6e94411f5 | 413 | } while(0) |
Kojto | 116:c0f6e94411f5 | 414 | |
Kojto | 116:c0f6e94411f5 | 415 | /** |
Kojto | 116:c0f6e94411f5 | 416 | * @brief Get the specified EXTI line for a comparator instance |
Kojto | 116:c0f6e94411f5 | 417 | * @param __INSTANCE__: specifies the COMP instance. |
Kojto | 116:c0f6e94411f5 | 418 | * @retval value of @ref COMP_ExtiLineEvent |
Kojto | 116:c0f6e94411f5 | 419 | */ |
Kojto | 116:c0f6e94411f5 | 420 | #define COMP_GET_EXTI_LINE(__INSTANCE__) (((__INSTANCE__) == COMP1) ? COMP_EXTI_LINE_COMP1 : \ |
Kojto | 116:c0f6e94411f5 | 421 | COMP_EXTI_LINE_COMP2) |
Kojto | 116:c0f6e94411f5 | 422 | |
Kojto | 116:c0f6e94411f5 | 423 | /** |
Kojto | 116:c0f6e94411f5 | 424 | * @brief Enable the COMP Exti Line. |
Kojto | 116:c0f6e94411f5 | 425 | * @retval None. |
Kojto | 116:c0f6e94411f5 | 426 | */ |
Kojto | 116:c0f6e94411f5 | 427 | |
Kojto | 116:c0f6e94411f5 | 428 | #define __HAL_COMP_COMP1_EXTI_ENABLE_IT() SET_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP1) |
Kojto | 116:c0f6e94411f5 | 429 | #define __HAL_COMP_COMP2_EXTI_ENABLE_IT() SET_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP2) |
Kojto | 116:c0f6e94411f5 | 430 | |
Kojto | 116:c0f6e94411f5 | 431 | /** |
Kojto | 116:c0f6e94411f5 | 432 | * @brief Disable the COMP Exti Line. |
Kojto | 116:c0f6e94411f5 | 433 | * @retval None. |
Kojto | 116:c0f6e94411f5 | 434 | */ |
Kojto | 116:c0f6e94411f5 | 435 | |
Kojto | 116:c0f6e94411f5 | 436 | #define __HAL_COMP_COMP1_EXTI_DISABLE_IT() CLEAR_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP1) |
Kojto | 116:c0f6e94411f5 | 437 | #define __HAL_COMP_COMP2_EXTI_DISABLE_IT() CLEAR_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP2) |
Kojto | 116:c0f6e94411f5 | 438 | |
Kojto | 116:c0f6e94411f5 | 439 | /** |
Kojto | 116:c0f6e94411f5 | 440 | * @brief Generate a software interrupt on the COMP EXTI line. |
Kojto | 116:c0f6e94411f5 | 441 | * @retval None |
Kojto | 116:c0f6e94411f5 | 442 | */ |
Kojto | 116:c0f6e94411f5 | 443 | #define __HAL_COMP_COMP1_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER, COMP_EXTI_LINE_COMP1) |
Kojto | 116:c0f6e94411f5 | 444 | #define __HAL_COMP_COMP2_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER, COMP_EXTI_LINE_COMP2) |
Kojto | 116:c0f6e94411f5 | 445 | |
Kojto | 116:c0f6e94411f5 | 446 | |
Kojto | 116:c0f6e94411f5 | 447 | /** |
Kojto | 116:c0f6e94411f5 | 448 | * @brief Enable the COMP EXTI Line in event mode |
Kojto | 116:c0f6e94411f5 | 449 | * @retval None |
Kojto | 116:c0f6e94411f5 | 450 | */ |
Kojto | 116:c0f6e94411f5 | 451 | #define __HAL_COMP_COMP1_EXTI_ENABLE_EVENT() SET_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP1) |
Kojto | 116:c0f6e94411f5 | 452 | #define __HAL_COMP_COMP2_EXTI_ENABLE_EVENT() SET_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP2) |
Kojto | 116:c0f6e94411f5 | 453 | |
Kojto | 116:c0f6e94411f5 | 454 | /** |
Kojto | 116:c0f6e94411f5 | 455 | * @brief Disable the COMP EXTI Line in event mode. |
Kojto | 116:c0f6e94411f5 | 456 | * @retval None |
Kojto | 116:c0f6e94411f5 | 457 | */ |
Kojto | 116:c0f6e94411f5 | 458 | #define __HAL_COMP_COMP1_EXTI_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP1) |
Kojto | 116:c0f6e94411f5 | 459 | #define __HAL_COMP_COMP2_EXTI_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP2) |
Kojto | 116:c0f6e94411f5 | 460 | /** |
Kojto | 116:c0f6e94411f5 | 461 | * @brief Checks whether the specified EXTI line flag is set or not. |
Kojto | 116:c0f6e94411f5 | 462 | * @retval The state of __FLAG__ (SET or RESET). |
Kojto | 116:c0f6e94411f5 | 463 | */ |
Kojto | 116:c0f6e94411f5 | 464 | |
Kojto | 116:c0f6e94411f5 | 465 | #define __HAL_COMP_COMP1_EXTI_GET_FLAG() READ_BIT(EXTI->PR, COMP_EXTI_LINE_COMP1) |
Kojto | 116:c0f6e94411f5 | 466 | #define __HAL_COMP_COMP2_EXTI_GET_FLAG() READ_BIT(EXTI->PR, COMP_EXTI_LINE_COMP2) |
Kojto | 116:c0f6e94411f5 | 467 | |
Kojto | 116:c0f6e94411f5 | 468 | /** |
Kojto | 116:c0f6e94411f5 | 469 | * @brief Clear the COMP Exti flags. |
Kojto | 116:c0f6e94411f5 | 470 | * @retval None. |
Kojto | 116:c0f6e94411f5 | 471 | */ |
Kojto | 116:c0f6e94411f5 | 472 | #define __HAL_COMP_COMP1_EXTI_CLEAR_FLAG() WRITE_REG(EXTI->PR, COMP_EXTI_LINE_COMP1) |
Kojto | 116:c0f6e94411f5 | 473 | #define __HAL_COMP_COMP2_EXTI_CLEAR_FLAG() WRITE_REG(EXTI->PR, COMP_EXTI_LINE_COMP2) |
Kojto | 116:c0f6e94411f5 | 474 | |
Kojto | 116:c0f6e94411f5 | 475 | |
Kojto | 116:c0f6e94411f5 | 476 | /** |
Kojto | 116:c0f6e94411f5 | 477 | * @} |
Kojto | 116:c0f6e94411f5 | 478 | */ |
Kojto | 116:c0f6e94411f5 | 479 | |
Kojto | 116:c0f6e94411f5 | 480 | /* Include COMP HAL Extended module */ |
Kojto | 116:c0f6e94411f5 | 481 | #include "stm32l0xx_hal_comp_ex.h" |
Kojto | 116:c0f6e94411f5 | 482 | |
Kojto | 116:c0f6e94411f5 | 483 | /* Exported functions --------------------------------------------------------*/ |
Kojto | 116:c0f6e94411f5 | 484 | /** @defgroup COMP_Exported_Functions COMP Exported Functions |
Kojto | 116:c0f6e94411f5 | 485 | * @{ |
Kojto | 116:c0f6e94411f5 | 486 | */ |
Kojto | 116:c0f6e94411f5 | 487 | |
Kojto | 116:c0f6e94411f5 | 488 | /** @defgroup COMP_Exported_Functions_Group1 Initialization/de-initialization functions |
Kojto | 116:c0f6e94411f5 | 489 | * @{ |
Kojto | 116:c0f6e94411f5 | 490 | */ |
Kojto | 116:c0f6e94411f5 | 491 | |
Kojto | 116:c0f6e94411f5 | 492 | /* Initialization/de-initialization functions **********************************/ |
Kojto | 116:c0f6e94411f5 | 493 | HAL_StatusTypeDef HAL_COMP_Init(COMP_HandleTypeDef *hcomp); |
Kojto | 116:c0f6e94411f5 | 494 | HAL_StatusTypeDef HAL_COMP_DeInit (COMP_HandleTypeDef *hcomp); |
Kojto | 116:c0f6e94411f5 | 495 | void HAL_COMP_MspInit(COMP_HandleTypeDef *hcomp); |
Kojto | 116:c0f6e94411f5 | 496 | void HAL_COMP_MspDeInit(COMP_HandleTypeDef *hcomp); |
Kojto | 116:c0f6e94411f5 | 497 | /** |
Kojto | 116:c0f6e94411f5 | 498 | * @} |
Kojto | 116:c0f6e94411f5 | 499 | */ |
Kojto | 116:c0f6e94411f5 | 500 | |
Kojto | 116:c0f6e94411f5 | 501 | /** @defgroup COMP_Exported_Functions_Group2 I/O operation functions |
Kojto | 116:c0f6e94411f5 | 502 | * @{ |
Kojto | 116:c0f6e94411f5 | 503 | */ |
Kojto | 116:c0f6e94411f5 | 504 | /* I/O operation functions *****************************************************/ |
Kojto | 116:c0f6e94411f5 | 505 | HAL_StatusTypeDef HAL_COMP_Start(COMP_HandleTypeDef *hcomp); |
Kojto | 116:c0f6e94411f5 | 506 | HAL_StatusTypeDef HAL_COMP_Stop(COMP_HandleTypeDef *hcomp); |
Kojto | 116:c0f6e94411f5 | 507 | HAL_StatusTypeDef HAL_COMP_Start_IT(COMP_HandleTypeDef *hcomp); |
Kojto | 116:c0f6e94411f5 | 508 | HAL_StatusTypeDef HAL_COMP_Stop_IT(COMP_HandleTypeDef *hcomp); |
Kojto | 116:c0f6e94411f5 | 509 | void HAL_COMP_IRQHandler(COMP_HandleTypeDef *hcomp); |
Kojto | 116:c0f6e94411f5 | 510 | /** |
Kojto | 116:c0f6e94411f5 | 511 | * @} |
Kojto | 116:c0f6e94411f5 | 512 | */ |
Kojto | 116:c0f6e94411f5 | 513 | |
Kojto | 116:c0f6e94411f5 | 514 | /** @defgroup COMP_Exported_Functions_Group3 Peripheral Control functions |
Kojto | 116:c0f6e94411f5 | 515 | * @{ |
Kojto | 116:c0f6e94411f5 | 516 | */ |
Kojto | 116:c0f6e94411f5 | 517 | /* Peripheral Control functions ************************************************/ |
Kojto | 116:c0f6e94411f5 | 518 | HAL_StatusTypeDef HAL_COMP_Lock(COMP_HandleTypeDef *hcomp); |
Kojto | 116:c0f6e94411f5 | 519 | uint32_t HAL_COMP_GetOutputLevel(COMP_HandleTypeDef *hcomp); |
Kojto | 116:c0f6e94411f5 | 520 | |
Kojto | 116:c0f6e94411f5 | 521 | /* Callback in Interrupt mode */ |
Kojto | 116:c0f6e94411f5 | 522 | void HAL_COMP_TriggerCallback(COMP_HandleTypeDef *hcomp); |
Kojto | 116:c0f6e94411f5 | 523 | /** |
Kojto | 116:c0f6e94411f5 | 524 | * @} |
Kojto | 116:c0f6e94411f5 | 525 | */ |
Kojto | 116:c0f6e94411f5 | 526 | |
Kojto | 116:c0f6e94411f5 | 527 | /** @defgroup COMP_Exported_Functions_Group4 Peripheral State functions |
Kojto | 116:c0f6e94411f5 | 528 | * @{ |
Kojto | 116:c0f6e94411f5 | 529 | */ |
Kojto | 116:c0f6e94411f5 | 530 | /* Peripheral State functions **************************************************/ |
Kojto | 116:c0f6e94411f5 | 531 | HAL_COMP_StateTypeDef HAL_COMP_GetState(COMP_HandleTypeDef *hcomp); |
Kojto | 116:c0f6e94411f5 | 532 | |
Kojto | 116:c0f6e94411f5 | 533 | /** |
Kojto | 116:c0f6e94411f5 | 534 | * @} |
Kojto | 116:c0f6e94411f5 | 535 | */ |
Kojto | 116:c0f6e94411f5 | 536 | |
Kojto | 116:c0f6e94411f5 | 537 | |
Kojto | 116:c0f6e94411f5 | 538 | /** |
Kojto | 116:c0f6e94411f5 | 539 | * @} |
Kojto | 116:c0f6e94411f5 | 540 | */ |
Kojto | 116:c0f6e94411f5 | 541 | |
Kojto | 116:c0f6e94411f5 | 542 | /** |
Kojto | 116:c0f6e94411f5 | 543 | * @} |
Kojto | 116:c0f6e94411f5 | 544 | */ |
Kojto | 116:c0f6e94411f5 | 545 | |
Kojto | 116:c0f6e94411f5 | 546 | /** |
Kojto | 116:c0f6e94411f5 | 547 | * @} |
Kojto | 116:c0f6e94411f5 | 548 | */ |
Kojto | 116:c0f6e94411f5 | 549 | |
Kojto | 116:c0f6e94411f5 | 550 | #ifdef __cplusplus |
Kojto | 116:c0f6e94411f5 | 551 | } |
Kojto | 116:c0f6e94411f5 | 552 | #endif |
Kojto | 116:c0f6e94411f5 | 553 | |
Kojto | 116:c0f6e94411f5 | 554 | #endif /* __STM32L0xx_HAL_COMP_H */ |
Kojto | 116:c0f6e94411f5 | 555 | |
Kojto | 116:c0f6e94411f5 | 556 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
Kojto | 116:c0f6e94411f5 | 557 |