cc y / mbed

Fork of mbed by mbed official

Committer:
Kojto
Date:
Wed Apr 27 12:10:56 2016 -0500
Revision:
119:aae6fcc7d9bb
Parent:
96:487b796308b0
Release 119 of the mbed library

Changes:
- new targets - EFM32PG_STK3401, NUCLEO_L031K6
- ST - hwflwctl support for NUCLEO_L476RG
- Update STM32CUBE_L0 from v1.2 to v1.5
- STM32F7 - bugfix - The weak function HAL_Delay is overwritten to use us ticker API.
- Maxim - Fixing the send break for the MAXWSNENV and MAX32600MBED

Who changed what in which revision?

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