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