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 mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
109:9296ab0bfc11
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 109:9296ab0bfc11 1 /**
Kojto 109:9296ab0bfc11 2 ******************************************************************************
Kojto 109:9296ab0bfc11 3 * @file stm32f3xx_hal_comp_ex.h
Kojto 109:9296ab0bfc11 4 * @author MCD Application Team
Kojto 109:9296ab0bfc11 5 * @version V1.1.0
Kojto 109:9296ab0bfc11 6 * @date 12-Sept-2014
Kojto 109:9296ab0bfc11 7 * @brief Header file of COMP HAL Extended module.
Kojto 109:9296ab0bfc11 8 ******************************************************************************
Kojto 109:9296ab0bfc11 9 * @attention
Kojto 109:9296ab0bfc11 10 *
Kojto 109:9296ab0bfc11 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
Kojto 109:9296ab0bfc11 12 *
Kojto 109:9296ab0bfc11 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 109:9296ab0bfc11 14 * are permitted provided that the following conditions are met:
Kojto 109:9296ab0bfc11 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 109:9296ab0bfc11 16 * this list of conditions and the following disclaimer.
Kojto 109:9296ab0bfc11 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 109:9296ab0bfc11 18 * this list of conditions and the following disclaimer in the documentation
Kojto 109:9296ab0bfc11 19 * and/or other materials provided with the distribution.
Kojto 109:9296ab0bfc11 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 109:9296ab0bfc11 21 * may be used to endorse or promote products derived from this software
Kojto 109:9296ab0bfc11 22 * without specific prior written permission.
Kojto 109:9296ab0bfc11 23 *
Kojto 109:9296ab0bfc11 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 109:9296ab0bfc11 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 109:9296ab0bfc11 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 109:9296ab0bfc11 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 109:9296ab0bfc11 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 109:9296ab0bfc11 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 109:9296ab0bfc11 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 109:9296ab0bfc11 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 109:9296ab0bfc11 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 109:9296ab0bfc11 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 109:9296ab0bfc11 34 *
Kojto 109:9296ab0bfc11 35 ******************************************************************************
Kojto 109:9296ab0bfc11 36 */
Kojto 109:9296ab0bfc11 37
Kojto 109:9296ab0bfc11 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 109:9296ab0bfc11 39 #ifndef __STM32F3xx_HAL_COMP_EX_H
Kojto 109:9296ab0bfc11 40 #define __STM32F3xx_HAL_COMP_EX_H
Kojto 109:9296ab0bfc11 41
Kojto 109:9296ab0bfc11 42 #ifdef __cplusplus
Kojto 109:9296ab0bfc11 43 extern "C" {
Kojto 109:9296ab0bfc11 44 #endif
Kojto 109:9296ab0bfc11 45
Kojto 109:9296ab0bfc11 46 /* Includes ------------------------------------------------------------------*/
Kojto 109:9296ab0bfc11 47 #include "stm32f3xx_hal_def.h"
Kojto 109:9296ab0bfc11 48
Kojto 109:9296ab0bfc11 49 /** @addtogroup STM32F3xx_HAL_Driver
Kojto 109:9296ab0bfc11 50 * @{
Kojto 109:9296ab0bfc11 51 */
Kojto 109:9296ab0bfc11 52
Kojto 109:9296ab0bfc11 53 /** @defgroup COMPEx COMP Extended HAL module driver
Kojto 109:9296ab0bfc11 54 * @{
Kojto 109:9296ab0bfc11 55 */
Kojto 109:9296ab0bfc11 56
Kojto 109:9296ab0bfc11 57 /* Exported types ------------------------------------------------------------*/
Kojto 109:9296ab0bfc11 58 /* Exported constants --------------------------------------------------------*/
Kojto 109:9296ab0bfc11 59 /** @defgroup COMPEx_Exported_Constants COMP Extended Exported Constants
Kojto 109:9296ab0bfc11 60 * @{
Kojto 109:9296ab0bfc11 61 */
Kojto 109:9296ab0bfc11 62
Kojto 109:9296ab0bfc11 63 #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \
Kojto 109:9296ab0bfc11 64 defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)
Kojto 109:9296ab0bfc11 65 /** @defgroup COMPEx_InvertingInput COMP Extended InvertingInput (STM32F302xE/STM32F303xE/STM32F398xx/STM32F302xC/STM32F303xC/STM32F358xx Product devices)
Kojto 109:9296ab0bfc11 66 * @{
Kojto 109:9296ab0bfc11 67 */
Kojto 109:9296ab0bfc11 68 #define COMP_INVERTINGINPUT_1_4VREFINT ((uint32_t)0x00000000) /*!< 1/4 VREFINT connected to comparator inverting input */
Kojto 109:9296ab0bfc11 69 #define COMP_INVERTINGINPUT_1_2VREFINT COMP_CSR_COMPxINSEL_0 /*!< 1/2 VREFINT connected to comparator inverting input */
Kojto 109:9296ab0bfc11 70 #define COMP_INVERTINGINPUT_3_4VREFINT COMP_CSR_COMPxINSEL_1 /*!< 3/4 VREFINT connected to comparator inverting input */
Kojto 109:9296ab0bfc11 71 #define COMP_INVERTINGINPUT_VREFINT (COMP_CSR_COMPxINSEL_1|COMP_CSR_COMPxINSEL_0) /*!< VREFINT connected to comparator inverting input */
Kojto 109:9296ab0bfc11 72 #define COMP_INVERTINGINPUT_DAC1_CH1 COMP_CSR_COMPxINSEL_2 /*!< DAC1_CH1_OUT (PA4) connected to comparator inverting input */
Kojto 109:9296ab0bfc11 73 #define COMP_INVERTINGINPUT_DAC1_CH2 (COMP_CSR_COMPxINSEL_2|COMP_CSR_COMPxINSEL_0) /*!< DAC1_CH2_OUT (PA5) connected to comparator inverting input */
Kojto 109:9296ab0bfc11 74 #define COMP_INVERTINGINPUT_IO1 (COMP_CSR_COMPxINSEL_2|COMP_CSR_COMPxINSEL_1) /*!< I/O1 (PA0 for COMP1, PA2 for COMP2, PD15 for COMP3,
Kojto 109:9296ab0bfc11 75 PE8 for COMP4, PD13 for COMP5, PD10 for COMP6,
Kojto 109:9296ab0bfc11 76 PC0 for COMP7) connected to comparator inverting input */
Kojto 109:9296ab0bfc11 77 #define COMP_INVERTINGINPUT_IO2 COMP_CSR_COMPxINSEL /*!< I/O2 (PB12 for COMP3, PB2 for COMP4, PB10 for COMP5,
Kojto 109:9296ab0bfc11 78 PB15 for COMP6) connected to comparator inverting input */
Kojto 109:9296ab0bfc11 79 /* Aliases for compatibility */
Kojto 109:9296ab0bfc11 80 #define COMP_INVERTINGINPUT_DAC1 COMP_INVERTINGINPUT_DAC1_CH1
Kojto 109:9296ab0bfc11 81 #define COMP_INVERTINGINPUT_DAC2 COMP_INVERTINGINPUT_DAC1_CH2
Kojto 109:9296ab0bfc11 82
Kojto 109:9296ab0bfc11 83 #define IS_COMP_INVERTINGINPUT(INPUT) (((INPUT) == COMP_INVERTINGINPUT_1_4VREFINT) || \
Kojto 109:9296ab0bfc11 84 ((INPUT) == COMP_INVERTINGINPUT_1_2VREFINT) || \
Kojto 109:9296ab0bfc11 85 ((INPUT) == COMP_INVERTINGINPUT_3_4VREFINT) || \
Kojto 109:9296ab0bfc11 86 ((INPUT) == COMP_INVERTINGINPUT_VREFINT) || \
Kojto 109:9296ab0bfc11 87 ((INPUT) == COMP_INVERTINGINPUT_DAC1_CH1) || \
Kojto 109:9296ab0bfc11 88 ((INPUT) == COMP_INVERTINGINPUT_DAC1_CH2) || \
Kojto 109:9296ab0bfc11 89 ((INPUT) == COMP_INVERTINGINPUT_IO1) || \
Kojto 109:9296ab0bfc11 90 ((INPUT) == COMP_INVERTINGINPUT_IO2))
Kojto 109:9296ab0bfc11 91 /**
Kojto 109:9296ab0bfc11 92 * @}
Kojto 109:9296ab0bfc11 93 */
Kojto 109:9296ab0bfc11 94 #elif defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx)
Kojto 109:9296ab0bfc11 95 /** @defgroup COMPEx_InvertingInput COMP Extended InvertingInput (STM32F301x8/STM32F302x8/STM32F318xx Product devices)
Kojto 109:9296ab0bfc11 96 * @{
Kojto 109:9296ab0bfc11 97 */
Kojto 109:9296ab0bfc11 98 #define COMP_INVERTINGINPUT_1_4VREFINT ((uint32_t)0x00000000) /*!< 1/4 VREFINT connected to comparator inverting input */
Kojto 109:9296ab0bfc11 99 #define COMP_INVERTINGINPUT_1_2VREFINT COMP_CSR_COMPxINSEL_0 /*!< 1/2 VREFINT connected to comparator inverting input */
Kojto 109:9296ab0bfc11 100 #define COMP_INVERTINGINPUT_3_4VREFINT COMP_CSR_COMPxINSEL_1 /*!< 3/4 VREFINT connected to comparator inverting input */
Kojto 109:9296ab0bfc11 101 #define COMP_INVERTINGINPUT_VREFINT (COMP_CSR_COMPxINSEL_1|COMP_CSR_COMPxINSEL_0) /*!< VREFINT connected to comparator inverting input */
Kojto 109:9296ab0bfc11 102 #define COMP_INVERTINGINPUT_DAC1_CH1 COMP_CSR_COMPxINSEL_2 /*!< DAC1_CH1_OUT (PA4) connected to comparator inverting input */
Kojto 109:9296ab0bfc11 103 #define COMP_INVERTINGINPUT_IO1 (COMP_CSR_COMPxINSEL_2|COMP_CSR_COMPxINSEL_1) /*!< I/O1 (PA2 for COMP2, PB2 for COMP4, PB15 for COMP6)
Kojto 109:9296ab0bfc11 104 connected to comparator inverting input */
Kojto 109:9296ab0bfc11 105 /* Aliases for compatibility */
Kojto 109:9296ab0bfc11 106 #define COMP_INVERTINGINPUT_DAC1 COMP_INVERTINGINPUT_DAC1_CH1
Kojto 109:9296ab0bfc11 107
Kojto 109:9296ab0bfc11 108 #define IS_COMP_INVERTINGINPUT(INPUT) (((INPUT) == COMP_INVERTINGINPUT_1_4VREFINT) || \
Kojto 109:9296ab0bfc11 109 ((INPUT) == COMP_INVERTINGINPUT_1_2VREFINT) || \
Kojto 109:9296ab0bfc11 110 ((INPUT) == COMP_INVERTINGINPUT_3_4VREFINT) || \
Kojto 109:9296ab0bfc11 111 ((INPUT) == COMP_INVERTINGINPUT_VREFINT) || \
Kojto 109:9296ab0bfc11 112 ((INPUT) == COMP_INVERTINGINPUT_DAC1_CH1) || \
Kojto 109:9296ab0bfc11 113 ((INPUT) == COMP_INVERTINGINPUT_IO1))
Kojto 109:9296ab0bfc11 114 /**
Kojto 109:9296ab0bfc11 115 * @}
Kojto 109:9296ab0bfc11 116 */
Kojto 109:9296ab0bfc11 117 #elif defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
Kojto 109:9296ab0bfc11 118 /** @defgroup COMPEx_InvertingInput COMP Extended InvertingInput (STM32F303x8/STM32F334x8/STM32F328xx Product devices)
Kojto 109:9296ab0bfc11 119 * @{
Kojto 109:9296ab0bfc11 120 */
Kojto 109:9296ab0bfc11 121 #define COMP_INVERTINGINPUT_1_4VREFINT ((uint32_t)0x00000000) /*!< 1/4 VREFINT connected to comparator inverting input */
Kojto 109:9296ab0bfc11 122 #define COMP_INVERTINGINPUT_1_2VREFINT COMP_CSR_COMPxINSEL_0 /*!< 1/2 VREFINT connected to comparator inverting input */
Kojto 109:9296ab0bfc11 123 #define COMP_INVERTINGINPUT_3_4VREFINT COMP_CSR_COMPxINSEL_1 /*!< 3/4 VREFINT connected to comparator inverting input */
Kojto 109:9296ab0bfc11 124 #define COMP_INVERTINGINPUT_VREFINT (COMP_CSR_COMPxINSEL_1|COMP_CSR_COMPxINSEL_0) /*!< VREFINT connected to comparator inverting input */
Kojto 109:9296ab0bfc11 125 #define COMP_INVERTINGINPUT_DAC1_CH1 COMP_CSR_COMPxINSEL_2 /*!< DAC1_CH1_OUT (PA4) connected to comparator inverting input */
Kojto 109:9296ab0bfc11 126 #define COMP_INVERTINGINPUT_DAC1_CH2 (COMP_CSR_COMPxINSEL_2|COMP_CSR_COMPxINSEL_0) /*!< DAC1_CH2_OUT (PA5) connected to comparator inverting input */
Kojto 109:9296ab0bfc11 127 #define COMP_INVERTINGINPUT_IO1 (COMP_CSR_COMPxINSEL_2|COMP_CSR_COMPxINSEL_1) /*!< I/O1 (PA2 for COMP2, PB2 for COMP4, PB15 for COMP6)
Kojto 109:9296ab0bfc11 128 connected to comparator inverting input */
Kojto 109:9296ab0bfc11 129 #define COMP_INVERTINGINPUT_DAC2_CH1 COMP_CSR_COMPxINSEL_3 /*!< DAC2_CH1_OUT connected to comparator inverting input */
Kojto 109:9296ab0bfc11 130 /* Aliases for compatibility */
Kojto 109:9296ab0bfc11 131 #define COMP_INVERTINGINPUT_DAC1 COMP_INVERTINGINPUT_DAC1_CH1
Kojto 109:9296ab0bfc11 132 #define COMP_INVERTINGINPUT_DAC2 COMP_INVERTINGINPUT_DAC1_CH2
Kojto 109:9296ab0bfc11 133
Kojto 109:9296ab0bfc11 134 #define IS_COMP_INVERTINGINPUT(INPUT) (((INPUT) == COMP_INVERTINGINPUT_1_4VREFINT) || \
Kojto 109:9296ab0bfc11 135 ((INPUT) == COMP_INVERTINGINPUT_1_2VREFINT) || \
Kojto 109:9296ab0bfc11 136 ((INPUT) == COMP_INVERTINGINPUT_3_4VREFINT) || \
Kojto 109:9296ab0bfc11 137 ((INPUT) == COMP_INVERTINGINPUT_VREFINT) || \
Kojto 109:9296ab0bfc11 138 ((INPUT) == COMP_INVERTINGINPUT_DAC1_CH1) || \
Kojto 109:9296ab0bfc11 139 ((INPUT) == COMP_INVERTINGINPUT_DAC1_CH2) || \
Kojto 109:9296ab0bfc11 140 ((INPUT) == COMP_INVERTINGINPUT_IO1) || \
Kojto 109:9296ab0bfc11 141 ((INPUT) == COMP_INVERTINGINPUT_DAC2_CH1))
Kojto 109:9296ab0bfc11 142 /**
Kojto 109:9296ab0bfc11 143 * @}
Kojto 109:9296ab0bfc11 144 */
Kojto 109:9296ab0bfc11 145 #elif defined(STM32F373xC) || defined(STM32F378xx)
Kojto 109:9296ab0bfc11 146 /** @defgroup COMPEx_InvertingInput COMP Extended InvertingInput (STM32F373xC/STM32F378xx Product devices)
Kojto 109:9296ab0bfc11 147 * @{
Kojto 109:9296ab0bfc11 148 */
Kojto 109:9296ab0bfc11 149 #define COMP_INVERTINGINPUT_1_4VREFINT ((uint32_t)0x00000000) /*!< 1/4 VREFINT connected to comparator inverting input */
Kojto 109:9296ab0bfc11 150 #define COMP_INVERTINGINPUT_1_2VREFINT ((uint32_t)COMP_CSR_COMPxINSEL_0) /*!< 1/2 VREFINT connected to comparator inverting input */
Kojto 109:9296ab0bfc11 151 #define COMP_INVERTINGINPUT_3_4VREFINT ((uint32_t)COMP_CSR_COMPxINSEL_1) /*!< 3/4 VREFINT connected to comparator inverting input */
Kojto 109:9296ab0bfc11 152 #define COMP_INVERTINGINPUT_VREFINT ((uint32_t)(COMP_CSR_COMPxINSEL_1|COMP_CSR_COMPxINSEL_0)) /*!< VREFINT connected to comparator inverting input */
Kojto 109:9296ab0bfc11 153 #define COMP_INVERTINGINPUT_DAC1_CH1 ((uint32_t)COMP_CSR_COMPxINSEL_2) /*!< DAC1_CH1_OUT (PA4) connected to comparator inverting input */
Kojto 109:9296ab0bfc11 154 #define COMP_INVERTINGINPUT_DAC1_CH2 ((uint32_t)(COMP_CSR_COMPxINSEL_2|COMP_CSR_COMPxINSEL_0)) /*!< DAC1_CH2_OUT (PA5) connected to comparator inverting input */
Kojto 109:9296ab0bfc11 155 #define COMP_INVERTINGINPUT_IO1 ((uint32_t)(COMP_CSR_COMPxINSEL_2|COMP_CSR_COMPxINSEL_1)) /*!< I/O1 (PA0 for COMP1, PA2 for COMP2) connected to comparator inverting input */
Kojto 109:9296ab0bfc11 156 #define COMP_INVERTINGINPUT_DAC2_CH1 ((uint32_t)COMP_CSR_COMPxINSEL) /*!< DAC2_CH1_OUT connected to comparator inverting input */
Kojto 109:9296ab0bfc11 157 /* Aliases for compatibility */
Kojto 109:9296ab0bfc11 158 #define COMP_INVERTINGINPUT_DAC1 COMP_INVERTINGINPUT_DAC1_CH1
Kojto 109:9296ab0bfc11 159 #define COMP_INVERTINGINPUT_DAC2 COMP_INVERTINGINPUT_DAC1_CH2
Kojto 109:9296ab0bfc11 160
Kojto 109:9296ab0bfc11 161 #define IS_COMP_INVERTINGINPUT(INPUT) (((INPUT) == COMP_INVERTINGINPUT_1_4VREFINT) || \
Kojto 109:9296ab0bfc11 162 ((INPUT) == COMP_INVERTINGINPUT_1_2VREFINT) || \
Kojto 109:9296ab0bfc11 163 ((INPUT) == COMP_INVERTINGINPUT_3_4VREFINT) || \
Kojto 109:9296ab0bfc11 164 ((INPUT) == COMP_INVERTINGINPUT_VREFINT) || \
Kojto 109:9296ab0bfc11 165 ((INPUT) == COMP_INVERTINGINPUT_DAC1_CH1) || \
Kojto 109:9296ab0bfc11 166 ((INPUT) == COMP_INVERTINGINPUT_DAC1_CH2) || \
Kojto 109:9296ab0bfc11 167 ((INPUT) == COMP_INVERTINGINPUT_IO1) || \
Kojto 109:9296ab0bfc11 168 ((INPUT) == COMP_INVERTINGINPUT_DAC2_CH1))
Kojto 109:9296ab0bfc11 169 /**
Kojto 109:9296ab0bfc11 170 * @}
Kojto 109:9296ab0bfc11 171 */
Kojto 109:9296ab0bfc11 172 #endif /* STM32F302xE || STM32F303xE || STM32F398xx || */
Kojto 109:9296ab0bfc11 173 /* STM32F302xC || STM32F303xC || STM32F358xx */
Kojto 109:9296ab0bfc11 174
Kojto 109:9296ab0bfc11 175 #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)
Kojto 109:9296ab0bfc11 176 /** @defgroup COMPEx_NonInvertingInput COMP Extended NonInvertingInput (STM32F302xC/STM32F303xC/STM32F358xx Product devices)
Kojto 109:9296ab0bfc11 177 * @{
Kojto 109:9296ab0bfc11 178 */
Kojto 109:9296ab0bfc11 179 #define COMP_NONINVERTINGINPUT_IO1 ((uint32_t)0x00000000) /*!< I/O1 (PA1 for COMP1, PA7 for COMP2, PB14 for COMP3,
Kojto 109:9296ab0bfc11 180 PB0 for COMP4, PD12 for COMP5, PD11 for COMP6,
Kojto 109:9296ab0bfc11 181 PA0 for COMP7) connected to comparator non inverting input */
Kojto 109:9296ab0bfc11 182 #define COMP_NONINVERTINGINPUT_IO2 COMP_CSR_COMPxNONINSEL /*!< I/O2 (PA3 for COMP2, PD14 for COMP3, PE7 for COMP4, PB13 for COMP5,
Kojto 109:9296ab0bfc11 183 PB11 for COMP6, PC1 for COMP7) connected to comparator non inverting input */
Kojto 109:9296ab0bfc11 184 #define COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED COMP1_CSR_COMP1SW1 /*!< DAC ouput connected to comparator COMP1 non inverting input */
Kojto 109:9296ab0bfc11 185
Kojto 109:9296ab0bfc11 186 #define IS_COMP_NONINVERTINGINPUT(INPUT) (((INPUT) == COMP_NONINVERTINGINPUT_IO1) || \
Kojto 109:9296ab0bfc11 187 ((INPUT) == COMP_NONINVERTINGINPUT_IO2) || \
Kojto 109:9296ab0bfc11 188 ((INPUT) == COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED))
Kojto 109:9296ab0bfc11 189
Kojto 109:9296ab0bfc11 190 /* STM32F302xB/xC, STM32F303xB/xC, STM32F358xx devices comparator instances non inverting source values */
Kojto 109:9296ab0bfc11 191 #define IS_COMP_NONINVERTINGINPUT_INSTANCE(INSTANCE, INPUT) \
Kojto 109:9296ab0bfc11 192 ((((INSTANCE) == COMP1) && \
Kojto 109:9296ab0bfc11 193 (((INPUT) == COMP_NONINVERTINGINPUT_IO1) || \
Kojto 109:9296ab0bfc11 194 ((INPUT) == COMP_NONINVERTINGINPUT_IO2) || \
Kojto 109:9296ab0bfc11 195 ((INPUT) == COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED))) \
Kojto 109:9296ab0bfc11 196 || \
Kojto 109:9296ab0bfc11 197 ((((INPUT) == COMP_NONINVERTINGINPUT_IO1) || \
Kojto 109:9296ab0bfc11 198 ((INPUT) == COMP_NONINVERTINGINPUT_IO2))))
Kojto 109:9296ab0bfc11 199
Kojto 109:9296ab0bfc11 200 #define COMP_CSR_COMPxNONINSEL_MASK (COMP_CSR_COMPxNONINSEL | COMP1_CSR_COMP1SW1) /*!< COMP_CSR_COMPxNONINSEL mask */
Kojto 109:9296ab0bfc11 201 /**
Kojto 109:9296ab0bfc11 202 * @}
Kojto 109:9296ab0bfc11 203 */
Kojto 109:9296ab0bfc11 204 #elif defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx)
Kojto 109:9296ab0bfc11 205 /** @defgroup COMPEx_NonInvertingInput COMP Extended NonInvertingInput (STM32F301x8/STM32F302x8/STM32F318xx Product devices)
Kojto 109:9296ab0bfc11 206 * @{
Kojto 109:9296ab0bfc11 207 */
Kojto 109:9296ab0bfc11 208 #define COMP_NONINVERTINGINPUT_IO1 ((uint32_t)0x00000000) /*!< I/O1 (PA7 for COMP2, PB0 for COMP4, PB11 for COMP6)
Kojto 109:9296ab0bfc11 209 connected to comparator non inverting input */
Kojto 109:9296ab0bfc11 210 #define COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED COMP2_CSR_COMP2INPDAC /*!< DAC ouput connected to comparator COMP2 non inverting input */
Kojto 109:9296ab0bfc11 211
Kojto 109:9296ab0bfc11 212 #define IS_COMP_NONINVERTINGINPUT(INPUT) (((INPUT) == COMP_NONINVERTINGINPUT_IO1) || \
Kojto 109:9296ab0bfc11 213 ((INPUT) == COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED))
Kojto 109:9296ab0bfc11 214
Kojto 109:9296ab0bfc11 215 /* STM32F301x6/x8, STM32F302x6/x8, STM32F318xx devices comparator instances non inverting source values */
Kojto 109:9296ab0bfc11 216 #define IS_COMP_NONINVERTINGINPUT_INSTANCE(INSTANCE, INPUT) \
Kojto 109:9296ab0bfc11 217 ((((INSTANCE) == COMP2) && \
Kojto 109:9296ab0bfc11 218 (((INPUT) == COMP_NONINVERTINGINPUT_IO1) || \
Kojto 109:9296ab0bfc11 219 ((INPUT) == COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED))) \
Kojto 109:9296ab0bfc11 220 || \
Kojto 109:9296ab0bfc11 221 (((INPUT) == COMP_NONINVERTINGINPUT_IO1)))
Kojto 109:9296ab0bfc11 222
Kojto 109:9296ab0bfc11 223 #define COMP_CSR_COMPxNONINSEL_MASK (COMP2_CSR_COMP2INPDAC) /*!< COMP_CSR_COMPxNONINSEL mask */
Kojto 109:9296ab0bfc11 224 /**
Kojto 109:9296ab0bfc11 225 * @}
Kojto 109:9296ab0bfc11 226 */
Kojto 109:9296ab0bfc11 227 #elif defined(STM32F373xC) || defined(STM32F378xx)
Kojto 109:9296ab0bfc11 228 /** @defgroup COMPEx_NonInvertingInput COMP Extended NonInvertingInput (STM32F373xC/STM32F378xx Product devices)
Kojto 109:9296ab0bfc11 229 * @{
Kojto 109:9296ab0bfc11 230 */
Kojto 109:9296ab0bfc11 231 #define COMP_NONINVERTINGINPUT_IO1 ((uint32_t)0x00000000) /*!< I/O1 (PA1 for COMP1, PA3 for COMP2)
Kojto 109:9296ab0bfc11 232 connected to comparator non inverting input */
Kojto 109:9296ab0bfc11 233 #define COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED COMP_CSR_COMP1SW1 /*!< DAC ouput connected to comparator COMP1 non inverting input */
Kojto 109:9296ab0bfc11 234
Kojto 109:9296ab0bfc11 235 #define IS_COMP_NONINVERTINGINPUT(INPUT) (((INPUT) == COMP_NONINVERTINGINPUT_IO1) || \
Kojto 109:9296ab0bfc11 236 ((INPUT) == COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED))
Kojto 109:9296ab0bfc11 237
Kojto 109:9296ab0bfc11 238 /* STM32F373xB/xC, STM32F378xx devices comparator instances non inverting source values */
Kojto 109:9296ab0bfc11 239 #define IS_COMP_NONINVERTINGINPUT_INSTANCE(INSTANCE, INPUT) \
Kojto 109:9296ab0bfc11 240 ((((INSTANCE) == COMP1) && \
Kojto 109:9296ab0bfc11 241 (((INPUT) == COMP_NONINVERTINGINPUT_IO1) || \
Kojto 109:9296ab0bfc11 242 ((INPUT) == COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED))) \
Kojto 109:9296ab0bfc11 243 || \
Kojto 109:9296ab0bfc11 244 (((INPUT) == COMP_NONINVERTINGINPUT_IO1)))
Kojto 109:9296ab0bfc11 245
Kojto 109:9296ab0bfc11 246 #define COMP_CSR_COMPxNONINSEL_MASK (COMP_CSR_COMP1SW1) /*!< COMP_CSR_COMPxNONINSEL mask */
Kojto 109:9296ab0bfc11 247 /**
Kojto 109:9296ab0bfc11 248 * @}
Kojto 109:9296ab0bfc11 249 */
Kojto 109:9296ab0bfc11 250 #elif defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)
Kojto 109:9296ab0bfc11 251 /** @defgroup COMPEx_NonInvertingInput COMP Extended NonInvertingInput (STM32F302xE/STM32F303xE/STM32F398xx Product devices)
Kojto 109:9296ab0bfc11 252 * @{
Kojto 109:9296ab0bfc11 253 */
Kojto 109:9296ab0bfc11 254 #define COMP_NONINVERTINGINPUT_IO1 ((uint32_t)0x00000000) /*!< I/O1 (PA1 for COMP1, PA7 for COMP2, PB14 for COMP3,
Kojto 109:9296ab0bfc11 255 PB0 for COMP4, PD12 for COMP5, PD11 for COMP6,
Kojto 109:9296ab0bfc11 256 PA0 for COMP7) connected to comparator non inverting input */
Kojto 109:9296ab0bfc11 257 #define COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED COMP1_CSR_COMP1SW1 /*!< DAC ouput connected to comparator COMP1 non inverting input */
Kojto 109:9296ab0bfc11 258
Kojto 109:9296ab0bfc11 259 #define IS_COMP_NONINVERTINGINPUT(INPUT) (((INPUT) == COMP_NONINVERTINGINPUT_IO1) || \
Kojto 109:9296ab0bfc11 260 ((INPUT) == COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED))
Kojto 109:9296ab0bfc11 261
Kojto 109:9296ab0bfc11 262 /* STM32F302xE/STM32F303xE/STM32F398xx devices comparator instances non inverting source values */
Kojto 109:9296ab0bfc11 263 #define IS_COMP_NONINVERTINGINPUT_INSTANCE(INSTANCE, INPUT) \
Kojto 109:9296ab0bfc11 264 ((((INSTANCE) == COMP1) && \
Kojto 109:9296ab0bfc11 265 (((INPUT) == COMP_NONINVERTINGINPUT_IO1) || \
Kojto 109:9296ab0bfc11 266 ((INPUT) == COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED))) \
Kojto 109:9296ab0bfc11 267 || \
Kojto 109:9296ab0bfc11 268 (((INPUT) == COMP_NONINVERTINGINPUT_IO1)))
Kojto 109:9296ab0bfc11 269
Kojto 109:9296ab0bfc11 270 #define COMP_CSR_COMPxNONINSEL_MASK (COMP1_CSR_COMP1SW1) /*!< COMP_CSR_COMPxNONINSEL mask */
Kojto 109:9296ab0bfc11 271 /**
Kojto 109:9296ab0bfc11 272 * @}
Kojto 109:9296ab0bfc11 273 */
Kojto 109:9296ab0bfc11 274 #else
Kojto 109:9296ab0bfc11 275 /** @defgroup COMPEx_NonInvertingInput COMP Extended NonInvertingInput (Other Product devices)
Kojto 109:9296ab0bfc11 276 * @{
Kojto 109:9296ab0bfc11 277 */
Kojto 109:9296ab0bfc11 278 #define COMP_NONINVERTINGINPUT_IO1 ((uint32_t)0x00000000) /*!< I/O1 (PA7 for COMP2, PB0 for COMP4, PB11 for COMP6)
Kojto 109:9296ab0bfc11 279 connected to comparator non inverting input */
Kojto 109:9296ab0bfc11 280 /*!< Non inverting input not available */
Kojto 109:9296ab0bfc11 281 #define IS_COMP_NONINVERTINGINPUT(INPUT) ((INPUT) == (INPUT)) /*!< Multiple selection not available: check always true */
Kojto 109:9296ab0bfc11 282
Kojto 109:9296ab0bfc11 283 #define IS_COMP_NONINVERTINGINPUT_INSTANCE(INSTANCE, INPUT) ((INPUT) == (INPUT)) /*!< Multiple selection not available: check always true */
Kojto 109:9296ab0bfc11 284
Kojto 109:9296ab0bfc11 285 #define COMP_CSR_COMPxNONINSEL_MASK ((uint32_t)0x00000000) /*!< Mask empty: feature not available */
Kojto 109:9296ab0bfc11 286 /**
Kojto 109:9296ab0bfc11 287 * @}
Kojto 109:9296ab0bfc11 288 */
Kojto 109:9296ab0bfc11 289 #endif /* STM32F302xC || STM32F303xC || STM32F358xx */
Kojto 109:9296ab0bfc11 290
Kojto 109:9296ab0bfc11 291 #if defined(STM32F302xC)
Kojto 109:9296ab0bfc11 292 /** @defgroup COMPEx_Output COMP Extended Output (STM32F302xC Product devices)
Kojto 109:9296ab0bfc11 293 * @{
Kojto 109:9296ab0bfc11 294 */
Kojto 109:9296ab0bfc11 295 #define COMP_OUTPUT_NONE ((uint32_t)0x00000000) /*!< COMP output isn't connected to other peripherals */
Kojto 109:9296ab0bfc11 296 /* Output Redirection common for all comparators COMP1, COMP2, COMP4, COMP6 */
Kojto 109:9296ab0bfc11 297 #define COMP_OUTPUT_TIM1BKIN COMP_CSR_COMPxOUTSEL_0 /*!< COMP output connected to TIM1 Break Input (BKIN) */
Kojto 109:9296ab0bfc11 298 #define COMP_OUTPUT_TIM1BKIN2_BRK2 ((uint32_t)0x00000800) /*!< COMP output connected to TIM1 Break Input 2 (BKIN2) */
Kojto 109:9296ab0bfc11 299 #define COMP_OUTPUT_TIM1BKIN2 ((uint32_t)0x00001400) /*!< COMP output connected to TIM1 Break Input 2 */
Kojto 109:9296ab0bfc11 300 /* Output Redirection common for COMP1 and COMP2 */
Kojto 109:9296ab0bfc11 301 #define COMP_OUTPUT_TIM1OCREFCLR ((uint32_t)0x00001800) /*!< COMP output connected to TIM1 OCREF Clear */
Kojto 109:9296ab0bfc11 302 #define COMP_OUTPUT_TIM1IC1 ((uint32_t)0x00001C00) /*!< COMP output connected to TIM1 Input Capture 1 */
Kojto 109:9296ab0bfc11 303 #define COMP_OUTPUT_TIM2IC4 ((uint32_t)0x00002000) /*!< COMP output connected to TIM2 Input Capture 4 */
Kojto 109:9296ab0bfc11 304 #define COMP_OUTPUT_TIM2OCREFCLR ((uint32_t)0x00002400) /*!< COMP output connected to TIM2 OCREF Clear */
Kojto 109:9296ab0bfc11 305 #define COMP_OUTPUT_TIM3IC1 ((uint32_t)0x00002800) /*!< COMP output connected to TIM3 Input Capture 1 */
Kojto 109:9296ab0bfc11 306 /* Output Redirection common for COMP1,COMP2 and COMP4 */
Kojto 109:9296ab0bfc11 307 #define COMP_OUTPUT_TIM3OCREFCLR ((uint32_t)0x00002C00) /*!< COMP output connected to TIM3 OCREF Clear */
Kojto 109:9296ab0bfc11 308 /* Output Redirection specific to COMP4 */
Kojto 109:9296ab0bfc11 309 #define COMP_OUTPUT_TIM3IC3 ((uint32_t)0x00001800) /*!< COMP output connected to TIM3 Input Capture 3 */
Kojto 109:9296ab0bfc11 310 #define COMP_OUTPUT_TIM15IC2 ((uint32_t)0x00002000) /*!< COMP output connected to TIM15 Input Capture 2 */
Kojto 109:9296ab0bfc11 311 #define COMP_OUTPUT_TIM4IC2 ((uint32_t)0x00002400) /*!< COMP output connected to TIM4 Input Capture 2 */
Kojto 109:9296ab0bfc11 312 #define COMP_OUTPUT_TIM15OCREFCLR ((uint32_t)0x00002800) /*!< COMP output connected to TIM15 OCREF Clear */
Kojto 109:9296ab0bfc11 313 /* Output Redirection specific to COMP6 */
Kojto 109:9296ab0bfc11 314 #define COMP_OUTPUT_TIM2IC2 ((uint32_t)0x00001800) /*!< COMP output connected to TIM2 Input Capture 2 */
Kojto 109:9296ab0bfc11 315 #define COMP_OUTPUT_COMP6TIM2OCREFCLR ((uint32_t)0x00002000) /*!< COMP6 output connected to TIM2 OCREF Clear */
Kojto 109:9296ab0bfc11 316 #define COMP_OUTPUT_TIM16OCREFCLR ((uint32_t)0x00002400) /*!< COMP output connected to TIM16 OCREF Clear */
Kojto 109:9296ab0bfc11 317 #define COMP_OUTPUT_TIM16IC1 ((uint32_t)0x00002800) /*!< COMP output connected to TIM16 Input Capture 1 */
Kojto 109:9296ab0bfc11 318 #define COMP_OUTPUT_TIM4IC4 ((uint32_t)0x00002C00) /*!< COMP output connected to TIM4 Input Capture 4 */
Kojto 109:9296ab0bfc11 319
Kojto 109:9296ab0bfc11 320 #define IS_COMP_OUTPUT(OUTPUT) (((OUTPUT) == COMP_OUTPUT_NONE) || \
Kojto 109:9296ab0bfc11 321 ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
Kojto 109:9296ab0bfc11 322 ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_BRK2) || \
Kojto 109:9296ab0bfc11 323 ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
Kojto 109:9296ab0bfc11 324 ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
Kojto 109:9296ab0bfc11 325 ((OUTPUT) == COMP_OUTPUT_TIM1IC1) || \
Kojto 109:9296ab0bfc11 326 ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
Kojto 109:9296ab0bfc11 327 ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
Kojto 109:9296ab0bfc11 328 ((OUTPUT) == COMP_OUTPUT_TIM3IC1) || \
Kojto 109:9296ab0bfc11 329 ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR) || \
Kojto 109:9296ab0bfc11 330 ((OUTPUT) == COMP_OUTPUT_TIM3IC3) || \
Kojto 109:9296ab0bfc11 331 ((OUTPUT) == COMP_OUTPUT_TIM15IC2) || \
Kojto 109:9296ab0bfc11 332 ((OUTPUT) == COMP_OUTPUT_TIM4IC2) || \
Kojto 109:9296ab0bfc11 333 ((OUTPUT) == COMP_OUTPUT_TIM15OCREFCLR) || \
Kojto 109:9296ab0bfc11 334 ((OUTPUT) == COMP_OUTPUT_TIM2IC2) || \
Kojto 109:9296ab0bfc11 335 ((OUTPUT) == COMP_OUTPUT_COMP6TIM2OCREFCLR) || \
Kojto 109:9296ab0bfc11 336 ((OUTPUT) == COMP_OUTPUT_TIM16OCREFCLR) || \
Kojto 109:9296ab0bfc11 337 ((OUTPUT) == COMP_OUTPUT_TIM16IC1) || \
Kojto 109:9296ab0bfc11 338 ((OUTPUT) == COMP_OUTPUT_TIM4IC4))
Kojto 109:9296ab0bfc11 339 /**
Kojto 109:9296ab0bfc11 340 * @}
Kojto 109:9296ab0bfc11 341 */
Kojto 109:9296ab0bfc11 342 #elif defined(STM32F303xC) || defined(STM32F358xx)
Kojto 109:9296ab0bfc11 343 /** @defgroup COMPEx_Output COMP Extended Output (STM32F303xC/STM32F358xx Product devices)
Kojto 109:9296ab0bfc11 344 * @{
Kojto 109:9296ab0bfc11 345 */
Kojto 109:9296ab0bfc11 346 #define COMP_OUTPUT_NONE ((uint32_t)0x00000000) /*!< COMP output isn't connected to other peripherals */
Kojto 109:9296ab0bfc11 347 /* Output Redirection common for all comparators COMP1...COMP7 */
Kojto 109:9296ab0bfc11 348 #define COMP_OUTPUT_TIM1BKIN COMP_CSR_COMPxOUTSEL_0 /*!< COMP output connected to TIM1 Break Input (BKIN) */
Kojto 109:9296ab0bfc11 349 #define COMP_OUTPUT_TIM1BKIN2 ((uint32_t)0x00000800) /*!< COMP output connected to TIM1 Break Input 2 (BKIN2) */
Kojto 109:9296ab0bfc11 350 #define COMP_OUTPUT_TIM8BKIN ((uint32_t)0x00000C00) /*!< COMP output connected to TIM8 Break Input (BKIN) */
Kojto 109:9296ab0bfc11 351 #define COMP_OUTPUT_TIM8BKIN2 ((uint32_t)0x00001000) /*!< COMP output connected to TIM8 Break Input 2 (BKIN2) */
Kojto 109:9296ab0bfc11 352 #define COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2 ((uint32_t)0x00001400) /*!< COMP output connected to TIM1 Break Input 2 and TIM8 Break Input 2 */
Kojto 109:9296ab0bfc11 353 /* Output Redirection common for COMP1, COMP2 and COMP3 */
Kojto 109:9296ab0bfc11 354 #define COMP_OUTPUT_TIM1OCREFCLR ((uint32_t)0x00001800) /*!< COMP output connected to TIM1 OCREF Clear */
Kojto 109:9296ab0bfc11 355 /* Output Redirection common for COMP1 and COMP2 */
Kojto 109:9296ab0bfc11 356 #define COMP_OUTPUT_TIM1IC1 ((uint32_t)0x00001C00) /*!< COMP output connected to TIM1 Input Capture 1 */
Kojto 109:9296ab0bfc11 357 #define COMP_OUTPUT_TIM2IC4 ((uint32_t)0x00002000) /*!< COMP output connected to TIM2 Input Capture 4 */
Kojto 109:9296ab0bfc11 358 #define COMP_OUTPUT_TIM2OCREFCLR ((uint32_t)0x00002400) /*!< COMP output connected to TIM2 OCREF Clear */
Kojto 109:9296ab0bfc11 359 #define COMP_OUTPUT_TIM3IC1 ((uint32_t)0x00002800) /*!< COMP output connected to TIM3 Input Capture 1 */
Kojto 109:9296ab0bfc11 360 #define COMP_OUTPUT_TIM3OCREFCLR ((uint32_t)0x00002C00) /*!< COMP output connected to TIM3 OCREF Clear */
Kojto 109:9296ab0bfc11 361 /* Output Redirection specific to COMP3 */
Kojto 109:9296ab0bfc11 362 #define COMP_OUTPUT_TIM4IC1 ((uint32_t)0x00001C00) /*!< COMP output connected to TIM4 Input Capture 1 */
Kojto 109:9296ab0bfc11 363 #define COMP_OUTPUT_TIM3IC2 ((uint32_t)0x00002000) /*!< COMP output connected to TIM3 Input Capture 2 */
Kojto 109:9296ab0bfc11 364 #define COMP_OUTPUT_TIM15IC1 ((uint32_t)0x00002800) /*!< COMP output connected to TIM15 Input Capture 1 */
Kojto 109:9296ab0bfc11 365 #define COMP_OUTPUT_TIM15BKIN ((uint32_t)0x00002C00) /*!< COMP output connected to TIM15 Break Input (BKIN) */
Kojto 109:9296ab0bfc11 366 /* Output Redirection specific to COMP4 */
Kojto 109:9296ab0bfc11 367 #define COMP_OUTPUT_TIM3IC3 ((uint32_t)0x00001800) /*!< COMP output connected to TIM3 Input Capture 3 */
Kojto 109:9296ab0bfc11 368 #define COMP_OUTPUT_TIM8OCREFCLR ((uint32_t)0x00001C00) /*!< COMP output connected to TIM8 OCREF Clear */
Kojto 109:9296ab0bfc11 369 #define COMP_OUTPUT_TIM15IC2 ((uint32_t)0x00002000) /*!< COMP output connected to TIM15 Input Capture 2 */
Kojto 109:9296ab0bfc11 370 #define COMP_OUTPUT_TIM4IC2 ((uint32_t)0x00002400) /*!< COMP output connected to TIM4 Input Capture 2 */
Kojto 109:9296ab0bfc11 371 #define COMP_OUTPUT_TIM15OCREFCLR ((uint32_t)0x00002800) /*!< COMP output connected to TIM15 OCREF Clear */
Kojto 109:9296ab0bfc11 372 #define COMP_OUTPUT_TIM3OCREFCLR ((uint32_t)0x00002C00) /*!< COMP output connected to TIM3 OCREF Clear */
Kojto 109:9296ab0bfc11 373 /* Output Redirection specific to COMP5 */
Kojto 109:9296ab0bfc11 374 #define COMP_OUTPUT_TIM2IC1 ((uint32_t)0x00001800) /*!< COMP output connected to TIM2 Input Capture 1 */
Kojto 109:9296ab0bfc11 375 #define COMP_OUTPUT_TIM8OCREFCLR ((uint32_t)0x00001C00) /*!< COMP output connected to TIM8 OCREF Clear */
Kojto 109:9296ab0bfc11 376 #define COMP_OUTPUT_TIM17IC1 ((uint32_t)0x00002000) /*!< COMP output connected to TIM17 Input Capture 1 */
Kojto 109:9296ab0bfc11 377 #define COMP_OUTPUT_TIM4IC3 ((uint32_t)0x00002400) /*!< COMP output connected to TIM4 Input Capture 3 */
Kojto 109:9296ab0bfc11 378 #define COMP_OUTPUT_TIM16BKIN ((uint32_t)0x00002800) /*!< COMP output connected to TIM16 Break Input (BKIN) */
Kojto 109:9296ab0bfc11 379 #define COMP_OUTPUT_TIM3OCREFCLR ((uint32_t)0x00002C00) /*!< COMP output connected to TIM3 OCREF Clear */
Kojto 109:9296ab0bfc11 380 /* Output Redirection specific to COMP6 */
Kojto 109:9296ab0bfc11 381 #define COMP_OUTPUT_TIM2IC2 ((uint32_t)0x00001800) /*!< COMP output connected to TIM2 Input Capture 2 */
Kojto 109:9296ab0bfc11 382 #define COMP_OUTPUT_TIM8OCREFCLR ((uint32_t)0x00001C00) /*!< COMP output connected to TIM8 OCREF Clear */
Kojto 109:9296ab0bfc11 383 #define COMP_OUTPUT_COMP6_TIM2OCREFCLR ((uint32_t)0x00002000) /*!< COMP6 output connected to TIM2 OCREF Clear */
Kojto 109:9296ab0bfc11 384 #define COMP_OUTPUT_TIM16OCREFCLR ((uint32_t)0x00002400) /*!< COMP output connected to TIM16 OCREF Clear */
Kojto 109:9296ab0bfc11 385 #define COMP_OUTPUT_TIM16IC1 ((uint32_t)0x00002800) /*!< COMP output connected to TIM16 Input Capture 1 */
Kojto 109:9296ab0bfc11 386 #define COMP_OUTPUT_TIM4IC4 ((uint32_t)0x00002C00) /*!< COMP output connected to TIM4 Input Capture 4 */
Kojto 109:9296ab0bfc11 387 /* Output Redirection specific to COMP7 */
Kojto 109:9296ab0bfc11 388 #define COMP_OUTPUT_TIM1OCREFCLR ((uint32_t)0x00001800) /*!< COMP output connected to TIM1 OCREF Clear */
Kojto 109:9296ab0bfc11 389 #define COMP_OUTPUT_TIM8OCREFCLR ((uint32_t)0x00001C00) /*!< COMP output connected to TIM8 OCREF Clear */
Kojto 109:9296ab0bfc11 390 #define COMP_OUTPUT_TIM2IC3 ((uint32_t)0x00002000) /*!< COMP output connected to TIM2 Input Capture 3 */
Kojto 109:9296ab0bfc11 391 #define COMP_OUTPUT_TIM1IC2 ((uint32_t)0x00002400) /*!< COMP output connected to TIM1 Input Capture 2 */
Kojto 109:9296ab0bfc11 392 #define COMP_OUTPUT_TIM17OCREFCLR ((uint32_t)0x00002800) /*!< COMP output connected to TIM16 OCREF Clear */
Kojto 109:9296ab0bfc11 393 #define COMP_OUTPUT_TIM17BKIN ((uint32_t)0x00002C00) /*!< COMP output connected to TIM16 Break Input (BKIN) */
Kojto 109:9296ab0bfc11 394
Kojto 109:9296ab0bfc11 395 #define IS_COMP_OUTPUT(OUTPUT) (((OUTPUT) == COMP_OUTPUT_NONE) || \
Kojto 109:9296ab0bfc11 396 ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
Kojto 109:9296ab0bfc11 397 ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
Kojto 109:9296ab0bfc11 398 ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2) || \
Kojto 109:9296ab0bfc11 399 ((OUTPUT) == COMP_OUTPUT_TIM1IC1) || \
Kojto 109:9296ab0bfc11 400 ((OUTPUT) == COMP_OUTPUT_TIM1IC2) || \
Kojto 109:9296ab0bfc11 401 ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
Kojto 109:9296ab0bfc11 402 ((OUTPUT) == COMP_OUTPUT_TIM2IC1) || \
Kojto 109:9296ab0bfc11 403 ((OUTPUT) == COMP_OUTPUT_TIM2IC2) || \
Kojto 109:9296ab0bfc11 404 ((OUTPUT) == COMP_OUTPUT_TIM2IC3) || \
Kojto 109:9296ab0bfc11 405 ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
Kojto 109:9296ab0bfc11 406 ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
Kojto 109:9296ab0bfc11 407 ((OUTPUT) == COMP_OUTPUT_COMP6_TIM2OCREFCLR) || \
Kojto 109:9296ab0bfc11 408 ((OUTPUT) == COMP_OUTPUT_TIM3IC1) || \
Kojto 109:9296ab0bfc11 409 ((OUTPUT) == COMP_OUTPUT_TIM3IC2) || \
Kojto 109:9296ab0bfc11 410 ((OUTPUT) == COMP_OUTPUT_TIM3IC3) || \
Kojto 109:9296ab0bfc11 411 ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR) || \
Kojto 109:9296ab0bfc11 412 ((OUTPUT) == COMP_OUTPUT_TIM4IC1) || \
Kojto 109:9296ab0bfc11 413 ((OUTPUT) == COMP_OUTPUT_TIM4IC2) || \
Kojto 109:9296ab0bfc11 414 ((OUTPUT) == COMP_OUTPUT_TIM4IC3) || \
Kojto 109:9296ab0bfc11 415 ((OUTPUT) == COMP_OUTPUT_TIM4IC4) || \
Kojto 109:9296ab0bfc11 416 ((OUTPUT) == COMP_OUTPUT_TIM8BKIN) || \
Kojto 109:9296ab0bfc11 417 ((OUTPUT) == COMP_OUTPUT_TIM8BKIN2) || \
Kojto 109:9296ab0bfc11 418 ((OUTPUT) == COMP_OUTPUT_TIM8OCREFCLR) || \
Kojto 109:9296ab0bfc11 419 ((OUTPUT) == COMP_OUTPUT_TIM15IC1) || \
Kojto 109:9296ab0bfc11 420 ((OUTPUT) == COMP_OUTPUT_TIM15IC2) || \
Kojto 109:9296ab0bfc11 421 ((OUTPUT) == COMP_OUTPUT_TIM15BKIN) || \
Kojto 109:9296ab0bfc11 422 ((OUTPUT) == COMP_OUTPUT_TIM15OCREFCLR) || \
Kojto 109:9296ab0bfc11 423 ((OUTPUT) == COMP_OUTPUT_TIM16BKIN) || \
Kojto 109:9296ab0bfc11 424 ((OUTPUT) == COMP_OUTPUT_TIM16IC1) || \
Kojto 109:9296ab0bfc11 425 ((OUTPUT) == COMP_OUTPUT_TIM16OCREFCLR) || \
Kojto 109:9296ab0bfc11 426 ((OUTPUT) == COMP_OUTPUT_TIM17BKIN) || \
Kojto 109:9296ab0bfc11 427 ((OUTPUT) == COMP_OUTPUT_TIM17IC1) || \
Kojto 109:9296ab0bfc11 428 ((OUTPUT) == COMP_OUTPUT_TIM17OCREFCLR))
Kojto 109:9296ab0bfc11 429 /**
Kojto 109:9296ab0bfc11 430 * @}
Kojto 109:9296ab0bfc11 431 */
Kojto 109:9296ab0bfc11 432 #elif defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx)
Kojto 109:9296ab0bfc11 433 /** @defgroup COMPEx_Output COMP Extended Output (STM32F301x8/STM32F302x8/STM32F318xx Product devices)
Kojto 109:9296ab0bfc11 434 * @{
Kojto 109:9296ab0bfc11 435 */
Kojto 109:9296ab0bfc11 436 #define COMP_OUTPUT_NONE ((uint32_t)0x00000000) /*!< COMP output isn't connected to other peripherals */
Kojto 109:9296ab0bfc11 437 /* Output Redirection common for all comparators COMP2, COMP4 and COMP6 */
Kojto 109:9296ab0bfc11 438 #define COMP_OUTPUT_TIM1BKIN COMP_CSR_COMPxOUTSEL_0 /*!< COMP output connected to TIM1 Break Input (BKIN) */
Kojto 109:9296ab0bfc11 439 #define COMP_OUTPUT_TIM1BKIN2 ((uint32_t)0x00000800) /*!< COMP output connected to TIM1 Break Input 2 (BKIN2) */
Kojto 109:9296ab0bfc11 440 /* Output Redirection specific to COMP2 */
Kojto 109:9296ab0bfc11 441 #define COMP_OUTPUT_TIM1OCREFCLR ((uint32_t)0x00001800) /*!< COMP output connected to TIM1 OCREF Clear */
Kojto 109:9296ab0bfc11 442 #define COMP_OUTPUT_TIM1IC1 ((uint32_t)0x00001C00) /*!< COMP output connected to TIM1 Input Capture 1 */
Kojto 109:9296ab0bfc11 443 #define COMP_OUTPUT_TIM2IC4 ((uint32_t)0x00002000) /*!< COMP output connected to TIM2 Input Capture 4 */
Kojto 109:9296ab0bfc11 444 #define COMP_OUTPUT_TIM2OCREFCLR ((uint32_t)0x00002400) /*!< COMP output connected to TIM2 OCREF Clear */
Kojto 109:9296ab0bfc11 445 /* Output Redirection specific to COMP4 */
Kojto 109:9296ab0bfc11 446 #define COMP_OUTPUT_TIM15IC2 ((uint32_t)0x00002000) /*!< COMP output connected to TIM15 Input Capture 2 */
Kojto 109:9296ab0bfc11 447 #define COMP_OUTPUT_TIM15OCREFCLR ((uint32_t)0x00002800) /*!< COMP output connected to TIM15 OCREF Clear */
Kojto 109:9296ab0bfc11 448 /* Output Redirection specific to COMP6 */
Kojto 109:9296ab0bfc11 449 #define COMP_OUTPUT_TIM2IC2 ((uint32_t)0x00001800) /*!< COMP output connected to TIM2 Input Capture 2 */
Kojto 109:9296ab0bfc11 450 #define COMP_OUTPUT_COMP6_TIM2OCREFCLR ((uint32_t)0x00002000) /*!< COMP6 output connected to TIM2 OCREF Clear */
Kojto 109:9296ab0bfc11 451 #define COMP_OUTPUT_TIM16OCREFCLR ((uint32_t)0x00002400) /*!< COMP output connected to TIM16 OCREF Clear */
Kojto 109:9296ab0bfc11 452 #define COMP_OUTPUT_TIM16IC1 ((uint32_t)0x00002800) /*!< COMP output connected to TIM16 Input Capture 1 */
Kojto 109:9296ab0bfc11 453
Kojto 109:9296ab0bfc11 454 #define IS_COMP_OUTPUT(OUTPUT) (((OUTPUT) == COMP_OUTPUT_NONE) || \
Kojto 109:9296ab0bfc11 455 ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
Kojto 109:9296ab0bfc11 456 ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
Kojto 109:9296ab0bfc11 457 ((OUTPUT) == COMP_OUTPUT_TIM1IC1) || \
Kojto 109:9296ab0bfc11 458 ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
Kojto 109:9296ab0bfc11 459 ((OUTPUT) == COMP_OUTPUT_TIM2IC2) || \
Kojto 109:9296ab0bfc11 460 ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
Kojto 109:9296ab0bfc11 461 ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
Kojto 109:9296ab0bfc11 462 ((OUTPUT) == COMP_OUTPUT_COMP6_TIM2OCREFCLR) || \
Kojto 109:9296ab0bfc11 463 ((OUTPUT) == COMP_OUTPUT_TIM15IC2) || \
Kojto 109:9296ab0bfc11 464 ((OUTPUT) == COMP_OUTPUT_TIM15OCREFCLR) || \
Kojto 109:9296ab0bfc11 465 ((OUTPUT) == COMP_OUTPUT_TIM16IC1) || \
Kojto 109:9296ab0bfc11 466 ((OUTPUT) == COMP_OUTPUT_TIM16OCREFCLR))
Kojto 109:9296ab0bfc11 467 /**
Kojto 109:9296ab0bfc11 468 * @}
Kojto 109:9296ab0bfc11 469 */
Kojto 109:9296ab0bfc11 470 #elif defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
Kojto 109:9296ab0bfc11 471 /** @defgroup COMPEx_Output COMP Extended Output (STM32F303x8/STM32F334x8/STM32F328xx Product devices)
Kojto 109:9296ab0bfc11 472 * @{
Kojto 109:9296ab0bfc11 473 */
Kojto 109:9296ab0bfc11 474 #define COMP_OUTPUT_NONE ((uint32_t)0x00000000) /*!< COMP output isn't connected to other peripherals */
Kojto 109:9296ab0bfc11 475 /* Output Redirection common for all comparators COMP2, COMP4 and COMP6 */
Kojto 109:9296ab0bfc11 476 #define COMP_OUTPUT_TIM1BKIN COMP_CSR_COMPxOUTSEL_0 /*!< COMP output connected to TIM1 Break Input (BKIN) */
Kojto 109:9296ab0bfc11 477 #define COMP_OUTPUT_TIM1BKIN2 ((uint32_t)0x00000800) /*!< COMP output connected to TIM1 Break Input 2 (BKIN2) */
Kojto 109:9296ab0bfc11 478 /* Output Redirection specific to COMP2 */
Kojto 109:9296ab0bfc11 479 #define COMP_OUTPUT_TIM1OCREFCLR ((uint32_t)0x00001800) /*!< COMP output connected to TIM1 OCREF Clear */
Kojto 109:9296ab0bfc11 480 #define COMP_OUTPUT_TIM1IC1 ((uint32_t)0x00001C00) /*!< COMP output connected to TIM1 Input Capture 1 */
Kojto 109:9296ab0bfc11 481 #define COMP_OUTPUT_TIM2IC4 ((uint32_t)0x00002000) /*!< COMP output connected to TIM2 Input Capture 4 */
Kojto 109:9296ab0bfc11 482 #define COMP_OUTPUT_TIM2OCREFCLR ((uint32_t)0x00002400) /*!< COMP output connected to TIM2 OCREF Clear */
Kojto 109:9296ab0bfc11 483 #define COMP_OUTPUT_TIM3IC1 ((uint32_t)0x00002800) /*!< COMP output connected to TIM3 Input Capture 1 */
Kojto 109:9296ab0bfc11 484 #define COMP_OUTPUT_TIM3OCREFCLR ((uint32_t)0x00002C00) /*!< COMP output connected to TIM3 OCREF Clear */
Kojto 109:9296ab0bfc11 485 /* Output Redirection specific to COMP4 */
Kojto 109:9296ab0bfc11 486 #define COMP_OUTPUT_TIM3IC3 ((uint32_t)0x00001800) /*!< COMP output connected to TIM3 Input Capture 3 */
Kojto 109:9296ab0bfc11 487 #define COMP_OUTPUT_TIM15IC2 ((uint32_t)0x00002000) /*!< COMP output connected to TIM15 Input Capture 2 */
Kojto 109:9296ab0bfc11 488 #define COMP_OUTPUT_TIM15OCREFCLR ((uint32_t)0x00002800) /*!< COMP output connected to TIM15 OCREF Clear */
Kojto 109:9296ab0bfc11 489 #define COMP_OUTPUT_TIM3OCREFCLR ((uint32_t)0x00002C00) /*!< COMP output connected to TIM3 OCREF Clear */
Kojto 109:9296ab0bfc11 490 /* Output Redirection specific to COMP6 */
Kojto 109:9296ab0bfc11 491 #define COMP_OUTPUT_TIM2IC2 ((uint32_t)0x00001800) /*!< COMP output connected to TIM2 Input Capture 2 */
Kojto 109:9296ab0bfc11 492 #define COMP_OUTPUT_COMP6_TIM2OCREFCLR ((uint32_t)0x00002000) /*!< COMP6 output connected to TIM2 OCREF Clear */
Kojto 109:9296ab0bfc11 493 #define COMP_OUTPUT_TIM16OCREFCLR ((uint32_t)0x00002400) /*!< COMP output connected to TIM16 OCREF Clear */
Kojto 109:9296ab0bfc11 494 #define COMP_OUTPUT_TIM16IC1 ((uint32_t)0x00002800) /*!< COMP output connected to TIM16 Input Capture 1 */
Kojto 109:9296ab0bfc11 495
Kojto 109:9296ab0bfc11 496 #define IS_COMP_OUTPUT(OUTPUT) (((OUTPUT) == COMP_OUTPUT_NONE) || \
Kojto 109:9296ab0bfc11 497 ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
Kojto 109:9296ab0bfc11 498 ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
Kojto 109:9296ab0bfc11 499 ((OUTPUT) == COMP_OUTPUT_TIM1IC1) || \
Kojto 109:9296ab0bfc11 500 ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
Kojto 109:9296ab0bfc11 501 ((OUTPUT) == COMP_OUTPUT_TIM2IC2) || \
Kojto 109:9296ab0bfc11 502 ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
Kojto 109:9296ab0bfc11 503 ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
Kojto 109:9296ab0bfc11 504 ((OUTPUT) == COMP_OUTPUT_COMP6_TIM2OCREFCLR) || \
Kojto 109:9296ab0bfc11 505 ((OUTPUT) == COMP_OUTPUT_TIM3IC1) || \
Kojto 109:9296ab0bfc11 506 ((OUTPUT) == COMP_OUTPUT_TIM3IC3) || \
Kojto 109:9296ab0bfc11 507 ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR) || \
Kojto 109:9296ab0bfc11 508 ((OUTPUT) == COMP_OUTPUT_TIM15IC2) || \
Kojto 109:9296ab0bfc11 509 ((OUTPUT) == COMP_OUTPUT_TIM15OCREFCLR) || \
Kojto 109:9296ab0bfc11 510 ((OUTPUT) == COMP_OUTPUT_TIM16IC1) || \
Kojto 109:9296ab0bfc11 511 ((OUTPUT) == COMP_OUTPUT_TIM16OCREFCLR))
Kojto 109:9296ab0bfc11 512 /**
Kojto 109:9296ab0bfc11 513 * @}
Kojto 109:9296ab0bfc11 514 */
Kojto 109:9296ab0bfc11 515 #elif defined(STM32F373xC) || defined(STM32F378xx)
Kojto 109:9296ab0bfc11 516 /** @defgroup COMPEx_Output COMP Extended Output (STM32F373xC/STM32F378xx Product devices)
Kojto 109:9296ab0bfc11 517 * @{
Kojto 109:9296ab0bfc11 518 */
Kojto 109:9296ab0bfc11 519 /* Output Redirection common for all comparators COMP1 and COMP2 */
Kojto 109:9296ab0bfc11 520 #define COMP_OUTPUT_NONE ((uint32_t)0x0000) /*!< COMP output isn't connected to other peripherals */
Kojto 109:9296ab0bfc11 521 #define COMP_OUTPUT_TIM3IC1 ((uint32_t)0x0200) /*!< COMP output connected to TIM1 Input Capture 1 */
Kojto 109:9296ab0bfc11 522 #define COMP_OUTPUT_TIM3OCREFCLR ((uint32_t)0x0300) /*!< COMP output connected to TIM3 OCREF Clear */
Kojto 109:9296ab0bfc11 523 #define COMP_OUTPUT_TIM2IC4 ((uint32_t)0x0400) /*!< COMP output connected to TIM2 Input Capture 4 */
Kojto 109:9296ab0bfc11 524 #define COMP_OUTPUT_TIM2OCREFCLR ((uint32_t)0x0500) /*!< COMP output connected to TIM2 OCREF Clear */
Kojto 109:9296ab0bfc11 525 /* Output Redirection specific to COMP1 */
Kojto 109:9296ab0bfc11 526 #define COMP_OUTPUT_TIM15BKIN ((uint32_t)0x0100) /*!< COMP output connected to TIM15 Break Input */
Kojto 109:9296ab0bfc11 527 #define COMP_OUTPUT_TIM5IC4 ((uint32_t)0x0600) /*!< COMP output connected to TIM5 Input Capture 4 */
Kojto 109:9296ab0bfc11 528 #define COMP_OUTPUT_TIM5OCREFCLR ((uint32_t)0x0700) /*!< COMP output connected to TIM5 OCREF Clear */
Kojto 109:9296ab0bfc11 529 /* Output Redirection specific to COMP2 */
Kojto 109:9296ab0bfc11 530 #define COMP_OUTPUT_TIM16BKIN ((uint32_t)0x0100) /*!< COMP output connected to TIM16 Break Input */
Kojto 109:9296ab0bfc11 531 #define COMP_OUTPUT_TIM4IC1 ((uint32_t)0x0200) /*!< COMP output connected to TIM4 Input Capture 1 */
Kojto 109:9296ab0bfc11 532 #define COMP_OUTPUT_TIM4OCREFCLR ((uint32_t)0x0300) /*!< COMP output connected to TIM4 OCREF Clear */
Kojto 109:9296ab0bfc11 533
Kojto 109:9296ab0bfc11 534 #define IS_COMP_OUTPUT(OUTPUT) (((OUTPUT) == COMP_OUTPUT_NONE) || \
Kojto 109:9296ab0bfc11 535 ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
Kojto 109:9296ab0bfc11 536 ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
Kojto 109:9296ab0bfc11 537 ((OUTPUT) == COMP_OUTPUT_TIM3IC1) || \
Kojto 109:9296ab0bfc11 538 ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR) || \
Kojto 109:9296ab0bfc11 539 ((OUTPUT) == COMP_OUTPUT_TIM4IC1) || \
Kojto 109:9296ab0bfc11 540 ((OUTPUT) == COMP_OUTPUT_TIM4OCREFCLR) || \
Kojto 109:9296ab0bfc11 541 ((OUTPUT) == COMP_OUTPUT_TIM5IC4) || \
Kojto 109:9296ab0bfc11 542 ((OUTPUT) == COMP_OUTPUT_TIM5OCREFCLR) || \
Kojto 109:9296ab0bfc11 543 ((OUTPUT) == COMP_OUTPUT_TIM15BKIN) || \
Kojto 109:9296ab0bfc11 544 ((OUTPUT) == COMP_OUTPUT_TIM16BKIN))
Kojto 109:9296ab0bfc11 545 /**
Kojto 109:9296ab0bfc11 546 * @}
Kojto 109:9296ab0bfc11 547 */
Kojto 109:9296ab0bfc11 548 #elif defined(STM32F302xE)
Kojto 109:9296ab0bfc11 549 /** @defgroup COMPEx_Output COMP Extended Output (STM32F302xE Product devices)
Kojto 109:9296ab0bfc11 550 * @{
Kojto 109:9296ab0bfc11 551 */
Kojto 109:9296ab0bfc11 552 #define COMP_OUTPUT_NONE ((uint32_t)0x00000000) /*!< COMP output isn't connected to other peripherals */
Kojto 109:9296ab0bfc11 553 /* Output Redirection common for all comparators COMP1, COMP2, COMP4, COMP6 */
Kojto 109:9296ab0bfc11 554 #define COMP_OUTPUT_TIM1BKIN COMP_CSR_COMPxOUTSEL_0 /*!< COMP output connected to TIM1 Break Input (BKIN) */
Kojto 109:9296ab0bfc11 555 #define COMP_OUTPUT_TIM1BKIN2_BRK2 ((uint32_t)0x00000800) /*!< COMP output connected to TIM1 Break Input 2 (BKIN2) */
Kojto 109:9296ab0bfc11 556 #define COMP_OUTPUT_TIM1BKIN2 ((uint32_t)0x00001400) /*!< COMP output connected to TIM1 Break Input 2 */
Kojto 109:9296ab0bfc11 557 /* Output Redirection common for COMP1 and COMP2 */
Kojto 109:9296ab0bfc11 558 #define COMP_OUTPUT_TIM1OCREFCLR ((uint32_t)0x00001800) /*!< COMP output connected to TIM1 OCREF Clear */
Kojto 109:9296ab0bfc11 559 #define COMP_OUTPUT_TIM1IC1 ((uint32_t)0x00001C00) /*!< COMP output connected to TIM1 Input Capture 1 */
Kojto 109:9296ab0bfc11 560 #define COMP_OUTPUT_TIM2IC4 ((uint32_t)0x00002000) /*!< COMP output connected to TIM2 Input Capture 4 */
Kojto 109:9296ab0bfc11 561 #define COMP_OUTPUT_TIM2OCREFCLR ((uint32_t)0x00002400) /*!< COMP output connected to TIM2 OCREF Clear */
Kojto 109:9296ab0bfc11 562 #define COMP_OUTPUT_TIM3IC1 ((uint32_t)0x00002800) /*!< COMP output connected to TIM3 Input Capture 1 */
Kojto 109:9296ab0bfc11 563 #define COMP_OUTPUT_TIM3OCREFCLR ((uint32_t)0x00002C00) /*!< COMP output connected to TIM3 OCREF Clear */
Kojto 109:9296ab0bfc11 564 /* Output Redirection specific to COMP4 */
Kojto 109:9296ab0bfc11 565 #define COMP_OUTPUT_TIM3IC3 ((uint32_t)0x00001800) /*!< COMP output connected to TIM3 Input Capture 3 */
Kojto 109:9296ab0bfc11 566 #define COMP_OUTPUT_TIM15IC2 ((uint32_t)0x00002000) /*!< COMP output connected to TIM15 Input Capture 2 */
Kojto 109:9296ab0bfc11 567 #define COMP_OUTPUT_TIM4IC2 ((uint32_t)0x00002400) /*!< COMP output connected to TIM4 Input Capture 2 */
Kojto 109:9296ab0bfc11 568 #define COMP_OUTPUT_TIM15OCREFCLR ((uint32_t)0x00002800) /*!< COMP output connected to TIM15 OCREF Clear */
Kojto 109:9296ab0bfc11 569 /* Output Redirection specific to COMP6 */
Kojto 109:9296ab0bfc11 570 #define COMP_OUTPUT_TIM2IC2 ((uint32_t)0x00001800) /*!< COMP output connected to TIM2 Input Capture 2 */
Kojto 109:9296ab0bfc11 571 #define COMP_OUTPUT_COMP6TIM2OCREFCLR ((uint32_t)0x00002000) /*!< COMP output connected to TIM2 OCREF Clear */
Kojto 109:9296ab0bfc11 572 #define COMP_OUTPUT_TIM16OCREFCLR ((uint32_t)0x00002400) /*!< COMP output connected to TIM16 OCREF Clear */
Kojto 109:9296ab0bfc11 573 #define COMP_OUTPUT_TIM16IC1 ((uint32_t)0x00002800) /*!< COMP output connected to TIM16 Input Capture 1 */
Kojto 109:9296ab0bfc11 574 #define COMP_OUTPUT_TIM4IC4 ((uint32_t)0x00002C00) /*!< COMP output connected to TIM4 Input Capture 4 */
Kojto 109:9296ab0bfc11 575
Kojto 109:9296ab0bfc11 576 #define IS_COMP_OUTPUT(OUTPUT) (((OUTPUT) == COMP_OUTPUT_NONE) || \
Kojto 109:9296ab0bfc11 577 ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
Kojto 109:9296ab0bfc11 578 ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_BRK2) || \
Kojto 109:9296ab0bfc11 579 ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
Kojto 109:9296ab0bfc11 580 ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
Kojto 109:9296ab0bfc11 581 ((OUTPUT) == COMP_OUTPUT_TIM1IC1) || \
Kojto 109:9296ab0bfc11 582 ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
Kojto 109:9296ab0bfc11 583 ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
Kojto 109:9296ab0bfc11 584 ((OUTPUT) == COMP_OUTPUT_TIM3IC1) || \
Kojto 109:9296ab0bfc11 585 ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR) || \
Kojto 109:9296ab0bfc11 586 ((OUTPUT) == COMP_OUTPUT_TIM3IC3) || \
Kojto 109:9296ab0bfc11 587 ((OUTPUT) == COMP_OUTPUT_TIM15IC2) || \
Kojto 109:9296ab0bfc11 588 ((OUTPUT) == COMP_OUTPUT_TIM4IC2) || \
Kojto 109:9296ab0bfc11 589 ((OUTPUT) == COMP_OUTPUT_TIM15OCREFCLR) || \
Kojto 109:9296ab0bfc11 590 ((OUTPUT) == COMP_OUTPUT_TIM2IC2) || \
Kojto 109:9296ab0bfc11 591 ((OUTPUT) == COMP_OUTPUT_COMP6TIM2OCREFCLR) || \
Kojto 109:9296ab0bfc11 592 ((OUTPUT) == COMP_OUTPUT_TIM16OCREFCLR) || \
Kojto 109:9296ab0bfc11 593 ((OUTPUT) == COMP_OUTPUT_TIM16IC1) || \
Kojto 109:9296ab0bfc11 594 ((OUTPUT) == COMP_OUTPUT_TIM4IC4))
Kojto 109:9296ab0bfc11 595
Kojto 109:9296ab0bfc11 596 /**
Kojto 109:9296ab0bfc11 597 * @}
Kojto 109:9296ab0bfc11 598 */
Kojto 109:9296ab0bfc11 599 #elif defined(STM32F303xE) || defined(STM32F398xx)
Kojto 109:9296ab0bfc11 600 /** @defgroup COMPEx_Output COMP Extended Output (STM32F303xE/STM32F398xx Product devices)
Kojto 109:9296ab0bfc11 601 * @{
Kojto 109:9296ab0bfc11 602 */
Kojto 109:9296ab0bfc11 603 #define COMP_OUTPUT_NONE ((uint32_t)0x00000000) /*!< COMP output isn't connected to other peripherals */
Kojto 109:9296ab0bfc11 604 /* Output Redirection common for all comparators COMP1...COMP7 */
Kojto 109:9296ab0bfc11 605 #define COMP_OUTPUT_TIM1BKIN COMP_CSR_COMPxOUTSEL_0 /*!< COMP output connected to TIM1 Break Input (BKIN) */
Kojto 109:9296ab0bfc11 606 #define COMP_OUTPUT_TIM1BKIN2 ((uint32_t)0x00000800) /*!< COMP output connected to TIM1 Break Input 2 (BKIN2) */
Kojto 109:9296ab0bfc11 607 #define COMP_OUTPUT_TIM8BKIN ((uint32_t)0x00000C00) /*!< COMP output connected to TIM8 Break Input (BKIN) */
Kojto 109:9296ab0bfc11 608 #define COMP_OUTPUT_TIM8BKIN2 ((uint32_t)0x00001000) /*!< COMP output connected to TIM8 Break Input 2 (BKIN2) */
Kojto 109:9296ab0bfc11 609 #define COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2 ((uint32_t)0x00001400) /*!< COMP output connected to TIM1 Break Input 2 and TIM8 Break Input 2 */
Kojto 109:9296ab0bfc11 610 #define COMP_OUTPUT_TIM20BKIN ((uint32_t)0x00003000) /*!< COMP output connected to TIM20 Break Input (BKIN) */
Kojto 109:9296ab0bfc11 611 #define COMP_OUTPUT_TIM20BKIN2 ((uint32_t)0x00003400) /*!< COMP output connected to TIM20 Break Input 2 (BKIN2) */
Kojto 109:9296ab0bfc11 612 #define COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2_TIM20BKIN2 ((uint32_t)0x00003800) /*!< COMP output connected to TIM1 Break Input 2, TIM8 Break Input 2 and TIM20 Break Input 2 */
Kojto 109:9296ab0bfc11 613 /* Output Redirection common for COMP1 and COMP2 */
Kojto 109:9296ab0bfc11 614 #define COMP_OUTPUT_TIM1OCREFCLR ((uint32_t)0x00001800) /*!< COMP output connected to TIM1 OCREF Clear */
Kojto 109:9296ab0bfc11 615 #define COMP_OUTPUT_TIM1IC1 ((uint32_t)0x00001C00) /*!< COMP output connected to TIM1 Input Capture 1 */
Kojto 109:9296ab0bfc11 616 #define COMP_OUTPUT_TIM2IC4 ((uint32_t)0x00002000) /*!< COMP output connected to TIM2 Input Capture 4 */
Kojto 109:9296ab0bfc11 617 #define COMP_OUTPUT_TIM2OCREFCLR ((uint32_t)0x00002400) /*!< COMP output connected to TIM2 OCREF Clear */
Kojto 109:9296ab0bfc11 618 #define COMP_OUTPUT_TIM3IC1 ((uint32_t)0x00002800) /*!< COMP output connected to TIM3 Input Capture 1 */
Kojto 109:9296ab0bfc11 619 #define COMP_OUTPUT_TIM3OCREFCLR ((uint32_t)0x00002C00) /*!< COMP output connected to TIM3 OCREF Clear */
Kojto 109:9296ab0bfc11 620 /* Output Redirection specific to COMP2 */
Kojto 109:9296ab0bfc11 621 #define COMP_OUTPUT_TIM20OCREFCLR ((uint32_t)0x00003C00) /*!< COMP output connected to TIM20 OCREF Clear */
Kojto 109:9296ab0bfc11 622 /* Output Redirection specific to COMP3 */
Kojto 109:9296ab0bfc11 623 #define COMP_OUTPUT_TIM4IC1 ((uint32_t)0x00001C00) /*!< COMP output connected to TIM4 Input Capture 1 */
Kojto 109:9296ab0bfc11 624 #define COMP_OUTPUT_TIM3IC2 ((uint32_t)0x00002000) /*!< COMP output connected to TIM3 Input Capture 2 */
Kojto 109:9296ab0bfc11 625 #define COMP_OUTPUT_TIM15IC1 ((uint32_t)0x00002800) /*!< COMP output connected to TIM15 Input Capture 1 */
Kojto 109:9296ab0bfc11 626 #define COMP_OUTPUT_TIM15BKIN ((uint32_t)0x00002C00) /*!< COMP output connected to TIM15 Break Input (BKIN) */
Kojto 109:9296ab0bfc11 627 /* Output Redirection specific to COMP4 */
Kojto 109:9296ab0bfc11 628 #define COMP_OUTPUT_TIM3IC3 ((uint32_t)0x00001800) /*!< COMP output connected to TIM3 Input Capture 3 */
Kojto 109:9296ab0bfc11 629 #define COMP_OUTPUT_TIM8OCREFCLR ((uint32_t)0x00001C00) /*!< COMP output connected to TIM8 OCREF Clear */
Kojto 109:9296ab0bfc11 630 #define COMP_OUTPUT_TIM15IC2 ((uint32_t)0x00002000) /*!< COMP output connected to TIM15 Input Capture 2 */
Kojto 109:9296ab0bfc11 631 #define COMP_OUTPUT_TIM4IC2 ((uint32_t)0x00002400) /*!< COMP output connected to TIM4 Input Capture 2 */
Kojto 109:9296ab0bfc11 632 #define COMP_OUTPUT_TIM15OCREFCLR ((uint32_t)0x00002800) /*!< COMP output connected to TIM15 OCREF Clear */
Kojto 109:9296ab0bfc11 633 /* Output Redirection specific to COMP5 */
Kojto 109:9296ab0bfc11 634 #define COMP_OUTPUT_TIM2IC1 ((uint32_t)0x00001800) /*!< COMP output connected to TIM2 Input Capture 1 */
Kojto 109:9296ab0bfc11 635 #define COMP_OUTPUT_TIM17IC1 ((uint32_t)0x00002000) /*!< COMP output connected to TIM17 Input Capture 1 */
Kojto 109:9296ab0bfc11 636 #define COMP_OUTPUT_TIM4IC3 ((uint32_t)0x00002400) /*!< COMP output connected to TIM4 Input Capture 3 */
Kojto 109:9296ab0bfc11 637 #define COMP_OUTPUT_TIM16BKIN ((uint32_t)0x00002800) /*!< COMP output connected to TIM16 Break Input (BKIN) */
Kojto 109:9296ab0bfc11 638 /* Output Redirection specific to COMP6 */
Kojto 109:9296ab0bfc11 639 #define COMP_OUTPUT_TIM2IC2 ((uint32_t)0x00001800) /*!< COMP output connected to TIM2 Input Capture 2 */
Kojto 109:9296ab0bfc11 640 #define COMP_OUTPUT_COMP6TIM2OCREFCLR ((uint32_t)0x00002000) /*!< COMP output connected to TIM2 OCREF Clear */
Kojto 109:9296ab0bfc11 641 #define COMP_OUTPUT_TIM16OCREFCLR ((uint32_t)0x00002400) /*!< COMP output connected to TIM16 OCREF Clear */
Kojto 109:9296ab0bfc11 642 #define COMP_OUTPUT_TIM16IC1 ((uint32_t)0x00002800) /*!< COMP output connected to TIM16 Input Capture 1 */
Kojto 109:9296ab0bfc11 643 #define COMP_OUTPUT_TIM4IC4 ((uint32_t)0x00002C00) /*!< COMP output connected to TIM4 Input Capture 4 */
Kojto 109:9296ab0bfc11 644 /* Output Redirection specific to COMP7 */
Kojto 109:9296ab0bfc11 645 #define COMP_OUTPUT_TIM2IC3 ((uint32_t)0x00002000) /*!< COMP output connected to TIM2 Input Capture 3 */
Kojto 109:9296ab0bfc11 646 #define COMP_OUTPUT_TIM1IC2 ((uint32_t)0x00002400) /*!< COMP output connected to TIM1 Input Capture 2 */
Kojto 109:9296ab0bfc11 647 #define COMP_OUTPUT_TIM17OCREFCLR ((uint32_t)0x00002800) /*!< COMP output connected to TIM16 OCREF Clear */
Kojto 109:9296ab0bfc11 648 #define COMP_OUTPUT_TIM17BKIN ((uint32_t)0x00002C00) /*!< COMP output connected to TIM16 Break Input (BKIN) */
Kojto 109:9296ab0bfc11 649 #define IS_COMP_OUTPUT(OUTPUT) (((OUTPUT) == COMP_OUTPUT_NONE) || \
Kojto 109:9296ab0bfc11 650 ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
Kojto 109:9296ab0bfc11 651 ((OUTPUT) == COMP_OUTPUT_TIM1IC1) || \
Kojto 109:9296ab0bfc11 652 ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
Kojto 109:9296ab0bfc11 653 ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
Kojto 109:9296ab0bfc11 654 ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
Kojto 109:9296ab0bfc11 655 ((OUTPUT) == COMP_OUTPUT_COMP6TIM2OCREFCLR) || \
Kojto 109:9296ab0bfc11 656 ((OUTPUT) == COMP_OUTPUT_TIM3IC1) || \
Kojto 109:9296ab0bfc11 657 ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR) || \
Kojto 109:9296ab0bfc11 658 ((OUTPUT) == COMP_OUTPUT_TIM20OCREFCLR) || \
Kojto 109:9296ab0bfc11 659 ((OUTPUT) == COMP_OUTPUT_TIM8BKIN) || \
Kojto 109:9296ab0bfc11 660 ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
Kojto 109:9296ab0bfc11 661 ((OUTPUT) == COMP_OUTPUT_TIM8BKIN2) || \
Kojto 109:9296ab0bfc11 662 ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
Kojto 109:9296ab0bfc11 663 ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2) || \
Kojto 109:9296ab0bfc11 664 ((OUTPUT) == COMP_OUTPUT_TIM20BKIN) || \
Kojto 109:9296ab0bfc11 665 ((OUTPUT) == COMP_OUTPUT_TIM20BKIN2) || \
Kojto 109:9296ab0bfc11 666 ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2_TIM20BKIN2) || \
Kojto 109:9296ab0bfc11 667 ((OUTPUT) == COMP_OUTPUT_TIM3IC2) || \
Kojto 109:9296ab0bfc11 668 ((OUTPUT) == COMP_OUTPUT_TIM4IC1) || \
Kojto 109:9296ab0bfc11 669 ((OUTPUT) == COMP_OUTPUT_TIM15IC1) || \
Kojto 109:9296ab0bfc11 670 ((OUTPUT) == COMP_OUTPUT_TIM15BKIN) || \
Kojto 109:9296ab0bfc11 671 ((OUTPUT) == COMP_OUTPUT_TIM8OCREFCLR) || \
Kojto 109:9296ab0bfc11 672 ((OUTPUT) == COMP_OUTPUT_TIM3IC3) || \
Kojto 109:9296ab0bfc11 673 ((OUTPUT) == COMP_OUTPUT_TIM4IC1) || \
Kojto 109:9296ab0bfc11 674 ((OUTPUT) == COMP_OUTPUT_TIM15IC1) || \
Kojto 109:9296ab0bfc11 675 ((OUTPUT) == COMP_OUTPUT_TIM2IC1) || \
Kojto 109:9296ab0bfc11 676 ((OUTPUT) == COMP_OUTPUT_TIM4IC3) || \
Kojto 109:9296ab0bfc11 677 ((OUTPUT) == COMP_OUTPUT_TIM16BKIN) || \
Kojto 109:9296ab0bfc11 678 ((OUTPUT) == COMP_OUTPUT_TIM17IC1) || \
Kojto 109:9296ab0bfc11 679 ((OUTPUT) == COMP_OUTPUT_TIM2IC2) || \
Kojto 109:9296ab0bfc11 680 ((OUTPUT) == COMP_OUTPUT_TIM16IC1) || \
Kojto 109:9296ab0bfc11 681 ((OUTPUT) == COMP_OUTPUT_TIM4IC4) || \
Kojto 109:9296ab0bfc11 682 ((OUTPUT) == COMP_OUTPUT_TIM16OCREFCLR) || \
Kojto 109:9296ab0bfc11 683 ((OUTPUT) == COMP_OUTPUT_TIM2IC3) || \
Kojto 109:9296ab0bfc11 684 ((OUTPUT) == COMP_OUTPUT_TIM1IC2) || \
Kojto 109:9296ab0bfc11 685 ((OUTPUT) == COMP_OUTPUT_TIM17BKIN) || \
Kojto 109:9296ab0bfc11 686 ((OUTPUT) == COMP_OUTPUT_TIM17OCREFCLR))
Kojto 109:9296ab0bfc11 687 /**
Kojto 109:9296ab0bfc11 688 * @}
Kojto 109:9296ab0bfc11 689 */
Kojto 109:9296ab0bfc11 690 #endif /* STM32F302xC */
Kojto 109:9296ab0bfc11 691
Kojto 109:9296ab0bfc11 692 #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)
Kojto 109:9296ab0bfc11 693 /** @defgroup COMPEx_WindowMode COMP Extended WindowMode (STM32F302xC/STM32F303xC/STM32F358xx Product devices)
Kojto 109:9296ab0bfc11 694 * @{
Kojto 109:9296ab0bfc11 695 */
Kojto 109:9296ab0bfc11 696 #define COMP_WINDOWMODE_DISABLED ((uint32_t)0x00000000) /*!< Window mode disabled */
Kojto 109:9296ab0bfc11 697 #define COMP_WINDOWMODE_ENABLED COMP_CSR_COMPxWNDWEN /*!< Window mode enabled: non inverting input of comparator X (x=2,4,6)
Kojto 109:9296ab0bfc11 698 is connected to the non inverting input of comparator X-1 */
Kojto 109:9296ab0bfc11 699 #define IS_COMP_WINDOWMODE(WINDOWMODE) (((WINDOWMODE) == COMP_WINDOWMODE_DISABLED) || \
Kojto 109:9296ab0bfc11 700 ((WINDOWMODE) == COMP_WINDOWMODE_ENABLED))
Kojto 109:9296ab0bfc11 701
Kojto 109:9296ab0bfc11 702 #define COMP_CSR_COMPxWNDWEN_MASK COMP_CSR_COMPxWNDWEN /*!< COMP_CSR_COMPxWNDWEN mask */
Kojto 109:9296ab0bfc11 703 /**
Kojto 109:9296ab0bfc11 704 * @}
Kojto 109:9296ab0bfc11 705 */
Kojto 109:9296ab0bfc11 706 #elif defined(STM32F373xC) || defined(STM32F378xx)
Kojto 109:9296ab0bfc11 707 /** @defgroup COMPEx_WindowMode COMP Extended WindowMode (STM32F373xC/STM32F378xx Product devices)
Kojto 109:9296ab0bfc11 708 * @{
Kojto 109:9296ab0bfc11 709 */
Kojto 109:9296ab0bfc11 710 #define COMP_WINDOWMODE_DISABLED ((uint32_t)0x00000000) /*!< Window mode disabled */
Kojto 109:9296ab0bfc11 711 #define COMP_WINDOWMODE_ENABLED ((uint32_t)COMP_CSR_COMPxWNDWEN) /*!< Window mode enabled: non inverting input of comparator 2
Kojto 109:9296ab0bfc11 712 is connected to the non inverting input of comparator 1 (PA1) */
Kojto 109:9296ab0bfc11 713 #define IS_COMP_WINDOWMODE(WINDOWMODE) (((WINDOWMODE) == COMP_WINDOWMODE_DISABLED) || \
Kojto 109:9296ab0bfc11 714 ((WINDOWMODE) == COMP_WINDOWMODE_ENABLED))
Kojto 109:9296ab0bfc11 715
Kojto 109:9296ab0bfc11 716 #define COMP_CSR_COMPxWNDWEN_MASK COMP_CSR_COMPxWNDWEN /*!< COMP_CSR_COMPxWNDWEN mask */
Kojto 109:9296ab0bfc11 717 /**
Kojto 109:9296ab0bfc11 718 * @}
Kojto 109:9296ab0bfc11 719 */
Kojto 109:9296ab0bfc11 720 #else
Kojto 109:9296ab0bfc11 721 /** @defgroup COMPEx_WindowMode COMP Extended WindowMode (Other Product devices)
Kojto 109:9296ab0bfc11 722 * @{
Kojto 109:9296ab0bfc11 723 */
Kojto 109:9296ab0bfc11 724 #define COMP_WINDOWMODE_DISABLED ((uint32_t)0x00000000) /*!< Window mode disabled (not available) */
Kojto 109:9296ab0bfc11 725
Kojto 109:9296ab0bfc11 726 #define IS_COMP_WINDOWMODE(WINDOWMODE) ((WINDOWMODE) == (WINDOWMODE)) /*!< Not available: check always true */
Kojto 109:9296ab0bfc11 727
Kojto 109:9296ab0bfc11 728 #define COMP_CSR_COMPxWNDWEN_MASK ((uint32_t)0x00000000) /*!< Mask empty: feature not available */
Kojto 109:9296ab0bfc11 729 /**
Kojto 109:9296ab0bfc11 730 * @}
Kojto 109:9296ab0bfc11 731 */
Kojto 109:9296ab0bfc11 732 #endif /* STM32F302xC || STM32F303xC || STM32F358xx */
Kojto 109:9296ab0bfc11 733
Kojto 109:9296ab0bfc11 734 /** @defgroup COMPEx_Mode COMP Extended Mode
Kojto 109:9296ab0bfc11 735 * @{
Kojto 109:9296ab0bfc11 736 */
Kojto 109:9296ab0bfc11 737 #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \
Kojto 109:9296ab0bfc11 738 defined(STM32F373xC) || defined(STM32F378xx)
Kojto 109:9296ab0bfc11 739
Kojto 109:9296ab0bfc11 740 /* Please refer to the electrical characteristics in the device datasheet for
Kojto 109:9296ab0bfc11 741 the power consumption values */
Kojto 109:9296ab0bfc11 742 #define COMP_MODE_HIGHSPEED ((uint32_t)0x00000000) /*!< High Speed */
Kojto 109:9296ab0bfc11 743 #define COMP_MODE_MEDIUMSPEED COMP_CSR_COMPxMODE_0 /*!< Medium Speed */
Kojto 109:9296ab0bfc11 744 #define COMP_MODE_LOWPOWER COMP_CSR_COMPxMODE_1 /*!< Low power mode */
Kojto 109:9296ab0bfc11 745 #define COMP_MODE_ULTRALOWPOWER COMP_CSR_COMPxMODE /*!< Ultra-low power mode */
Kojto 109:9296ab0bfc11 746
Kojto 109:9296ab0bfc11 747 #define IS_COMP_MODE(MODE) (((MODE) == COMP_MODE_HIGHSPEED) || \
Kojto 109:9296ab0bfc11 748 ((MODE) == COMP_MODE_MEDIUMSPEED) || \
Kojto 109:9296ab0bfc11 749 ((MODE) == COMP_MODE_LOWPOWER) || \
Kojto 109:9296ab0bfc11 750 ((MODE) == COMP_MODE_ULTRALOWPOWER))
Kojto 109:9296ab0bfc11 751
Kojto 109:9296ab0bfc11 752 #define COMP_CSR_COMPxMODE_MASK COMP_CSR_COMPxMODE /*!< COMP_CSR_COMPxMODE Mask */
Kojto 109:9296ab0bfc11 753
Kojto 109:9296ab0bfc11 754 #else
Kojto 109:9296ab0bfc11 755
Kojto 109:9296ab0bfc11 756 /*!< Power mode not available */
Kojto 109:9296ab0bfc11 757 #define IS_COMP_MODE(MODE) ((MODE) == (MODE)) /*!< Not available: check always true */
Kojto 109:9296ab0bfc11 758
Kojto 109:9296ab0bfc11 759 #define COMP_CSR_COMPxMODE_MASK ((uint32_t)0x00000000) /*!< Mask empty: feature not available */
Kojto 109:9296ab0bfc11 760
Kojto 109:9296ab0bfc11 761 #endif /* STM32F302xC || STM32F303xC || STM32F358xx || */
Kojto 109:9296ab0bfc11 762 /* STM32F373xC || STM32F378xx */
Kojto 109:9296ab0bfc11 763 /**
Kojto 109:9296ab0bfc11 764 * @}
Kojto 109:9296ab0bfc11 765 */
Kojto 109:9296ab0bfc11 766
Kojto 109:9296ab0bfc11 767 /** @defgroup COMPEx_Hysteresis COMP Extended Hysteresis
Kojto 109:9296ab0bfc11 768 * @{
Kojto 109:9296ab0bfc11 769 */
Kojto 109:9296ab0bfc11 770 #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \
Kojto 109:9296ab0bfc11 771 defined(STM32F373xC) || defined(STM32F378xx)
Kojto 109:9296ab0bfc11 772
Kojto 109:9296ab0bfc11 773 #define COMP_HYSTERESIS_NONE ((uint32_t)0x00000000) /*!< No hysteresis */
Kojto 109:9296ab0bfc11 774 #define COMP_HYSTERESIS_LOW COMP_CSR_COMPxHYST_0 /*!< Hysteresis level low */
Kojto 109:9296ab0bfc11 775 #define COMP_HYSTERESIS_MEDIUM COMP_CSR_COMPxHYST_1 /*!< Hysteresis level medium */
Kojto 109:9296ab0bfc11 776 #define COMP_HYSTERESIS_HIGH COMP_CSR_COMPxHYST /*!< Hysteresis level high */
Kojto 109:9296ab0bfc11 777
Kojto 109:9296ab0bfc11 778 #define IS_COMP_HYSTERESIS(HYSTERESIS) (((HYSTERESIS) == COMP_HYSTERESIS_NONE) || \
Kojto 109:9296ab0bfc11 779 ((HYSTERESIS) == COMP_HYSTERESIS_LOW) || \
Kojto 109:9296ab0bfc11 780 ((HYSTERESIS) == COMP_HYSTERESIS_MEDIUM) || \
Kojto 109:9296ab0bfc11 781 ((HYSTERESIS) == COMP_HYSTERESIS_HIGH))
Kojto 109:9296ab0bfc11 782
Kojto 109:9296ab0bfc11 783 #define COMP_CSR_COMPxHYST_MASK COMP_CSR_COMPxHYST /*!< COMP_CSR_COMPxHYST Mask */
Kojto 109:9296ab0bfc11 784
Kojto 109:9296ab0bfc11 785 #else
Kojto 109:9296ab0bfc11 786
Kojto 109:9296ab0bfc11 787 #define COMP_HYSTERESIS_NONE ((uint32_t)0x00000000) /*!< No hysteresis */
Kojto 109:9296ab0bfc11 788
Kojto 109:9296ab0bfc11 789 #define IS_COMP_HYSTERESIS(HYSTERESIS) ((HYSTERESIS) == (HYSTERESIS)) /*!< Not available: check always true */
Kojto 109:9296ab0bfc11 790
Kojto 109:9296ab0bfc11 791 #define COMP_CSR_COMPxHYST_MASK ((uint32_t)0x00000000) /*!< Mask empty: feature not available */
Kojto 109:9296ab0bfc11 792
Kojto 109:9296ab0bfc11 793 #endif /* STM32F302xC || STM32F303xC || STM32F358xx || */
Kojto 109:9296ab0bfc11 794 /* STM32F373xC || STM32F378xx */
Kojto 109:9296ab0bfc11 795 /**
Kojto 109:9296ab0bfc11 796 * @}
Kojto 109:9296ab0bfc11 797 */
Kojto 109:9296ab0bfc11 798
Kojto 109:9296ab0bfc11 799 #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) || \
Kojto 109:9296ab0bfc11 800 defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
Kojto 109:9296ab0bfc11 801 /** @defgroup COMPEx_BlankingSrce COMP Extended Blanking Source (STM32F301x8/STM32F302x8/STM32F303x8/STM32F334x8/STM32F318xx/STM32F328xx Product devices)
Kojto 109:9296ab0bfc11 802 * @{
Kojto 109:9296ab0bfc11 803 */
Kojto 109:9296ab0bfc11 804 /* No blanking source can be selected for all comparators */
Kojto 109:9296ab0bfc11 805 #define COMP_BLANKINGSRCE_NONE ((uint32_t)0x00000000) /*!< No blanking source */
Kojto 109:9296ab0bfc11 806 /* Blanking source for COMP2 */
Kojto 109:9296ab0bfc11 807 #define COMP_BLANKINGSRCE_TIM1OC5 COMP_CSR_COMPxBLANKING_0 /*!< TIM1 OC5 selected as blanking source for compartor */
Kojto 109:9296ab0bfc11 808 #define COMP_BLANKINGSRCE_TIM2OC3 COMP_CSR_COMPxBLANKING_1 /*!< TIM2 OC3 selected as blanking source for compartor */
Kojto 109:9296ab0bfc11 809 #define COMP_BLANKINGSRCE_TIM3OC3 (COMP_CSR_COMPxBLANKING_0|COMP_CSR_COMPxBLANKING_1) /*!< TIM3 OC3 selected as blanking source for compartor */
Kojto 109:9296ab0bfc11 810 /* Blanking source for COMP4 */
Kojto 109:9296ab0bfc11 811 #define COMP_BLANKINGSRCE_TIM3OC4 COMP_CSR_COMPxBLANKING_0 /*!< TIM3 OC4 selected as blanking source for compartor */
Kojto 109:9296ab0bfc11 812 #define COMP_BLANKINGSRCE_TIM15OC1 (COMP_CSR_COMPxBLANKING_0|COMP_CSR_COMPxBLANKING_1) /*!< TIM15 OC1 selected as blanking source for compartor */
Kojto 109:9296ab0bfc11 813 /* Blanking source for COMP6 */
Kojto 109:9296ab0bfc11 814 #define COMP_BLANKINGSRCE_TIM2OC4 (COMP_CSR_COMPxBLANKING_0|COMP_CSR_COMPxBLANKING_1) /*!< TIM2 OC4 selected as blanking source for compartor */
Kojto 109:9296ab0bfc11 815 #define COMP_BLANKINGSRCE_TIM15OC2 COMP_CSR_COMPxBLANKING_2 /*!< TIM15 OC2 selected as blanking source for compartor */
Kojto 109:9296ab0bfc11 816 #define IS_COMP_BLANKINGSRCE(SOURCE) (((SOURCE) == COMP_BLANKINGSRCE_NONE) || \
Kojto 109:9296ab0bfc11 817 ((SOURCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
Kojto 109:9296ab0bfc11 818 ((SOURCE) == COMP_BLANKINGSRCE_TIM2OC3) || \
Kojto 109:9296ab0bfc11 819 ((SOURCE) == COMP_BLANKINGSRCE_TIM3OC3) || \
Kojto 109:9296ab0bfc11 820 ((SOURCE) == COMP_BLANKINGSRCE_TIM3OC4) || \
Kojto 109:9296ab0bfc11 821 ((SOURCE) == COMP_BLANKINGSRCE_TIM2OC4) || \
Kojto 109:9296ab0bfc11 822 ((SOURCE) == COMP_BLANKINGSRCE_TIM15OC1) || \
Kojto 109:9296ab0bfc11 823 ((SOURCE) == COMP_BLANKINGSRCE_TIM15OC2))
Kojto 109:9296ab0bfc11 824
Kojto 109:9296ab0bfc11 825 /* STM32F301x6/x8, STM32F302x6/x8, STM32F303x6/x8, STM32F334x4/6/8, STM32F318xx/STM32F328xx devices comparator instances blanking source values */
Kojto 109:9296ab0bfc11 826 #define IS_COMP_BLANKINGSRCE_INSTANCE(INSTANCE, BLANKINGSRCE) \
Kojto 109:9296ab0bfc11 827 ((((INSTANCE) == COMP2) && \
Kojto 109:9296ab0bfc11 828 (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
Kojto 109:9296ab0bfc11 829 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
Kojto 109:9296ab0bfc11 830 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM2OC3) || \
Kojto 109:9296ab0bfc11 831 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM3OC3))) \
Kojto 109:9296ab0bfc11 832 || \
Kojto 109:9296ab0bfc11 833 (((INSTANCE) == COMP4) && \
Kojto 109:9296ab0bfc11 834 (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
Kojto 109:9296ab0bfc11 835 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM3OC4) || \
Kojto 109:9296ab0bfc11 836 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM15OC1))) \
Kojto 109:9296ab0bfc11 837 || \
Kojto 109:9296ab0bfc11 838 (((INSTANCE) == COMP6) && \
Kojto 109:9296ab0bfc11 839 (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
Kojto 109:9296ab0bfc11 840 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM2OC4) || \
Kojto 109:9296ab0bfc11 841 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM15OC2))))
Kojto 109:9296ab0bfc11 842
Kojto 109:9296ab0bfc11 843 #define COMP_CSR_COMPxBLANKING_MASK COMP_CSR_COMPxBLANKING /*!< COMP_CSR_COMPxBLANKING mask */
Kojto 109:9296ab0bfc11 844
Kojto 109:9296ab0bfc11 845 /**
Kojto 109:9296ab0bfc11 846 * @}
Kojto 109:9296ab0bfc11 847 */
Kojto 109:9296ab0bfc11 848
Kojto 109:9296ab0bfc11 849 /** @defgroup COMPEx_ExtiLineEvent COMP Extended EXTI Line Event (STM32F301x8/STM32F302x8/STM32F303x8/STM32F334x8/STM32F318xx/STM32F328xx Product devices)
Kojto 109:9296ab0bfc11 850 * Elements values convention: XXXXZYYY
Kojto 109:9296ab0bfc11 851 * - XXXX : Interrupt mask in the register list where Z equal 0x0
Kojto 109:9296ab0bfc11 852 * - YYY : Interrupt mask in the register list where Z equal 0x1
Kojto 109:9296ab0bfc11 853 * - Z : register index(4bits)
Kojto 109:9296ab0bfc11 854 * - 0x0: EMR/IMR/RTSR/FTSR register
Kojto 109:9296ab0bfc11 855 * - 0x1: EMR2/IMR2/RTSR2/FTSR2 register
Kojto 109:9296ab0bfc11 856 * @{
Kojto 109:9296ab0bfc11 857 */
Kojto 109:9296ab0bfc11 858 #define COMP_EXTI_LINE_MASK ((uint32_t)0xffff0fff) /*!< Mask on possible line values */
Kojto 109:9296ab0bfc11 859 #define COMP_EXTI_LINE_REG_MASK ((uint32_t)0x00001000) /*!< Mask on possible register values */
Kojto 109:9296ab0bfc11 860 #define COMP_EXTI_LINE_COMP2_EVENT ((uint32_t)0x00400000) /*!< External interrupt line 22 Connected to COMP2 */
Kojto 109:9296ab0bfc11 861 #define COMP_EXTI_LINE_COMP4_EVENT ((uint32_t)0x40000000) /*!< External interrupt line 30 Connected to COMP4 */
Kojto 109:9296ab0bfc11 862 #define COMP_EXTI_LINE_COMP6_EVENT ((uint32_t)0x00001001) /*!< External interrupt line 32 Connected to COMP6 */
Kojto 109:9296ab0bfc11 863
Kojto 109:9296ab0bfc11 864 /**
Kojto 109:9296ab0bfc11 865 * @}
Kojto 109:9296ab0bfc11 866 */
Kojto 109:9296ab0bfc11 867 #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */
Kojto 109:9296ab0bfc11 868 /* STM32F303x8 || STM32F334x8 || STM32F328xx */
Kojto 109:9296ab0bfc11 869
Kojto 109:9296ab0bfc11 870 #if defined(STM32F302xE) ||\
Kojto 109:9296ab0bfc11 871 defined(STM32F302xC)
Kojto 109:9296ab0bfc11 872 /** @defgroup COMPEx_BlankingSrce COMP Extended Blanking Source (STM32F302xE/STM32F302xC Product devices)
Kojto 109:9296ab0bfc11 873 * @{
Kojto 109:9296ab0bfc11 874 */
Kojto 109:9296ab0bfc11 875 /* No blanking source can be selected for all comparators */
Kojto 109:9296ab0bfc11 876 #define COMP_BLANKINGSRCE_NONE ((uint32_t)0x00000000) /*!< No blanking source */
Kojto 109:9296ab0bfc11 877 /* Blanking source common for COMP1 and COMP2 */
Kojto 109:9296ab0bfc11 878 #define COMP_BLANKINGSRCE_TIM1OC5 COMP_CSR_COMPxBLANKING_0 /*!< TIM1 OC5 selected as blanking source for compartor */
Kojto 109:9296ab0bfc11 879 /* Blanking source common for COMP1 and COMP2 */
Kojto 109:9296ab0bfc11 880 #define COMP_BLANKINGSRCE_TIM2OC3 COMP_CSR_COMPxBLANKING_1 /*!< TIM2 OC3 selected as blanking source for compartor */
Kojto 109:9296ab0bfc11 881 /* Blanking source common for COMP1 and COMP2 */
Kojto 109:9296ab0bfc11 882 #define COMP_BLANKINGSRCE_TIM3OC3 (COMP_CSR_COMPxBLANKING_0|COMP_CSR_COMPxBLANKING_1) /*!< TIM3 OC3 selected as blanking source for comparator */
Kojto 109:9296ab0bfc11 883 /* Blanking source for COMP4 */
Kojto 109:9296ab0bfc11 884 #define COMP_BLANKINGSRCE_TIM3OC4 COMP_CSR_COMPxBLANKING_0 /*!< TIM3 OC4 selected as blanking source for comparator */
Kojto 109:9296ab0bfc11 885 #define COMP_BLANKINGSRCE_TIM15OC1 (COMP_CSR_COMPxBLANKING_0|COMP_CSR_COMPxBLANKING_1) /*!< TIM15 OC1 selected as blanking source for comparator */
Kojto 109:9296ab0bfc11 886 /* Blanking source for COMP6 */
Kojto 109:9296ab0bfc11 887 #define COMP_BLANKINGSRCE_TIM2OC4 (COMP_CSR_COMPxBLANKING_0|COMP_CSR_COMPxBLANKING_1) /*!< TIM2 OC4 selected as blanking source for comparator */
Kojto 109:9296ab0bfc11 888 #define COMP_BLANKINGSRCE_TIM15OC2 COMP_CSR_COMPxBLANKING_2 /*!< TIM15 OC2 selected as blanking source for comparator */
Kojto 109:9296ab0bfc11 889
Kojto 109:9296ab0bfc11 890 #define IS_COMP_BLANKINGSRCE(SOURCE) (((SOURCE) == COMP_BLANKINGSRCE_NONE) || \
Kojto 109:9296ab0bfc11 891 ((SOURCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
Kojto 109:9296ab0bfc11 892 ((SOURCE) == COMP_BLANKINGSRCE_TIM2OC3) || \
Kojto 109:9296ab0bfc11 893 ((SOURCE) == COMP_BLANKINGSRCE_TIM3OC3) || \
Kojto 109:9296ab0bfc11 894 ((SOURCE) == COMP_BLANKINGSRCE_TIM3OC4) || \
Kojto 109:9296ab0bfc11 895 ((SOURCE) == COMP_BLANKINGSRCE_TIM2OC4) || \
Kojto 109:9296ab0bfc11 896 ((SOURCE) == COMP_BLANKINGSRCE_TIM15OC1) || \
Kojto 109:9296ab0bfc11 897 ((SOURCE) == COMP_BLANKINGSRCE_TIM15OC2))
Kojto 109:9296ab0bfc11 898
Kojto 109:9296ab0bfc11 899 /* STM32F302xB/STM32F302xC/STM32F302xE devices comparator instances blanking source values */
Kojto 109:9296ab0bfc11 900 #define IS_COMP_BLANKINGSRCE_INSTANCE(INSTANCE, BLANKINGSRCE) \
Kojto 109:9296ab0bfc11 901 (((((INSTANCE) == COMP1) || ((INSTANCE) == COMP2)) && \
Kojto 109:9296ab0bfc11 902 (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
Kojto 109:9296ab0bfc11 903 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
Kojto 109:9296ab0bfc11 904 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM2OC3) || \
Kojto 109:9296ab0bfc11 905 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM3OC3))) \
Kojto 109:9296ab0bfc11 906 || \
Kojto 109:9296ab0bfc11 907 (((INSTANCE) == COMP4) && \
Kojto 109:9296ab0bfc11 908 (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
Kojto 109:9296ab0bfc11 909 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM3OC4) || \
Kojto 109:9296ab0bfc11 910 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM15OC1))) \
Kojto 109:9296ab0bfc11 911 || \
Kojto 109:9296ab0bfc11 912 (((INSTANCE) == COMP6) && \
Kojto 109:9296ab0bfc11 913 (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
Kojto 109:9296ab0bfc11 914 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM2OC4) || \
Kojto 109:9296ab0bfc11 915 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM15OC2))))
Kojto 109:9296ab0bfc11 916
Kojto 109:9296ab0bfc11 917 #define COMP_CSR_COMPxBLANKING_MASK COMP_CSR_COMPxBLANKING /*!< COMP_CSR_COMPxBLANKING mask */
Kojto 109:9296ab0bfc11 918
Kojto 109:9296ab0bfc11 919 /**
Kojto 109:9296ab0bfc11 920 * @}
Kojto 109:9296ab0bfc11 921 */
Kojto 109:9296ab0bfc11 922
Kojto 109:9296ab0bfc11 923 /** @defgroup COMPEx_ExtiLineEvent COMP Extended EXTI Line Event (STM32F302xC Product devices)
Kojto 109:9296ab0bfc11 924 * Elements values convention: XXXXZYYY
Kojto 109:9296ab0bfc11 925 * - XXXX : Interrupt mask in the register list where Z equal 0x0
Kojto 109:9296ab0bfc11 926 * - YYY : Interrupt mask in the register list where Z equal 0x1
Kojto 109:9296ab0bfc11 927 * - Z : register index(4bits)
Kojto 109:9296ab0bfc11 928 * - 0x0: EMR/IMR/RTSR/FTSR register
Kojto 109:9296ab0bfc11 929 * - 0x1: EMR2/IMR2/RTSR2/FTSR2 register
Kojto 109:9296ab0bfc11 930 * @{
Kojto 109:9296ab0bfc11 931 */
Kojto 109:9296ab0bfc11 932 #define COMP_EXTI_LINE_MASK ((uint32_t)0xffff0fff) /*!< Mask on possible line values */
Kojto 109:9296ab0bfc11 933 #define COMP_EXTI_LINE_REG_MASK ((uint32_t)0x00001000) /*!< Mask on possible register values */
Kojto 109:9296ab0bfc11 934 #define COMP_EXTI_LINE_COMP1_EVENT ((uint32_t)0x00200000) /*!< External interrupt line 21 Connected to COMP1 */
Kojto 109:9296ab0bfc11 935 #define COMP_EXTI_LINE_COMP2_EVENT ((uint32_t)0x00400000) /*!< External interrupt line 22 Connected to COMP2 */
Kojto 109:9296ab0bfc11 936 #define COMP_EXTI_LINE_COMP4_EVENT ((uint32_t)0x40000000) /*!< External interrupt line 30 Connected to COMP4 */
Kojto 109:9296ab0bfc11 937 #define COMP_EXTI_LINE_COMP6_EVENT ((uint32_t)0x00001001) /*!< External interrupt line 32 Connected to COMP6 */
Kojto 109:9296ab0bfc11 938
Kojto 109:9296ab0bfc11 939 /**
Kojto 109:9296ab0bfc11 940 * @}
Kojto 109:9296ab0bfc11 941 */
Kojto 109:9296ab0bfc11 942 #endif /* STM32F302xE || */
Kojto 109:9296ab0bfc11 943 /* STM32F302xC */
Kojto 109:9296ab0bfc11 944
Kojto 109:9296ab0bfc11 945 #if defined(STM32F303xE) || defined(STM32F398xx) || \
Kojto 109:9296ab0bfc11 946 defined(STM32F303xC) || defined(STM32F358xx)
Kojto 109:9296ab0bfc11 947 /** @defgroup COMPEx_BlankingSrce COMP Extended Blanking Source (STM32F303xE/STM32F398xx/STM32F303xC/STM32F358xx Product devices)
Kojto 109:9296ab0bfc11 948 * @{
Kojto 109:9296ab0bfc11 949 */
Kojto 109:9296ab0bfc11 950 /* No blanking source can be selected for all comparators */
Kojto 109:9296ab0bfc11 951 #define COMP_BLANKINGSRCE_NONE ((uint32_t)0x00000000) /*!< No blanking source */
Kojto 109:9296ab0bfc11 952 /* Blanking source common for COMP1, COMP2, COMP3 and COMP7 */
Kojto 109:9296ab0bfc11 953 #define COMP_BLANKINGSRCE_TIM1OC5 COMP_CSR_COMPxBLANKING_0 /*!< TIM1 OC5 selected as blanking source for comparator */
Kojto 109:9296ab0bfc11 954 /* Blanking source common for COMP1 and COMP2 */
Kojto 109:9296ab0bfc11 955 #define COMP_BLANKINGSRCE_TIM2OC3 COMP_CSR_COMPxBLANKING_1 /*!< TIM2 OC5 selected as blanking source for comparator */
Kojto 109:9296ab0bfc11 956 /* Blanking source common for COMP1, COMP2 and COMP5 */
Kojto 109:9296ab0bfc11 957 #define COMP_BLANKINGSRCE_TIM3OC3 (COMP_CSR_COMPxBLANKING_0|COMP_CSR_COMPxBLANKING_1) /*!< TIM2 OC3 selected as blanking source for comparator */
Kojto 109:9296ab0bfc11 958 /* Blanking source common for COMP3 and COMP6 */
Kojto 109:9296ab0bfc11 959 #define COMP_BLANKINGSRCE_TIM2OC4 (COMP_CSR_COMPxBLANKING_0|COMP_CSR_COMPxBLANKING_1) /*!< TIM2 OC4 selected as blanking source for comparator */
Kojto 109:9296ab0bfc11 960 /* Blanking source common for COMP4, COMP5, COMP6 and COMP7 */
Kojto 109:9296ab0bfc11 961 #define COMP_BLANKINGSRCE_TIM8OC5 COMP_CSR_COMPxBLANKING_1 /*!< TIM8 OC5 selected as blanking source for comparator */
Kojto 109:9296ab0bfc11 962 /* Blanking source for COMP4 */
Kojto 109:9296ab0bfc11 963 #define COMP_BLANKINGSRCE_TIM3OC4 COMP_CSR_COMPxBLANKING_0 /*!< TIM3 OC4 selected as blanking source for comparator */
Kojto 109:9296ab0bfc11 964 #define COMP_BLANKINGSRCE_TIM15OC1 (COMP_CSR_COMPxBLANKING_0|COMP_CSR_COMPxBLANKING_1) /*!< TIM15 OC1 selected as blanking source for comparator */
Kojto 109:9296ab0bfc11 965 /* Blanking source common for COMP6 and COMP7 */
Kojto 109:9296ab0bfc11 966 #define COMP_BLANKINGSRCE_TIM15OC2 COMP_CSR_COMPxBLANKING_2 /*!< TIM15 OC2 selected as blanking source for comparator */
Kojto 109:9296ab0bfc11 967
Kojto 109:9296ab0bfc11 968 #define IS_COMP_BLANKINGSRCE(SOURCE) (((SOURCE) == COMP_BLANKINGSRCE_NONE) || \
Kojto 109:9296ab0bfc11 969 ((SOURCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
Kojto 109:9296ab0bfc11 970 ((SOURCE) == COMP_BLANKINGSRCE_TIM2OC3) || \
Kojto 109:9296ab0bfc11 971 ((SOURCE) == COMP_BLANKINGSRCE_TIM3OC3) || \
Kojto 109:9296ab0bfc11 972 ((SOURCE) == COMP_BLANKINGSRCE_TIM2OC4) || \
Kojto 109:9296ab0bfc11 973 ((SOURCE) == COMP_BLANKINGSRCE_TIM8OC5) || \
Kojto 109:9296ab0bfc11 974 ((SOURCE) == COMP_BLANKINGSRCE_TIM3OC4) || \
Kojto 109:9296ab0bfc11 975 ((SOURCE) == COMP_BLANKINGSRCE_TIM15OC1) || \
Kojto 109:9296ab0bfc11 976 ((SOURCE) == COMP_BLANKINGSRCE_TIM15OC2))
Kojto 109:9296ab0bfc11 977
Kojto 109:9296ab0bfc11 978 /* STM32F303xE/STM32F398xx/STM32F303xB/STM32F303xC/STM32F358xx devices comparator instances blanking source values */
Kojto 109:9296ab0bfc11 979 #define IS_COMP_BLANKINGSRCE_INSTANCE(INSTANCE, BLANKINGSRCE) \
Kojto 109:9296ab0bfc11 980 (((((INSTANCE) == COMP1) || ((INSTANCE) == COMP2)) && \
Kojto 109:9296ab0bfc11 981 (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
Kojto 109:9296ab0bfc11 982 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
Kojto 109:9296ab0bfc11 983 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM2OC3) || \
Kojto 109:9296ab0bfc11 984 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM3OC3))) \
Kojto 109:9296ab0bfc11 985 || \
Kojto 109:9296ab0bfc11 986 (((INSTANCE) == COMP3) && \
Kojto 109:9296ab0bfc11 987 (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
Kojto 109:9296ab0bfc11 988 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
Kojto 109:9296ab0bfc11 989 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM2OC4))) \
Kojto 109:9296ab0bfc11 990 || \
Kojto 109:9296ab0bfc11 991 (((INSTANCE) == COMP4) && \
Kojto 109:9296ab0bfc11 992 (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
Kojto 109:9296ab0bfc11 993 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM3OC4) || \
Kojto 109:9296ab0bfc11 994 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM8OC5) || \
Kojto 109:9296ab0bfc11 995 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM15OC1))) \
Kojto 109:9296ab0bfc11 996 || \
Kojto 109:9296ab0bfc11 997 (((INSTANCE) == COMP5) && \
Kojto 109:9296ab0bfc11 998 (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
Kojto 109:9296ab0bfc11 999 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM8OC5) || \
Kojto 109:9296ab0bfc11 1000 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM3OC3))) \
Kojto 109:9296ab0bfc11 1001 || \
Kojto 109:9296ab0bfc11 1002 (((INSTANCE) == COMP6) && \
Kojto 109:9296ab0bfc11 1003 (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
Kojto 109:9296ab0bfc11 1004 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM8OC5) || \
Kojto 109:9296ab0bfc11 1005 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM2OC4) || \
Kojto 109:9296ab0bfc11 1006 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM15OC2))) \
Kojto 109:9296ab0bfc11 1007 || \
Kojto 109:9296ab0bfc11 1008 (((INSTANCE) == COMP7) && \
Kojto 109:9296ab0bfc11 1009 (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
Kojto 109:9296ab0bfc11 1010 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
Kojto 109:9296ab0bfc11 1011 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM8OC5) || \
Kojto 109:9296ab0bfc11 1012 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM15OC2))))
Kojto 109:9296ab0bfc11 1013
Kojto 109:9296ab0bfc11 1014 #define COMP_CSR_COMPxBLANKING_MASK COMP_CSR_COMPxBLANKING /*!< COMP_CSR_COMPxBLANKING mask */
Kojto 109:9296ab0bfc11 1015
Kojto 109:9296ab0bfc11 1016 /**
Kojto 109:9296ab0bfc11 1017 * @}
Kojto 109:9296ab0bfc11 1018 */
Kojto 109:9296ab0bfc11 1019
Kojto 109:9296ab0bfc11 1020 /** @defgroup COMPEx_ExtiLineEvent COMP Extended EXTI Line Event (STM32F303xE/STM32F398xx/STM32F303xC/STM32F358xx Product devices)
Kojto 109:9296ab0bfc11 1021 * Elements values convention: XXXXZYYY
Kojto 109:9296ab0bfc11 1022 * - XXXX : Interrupt mask in the register list where Z equal 0x0
Kojto 109:9296ab0bfc11 1023 * - YYY : Interrupt mask in the register list where Z equal 0x1
Kojto 109:9296ab0bfc11 1024 * - Z : register index(4bits)
Kojto 109:9296ab0bfc11 1025 * - 0x0: EMR/IMR/RTSR/FTSR register
Kojto 109:9296ab0bfc11 1026 * - 0x1: EMR2/IMR2/RTSR2/FTSR2 register
Kojto 109:9296ab0bfc11 1027 * @{
Kojto 109:9296ab0bfc11 1028 */
Kojto 109:9296ab0bfc11 1029 #define COMP_EXTI_LINE_MASK ((uint32_t)0xffff0fff) /*!< Mask on possible line values */
Kojto 109:9296ab0bfc11 1030 #define COMP_EXTI_LINE_REG_MASK ((uint32_t)0x00001000) /*!< Mask on possible register values */
Kojto 109:9296ab0bfc11 1031 #define COMP_EXTI_LINE_COMP1_EVENT ((uint32_t)0x00200000) /*!< External interrupt line 21 Connected to COMP1 */
Kojto 109:9296ab0bfc11 1032 #define COMP_EXTI_LINE_COMP2_EVENT ((uint32_t)0x00400000) /*!< External interrupt line 22 Connected to COMP2 */
Kojto 109:9296ab0bfc11 1033 #define COMP_EXTI_LINE_COMP3_EVENT ((uint32_t)0x20000000) /*!< External interrupt line 29 Connected to COMP3 */
Kojto 109:9296ab0bfc11 1034 #define COMP_EXTI_LINE_COMP4_EVENT ((uint32_t)0x40000000) /*!< External interrupt line 30 Connected to COMP4 */
Kojto 109:9296ab0bfc11 1035 #define COMP_EXTI_LINE_COMP5_EVENT ((uint32_t)0x80000000) /*!< External interrupt line 31 Connected to COMP5 */
Kojto 109:9296ab0bfc11 1036 #define COMP_EXTI_LINE_COMP6_EVENT ((uint32_t)0x00001001) /*!< External interrupt line 32 Connected to COMP6 */
Kojto 109:9296ab0bfc11 1037 #define COMP_EXTI_LINE_COMP7_EVENT ((uint32_t)0x00001002) /*!< External interrupt line 33 Connected to COMP7 */
Kojto 109:9296ab0bfc11 1038
Kojto 109:9296ab0bfc11 1039 /**
Kojto 109:9296ab0bfc11 1040 * @}
Kojto 109:9296ab0bfc11 1041 */
Kojto 109:9296ab0bfc11 1042 #endif /* STM32F303xE || STM32F398xx || */
Kojto 109:9296ab0bfc11 1043 /* STM32F303xC || STM32F358xx */
Kojto 109:9296ab0bfc11 1044
Kojto 109:9296ab0bfc11 1045 #if defined(STM32F373xC) ||defined(STM32F378xx)
Kojto 109:9296ab0bfc11 1046 /** @defgroup COMPEx_BlankingSrce COMP Extended Blanking Source (STM32F373xC/STM32F378xx Product devices)
Kojto 109:9296ab0bfc11 1047 * @{
Kojto 109:9296ab0bfc11 1048 */
Kojto 109:9296ab0bfc11 1049 /* No blanking source can be selected for all comparators */
Kojto 109:9296ab0bfc11 1050 #define COMP_BLANKINGSRCE_NONE ((uint32_t)0x00000000) /*!< No blanking source */
Kojto 109:9296ab0bfc11 1051
Kojto 109:9296ab0bfc11 1052 #define IS_COMP_BLANKINGSRCE(SOURCE) ((SOURCE) == (SOURCE)) /*!< Not available: check always true */
Kojto 109:9296ab0bfc11 1053
Kojto 109:9296ab0bfc11 1054 /* STM32F373xB/STM32F373xC/STM32F378xx devices comparator instances blanking source values */
Kojto 109:9296ab0bfc11 1055 #define IS_COMP_BLANKINGSRCE_INSTANCE(INSTANCE, BLANKINGSRCE) \
Kojto 109:9296ab0bfc11 1056 ((((INSTANCE) == COMP1) || ((INSTANCE) == COMP2)) && \
Kojto 109:9296ab0bfc11 1057 ((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE))
Kojto 109:9296ab0bfc11 1058
Kojto 109:9296ab0bfc11 1059 #define COMP_CSR_COMPxBLANKING_MASK ((uint32_t)0x00000000) /*!< Mask empty: feature not available */
Kojto 109:9296ab0bfc11 1060
Kojto 109:9296ab0bfc11 1061 /**
Kojto 109:9296ab0bfc11 1062 * @}
Kojto 109:9296ab0bfc11 1063 */
Kojto 109:9296ab0bfc11 1064
Kojto 109:9296ab0bfc11 1065 /** @defgroup COMPEx_ExtiLineEvent COMP Extended EXTI Line Event (STM32F373xC/STM32F378xx Product devices)
Kojto 109:9296ab0bfc11 1066 * Elements values convention: XXXX0000
Kojto 109:9296ab0bfc11 1067 * - XXXX : Interrupt mask in the EMR/IMR/RTSR/FTSR register
Kojto 109:9296ab0bfc11 1068 * @{
Kojto 109:9296ab0bfc11 1069 */
Kojto 109:9296ab0bfc11 1070 #define COMP_EXTI_LINE_COMP1_EVENT ((uint32_t)0x00200000) /*!< External interrupt line 21 Connected to COMP1 */
Kojto 109:9296ab0bfc11 1071 #define COMP_EXTI_LINE_COMP2_EVENT ((uint32_t)0x00400000) /*!< External interrupt line 22 Connected to COMP2 */
Kojto 109:9296ab0bfc11 1072
Kojto 109:9296ab0bfc11 1073 /**
Kojto 109:9296ab0bfc11 1074 * @}
Kojto 109:9296ab0bfc11 1075 */
Kojto 109:9296ab0bfc11 1076 #endif /* STM32F373xC || STM32F378xx */
Kojto 109:9296ab0bfc11 1077
Kojto 109:9296ab0bfc11 1078 #if defined(STM32F373xC) || defined(STM32F378xx)
Kojto 109:9296ab0bfc11 1079 /* CSR register reset value */
Kojto 109:9296ab0bfc11 1080 #define COMP_CSR_RESET_VALUE ((uint32_t)0x00000000)
Kojto 109:9296ab0bfc11 1081 #define COMP_CSR_RESET_PARAMETERS_MASK ((uint32_t)0x00003FFF)
Kojto 109:9296ab0bfc11 1082 #define COMP_CSR_UPDATE_PARAMETERS_MASK ((uint32_t)0x00003FFE)
Kojto 109:9296ab0bfc11 1083 /* CSR COMP1/COMP2 shift */
Kojto 109:9296ab0bfc11 1084 #define COMP_CSR_COMP1_SHIFT 0U
Kojto 109:9296ab0bfc11 1085 #define COMP_CSR_COMP2_SHIFT 16U
Kojto 109:9296ab0bfc11 1086 #else
Kojto 109:9296ab0bfc11 1087 /* CSR register reset value */
Kojto 109:9296ab0bfc11 1088 #define COMP_CSR_RESET_VALUE ((uint32_t)0x00000000)
Kojto 109:9296ab0bfc11 1089 #endif /* STM32F373xC || STM32F378xx */
Kojto 109:9296ab0bfc11 1090 /* CSR masks redefinition for internal use */
Kojto 109:9296ab0bfc11 1091 #define COMP_CSR_COMPxINSEL_MASK COMP_CSR_COMPxINSEL /*!< COMP_CSR_COMPxINSEL Mask */
Kojto 109:9296ab0bfc11 1092 #define COMP_CSR_COMPxOUTSEL_MASK COMP_CSR_COMPxOUTSEL /*!< COMP_CSR_COMPxOUTSEL Mask */
Kojto 109:9296ab0bfc11 1093 #define COMP_CSR_COMPxPOL_MASK COMP_CSR_COMPxPOL /*!< COMP_CSR_COMPxPOL Mask */
Kojto 109:9296ab0bfc11 1094
Kojto 109:9296ab0bfc11 1095 /**
Kojto 109:9296ab0bfc11 1096 * @}
Kojto 109:9296ab0bfc11 1097 */
Kojto 109:9296ab0bfc11 1098
Kojto 109:9296ab0bfc11 1099 /* Exported macro ------------------------------------------------------------*/
Kojto 109:9296ab0bfc11 1100 /** @defgroup USARTEx_Exported_Macros USART Extended Exported Macros
Kojto 109:9296ab0bfc11 1101 * @{
Kojto 109:9296ab0bfc11 1102 */
Kojto 109:9296ab0bfc11 1103 #if defined(STM32F373xC) ||defined(STM32F378xx)
Kojto 109:9296ab0bfc11 1104 /**
Kojto 109:9296ab0bfc11 1105 * @brief Checks whether the specified EXTI line flag is set or not.
Kojto 109:9296ab0bfc11 1106 * @param __FLAG__: specifies the COMP Exti sources to be checked.
Kojto 109:9296ab0bfc11 1107 * This parameter can be a value of @ref COMPEx_ExtiLineEvent
Kojto 109:9296ab0bfc11 1108 * @retval The state of __FLAG__ (SET or RESET).
Kojto 109:9296ab0bfc11 1109 */
Kojto 109:9296ab0bfc11 1110 #define __HAL_COMP_EXTI_GET_FLAG(__FLAG__) (EXTI->PR & (__FLAG__))
Kojto 109:9296ab0bfc11 1111
Kojto 109:9296ab0bfc11 1112 /**
Kojto 109:9296ab0bfc11 1113 * @brief Clear the COMP Exti flags.
Kojto 109:9296ab0bfc11 1114 * @param __FLAG__: specifies the COMP Exti sources to be cleared.
Kojto 109:9296ab0bfc11 1115 * This parameter can be a value of @ref COMPEx_ExtiLineEvent
Kojto 109:9296ab0bfc11 1116 * @retval None.
Kojto 109:9296ab0bfc11 1117 */
Kojto 109:9296ab0bfc11 1118 #define __HAL_COMP_EXTI_CLEAR_FLAG(__FLAG__) (EXTI->PR = (__FLAG__))
Kojto 109:9296ab0bfc11 1119
Kojto 109:9296ab0bfc11 1120 /**
Kojto 109:9296ab0bfc11 1121 * @brief Enable the COMP Exti Line.
Kojto 109:9296ab0bfc11 1122 * @param __EXTILINE__: specifies the COMP Exti sources to be enabled.
Kojto 109:9296ab0bfc11 1123 * This parameter can be a value of @ref COMPEx_ExtiLineEvent
Kojto 109:9296ab0bfc11 1124 * @retval None.
Kojto 109:9296ab0bfc11 1125 */
Kojto 109:9296ab0bfc11 1126 #define __HAL_COMP_EXTI_ENABLE_IT(__EXTILINE__) (EXTI->IMR |= (__EXTILINE__))
Kojto 109:9296ab0bfc11 1127
Kojto 109:9296ab0bfc11 1128 /**
Kojto 109:9296ab0bfc11 1129 * @brief Disable the COMP Exti Line.
Kojto 109:9296ab0bfc11 1130 * @param __EXTILINE__: specifies the COMP Exti sources to be disabled.
Kojto 109:9296ab0bfc11 1131 * This parameter can be a value of @ref COMPEx_ExtiLineEvent
Kojto 109:9296ab0bfc11 1132 * @retval None.
Kojto 109:9296ab0bfc11 1133 */
Kojto 109:9296ab0bfc11 1134 #define __HAL_COMP_EXTI_DISABLE_IT(__EXTILINE__) (EXTI->IMR &= ~(__EXTILINE__))
Kojto 109:9296ab0bfc11 1135
Kojto 109:9296ab0bfc11 1136 /**
Kojto 109:9296ab0bfc11 1137 * @brief Enable the Exti Line rising edge trigger.
Kojto 109:9296ab0bfc11 1138 * @param __EXTILINE__: specifies the COMP Exti sources to be enabled.
Kojto 109:9296ab0bfc11 1139 * This parameter can be a value of @ref COMPEx_ExtiLineEvent
Kojto 109:9296ab0bfc11 1140 * @retval None.
Kojto 109:9296ab0bfc11 1141 */
Kojto 109:9296ab0bfc11 1142 #define __HAL_COMP_EXTI_RISING_IT_ENABLE(__EXTILINE__) (EXTI->RTSR |= (__EXTILINE__))
Kojto 109:9296ab0bfc11 1143
Kojto 109:9296ab0bfc11 1144 /**
Kojto 109:9296ab0bfc11 1145 * @brief Disable the Exti Line rising edge trigger.
Kojto 109:9296ab0bfc11 1146 * @param __EXTILINE__: specifies the COMP Exti sources to be disabled.
Kojto 109:9296ab0bfc11 1147 * This parameter can be a value of @ref COMPEx_ExtiLineEvent
Kojto 109:9296ab0bfc11 1148 * @retval None.
Kojto 109:9296ab0bfc11 1149 */
Kojto 109:9296ab0bfc11 1150 #define __HAL_COMP_EXTI_RISING_IT_DISABLE(__EXTILINE__) (EXTI->RTSR &= ~(__EXTILINE__))
Kojto 109:9296ab0bfc11 1151
Kojto 109:9296ab0bfc11 1152 /**
Kojto 109:9296ab0bfc11 1153 * @brief Enable the Exti Line falling edge trigger.
Kojto 109:9296ab0bfc11 1154 * @param __EXTILINE__: specifies the COMP Exti sources to be enabled.
Kojto 109:9296ab0bfc11 1155 * This parameter can be a value of @ref COMPEx_ExtiLineEvent
Kojto 109:9296ab0bfc11 1156 * @retval None.
Kojto 109:9296ab0bfc11 1157 */
Kojto 109:9296ab0bfc11 1158 #define __HAL_COMP_EXTI_FALLING_IT_ENABLE(__EXTILINE__) (EXTI->FTSR |= (__EXTILINE__))
Kojto 109:9296ab0bfc11 1159
Kojto 109:9296ab0bfc11 1160 /**
Kojto 109:9296ab0bfc11 1161 * @brief Disable the Exti Line falling edge trigger.
Kojto 109:9296ab0bfc11 1162 * @param __EXTILINE__: specifies the COMP Exti sources to be disabled.
Kojto 109:9296ab0bfc11 1163 * This parameter can be a value of @ref COMPEx_ExtiLineEvent
Kojto 109:9296ab0bfc11 1164 * @retval None.
Kojto 109:9296ab0bfc11 1165 */
Kojto 109:9296ab0bfc11 1166 #define __HAL_COMP_EXTI_FALLING_IT_DISABLE(__EXTILINE__) (EXTI->FTSR &= ~(__EXTILINE__))
Kojto 109:9296ab0bfc11 1167
Kojto 109:9296ab0bfc11 1168 /**
Kojto 109:9296ab0bfc11 1169 * @brief Init a comparator instance
Kojto 109:9296ab0bfc11 1170 * @param __HANDLE__: specifies the COMP handle
Kojto 109:9296ab0bfc11 1171 * @note The common output selection is checked versus the COMP instance to set the right output configuration
Kojto 109:9296ab0bfc11 1172 * @retval None.
Kojto 109:9296ab0bfc11 1173 */
Kojto 109:9296ab0bfc11 1174 #define COMP_OUTPUT_COMP2_TIM2IC4 ((uint32_t)0x0400) /*!< COMP2 output connected to TIM2 Input Capture 4 */
Kojto 109:9296ab0bfc11 1175 #define COMP_OUTPUT_COMP2_TIM2OCREFCLR ((uint32_t)0x0500) /*!< COMP2 output connected to TIM4 OCREF Clear */
Kojto 109:9296ab0bfc11 1176 #define COMP_OUTPUT_COMP2_TIM3IC1 ((uint32_t)0x0600) /*!< COMP2 output connected to TIM3 Input Capture 1 */
Kojto 109:9296ab0bfc11 1177 #define COMP_OUTPUT_COMP2_TIM3OCREFCLR ((uint32_t)0x0700) /*!< COMP2 output connected to TIM3 OCREF Clear */
Kojto 109:9296ab0bfc11 1178
Kojto 109:9296ab0bfc11 1179 #define COMP_INIT(__HANDLE__) \
Kojto 109:9296ab0bfc11 1180 do { \
Kojto 109:9296ab0bfc11 1181 uint32_t regshift = COMP_CSR_COMP1_SHIFT; \
Kojto 109:9296ab0bfc11 1182 uint32_t compoutput = (__HANDLE__)->Init.Output; \
Kojto 109:9296ab0bfc11 1183 \
Kojto 109:9296ab0bfc11 1184 if((__HANDLE__)->Instance == COMP2) \
Kojto 109:9296ab0bfc11 1185 { \
Kojto 109:9296ab0bfc11 1186 regshift = COMP_CSR_COMP2_SHIFT; \
Kojto 109:9296ab0bfc11 1187 switch((__HANDLE__)->Init.Output) \
Kojto 109:9296ab0bfc11 1188 { \
Kojto 109:9296ab0bfc11 1189 case COMP_OUTPUT_TIM2IC4: \
Kojto 109:9296ab0bfc11 1190 compoutput = COMP_OUTPUT_COMP2_TIM2IC4; \
Kojto 109:9296ab0bfc11 1191 break; \
Kojto 109:9296ab0bfc11 1192 case COMP_OUTPUT_TIM2OCREFCLR: \
Kojto 109:9296ab0bfc11 1193 compoutput = COMP_OUTPUT_COMP2_TIM2OCREFCLR; \
Kojto 109:9296ab0bfc11 1194 break; \
Kojto 109:9296ab0bfc11 1195 case COMP_OUTPUT_TIM3IC1: \
Kojto 109:9296ab0bfc11 1196 compoutput = COMP_OUTPUT_COMP2_TIM3IC1; \
Kojto 109:9296ab0bfc11 1197 break; \
Kojto 109:9296ab0bfc11 1198 case COMP_OUTPUT_TIM3OCREFCLR: \
Kojto 109:9296ab0bfc11 1199 compoutput = COMP_OUTPUT_COMP2_TIM3OCREFCLR; \
Kojto 109:9296ab0bfc11 1200 break; \
Kojto 109:9296ab0bfc11 1201 default: \
Kojto 109:9296ab0bfc11 1202 break; \
Kojto 109:9296ab0bfc11 1203 } \
Kojto 109:9296ab0bfc11 1204 } \
Kojto 109:9296ab0bfc11 1205 \
Kojto 109:9296ab0bfc11 1206 MODIFY_REG(COMP->CSR, \
Kojto 109:9296ab0bfc11 1207 (COMP_CSR_COMPxINSEL | COMP_CSR_COMPxNONINSEL_MASK | \
Kojto 109:9296ab0bfc11 1208 COMP_CSR_COMPxOUTSEL | COMP_CSR_COMPxPOL | \
Kojto 109:9296ab0bfc11 1209 COMP_CSR_COMPxHYST | COMP_CSR_COMPxMODE) << regshift, \
Kojto 109:9296ab0bfc11 1210 ((__HANDLE__)->Init.InvertingInput | \
Kojto 109:9296ab0bfc11 1211 (__HANDLE__)->Init.NonInvertingInput | \
Kojto 109:9296ab0bfc11 1212 compoutput | \
Kojto 109:9296ab0bfc11 1213 (__HANDLE__)->Init.OutputPol | \
Kojto 109:9296ab0bfc11 1214 (__HANDLE__)->Init.Hysteresis | \
Kojto 109:9296ab0bfc11 1215 (__HANDLE__)->Init.Mode) << regshift); \
Kojto 109:9296ab0bfc11 1216 \
Kojto 109:9296ab0bfc11 1217 if((__HANDLE__)->Init.WindowMode != COMP_WINDOWMODE_DISABLED) \
Kojto 109:9296ab0bfc11 1218 { \
Kojto 109:9296ab0bfc11 1219 COMP->CSR |= COMP_CSR_WNDWEN; \
Kojto 109:9296ab0bfc11 1220 } \
Kojto 109:9296ab0bfc11 1221 } while(0)
Kojto 109:9296ab0bfc11 1222
Kojto 109:9296ab0bfc11 1223 /**
Kojto 109:9296ab0bfc11 1224 * @brief DeInit a comparator instance
Kojto 109:9296ab0bfc11 1225 * @param __HANDLE__: specifies the COMP handle
Kojto 109:9296ab0bfc11 1226 * @retval None.
Kojto 109:9296ab0bfc11 1227 */
Kojto 109:9296ab0bfc11 1228 #define COMP_DEINIT(__HANDLE__) \
Kojto 109:9296ab0bfc11 1229 do { \
Kojto 109:9296ab0bfc11 1230 uint32_t regshift = COMP_CSR_COMP1_SHIFT; \
Kojto 109:9296ab0bfc11 1231 \
Kojto 109:9296ab0bfc11 1232 if((__HANDLE__)->Instance == COMP2) \
Kojto 109:9296ab0bfc11 1233 { \
Kojto 109:9296ab0bfc11 1234 regshift = COMP_CSR_COMP2_SHIFT; \
Kojto 109:9296ab0bfc11 1235 } \
Kojto 109:9296ab0bfc11 1236 MODIFY_REG(COMP->CSR, \
Kojto 109:9296ab0bfc11 1237 COMP_CSR_RESET_PARAMETERS_MASK << regshift, \
Kojto 109:9296ab0bfc11 1238 COMP_CSR_RESET_VALUE << regshift); \
Kojto 109:9296ab0bfc11 1239 } while(0)
Kojto 109:9296ab0bfc11 1240
Kojto 109:9296ab0bfc11 1241 /**
Kojto 109:9296ab0bfc11 1242 * @brief Start a comparator instance
Kojto 109:9296ab0bfc11 1243 * @param __HANDLE__: specifies the COMP handle
Kojto 109:9296ab0bfc11 1244 * @retval None.
Kojto 109:9296ab0bfc11 1245 */
Kojto 109:9296ab0bfc11 1246 #define COMP_START(__HANDLE__) \
Kojto 109:9296ab0bfc11 1247 do { \
Kojto 109:9296ab0bfc11 1248 uint32_t regshift = COMP_CSR_COMP1_SHIFT; \
Kojto 109:9296ab0bfc11 1249 \
Kojto 109:9296ab0bfc11 1250 if((__HANDLE__)->Instance == COMP2) \
Kojto 109:9296ab0bfc11 1251 { \
Kojto 109:9296ab0bfc11 1252 regshift = COMP_CSR_COMP2_SHIFT; \
Kojto 109:9296ab0bfc11 1253 } \
Kojto 109:9296ab0bfc11 1254 SET_BIT(COMP->CSR, (uint32_t)COMP_CSR_COMPxEN << regshift); \
Kojto 109:9296ab0bfc11 1255 } while(0)
Kojto 109:9296ab0bfc11 1256
Kojto 109:9296ab0bfc11 1257 /**
Kojto 109:9296ab0bfc11 1258 * @brief Stop a comparator instance
Kojto 109:9296ab0bfc11 1259 * @param __HANDLE__: specifies the COMP handle
Kojto 109:9296ab0bfc11 1260 * @retval None.
Kojto 109:9296ab0bfc11 1261 */
Kojto 109:9296ab0bfc11 1262 #define COMP_STOP(__HANDLE__) \
Kojto 109:9296ab0bfc11 1263 do { \
Kojto 109:9296ab0bfc11 1264 uint32_t regshift = COMP_CSR_COMP1_SHIFT; \
Kojto 109:9296ab0bfc11 1265 \
Kojto 109:9296ab0bfc11 1266 if((__HANDLE__)->Instance == COMP2) \
Kojto 109:9296ab0bfc11 1267 { \
Kojto 109:9296ab0bfc11 1268 regshift = COMP_CSR_COMP2_SHIFT; \
Kojto 109:9296ab0bfc11 1269 } \
Kojto 109:9296ab0bfc11 1270 CLEAR_BIT(COMP->CSR, (uint32_t)COMP_CSR_COMPxEN << regshift); \
Kojto 109:9296ab0bfc11 1271 } while(0)
Kojto 109:9296ab0bfc11 1272
Kojto 109:9296ab0bfc11 1273 /**
Kojto 109:9296ab0bfc11 1274 * @brief Lock a comparator instance
Kojto 109:9296ab0bfc11 1275 * @param __HANDLE__: specifies the COMP handle
Kojto 109:9296ab0bfc11 1276 * @retval None.
Kojto 109:9296ab0bfc11 1277 */
Kojto 109:9296ab0bfc11 1278 #define COMP_LOCK(__HANDLE__) \
Kojto 109:9296ab0bfc11 1279 do { \
Kojto 109:9296ab0bfc11 1280 uint32_t regshift = COMP_CSR_COMP1_SHIFT; \
Kojto 109:9296ab0bfc11 1281 \
Kojto 109:9296ab0bfc11 1282 if((__HANDLE__)->Instance == COMP2) \
Kojto 109:9296ab0bfc11 1283 { \
Kojto 109:9296ab0bfc11 1284 regshift = COMP_CSR_COMP2_SHIFT; \
Kojto 109:9296ab0bfc11 1285 } \
Kojto 109:9296ab0bfc11 1286 SET_BIT(COMP->CSR, (uint32_t)COMP_CSR_COMPxLOCK << regshift); \
Kojto 109:9296ab0bfc11 1287 } while(0)
Kojto 109:9296ab0bfc11 1288
Kojto 109:9296ab0bfc11 1289 #else
Kojto 109:9296ab0bfc11 1290 /**
Kojto 109:9296ab0bfc11 1291 * @brief Checks whether the specified EXTI line flag is set or not.
Kojto 109:9296ab0bfc11 1292 * @param __EXTILINE__: specifies the COMP Exti sources to be checked.
Kojto 109:9296ab0bfc11 1293 * This parameter can be a value of @ref COMPEx_ExtiLineEvent
Kojto 109:9296ab0bfc11 1294 * @retval The state of __FLAG__ (SET or RESET).
Kojto 109:9296ab0bfc11 1295 */
Kojto 109:9296ab0bfc11 1296 #define __HAL_COMP_EXTI_GET_FLAG(__EXTILINE__) \
Kojto 109:9296ab0bfc11 1297 ((((__EXTILINE__) & COMP_EXTI_LINE_REG_MASK) != RESET) ? (EXTI->PR2 & (__EXTILINE__)) : (EXTI->PR & (__EXTILINE__)))
Kojto 109:9296ab0bfc11 1298
Kojto 109:9296ab0bfc11 1299 /**
Kojto 109:9296ab0bfc11 1300 * @brief Clear the COMP Exti flags.
Kojto 109:9296ab0bfc11 1301 * @param __EXTILINE__: specifies the COMP Exti sources to be cleared.
Kojto 109:9296ab0bfc11 1302 * This parameter can be a value of @ref COMPEx_ExtiLineEvent
Kojto 109:9296ab0bfc11 1303 * @retval None.
Kojto 109:9296ab0bfc11 1304 */
Kojto 109:9296ab0bfc11 1305 #define __HAL_COMP_EXTI_CLEAR_FLAG(__EXTILINE__) \
Kojto 109:9296ab0bfc11 1306 ((((__EXTILINE__) & COMP_EXTI_LINE_REG_MASK) != RESET) ? (EXTI->PR2 = (__EXTILINE__)) : (EXTI->PR = (__EXTILINE__)))
Kojto 109:9296ab0bfc11 1307
Kojto 109:9296ab0bfc11 1308 /**
Kojto 109:9296ab0bfc11 1309 * @brief Enable the COMP Exti Line.
Kojto 109:9296ab0bfc11 1310 * @param __EXTILINE__: specifies the COMP Exti sources to be enabled.
Kojto 109:9296ab0bfc11 1311 * This parameter can be a value of @ref COMPEx_ExtiLineEvent
Kojto 109:9296ab0bfc11 1312 * @retval None.
Kojto 109:9296ab0bfc11 1313 */
Kojto 109:9296ab0bfc11 1314 #define __HAL_COMP_EXTI_ENABLE_IT(__EXTILINE__) \
Kojto 109:9296ab0bfc11 1315 ((((__EXTILINE__) & COMP_EXTI_LINE_REG_MASK) != RESET) ? (EXTI->IMR2 |= (__EXTILINE__)) : (EXTI->IMR |= (__EXTILINE__)))
Kojto 109:9296ab0bfc11 1316
Kojto 109:9296ab0bfc11 1317 /**
Kojto 109:9296ab0bfc11 1318 * @brief Disable the COMP Exti Line.
Kojto 109:9296ab0bfc11 1319 * @param __EXTILINE__: specifies the COMP Exti sources to be disabled.
Kojto 109:9296ab0bfc11 1320 * This parameter can be a value of @ref COMPEx_ExtiLineEvent
Kojto 109:9296ab0bfc11 1321 * @retval None.
Kojto 109:9296ab0bfc11 1322 */
Kojto 109:9296ab0bfc11 1323 #define __HAL_COMP_EXTI_DISABLE_IT(__EXTILINE__) \
Kojto 109:9296ab0bfc11 1324 ((((__EXTILINE__) & COMP_EXTI_LINE_REG_MASK) != RESET) ? (EXTI->IMR2 &= ~(__EXTILINE__)) : (EXTI->IMR &= ~(__EXTILINE__)))
Kojto 109:9296ab0bfc11 1325
Kojto 109:9296ab0bfc11 1326 /**
Kojto 109:9296ab0bfc11 1327 * @brief Enable the Exti Line rising edge trigger.
Kojto 109:9296ab0bfc11 1328 * @param __EXTILINE__: specifies the COMP Exti sources to be enabled.
Kojto 109:9296ab0bfc11 1329 * This parameter can be a value of @ref COMPEx_ExtiLineEvent
Kojto 109:9296ab0bfc11 1330 * @retval None.
Kojto 109:9296ab0bfc11 1331 */
Kojto 109:9296ab0bfc11 1332 #define __HAL_COMP_EXTI_RISING_IT_ENABLE(__EXTILINE__) \
Kojto 109:9296ab0bfc11 1333 ((((__EXTILINE__) & COMP_EXTI_LINE_REG_MASK) != RESET) ? (EXTI->RTSR2 |= (__EXTILINE__)) : (EXTI->RTSR |= (__EXTILINE__)))
Kojto 109:9296ab0bfc11 1334
Kojto 109:9296ab0bfc11 1335 /**
Kojto 109:9296ab0bfc11 1336 * @brief Disable the Exti Line rising edge trigger.
Kojto 109:9296ab0bfc11 1337 * @param __EXTILINE__: specifies the COMP Exti sources to be disabled.
Kojto 109:9296ab0bfc11 1338 * This parameter can be a value of @ref COMPEx_ExtiLineEvent
Kojto 109:9296ab0bfc11 1339 * @retval None.
Kojto 109:9296ab0bfc11 1340 */
Kojto 109:9296ab0bfc11 1341 #define __HAL_COMP_EXTI_RISING_IT_DISABLE(__EXTILINE__) \
Kojto 109:9296ab0bfc11 1342 ((((__EXTILINE__) & COMP_EXTI_LINE_REG_MASK) != RESET) ? (EXTI->RTSR2 &= ~(__EXTILINE__)) : (EXTI->RTSR &= ~(__EXTILINE__)))
Kojto 109:9296ab0bfc11 1343
Kojto 109:9296ab0bfc11 1344 /**
Kojto 109:9296ab0bfc11 1345 * @brief Enable the Exti Line falling edge trigger.
Kojto 109:9296ab0bfc11 1346 * @param __EXTILINE__: specifies the COMP Exti sources to be enabled.
Kojto 109:9296ab0bfc11 1347 * This parameter can be a value of @ref COMPEx_ExtiLineEvent
Kojto 109:9296ab0bfc11 1348 * @retval None.
Kojto 109:9296ab0bfc11 1349 */
Kojto 109:9296ab0bfc11 1350 #define __HAL_COMP_EXTI_FALLING_IT_ENABLE(__EXTILINE__) \
Kojto 109:9296ab0bfc11 1351 ((((__EXTILINE__) & COMP_EXTI_LINE_REG_MASK) != RESET) ? (EXTI->FTSR2 |= (__EXTILINE__)) : (EXTI->FTSR |= (__EXTILINE__)))
Kojto 109:9296ab0bfc11 1352
Kojto 109:9296ab0bfc11 1353 /**
Kojto 109:9296ab0bfc11 1354 * @brief Disable the Exti Line falling edge trigger.
Kojto 109:9296ab0bfc11 1355 * @param __EXTILINE__: specifies the COMP Exti sources to be disabled.
Kojto 109:9296ab0bfc11 1356 * This parameter can be a value of @ref COMPEx_ExtiLineEvent
Kojto 109:9296ab0bfc11 1357 * @retval None.
Kojto 109:9296ab0bfc11 1358 */
Kojto 109:9296ab0bfc11 1359 #define __HAL_COMP_EXTI_FALLING_IT_DISABLE(__EXTILINE__) \
Kojto 109:9296ab0bfc11 1360 ((((__EXTILINE__) & COMP_EXTI_LINE_REG_MASK) != RESET) ? (EXTI->FTSR2 &= ~(__EXTILINE__)) : (EXTI->FTSR &= ~(__EXTILINE__)))
Kojto 109:9296ab0bfc11 1361
Kojto 109:9296ab0bfc11 1362
Kojto 109:9296ab0bfc11 1363 /**
Kojto 109:9296ab0bfc11 1364 * @brief Init a comparator instance
Kojto 109:9296ab0bfc11 1365 * @param __HANDLE__: specifies the COMP handle
Kojto 109:9296ab0bfc11 1366 * @retval None.
Kojto 109:9296ab0bfc11 1367 */
Kojto 109:9296ab0bfc11 1368 #define COMP_INIT(__HANDLE__) \
Kojto 109:9296ab0bfc11 1369 do { \
Kojto 109:9296ab0bfc11 1370 __IO uint32_t csrreg = 0; \
Kojto 109:9296ab0bfc11 1371 \
Kojto 109:9296ab0bfc11 1372 csrreg = READ_REG((__HANDLE__)->Instance->CSR); \
Kojto 109:9296ab0bfc11 1373 MODIFY_REG(csrreg, COMP_CSR_COMPxINSEL_MASK, (__HANDLE__)->Init.InvertingInput); \
Kojto 109:9296ab0bfc11 1374 MODIFY_REG(csrreg, COMP_CSR_COMPxNONINSEL_MASK, (__HANDLE__)->Init.NonInvertingInput); \
Kojto 109:9296ab0bfc11 1375 MODIFY_REG(csrreg, COMP_CSR_COMPxBLANKING_MASK, (__HANDLE__)->Init.BlankingSrce); \
Kojto 109:9296ab0bfc11 1376 MODIFY_REG(csrreg, COMP_CSR_COMPxOUTSEL_MASK, (__HANDLE__)->Init.Output); \
Kojto 109:9296ab0bfc11 1377 MODIFY_REG(csrreg, COMP_CSR_COMPxPOL_MASK, (__HANDLE__)->Init.OutputPol); \
Kojto 109:9296ab0bfc11 1378 MODIFY_REG(csrreg, COMP_CSR_COMPxHYST_MASK, (__HANDLE__)->Init.Hysteresis); \
Kojto 109:9296ab0bfc11 1379 MODIFY_REG(csrreg, COMP_CSR_COMPxMODE_MASK, (__HANDLE__)->Init.Mode); \
Kojto 109:9296ab0bfc11 1380 MODIFY_REG(csrreg, COMP_CSR_COMPxWNDWEN_MASK, (__HANDLE__)->Init.WindowMode); \
Kojto 109:9296ab0bfc11 1381 WRITE_REG((__HANDLE__)->Instance->CSR, csrreg); \
Kojto 109:9296ab0bfc11 1382 } while(0)
Kojto 109:9296ab0bfc11 1383
Kojto 109:9296ab0bfc11 1384 /**
Kojto 109:9296ab0bfc11 1385 * @brief DeInit a comparator instance
Kojto 109:9296ab0bfc11 1386 * @param __HANDLE__: specifies the COMP handle
Kojto 109:9296ab0bfc11 1387 * @retval None.
Kojto 109:9296ab0bfc11 1388 */
Kojto 109:9296ab0bfc11 1389 #define COMP_DEINIT(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->CSR, COMP_CSR_RESET_VALUE)
Kojto 109:9296ab0bfc11 1390
Kojto 109:9296ab0bfc11 1391 /**
Kojto 109:9296ab0bfc11 1392 * @brief Start a comparator instance
Kojto 109:9296ab0bfc11 1393 * @param __HANDLE__: specifies the COMP handle
Kojto 109:9296ab0bfc11 1394 * @retval None.
Kojto 109:9296ab0bfc11 1395 */
Kojto 109:9296ab0bfc11 1396 #define COMP_START(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_COMPxEN)
Kojto 109:9296ab0bfc11 1397
Kojto 109:9296ab0bfc11 1398 /**
Kojto 109:9296ab0bfc11 1399 * @brief Stop a comparator instance
Kojto 109:9296ab0bfc11 1400 * @param __HANDLE__: specifies the COMP handle
Kojto 109:9296ab0bfc11 1401 * @retval None.
Kojto 109:9296ab0bfc11 1402 */
Kojto 109:9296ab0bfc11 1403 #define COMP_STOP(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_COMPxEN)
Kojto 109:9296ab0bfc11 1404
Kojto 109:9296ab0bfc11 1405 /**
Kojto 109:9296ab0bfc11 1406 * @brief Lock a comparator instance
Kojto 109:9296ab0bfc11 1407 * @param __HANDLE__: specifies the COMP handle
Kojto 109:9296ab0bfc11 1408 * @retval None.
Kojto 109:9296ab0bfc11 1409 */
Kojto 109:9296ab0bfc11 1410 #define COMP_LOCK(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_COMPxLOCK)
Kojto 109:9296ab0bfc11 1411
Kojto 109:9296ab0bfc11 1412 #endif /* STM32F373xC || STM32F378xx */
Kojto 109:9296ab0bfc11 1413
Kojto 109:9296ab0bfc11 1414 #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) || \
Kojto 109:9296ab0bfc11 1415 defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
Kojto 109:9296ab0bfc11 1416 /**
Kojto 109:9296ab0bfc11 1417 * @brief Get the specified EXTI line for a comparator instance
Kojto 109:9296ab0bfc11 1418 * @param __INSTANCE__: specifies the COMP instance.
Kojto 109:9296ab0bfc11 1419 * @retval value of @ref COMPEx_ExtiLineEvent
Kojto 109:9296ab0bfc11 1420 */
Kojto 109:9296ab0bfc11 1421 #define __HAL_COMP_GET_EXTI_LINE(__INSTANCE__) (((__INSTANCE__) == COMP2) ? COMP_EXTI_LINE_COMP2_EVENT : \
Kojto 109:9296ab0bfc11 1422 ((__INSTANCE__) == COMP4) ? COMP_EXTI_LINE_COMP4_EVENT : \
Kojto 109:9296ab0bfc11 1423 COMP_EXTI_LINE_COMP6_EVENT)
Kojto 109:9296ab0bfc11 1424 #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */
Kojto 109:9296ab0bfc11 1425 /* STM32F303x8 || STM32F334x8 || STM32F328xx */
Kojto 109:9296ab0bfc11 1426
Kojto 109:9296ab0bfc11 1427 #if defined(STM32F302xE) || \
Kojto 109:9296ab0bfc11 1428 defined(STM32F302xC)
Kojto 109:9296ab0bfc11 1429 /**
Kojto 109:9296ab0bfc11 1430 * @brief Get the specified EXTI line for a comparator instance
Kojto 109:9296ab0bfc11 1431 * @param __INSTANCE__: specifies the COMP instance.
Kojto 109:9296ab0bfc11 1432 * @retval value of @ref COMPEx_ExtiLineEvent
Kojto 109:9296ab0bfc11 1433 */
Kojto 109:9296ab0bfc11 1434 #define __HAL_COMP_GET_EXTI_LINE(__INSTANCE__) (((__INSTANCE__) == COMP1) ? COMP_EXTI_LINE_COMP1_EVENT : \
Kojto 109:9296ab0bfc11 1435 ((__INSTANCE__) == COMP2) ? COMP_EXTI_LINE_COMP2_EVENT : \
Kojto 109:9296ab0bfc11 1436 ((__INSTANCE__) == COMP4) ? COMP_EXTI_LINE_COMP4_EVENT : \
Kojto 109:9296ab0bfc11 1437 COMP_EXTI_LINE_COMP6_EVENT)
Kojto 109:9296ab0bfc11 1438 #endif /* STM32F302xE || */
Kojto 109:9296ab0bfc11 1439 /* STM32F302xC */
Kojto 109:9296ab0bfc11 1440
Kojto 109:9296ab0bfc11 1441 #if defined(STM32F303xE) || defined(STM32F398xx) || \
Kojto 109:9296ab0bfc11 1442 defined(STM32F303xC) || defined(STM32F358xx)
Kojto 109:9296ab0bfc11 1443 /**
Kojto 109:9296ab0bfc11 1444 * @brief Get the specified EXTI line for a comparator instance
Kojto 109:9296ab0bfc11 1445 * @param __INSTANCE__: specifies the COMP instance.
Kojto 109:9296ab0bfc11 1446 * @retval value of @ref COMPEx_ExtiLineEvent
Kojto 109:9296ab0bfc11 1447 */
Kojto 109:9296ab0bfc11 1448 #define __HAL_COMP_GET_EXTI_LINE(__INSTANCE__) (((__INSTANCE__) == COMP1) ? COMP_EXTI_LINE_COMP1_EVENT : \
Kojto 109:9296ab0bfc11 1449 ((__INSTANCE__) == COMP2) ? COMP_EXTI_LINE_COMP2_EVENT : \
Kojto 109:9296ab0bfc11 1450 ((__INSTANCE__) == COMP3) ? COMP_EXTI_LINE_COMP3_EVENT : \
Kojto 109:9296ab0bfc11 1451 ((__INSTANCE__) == COMP4) ? COMP_EXTI_LINE_COMP4_EVENT : \
Kojto 109:9296ab0bfc11 1452 ((__INSTANCE__) == COMP5) ? COMP_EXTI_LINE_COMP5_EVENT : \
Kojto 109:9296ab0bfc11 1453 ((__INSTANCE__) == COMP6) ? COMP_EXTI_LINE_COMP6_EVENT : \
Kojto 109:9296ab0bfc11 1454 COMP_EXTI_LINE_COMP7_EVENT)
Kojto 109:9296ab0bfc11 1455 #endif /* STM32F303xE || STM32F398xx || */
Kojto 109:9296ab0bfc11 1456 /* STM32F303xC || STM32F358xx */
Kojto 109:9296ab0bfc11 1457
Kojto 109:9296ab0bfc11 1458 #if defined(STM32F373xC) ||defined(STM32F378xx)
Kojto 109:9296ab0bfc11 1459 /**
Kojto 109:9296ab0bfc11 1460 * @brief Get the specified EXTI line for a comparator instance
Kojto 109:9296ab0bfc11 1461 * @param __INSTANCE__: specifies the COMP instance.
Kojto 109:9296ab0bfc11 1462 * @retval value of @ref COMPEx_ExtiLineEvent
Kojto 109:9296ab0bfc11 1463 */
Kojto 109:9296ab0bfc11 1464 #define __HAL_COMP_GET_EXTI_LINE(__INSTANCE__) (((__INSTANCE__) == COMP1) ? COMP_EXTI_LINE_COMP1_EVENT : \
Kojto 109:9296ab0bfc11 1465 COMP_EXTI_LINE_COMP2_EVENT)
Kojto 109:9296ab0bfc11 1466 #endif /* STM32F373xC || STM32F378xx */
Kojto 109:9296ab0bfc11 1467
Kojto 109:9296ab0bfc11 1468 /**
Kojto 109:9296ab0bfc11 1469 * @}
Kojto 109:9296ab0bfc11 1470 */
Kojto 109:9296ab0bfc11 1471
Kojto 109:9296ab0bfc11 1472 /* Exported functions --------------------------------------------------------*/
Kojto 109:9296ab0bfc11 1473
Kojto 109:9296ab0bfc11 1474 /* Initialization and de-initialization functions ****************************/
Kojto 109:9296ab0bfc11 1475 /* IO operation functions *****************************************************/
Kojto 109:9296ab0bfc11 1476 /* Peripheral Control functions ***********************************************/
Kojto 109:9296ab0bfc11 1477 /* Peripheral State and Error functions ***************************************/
Kojto 109:9296ab0bfc11 1478
Kojto 109:9296ab0bfc11 1479 /**
Kojto 109:9296ab0bfc11 1480 * @}
Kojto 109:9296ab0bfc11 1481 */
Kojto 109:9296ab0bfc11 1482
Kojto 109:9296ab0bfc11 1483 /**
Kojto 109:9296ab0bfc11 1484 * @}
Kojto 109:9296ab0bfc11 1485 */
Kojto 109:9296ab0bfc11 1486
Kojto 109:9296ab0bfc11 1487 #ifdef __cplusplus
Kojto 109:9296ab0bfc11 1488 }
Kojto 109:9296ab0bfc11 1489 #endif
Kojto 109:9296ab0bfc11 1490
Kojto 109:9296ab0bfc11 1491 #endif /* __STM32F3xx_HAL_COMP_EX_H */
Kojto 109:9296ab0bfc11 1492
Kojto 109:9296ab0bfc11 1493 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/