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