mbed library sources
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_STM32F3XX/stm32f30x_adc.h@155:8435094ec241, 2014-04-08 (annotated)
- Committer:
- mbed_official
- Date:
- Tue Apr 08 09:15:06 2014 +0100
- Revision:
- 155:8435094ec241
Synchronized with git revision d616c415fc62f490b915ff0ff39c8d24b2917c0f
Full URL: https://github.com/mbedmicro/mbed/commit/d616c415fc62f490b915ff0ff39c8d24b2917c0f/
[STM32F3XX] Initial port
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 155:8435094ec241 | 1 | /** |
mbed_official | 155:8435094ec241 | 2 | ****************************************************************************** |
mbed_official | 155:8435094ec241 | 3 | * @file stm32f30x_adc.h |
mbed_official | 155:8435094ec241 | 4 | * @author MCD Application Team |
mbed_official | 155:8435094ec241 | 5 | * @version V1.1.0 |
mbed_official | 155:8435094ec241 | 6 | * @date 27-February-2014 |
mbed_official | 155:8435094ec241 | 7 | * @brief This file contains all the functions prototypes for the ADC firmware |
mbed_official | 155:8435094ec241 | 8 | * library. |
mbed_official | 155:8435094ec241 | 9 | ****************************************************************************** |
mbed_official | 155:8435094ec241 | 10 | * @attention |
mbed_official | 155:8435094ec241 | 11 | * |
mbed_official | 155:8435094ec241 | 12 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
mbed_official | 155:8435094ec241 | 13 | * |
mbed_official | 155:8435094ec241 | 14 | * Redistribution and use in source and binary forms, with or without modification, |
mbed_official | 155:8435094ec241 | 15 | * are permitted provided that the following conditions are met: |
mbed_official | 155:8435094ec241 | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
mbed_official | 155:8435094ec241 | 17 | * this list of conditions and the following disclaimer. |
mbed_official | 155:8435094ec241 | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 155:8435094ec241 | 19 | * this list of conditions and the following disclaimer in the documentation |
mbed_official | 155:8435094ec241 | 20 | * and/or other materials provided with the distribution. |
mbed_official | 155:8435094ec241 | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
mbed_official | 155:8435094ec241 | 22 | * may be used to endorse or promote products derived from this software |
mbed_official | 155:8435094ec241 | 23 | * without specific prior written permission. |
mbed_official | 155:8435094ec241 | 24 | * |
mbed_official | 155:8435094ec241 | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 155:8435094ec241 | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 155:8435094ec241 | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 155:8435094ec241 | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mbed_official | 155:8435094ec241 | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 155:8435094ec241 | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mbed_official | 155:8435094ec241 | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mbed_official | 155:8435094ec241 | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mbed_official | 155:8435094ec241 | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mbed_official | 155:8435094ec241 | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 155:8435094ec241 | 35 | * |
mbed_official | 155:8435094ec241 | 36 | ****************************************************************************** |
mbed_official | 155:8435094ec241 | 37 | */ |
mbed_official | 155:8435094ec241 | 38 | |
mbed_official | 155:8435094ec241 | 39 | /* Define to prevent recursive inclusion -------------------------------------*/ |
mbed_official | 155:8435094ec241 | 40 | #ifndef __STM32F30x_ADC_H |
mbed_official | 155:8435094ec241 | 41 | #define __STM32F30x_ADC_H |
mbed_official | 155:8435094ec241 | 42 | |
mbed_official | 155:8435094ec241 | 43 | #ifdef __cplusplus |
mbed_official | 155:8435094ec241 | 44 | extern "C" { |
mbed_official | 155:8435094ec241 | 45 | #endif |
mbed_official | 155:8435094ec241 | 46 | |
mbed_official | 155:8435094ec241 | 47 | /* Includes ------------------------------------------------------------------*/ |
mbed_official | 155:8435094ec241 | 48 | #include "stm32f30x.h" |
mbed_official | 155:8435094ec241 | 49 | |
mbed_official | 155:8435094ec241 | 50 | /** @addtogroup STM32F30x_StdPeriph_Driver |
mbed_official | 155:8435094ec241 | 51 | * @{ |
mbed_official | 155:8435094ec241 | 52 | */ |
mbed_official | 155:8435094ec241 | 53 | |
mbed_official | 155:8435094ec241 | 54 | /** @addtogroup ADC |
mbed_official | 155:8435094ec241 | 55 | * @{ |
mbed_official | 155:8435094ec241 | 56 | */ |
mbed_official | 155:8435094ec241 | 57 | |
mbed_official | 155:8435094ec241 | 58 | /* Exported types ------------------------------------------------------------*/ |
mbed_official | 155:8435094ec241 | 59 | |
mbed_official | 155:8435094ec241 | 60 | /** |
mbed_official | 155:8435094ec241 | 61 | * @brief ADC Init structure definition |
mbed_official | 155:8435094ec241 | 62 | */ |
mbed_official | 155:8435094ec241 | 63 | typedef struct |
mbed_official | 155:8435094ec241 | 64 | { |
mbed_official | 155:8435094ec241 | 65 | |
mbed_official | 155:8435094ec241 | 66 | uint32_t ADC_ContinuousConvMode; /*!< Specifies whether the conversion is performed in |
mbed_official | 155:8435094ec241 | 67 | Continuous or Single mode. |
mbed_official | 155:8435094ec241 | 68 | This parameter can be set to ENABLE or DISABLE. */ |
mbed_official | 155:8435094ec241 | 69 | uint32_t ADC_Resolution; /*!< Configures the ADC resolution. |
mbed_official | 155:8435094ec241 | 70 | This parameter can be a value of @ref ADC_resolution */ |
mbed_official | 155:8435094ec241 | 71 | uint32_t ADC_ExternalTrigConvEvent; /*!< Defines the external trigger used to start the analog |
mbed_official | 155:8435094ec241 | 72 | to digital conversion of regular channels. This parameter |
mbed_official | 155:8435094ec241 | 73 | can be a value of @ref ADC_external_trigger_sources_for_regular_channels_conversion */ |
mbed_official | 155:8435094ec241 | 74 | uint32_t ADC_ExternalTrigEventEdge; /*!< Select the external trigger edge and enable the trigger of a regular group. |
mbed_official | 155:8435094ec241 | 75 | This parameter can be a value of |
mbed_official | 155:8435094ec241 | 76 | @ref ADC_external_trigger_edge_for_regular_channels_conversion */ |
mbed_official | 155:8435094ec241 | 77 | uint32_t ADC_DataAlign; /*!< Specifies whether the ADC data alignment is left or right. |
mbed_official | 155:8435094ec241 | 78 | This parameter can be a value of @ref ADC_data_align */ |
mbed_official | 155:8435094ec241 | 79 | uint32_t ADC_OverrunMode; /*!< Specifies the way data overrun are managed. |
mbed_official | 155:8435094ec241 | 80 | This parameter can be set to ENABLE or DISABLE. */ |
mbed_official | 155:8435094ec241 | 81 | uint32_t ADC_AutoInjMode; /*!< Enable/disable automatic injected group conversion after |
mbed_official | 155:8435094ec241 | 82 | regular group conversion. |
mbed_official | 155:8435094ec241 | 83 | This parameter can be set to ENABLE or DISABLE. */ |
mbed_official | 155:8435094ec241 | 84 | uint8_t ADC_NbrOfRegChannel; /*!< Specifies the number of ADC channels that will be converted |
mbed_official | 155:8435094ec241 | 85 | using the sequencer for regular channel group. |
mbed_official | 155:8435094ec241 | 86 | This parameter must range from 1 to 16. */ |
mbed_official | 155:8435094ec241 | 87 | }ADC_InitTypeDef; |
mbed_official | 155:8435094ec241 | 88 | |
mbed_official | 155:8435094ec241 | 89 | /** |
mbed_official | 155:8435094ec241 | 90 | * @} |
mbed_official | 155:8435094ec241 | 91 | */ |
mbed_official | 155:8435094ec241 | 92 | /** |
mbed_official | 155:8435094ec241 | 93 | * @brief ADC Init structure definition |
mbed_official | 155:8435094ec241 | 94 | */ |
mbed_official | 155:8435094ec241 | 95 | typedef struct |
mbed_official | 155:8435094ec241 | 96 | { |
mbed_official | 155:8435094ec241 | 97 | |
mbed_official | 155:8435094ec241 | 98 | uint32_t ADC_ExternalTrigInjecConvEvent; /*!< Defines the external trigger used to start the analog |
mbed_official | 155:8435094ec241 | 99 | to digital conversion of injected channels. This parameter |
mbed_official | 155:8435094ec241 | 100 | can be a value of @ref ADC_external_trigger_sources_for_Injected_channels_conversion */ |
mbed_official | 155:8435094ec241 | 101 | uint32_t ADC_ExternalTrigInjecEventEdge; /*!< Select the external trigger edge and enable the trigger of an injected group. |
mbed_official | 155:8435094ec241 | 102 | This parameter can be a value of |
mbed_official | 155:8435094ec241 | 103 | @ref ADC_external_trigger_edge_for_Injected_channels_conversion */ |
mbed_official | 155:8435094ec241 | 104 | uint8_t ADC_NbrOfInjecChannel; /*!< Specifies the number of ADC channels that will be converted |
mbed_official | 155:8435094ec241 | 105 | using the sequencer for injected channel group. |
mbed_official | 155:8435094ec241 | 106 | This parameter must range from 1 to 4. */ |
mbed_official | 155:8435094ec241 | 107 | uint32_t ADC_InjecSequence1; |
mbed_official | 155:8435094ec241 | 108 | uint32_t ADC_InjecSequence2; |
mbed_official | 155:8435094ec241 | 109 | uint32_t ADC_InjecSequence3; |
mbed_official | 155:8435094ec241 | 110 | uint32_t ADC_InjecSequence4; |
mbed_official | 155:8435094ec241 | 111 | }ADC_InjectedInitTypeDef; |
mbed_official | 155:8435094ec241 | 112 | |
mbed_official | 155:8435094ec241 | 113 | /** |
mbed_official | 155:8435094ec241 | 114 | * @} |
mbed_official | 155:8435094ec241 | 115 | */ |
mbed_official | 155:8435094ec241 | 116 | typedef struct |
mbed_official | 155:8435094ec241 | 117 | { |
mbed_official | 155:8435094ec241 | 118 | uint32_t ADC_Mode; /*!< Configures the ADC to operate in |
mbed_official | 155:8435094ec241 | 119 | independent or multi mode. |
mbed_official | 155:8435094ec241 | 120 | This parameter can be a value of @ref ADC_mode */ |
mbed_official | 155:8435094ec241 | 121 | uint32_t ADC_Clock; /*!< Select the clock of the ADC. The clock is common for both master |
mbed_official | 155:8435094ec241 | 122 | and slave ADCs. |
mbed_official | 155:8435094ec241 | 123 | This parameter can be a value of @ref ADC_Clock */ |
mbed_official | 155:8435094ec241 | 124 | uint32_t ADC_DMAAccessMode; /*!< Configures the Direct memory access mode for multi ADC mode. |
mbed_official | 155:8435094ec241 | 125 | This parameter can be a value of |
mbed_official | 155:8435094ec241 | 126 | @ref ADC_Direct_memory_access_mode_for_multi_mode */ |
mbed_official | 155:8435094ec241 | 127 | uint32_t ADC_DMAMode; /*!< Configures the DMA mode for ADC. |
mbed_official | 155:8435094ec241 | 128 | This parameter can be a value of @ref ADC_DMA_Mode_definition */ |
mbed_official | 155:8435094ec241 | 129 | uint8_t ADC_TwoSamplingDelay; /*!< Configures the Delay between 2 sampling phases. |
mbed_official | 155:8435094ec241 | 130 | This parameter can be a value between 0x0 and 0xF */ |
mbed_official | 155:8435094ec241 | 131 | |
mbed_official | 155:8435094ec241 | 132 | }ADC_CommonInitTypeDef; |
mbed_official | 155:8435094ec241 | 133 | |
mbed_official | 155:8435094ec241 | 134 | /* Exported constants --------------------------------------------------------*/ |
mbed_official | 155:8435094ec241 | 135 | |
mbed_official | 155:8435094ec241 | 136 | /** @defgroup ADC_Exported_Constants |
mbed_official | 155:8435094ec241 | 137 | * @{ |
mbed_official | 155:8435094ec241 | 138 | */ |
mbed_official | 155:8435094ec241 | 139 | |
mbed_official | 155:8435094ec241 | 140 | #define IS_ADC_ALL_PERIPH(PERIPH) (((PERIPH) == ADC1) || \ |
mbed_official | 155:8435094ec241 | 141 | ((PERIPH) == ADC2) || \ |
mbed_official | 155:8435094ec241 | 142 | ((PERIPH) == ADC3) || \ |
mbed_official | 155:8435094ec241 | 143 | ((PERIPH) == ADC4)) |
mbed_official | 155:8435094ec241 | 144 | |
mbed_official | 155:8435094ec241 | 145 | #define IS_ADC_DMA_PERIPH(PERIPH) (((PERIPH) == ADC1) || \ |
mbed_official | 155:8435094ec241 | 146 | ((PERIPH) == ADC2) || \ |
mbed_official | 155:8435094ec241 | 147 | ((PERIPH) == ADC3) || \ |
mbed_official | 155:8435094ec241 | 148 | ((PERIPH) == ADC4)) |
mbed_official | 155:8435094ec241 | 149 | |
mbed_official | 155:8435094ec241 | 150 | /** @defgroup ADC_ContinuousConvMode |
mbed_official | 155:8435094ec241 | 151 | * @{ |
mbed_official | 155:8435094ec241 | 152 | */ |
mbed_official | 155:8435094ec241 | 153 | #define ADC_ContinuousConvMode_Enable ((uint32_t)0x00002000) /*!< ADC continuous conversion mode enable */ |
mbed_official | 155:8435094ec241 | 154 | #define ADC_ContinuousConvMode_Disable ((uint32_t)0x00000000) /*!< ADC continuous conversion mode disable */ |
mbed_official | 155:8435094ec241 | 155 | #define IS_ADC_CONVMODE(MODE) (((MODE) == ADC_ContinuousConvMode_Enable) || \ |
mbed_official | 155:8435094ec241 | 156 | ((MODE) == ADC_ContinuousConvMode_Disable)) |
mbed_official | 155:8435094ec241 | 157 | /** |
mbed_official | 155:8435094ec241 | 158 | * @} |
mbed_official | 155:8435094ec241 | 159 | */ |
mbed_official | 155:8435094ec241 | 160 | /** @defgroup ADC_OverunMode |
mbed_official | 155:8435094ec241 | 161 | * @{ |
mbed_official | 155:8435094ec241 | 162 | */ |
mbed_official | 155:8435094ec241 | 163 | #define ADC_OverrunMode_Enable ((uint32_t)0x00001000) /*!< ADC Overrun Mode enable */ |
mbed_official | 155:8435094ec241 | 164 | #define ADC_OverrunMode_Disable ((uint32_t)0x00000000) /*!< ADC Overrun Mode disable */ |
mbed_official | 155:8435094ec241 | 165 | #define IS_ADC_OVRUNMODE(MODE) (((MODE) == ADC_OverrunMode_Enable) || \ |
mbed_official | 155:8435094ec241 | 166 | ((MODE) == ADC_OverrunMode_Disable)) |
mbed_official | 155:8435094ec241 | 167 | /** |
mbed_official | 155:8435094ec241 | 168 | * @} |
mbed_official | 155:8435094ec241 | 169 | */ |
mbed_official | 155:8435094ec241 | 170 | /** @defgroup ADC_AutoInjecMode |
mbed_official | 155:8435094ec241 | 171 | * @{ |
mbed_official | 155:8435094ec241 | 172 | */ |
mbed_official | 155:8435094ec241 | 173 | #define ADC_AutoInjec_Enable ((uint32_t)0x02000000) /*!< ADC Auto injected Mode enable */ |
mbed_official | 155:8435094ec241 | 174 | #define ADC_AutoInjec_Disable ((uint32_t)0x00000000) /*!< ADC Auto injected Mode disable */ |
mbed_official | 155:8435094ec241 | 175 | #define IS_ADC_AUTOINJECMODE(MODE) (((MODE) == ADC_AutoInjec_Enable) || \ |
mbed_official | 155:8435094ec241 | 176 | ((MODE) == ADC_AutoInjec_Disable)) |
mbed_official | 155:8435094ec241 | 177 | /** |
mbed_official | 155:8435094ec241 | 178 | * @} |
mbed_official | 155:8435094ec241 | 179 | */ |
mbed_official | 155:8435094ec241 | 180 | /** @defgroup ADC_resolution |
mbed_official | 155:8435094ec241 | 181 | * @{ |
mbed_official | 155:8435094ec241 | 182 | */ |
mbed_official | 155:8435094ec241 | 183 | #define ADC_Resolution_12b ((uint32_t)0x00000000) /*!< ADC 12-bit resolution */ |
mbed_official | 155:8435094ec241 | 184 | #define ADC_Resolution_10b ((uint32_t)0x00000008) /*!< ADC 10-bit resolution */ |
mbed_official | 155:8435094ec241 | 185 | #define ADC_Resolution_8b ((uint32_t)0x00000010) /*!< ADC 8-bit resolution */ |
mbed_official | 155:8435094ec241 | 186 | #define ADC_Resolution_6b ((uint32_t)0x00000018) /*!< ADC 6-bit resolution */ |
mbed_official | 155:8435094ec241 | 187 | #define IS_ADC_RESOLUTION(RESOLUTION) (((RESOLUTION) == ADC_Resolution_12b) || \ |
mbed_official | 155:8435094ec241 | 188 | ((RESOLUTION) == ADC_Resolution_10b) || \ |
mbed_official | 155:8435094ec241 | 189 | ((RESOLUTION) == ADC_Resolution_8b) || \ |
mbed_official | 155:8435094ec241 | 190 | ((RESOLUTION) == ADC_Resolution_6b)) |
mbed_official | 155:8435094ec241 | 191 | |
mbed_official | 155:8435094ec241 | 192 | /** |
mbed_official | 155:8435094ec241 | 193 | * @} |
mbed_official | 155:8435094ec241 | 194 | */ |
mbed_official | 155:8435094ec241 | 195 | |
mbed_official | 155:8435094ec241 | 196 | |
mbed_official | 155:8435094ec241 | 197 | /** @defgroup ADC_external_trigger_edge_for_regular_channels_conversion |
mbed_official | 155:8435094ec241 | 198 | * @{ |
mbed_official | 155:8435094ec241 | 199 | */ |
mbed_official | 155:8435094ec241 | 200 | #define ADC_ExternalTrigEventEdge_None ((uint16_t)0x0000) /*!< ADC No external trigger for regular conversion */ |
mbed_official | 155:8435094ec241 | 201 | #define ADC_ExternalTrigEventEdge_RisingEdge ((uint16_t)0x0400) /*!< ADC external trigger rising edge for regular conversion */ |
mbed_official | 155:8435094ec241 | 202 | #define ADC_ExternalTrigEventEdge_FallingEdge ((uint16_t)0x0800) /*!< ADC ADC external trigger falling edge for regular conversion */ |
mbed_official | 155:8435094ec241 | 203 | #define ADC_ExternalTrigEventEdge_BothEdge ((uint16_t)0x0C00) /*!< ADC ADC external trigger both edges for regular conversion */ |
mbed_official | 155:8435094ec241 | 204 | |
mbed_official | 155:8435094ec241 | 205 | #define IS_EXTERNALTRIG_EDGE(EDGE) (((EDGE) == ADC_ExternalTrigEventEdge_None) || \ |
mbed_official | 155:8435094ec241 | 206 | ((EDGE) == ADC_ExternalTrigEventEdge_RisingEdge) || \ |
mbed_official | 155:8435094ec241 | 207 | ((EDGE) == ADC_ExternalTrigEventEdge_FallingEdge) || \ |
mbed_official | 155:8435094ec241 | 208 | ((EDGE) == ADC_ExternalTrigEventEdge_BothEdge)) |
mbed_official | 155:8435094ec241 | 209 | |
mbed_official | 155:8435094ec241 | 210 | /** |
mbed_official | 155:8435094ec241 | 211 | * @} |
mbed_official | 155:8435094ec241 | 212 | */ |
mbed_official | 155:8435094ec241 | 213 | |
mbed_official | 155:8435094ec241 | 214 | /** @defgroup ADC_external_trigger_edge_for_Injected_channels_conversion |
mbed_official | 155:8435094ec241 | 215 | * @{ |
mbed_official | 155:8435094ec241 | 216 | */ |
mbed_official | 155:8435094ec241 | 217 | #define ADC_ExternalTrigInjecEventEdge_None ((uint16_t)0x0000) /*!< ADC No external trigger for regular conversion */ |
mbed_official | 155:8435094ec241 | 218 | #define ADC_ExternalTrigInjecEventEdge_RisingEdge ((uint16_t)0x0040) /*!< ADC external trigger rising edge for injected conversion */ |
mbed_official | 155:8435094ec241 | 219 | #define ADC_ExternalTrigInjecEventEdge_FallingEdge ((uint16_t)0x0080) /*!< ADC external trigger falling edge for injected conversion */ |
mbed_official | 155:8435094ec241 | 220 | #define ADC_ExternalTrigInjecEventEdge_BothEdge ((uint16_t)0x00C0) /*!< ADC external trigger both edges for injected conversion */ |
mbed_official | 155:8435094ec241 | 221 | |
mbed_official | 155:8435094ec241 | 222 | #define IS_EXTERNALTRIGINJ_EDGE(EDGE) (((EDGE) == ADC_ExternalTrigInjecEventEdge_None) || \ |
mbed_official | 155:8435094ec241 | 223 | ((EDGE) == ADC_ExternalTrigInjecEventEdge_RisingEdge) || \ |
mbed_official | 155:8435094ec241 | 224 | ((EDGE) == ADC_ExternalTrigInjecEventEdge_FallingEdge) || \ |
mbed_official | 155:8435094ec241 | 225 | ((EDGE) == ADC_ExternalTrigInjecEventEdge_BothEdge)) |
mbed_official | 155:8435094ec241 | 226 | |
mbed_official | 155:8435094ec241 | 227 | /** @defgroup ADC_external_trigger_sources_for_regular_channels_conversion |
mbed_official | 155:8435094ec241 | 228 | * @{ |
mbed_official | 155:8435094ec241 | 229 | */ |
mbed_official | 155:8435094ec241 | 230 | #define ADC_ExternalTrigConvEvent_0 ((uint16_t)0x0000) /*!< ADC external trigger event 0 */ |
mbed_official | 155:8435094ec241 | 231 | #define ADC_ExternalTrigConvEvent_1 ((uint16_t)0x0040) /*!< ADC external trigger event 1 */ |
mbed_official | 155:8435094ec241 | 232 | #define ADC_ExternalTrigConvEvent_2 ((uint16_t)0x0080) /*!< ADC external trigger event 2 */ |
mbed_official | 155:8435094ec241 | 233 | #define ADC_ExternalTrigConvEvent_3 ((uint16_t)0x00C0) /*!< ADC external trigger event 3 */ |
mbed_official | 155:8435094ec241 | 234 | #define ADC_ExternalTrigConvEvent_4 ((uint16_t)0x0100) /*!< ADC external trigger event 4 */ |
mbed_official | 155:8435094ec241 | 235 | #define ADC_ExternalTrigConvEvent_5 ((uint16_t)0x0140) /*!< ADC external trigger event 5 */ |
mbed_official | 155:8435094ec241 | 236 | #define ADC_ExternalTrigConvEvent_6 ((uint16_t)0x0180) /*!< ADC external trigger event 6 */ |
mbed_official | 155:8435094ec241 | 237 | #define ADC_ExternalTrigConvEvent_7 ((uint16_t)0x01C0) /*!< ADC external trigger event 7 */ |
mbed_official | 155:8435094ec241 | 238 | #define ADC_ExternalTrigConvEvent_8 ((uint16_t)0x0200) /*!< ADC external trigger event 8 */ |
mbed_official | 155:8435094ec241 | 239 | #define ADC_ExternalTrigConvEvent_9 ((uint16_t)0x0240) /*!< ADC external trigger event 9 */ |
mbed_official | 155:8435094ec241 | 240 | #define ADC_ExternalTrigConvEvent_10 ((uint16_t)0x0280) /*!< ADC external trigger event 10 */ |
mbed_official | 155:8435094ec241 | 241 | #define ADC_ExternalTrigConvEvent_11 ((uint16_t)0x02C0) /*!< ADC external trigger event 11 */ |
mbed_official | 155:8435094ec241 | 242 | #define ADC_ExternalTrigConvEvent_12 ((uint16_t)0x0300) /*!< ADC external trigger event 12 */ |
mbed_official | 155:8435094ec241 | 243 | #define ADC_ExternalTrigConvEvent_13 ((uint16_t)0x0340) /*!< ADC external trigger event 13 */ |
mbed_official | 155:8435094ec241 | 244 | #define ADC_ExternalTrigConvEvent_14 ((uint16_t)0x0380) /*!< ADC external trigger event 14 */ |
mbed_official | 155:8435094ec241 | 245 | #define ADC_ExternalTrigConvEvent_15 ((uint16_t)0x03C0) /*!< ADC external trigger event 15 */ |
mbed_official | 155:8435094ec241 | 246 | |
mbed_official | 155:8435094ec241 | 247 | #define IS_ADC_EXT_TRIG(REGTRIG) (((REGTRIG) == ADC_ExternalTrigConvEvent_0) || \ |
mbed_official | 155:8435094ec241 | 248 | ((REGTRIG) == ADC_ExternalTrigConvEvent_1) || \ |
mbed_official | 155:8435094ec241 | 249 | ((REGTRIG) == ADC_ExternalTrigConvEvent_2) || \ |
mbed_official | 155:8435094ec241 | 250 | ((REGTRIG) == ADC_ExternalTrigConvEvent_3) || \ |
mbed_official | 155:8435094ec241 | 251 | ((REGTRIG) == ADC_ExternalTrigConvEvent_4) || \ |
mbed_official | 155:8435094ec241 | 252 | ((REGTRIG) == ADC_ExternalTrigConvEvent_5) || \ |
mbed_official | 155:8435094ec241 | 253 | ((REGTRIG) == ADC_ExternalTrigConvEvent_6) || \ |
mbed_official | 155:8435094ec241 | 254 | ((REGTRIG) == ADC_ExternalTrigConvEvent_7) || \ |
mbed_official | 155:8435094ec241 | 255 | ((REGTRIG) == ADC_ExternalTrigConvEvent_8) || \ |
mbed_official | 155:8435094ec241 | 256 | ((REGTRIG) == ADC_ExternalTrigConvEvent_9) || \ |
mbed_official | 155:8435094ec241 | 257 | ((REGTRIG) == ADC_ExternalTrigConvEvent_10) || \ |
mbed_official | 155:8435094ec241 | 258 | ((REGTRIG) == ADC_ExternalTrigConvEvent_11) || \ |
mbed_official | 155:8435094ec241 | 259 | ((REGTRIG) == ADC_ExternalTrigConvEvent_12) || \ |
mbed_official | 155:8435094ec241 | 260 | ((REGTRIG) == ADC_ExternalTrigConvEvent_13) || \ |
mbed_official | 155:8435094ec241 | 261 | ((REGTRIG) == ADC_ExternalTrigConvEvent_14) || \ |
mbed_official | 155:8435094ec241 | 262 | ((REGTRIG) == ADC_ExternalTrigConvEvent_15)) |
mbed_official | 155:8435094ec241 | 263 | |
mbed_official | 155:8435094ec241 | 264 | /** |
mbed_official | 155:8435094ec241 | 265 | * @} |
mbed_official | 155:8435094ec241 | 266 | */ |
mbed_official | 155:8435094ec241 | 267 | |
mbed_official | 155:8435094ec241 | 268 | /** @defgroup ADC_external_trigger_sources_for_Injected_channels_conversion |
mbed_official | 155:8435094ec241 | 269 | * @{ |
mbed_official | 155:8435094ec241 | 270 | */ |
mbed_official | 155:8435094ec241 | 271 | |
mbed_official | 155:8435094ec241 | 272 | #define ADC_ExternalTrigInjecConvEvent_0 ((uint16_t)0x0000) /*!< ADC external trigger for injected conversion event 0 */ |
mbed_official | 155:8435094ec241 | 273 | #define ADC_ExternalTrigInjecConvEvent_1 ((uint16_t)0x0004) /*!< ADC external trigger for injected conversion event 1 */ |
mbed_official | 155:8435094ec241 | 274 | #define ADC_ExternalTrigInjecConvEvent_2 ((uint16_t)0x0008) /*!< ADC external trigger for injected conversion event 2 */ |
mbed_official | 155:8435094ec241 | 275 | #define ADC_ExternalTrigInjecConvEvent_3 ((uint16_t)0x000C) /*!< ADC external trigger for injected conversion event 3 */ |
mbed_official | 155:8435094ec241 | 276 | #define ADC_ExternalTrigInjecConvEvent_4 ((uint16_t)0x0010) /*!< ADC external trigger for injected conversion event 4 */ |
mbed_official | 155:8435094ec241 | 277 | #define ADC_ExternalTrigInjecConvEvent_5 ((uint16_t)0x0014) /*!< ADC external trigger for injected conversion event 5 */ |
mbed_official | 155:8435094ec241 | 278 | #define ADC_ExternalTrigInjecConvEvent_6 ((uint16_t)0x0018) /*!< ADC external trigger for injected conversion event 6 */ |
mbed_official | 155:8435094ec241 | 279 | #define ADC_ExternalTrigInjecConvEvent_7 ((uint16_t)0x001C) /*!< ADC external trigger for injected conversion event 7 */ |
mbed_official | 155:8435094ec241 | 280 | #define ADC_ExternalTrigInjecConvEvent_8 ((uint16_t)0x0020) /*!< ADC external trigger for injected conversion event 8 */ |
mbed_official | 155:8435094ec241 | 281 | #define ADC_ExternalTrigInjecConvEvent_9 ((uint16_t)0x0024) /*!< ADC external trigger for injected conversion event 9 */ |
mbed_official | 155:8435094ec241 | 282 | #define ADC_ExternalTrigInjecConvEvent_10 ((uint16_t)0x0028) /*!< ADC external trigger for injected conversion event 10 */ |
mbed_official | 155:8435094ec241 | 283 | #define ADC_ExternalTrigInjecConvEvent_11 ((uint16_t)0x002C) /*!< ADC external trigger for injected conversion event 11 */ |
mbed_official | 155:8435094ec241 | 284 | #define ADC_ExternalTrigInjecConvEvent_12 ((uint16_t)0x0030) /*!< ADC external trigger for injected conversion event 12 */ |
mbed_official | 155:8435094ec241 | 285 | #define ADC_ExternalTrigInjecConvEvent_13 ((uint16_t)0x0034) /*!< ADC external trigger for injected conversion event 13 */ |
mbed_official | 155:8435094ec241 | 286 | #define ADC_ExternalTrigInjecConvEvent_14 ((uint16_t)0x0038) /*!< ADC external trigger for injected conversion event 14 */ |
mbed_official | 155:8435094ec241 | 287 | #define ADC_ExternalTrigInjecConvEvent_15 ((uint16_t)0x003C) /*!< ADC external trigger for injected conversion event 15 */ |
mbed_official | 155:8435094ec241 | 288 | |
mbed_official | 155:8435094ec241 | 289 | #define IS_ADC_EXT_INJEC_TRIG(INJTRIG) (((INJTRIG) == ADC_ExternalTrigInjecConvEvent_0) || \ |
mbed_official | 155:8435094ec241 | 290 | ((INJTRIG) == ADC_ExternalTrigInjecConvEvent_1) || \ |
mbed_official | 155:8435094ec241 | 291 | ((INJTRIG) == ADC_ExternalTrigInjecConvEvent_2) || \ |
mbed_official | 155:8435094ec241 | 292 | ((INJTRIG) == ADC_ExternalTrigInjecConvEvent_3) || \ |
mbed_official | 155:8435094ec241 | 293 | ((INJTRIG) == ADC_ExternalTrigInjecConvEvent_4) || \ |
mbed_official | 155:8435094ec241 | 294 | ((INJTRIG) == ADC_ExternalTrigInjecConvEvent_5) || \ |
mbed_official | 155:8435094ec241 | 295 | ((INJTRIG) == ADC_ExternalTrigInjecConvEvent_6) || \ |
mbed_official | 155:8435094ec241 | 296 | ((INJTRIG) == ADC_ExternalTrigInjecConvEvent_7) || \ |
mbed_official | 155:8435094ec241 | 297 | ((INJTRIG) == ADC_ExternalTrigInjecConvEvent_8) || \ |
mbed_official | 155:8435094ec241 | 298 | ((INJTRIG) == ADC_ExternalTrigInjecConvEvent_9) || \ |
mbed_official | 155:8435094ec241 | 299 | ((INJTRIG) == ADC_ExternalTrigInjecConvEvent_10) || \ |
mbed_official | 155:8435094ec241 | 300 | ((INJTRIG) == ADC_ExternalTrigInjecConvEvent_11) || \ |
mbed_official | 155:8435094ec241 | 301 | ((INJTRIG) == ADC_ExternalTrigInjecConvEvent_12) || \ |
mbed_official | 155:8435094ec241 | 302 | ((INJTRIG) == ADC_ExternalTrigInjecConvEvent_13) || \ |
mbed_official | 155:8435094ec241 | 303 | ((INJTRIG) == ADC_ExternalTrigInjecConvEvent_14) || \ |
mbed_official | 155:8435094ec241 | 304 | ((INJTRIG) == ADC_ExternalTrigInjecConvEvent_15)) |
mbed_official | 155:8435094ec241 | 305 | /** |
mbed_official | 155:8435094ec241 | 306 | * @} |
mbed_official | 155:8435094ec241 | 307 | */ |
mbed_official | 155:8435094ec241 | 308 | /** @defgroup ADC_data_align |
mbed_official | 155:8435094ec241 | 309 | * @{ |
mbed_official | 155:8435094ec241 | 310 | */ |
mbed_official | 155:8435094ec241 | 311 | |
mbed_official | 155:8435094ec241 | 312 | #define ADC_DataAlign_Right ((uint32_t)0x00000000) /*!< ADC Data alignment right */ |
mbed_official | 155:8435094ec241 | 313 | #define ADC_DataAlign_Left ((uint32_t)0x00000020) /*!< ADC Data alignment left */ |
mbed_official | 155:8435094ec241 | 314 | #define IS_ADC_DATA_ALIGN(ALIGN) (((ALIGN) == ADC_DataAlign_Right) || \ |
mbed_official | 155:8435094ec241 | 315 | ((ALIGN) == ADC_DataAlign_Left)) |
mbed_official | 155:8435094ec241 | 316 | /** |
mbed_official | 155:8435094ec241 | 317 | * @} |
mbed_official | 155:8435094ec241 | 318 | */ |
mbed_official | 155:8435094ec241 | 319 | |
mbed_official | 155:8435094ec241 | 320 | /** @defgroup ADC_channels |
mbed_official | 155:8435094ec241 | 321 | * @{ |
mbed_official | 155:8435094ec241 | 322 | */ |
mbed_official | 155:8435094ec241 | 323 | |
mbed_official | 155:8435094ec241 | 324 | #define ADC_Channel_1 ((uint8_t)0x01) /*!< ADC Channel 1 */ |
mbed_official | 155:8435094ec241 | 325 | #define ADC_Channel_2 ((uint8_t)0x02) /*!< ADC Channel 2 */ |
mbed_official | 155:8435094ec241 | 326 | #define ADC_Channel_3 ((uint8_t)0x03) /*!< ADC Channel 3 */ |
mbed_official | 155:8435094ec241 | 327 | #define ADC_Channel_4 ((uint8_t)0x04) /*!< ADC Channel 4 */ |
mbed_official | 155:8435094ec241 | 328 | #define ADC_Channel_5 ((uint8_t)0x05) /*!< ADC Channel 5 */ |
mbed_official | 155:8435094ec241 | 329 | #define ADC_Channel_6 ((uint8_t)0x06) /*!< ADC Channel 6 */ |
mbed_official | 155:8435094ec241 | 330 | #define ADC_Channel_7 ((uint8_t)0x07) /*!< ADC Channel 7 */ |
mbed_official | 155:8435094ec241 | 331 | #define ADC_Channel_8 ((uint8_t)0x08) /*!< ADC Channel 8 */ |
mbed_official | 155:8435094ec241 | 332 | #define ADC_Channel_9 ((uint8_t)0x09) /*!< ADC Channel 9 */ |
mbed_official | 155:8435094ec241 | 333 | #define ADC_Channel_10 ((uint8_t)0x0A) /*!< ADC Channel 10 */ |
mbed_official | 155:8435094ec241 | 334 | #define ADC_Channel_11 ((uint8_t)0x0B) /*!< ADC Channel 11 */ |
mbed_official | 155:8435094ec241 | 335 | #define ADC_Channel_12 ((uint8_t)0x0C) /*!< ADC Channel 12 */ |
mbed_official | 155:8435094ec241 | 336 | #define ADC_Channel_13 ((uint8_t)0x0D) /*!< ADC Channel 13 */ |
mbed_official | 155:8435094ec241 | 337 | #define ADC_Channel_14 ((uint8_t)0x0E) /*!< ADC Channel 14 */ |
mbed_official | 155:8435094ec241 | 338 | #define ADC_Channel_15 ((uint8_t)0x0F) /*!< ADC Channel 15 */ |
mbed_official | 155:8435094ec241 | 339 | #define ADC_Channel_16 ((uint8_t)0x10) /*!< ADC Channel 16 */ |
mbed_official | 155:8435094ec241 | 340 | #define ADC_Channel_17 ((uint8_t)0x11) /*!< ADC Channel 17 */ |
mbed_official | 155:8435094ec241 | 341 | #define ADC_Channel_18 ((uint8_t)0x12) /*!< ADC Channel 18 */ |
mbed_official | 155:8435094ec241 | 342 | |
mbed_official | 155:8435094ec241 | 343 | #define ADC_Channel_TempSensor ((uint8_t)ADC_Channel_16) |
mbed_official | 155:8435094ec241 | 344 | #define ADC_Channel_Vrefint ((uint8_t)ADC_Channel_18) |
mbed_official | 155:8435094ec241 | 345 | #define ADC_Channel_Vbat ((uint8_t)ADC_Channel_17) |
mbed_official | 155:8435094ec241 | 346 | |
mbed_official | 155:8435094ec241 | 347 | #define IS_ADC_CHANNEL(CHANNEL) (((CHANNEL) == ADC_Channel_1) || \ |
mbed_official | 155:8435094ec241 | 348 | ((CHANNEL) == ADC_Channel_2) || \ |
mbed_official | 155:8435094ec241 | 349 | ((CHANNEL) == ADC_Channel_3) || \ |
mbed_official | 155:8435094ec241 | 350 | ((CHANNEL) == ADC_Channel_4) || \ |
mbed_official | 155:8435094ec241 | 351 | ((CHANNEL) == ADC_Channel_5) || \ |
mbed_official | 155:8435094ec241 | 352 | ((CHANNEL) == ADC_Channel_6) || \ |
mbed_official | 155:8435094ec241 | 353 | ((CHANNEL) == ADC_Channel_7) || \ |
mbed_official | 155:8435094ec241 | 354 | ((CHANNEL) == ADC_Channel_8) || \ |
mbed_official | 155:8435094ec241 | 355 | ((CHANNEL) == ADC_Channel_9) || \ |
mbed_official | 155:8435094ec241 | 356 | ((CHANNEL) == ADC_Channel_10) || \ |
mbed_official | 155:8435094ec241 | 357 | ((CHANNEL) == ADC_Channel_11) || \ |
mbed_official | 155:8435094ec241 | 358 | ((CHANNEL) == ADC_Channel_12) || \ |
mbed_official | 155:8435094ec241 | 359 | ((CHANNEL) == ADC_Channel_13) || \ |
mbed_official | 155:8435094ec241 | 360 | ((CHANNEL) == ADC_Channel_14) || \ |
mbed_official | 155:8435094ec241 | 361 | ((CHANNEL) == ADC_Channel_15) || \ |
mbed_official | 155:8435094ec241 | 362 | ((CHANNEL) == ADC_Channel_16) || \ |
mbed_official | 155:8435094ec241 | 363 | ((CHANNEL) == ADC_Channel_17) || \ |
mbed_official | 155:8435094ec241 | 364 | ((CHANNEL) == ADC_Channel_18)) |
mbed_official | 155:8435094ec241 | 365 | #define IS_ADC_DIFFCHANNEL(CHANNEL) (((CHANNEL) == ADC_Channel_1) || \ |
mbed_official | 155:8435094ec241 | 366 | ((CHANNEL) == ADC_Channel_2) || \ |
mbed_official | 155:8435094ec241 | 367 | ((CHANNEL) == ADC_Channel_3) || \ |
mbed_official | 155:8435094ec241 | 368 | ((CHANNEL) == ADC_Channel_4) || \ |
mbed_official | 155:8435094ec241 | 369 | ((CHANNEL) == ADC_Channel_5) || \ |
mbed_official | 155:8435094ec241 | 370 | ((CHANNEL) == ADC_Channel_6) || \ |
mbed_official | 155:8435094ec241 | 371 | ((CHANNEL) == ADC_Channel_7) || \ |
mbed_official | 155:8435094ec241 | 372 | ((CHANNEL) == ADC_Channel_8) || \ |
mbed_official | 155:8435094ec241 | 373 | ((CHANNEL) == ADC_Channel_9) || \ |
mbed_official | 155:8435094ec241 | 374 | ((CHANNEL) == ADC_Channel_10) || \ |
mbed_official | 155:8435094ec241 | 375 | ((CHANNEL) == ADC_Channel_11) || \ |
mbed_official | 155:8435094ec241 | 376 | ((CHANNEL) == ADC_Channel_12) || \ |
mbed_official | 155:8435094ec241 | 377 | ((CHANNEL) == ADC_Channel_13) || \ |
mbed_official | 155:8435094ec241 | 378 | ((CHANNEL) == ADC_Channel_14)) |
mbed_official | 155:8435094ec241 | 379 | /** |
mbed_official | 155:8435094ec241 | 380 | * @} |
mbed_official | 155:8435094ec241 | 381 | */ |
mbed_official | 155:8435094ec241 | 382 | |
mbed_official | 155:8435094ec241 | 383 | /** @defgroup ADC_mode |
mbed_official | 155:8435094ec241 | 384 | * @{ |
mbed_official | 155:8435094ec241 | 385 | */ |
mbed_official | 155:8435094ec241 | 386 | #define ADC_Mode_Independent ((uint32_t)0x00000000) /*!< ADC independent mode */ |
mbed_official | 155:8435094ec241 | 387 | #define ADC_Mode_CombRegSimulInjSimul ((uint32_t)0x00000001) /*!< ADC multi ADC mode: Combined Regular simultaneous injected simultaneous mode */ |
mbed_official | 155:8435094ec241 | 388 | #define ADC_Mode_CombRegSimulAltTrig ((uint32_t)0x00000002) /*!< ADC multi ADC mode: Combined Regular simultaneous Alternate trigger mode */ |
mbed_official | 155:8435094ec241 | 389 | #define ADC_Mode_InjSimul ((uint32_t)0x00000005) /*!< ADC multi ADC mode: Injected simultaneous mode */ |
mbed_official | 155:8435094ec241 | 390 | #define ADC_Mode_RegSimul ((uint32_t)0x00000006) /*!< ADC multi ADC mode: Regular simultaneous mode */ |
mbed_official | 155:8435094ec241 | 391 | #define ADC_Mode_Interleave ((uint32_t)0x00000007) /*!< ADC multi ADC mode: Interleave mode */ |
mbed_official | 155:8435094ec241 | 392 | #define ADC_Mode_AltTrig ((uint32_t)0x00000009) /*!< ADC multi ADC mode: Alternate Trigger mode */ |
mbed_official | 155:8435094ec241 | 393 | |
mbed_official | 155:8435094ec241 | 394 | #define IS_ADC_MODE(MODE) (((MODE) == ADC_Mode_Independent) || \ |
mbed_official | 155:8435094ec241 | 395 | ((MODE) == ADC_Mode_CombRegSimulInjSimul) || \ |
mbed_official | 155:8435094ec241 | 396 | ((MODE) == ADC_Mode_CombRegSimulAltTrig) || \ |
mbed_official | 155:8435094ec241 | 397 | ((MODE) == ADC_Mode_InjSimul) || \ |
mbed_official | 155:8435094ec241 | 398 | ((MODE) == ADC_Mode_RegSimul) || \ |
mbed_official | 155:8435094ec241 | 399 | ((MODE) == ADC_Mode_Interleave) || \ |
mbed_official | 155:8435094ec241 | 400 | ((MODE) == ADC_Mode_AltTrig)) |
mbed_official | 155:8435094ec241 | 401 | |
mbed_official | 155:8435094ec241 | 402 | /** |
mbed_official | 155:8435094ec241 | 403 | * @} |
mbed_official | 155:8435094ec241 | 404 | */ |
mbed_official | 155:8435094ec241 | 405 | |
mbed_official | 155:8435094ec241 | 406 | /** @defgroup ADC_Clock |
mbed_official | 155:8435094ec241 | 407 | * @{ |
mbed_official | 155:8435094ec241 | 408 | */ |
mbed_official | 155:8435094ec241 | 409 | #define ADC_Clock_AsynClkMode ((uint32_t)0x00000000) /*!< ADC Asynchronous clock mode */ |
mbed_official | 155:8435094ec241 | 410 | #define ADC_Clock_SynClkModeDiv1 ((uint32_t)0x00010000) /*!< Synchronous clock mode divided by 1 */ |
mbed_official | 155:8435094ec241 | 411 | #define ADC_Clock_SynClkModeDiv2 ((uint32_t)0x00020000) /*!< Synchronous clock mode divided by 2 */ |
mbed_official | 155:8435094ec241 | 412 | #define ADC_Clock_SynClkModeDiv4 ((uint32_t)0x00030000) /*!< Synchronous clock mode divided by 4 */ |
mbed_official | 155:8435094ec241 | 413 | #define IS_ADC_CLOCKMODE(CLOCK) (((CLOCK) == ADC_Clock_AsynClkMode) ||\ |
mbed_official | 155:8435094ec241 | 414 | ((CLOCK) == ADC_Clock_SynClkModeDiv1) ||\ |
mbed_official | 155:8435094ec241 | 415 | ((CLOCK) == ADC_Clock_SynClkModeDiv2)||\ |
mbed_official | 155:8435094ec241 | 416 | ((CLOCK) == ADC_Clock_SynClkModeDiv4)) |
mbed_official | 155:8435094ec241 | 417 | /** |
mbed_official | 155:8435094ec241 | 418 | * @} |
mbed_official | 155:8435094ec241 | 419 | */ |
mbed_official | 155:8435094ec241 | 420 | /** @defgroup ADC_Direct_memory_access_mode_for_multi_mode |
mbed_official | 155:8435094ec241 | 421 | * @{ |
mbed_official | 155:8435094ec241 | 422 | */ |
mbed_official | 155:8435094ec241 | 423 | #define ADC_DMAAccessMode_Disabled ((uint32_t)0x00000000) /*!< DMA mode disabled */ |
mbed_official | 155:8435094ec241 | 424 | #define ADC_DMAAccessMode_1 ((uint32_t)0x00008000) /*!< DMA mode enabled for 12 and 10-bit resolution (6 bit) */ |
mbed_official | 155:8435094ec241 | 425 | #define ADC_DMAAccessMode_2 ((uint32_t)0x0000C000) /*!< DMA mode enabled for 8 and 6-bit resolution (8bit) */ |
mbed_official | 155:8435094ec241 | 426 | #define IS_ADC_DMA_ACCESS_MODE(MODE) (((MODE) == ADC_DMAAccessMode_Disabled) || \ |
mbed_official | 155:8435094ec241 | 427 | ((MODE) == ADC_DMAAccessMode_1) || \ |
mbed_official | 155:8435094ec241 | 428 | ((MODE) == ADC_DMAAccessMode_2)) |
mbed_official | 155:8435094ec241 | 429 | |
mbed_official | 155:8435094ec241 | 430 | /** |
mbed_official | 155:8435094ec241 | 431 | * @} |
mbed_official | 155:8435094ec241 | 432 | */ |
mbed_official | 155:8435094ec241 | 433 | /** @defgroup ADC_sampling_time |
mbed_official | 155:8435094ec241 | 434 | * @{ |
mbed_official | 155:8435094ec241 | 435 | */ |
mbed_official | 155:8435094ec241 | 436 | |
mbed_official | 155:8435094ec241 | 437 | #define ADC_SampleTime_1Cycles5 ((uint8_t)0x00) /*!< ADC sampling time 1.5 cycle */ |
mbed_official | 155:8435094ec241 | 438 | #define ADC_SampleTime_2Cycles5 ((uint8_t)0x01) /*!< ADC sampling time 2.5 cycles */ |
mbed_official | 155:8435094ec241 | 439 | #define ADC_SampleTime_4Cycles5 ((uint8_t)0x02) /*!< ADC sampling time 4.5 cycles */ |
mbed_official | 155:8435094ec241 | 440 | #define ADC_SampleTime_7Cycles5 ((uint8_t)0x03) /*!< ADC sampling time 7.5 cycles */ |
mbed_official | 155:8435094ec241 | 441 | #define ADC_SampleTime_19Cycles5 ((uint8_t)0x04) /*!< ADC sampling time 19.5 cycles */ |
mbed_official | 155:8435094ec241 | 442 | #define ADC_SampleTime_61Cycles5 ((uint8_t)0x05) /*!< ADC sampling time 61.5 cycles */ |
mbed_official | 155:8435094ec241 | 443 | #define ADC_SampleTime_181Cycles5 ((uint8_t)0x06) /*!< ADC sampling time 181.5 cycles */ |
mbed_official | 155:8435094ec241 | 444 | #define ADC_SampleTime_601Cycles5 ((uint8_t)0x07) /*!< ADC sampling time 601.5 cycles */ |
mbed_official | 155:8435094ec241 | 445 | #define IS_ADC_SAMPLE_TIME(TIME) (((TIME) == ADC_SampleTime_1Cycles5) || \ |
mbed_official | 155:8435094ec241 | 446 | ((TIME) == ADC_SampleTime_2Cycles5) || \ |
mbed_official | 155:8435094ec241 | 447 | ((TIME) == ADC_SampleTime_4Cycles5) || \ |
mbed_official | 155:8435094ec241 | 448 | ((TIME) == ADC_SampleTime_7Cycles5) || \ |
mbed_official | 155:8435094ec241 | 449 | ((TIME) == ADC_SampleTime_19Cycles5) || \ |
mbed_official | 155:8435094ec241 | 450 | ((TIME) == ADC_SampleTime_61Cycles5) || \ |
mbed_official | 155:8435094ec241 | 451 | ((TIME) == ADC_SampleTime_181Cycles5) || \ |
mbed_official | 155:8435094ec241 | 452 | ((TIME) == ADC_SampleTime_601Cycles5)) |
mbed_official | 155:8435094ec241 | 453 | /** |
mbed_official | 155:8435094ec241 | 454 | * @} |
mbed_official | 155:8435094ec241 | 455 | */ |
mbed_official | 155:8435094ec241 | 456 | |
mbed_official | 155:8435094ec241 | 457 | /** @defgroup ADC_injected_Channel_selection |
mbed_official | 155:8435094ec241 | 458 | * @{ |
mbed_official | 155:8435094ec241 | 459 | */ |
mbed_official | 155:8435094ec241 | 460 | |
mbed_official | 155:8435094ec241 | 461 | #define ADC_InjectedChannel_1 ADC_Channel_1 /*!< ADC Injected channel 1 */ |
mbed_official | 155:8435094ec241 | 462 | #define ADC_InjectedChannel_2 ADC_Channel_2 /*!< ADC Injected channel 2 */ |
mbed_official | 155:8435094ec241 | 463 | #define ADC_InjectedChannel_3 ADC_Channel_3 /*!< ADC Injected channel 3 */ |
mbed_official | 155:8435094ec241 | 464 | #define ADC_InjectedChannel_4 ADC_Channel_4 /*!< ADC Injected channel 4 */ |
mbed_official | 155:8435094ec241 | 465 | #define ADC_InjectedChannel_5 ADC_Channel_5 /*!< ADC Injected channel 5 */ |
mbed_official | 155:8435094ec241 | 466 | #define ADC_InjectedChannel_6 ADC_Channel_6 /*!< ADC Injected channel 6 */ |
mbed_official | 155:8435094ec241 | 467 | #define ADC_InjectedChannel_7 ADC_Channel_7 /*!< ADC Injected channel 7 */ |
mbed_official | 155:8435094ec241 | 468 | #define ADC_InjectedChannel_8 ADC_Channel_8 /*!< ADC Injected channel 8 */ |
mbed_official | 155:8435094ec241 | 469 | #define ADC_InjectedChannel_9 ADC_Channel_9 /*!< ADC Injected channel 9 */ |
mbed_official | 155:8435094ec241 | 470 | #define ADC_InjectedChannel_10 ADC_Channel_10 /*!< ADC Injected channel 10 */ |
mbed_official | 155:8435094ec241 | 471 | #define ADC_InjectedChannel_11 ADC_Channel_11 /*!< ADC Injected channel 11 */ |
mbed_official | 155:8435094ec241 | 472 | #define ADC_InjectedChannel_12 ADC_Channel_12 /*!< ADC Injected channel 12 */ |
mbed_official | 155:8435094ec241 | 473 | #define ADC_InjectedChannel_13 ADC_Channel_13 /*!< ADC Injected channel 13 */ |
mbed_official | 155:8435094ec241 | 474 | #define ADC_InjectedChannel_14 ADC_Channel_14 /*!< ADC Injected channel 14 */ |
mbed_official | 155:8435094ec241 | 475 | #define ADC_InjectedChannel_15 ADC_Channel_15 /*!< ADC Injected channel 15 */ |
mbed_official | 155:8435094ec241 | 476 | #define ADC_InjectedChannel_16 ADC_Channel_16 /*!< ADC Injected channel 16 */ |
mbed_official | 155:8435094ec241 | 477 | #define ADC_InjectedChannel_17 ADC_Channel_17 /*!< ADC Injected channel 17 */ |
mbed_official | 155:8435094ec241 | 478 | #define ADC_InjectedChannel_18 ADC_Channel_18 /*!< ADC Injected channel 18 */ |
mbed_official | 155:8435094ec241 | 479 | |
mbed_official | 155:8435094ec241 | 480 | #define IS_ADC_INJECTED_CHANNEL(CHANNEL) (((CHANNEL) == ADC_InjectedChannel_1) || \ |
mbed_official | 155:8435094ec241 | 481 | ((CHANNEL) == ADC_InjectedChannel_2) || \ |
mbed_official | 155:8435094ec241 | 482 | ((CHANNEL) == ADC_InjectedChannel_3) || \ |
mbed_official | 155:8435094ec241 | 483 | ((CHANNEL) == ADC_InjectedChannel_4) ||\ |
mbed_official | 155:8435094ec241 | 484 | ((CHANNEL) == ADC_InjectedChannel_5) ||\ |
mbed_official | 155:8435094ec241 | 485 | ((CHANNEL) == ADC_InjectedChannel_6) ||\ |
mbed_official | 155:8435094ec241 | 486 | ((CHANNEL) == ADC_InjectedChannel_7) ||\ |
mbed_official | 155:8435094ec241 | 487 | ((CHANNEL) == ADC_InjectedChannel_8) ||\ |
mbed_official | 155:8435094ec241 | 488 | ((CHANNEL) == ADC_InjectedChannel_9) ||\ |
mbed_official | 155:8435094ec241 | 489 | ((CHANNEL) == ADC_InjectedChannel_10) ||\ |
mbed_official | 155:8435094ec241 | 490 | ((CHANNEL) == ADC_InjectedChannel_11) ||\ |
mbed_official | 155:8435094ec241 | 491 | ((CHANNEL) == ADC_InjectedChannel_12) ||\ |
mbed_official | 155:8435094ec241 | 492 | ((CHANNEL) == ADC_InjectedChannel_13) ||\ |
mbed_official | 155:8435094ec241 | 493 | ((CHANNEL) == ADC_InjectedChannel_14) ||\ |
mbed_official | 155:8435094ec241 | 494 | ((CHANNEL) == ADC_InjectedChannel_15) ||\ |
mbed_official | 155:8435094ec241 | 495 | ((CHANNEL) == ADC_InjectedChannel_16) ||\ |
mbed_official | 155:8435094ec241 | 496 | ((CHANNEL) == ADC_InjectedChannel_17) ||\ |
mbed_official | 155:8435094ec241 | 497 | ((CHANNEL) == ADC_InjectedChannel_18)) |
mbed_official | 155:8435094ec241 | 498 | /** |
mbed_official | 155:8435094ec241 | 499 | * @} |
mbed_official | 155:8435094ec241 | 500 | */ |
mbed_official | 155:8435094ec241 | 501 | |
mbed_official | 155:8435094ec241 | 502 | /** @defgroup ADC_injected_Sequence_selection |
mbed_official | 155:8435094ec241 | 503 | * @{ |
mbed_official | 155:8435094ec241 | 504 | */ |
mbed_official | 155:8435094ec241 | 505 | |
mbed_official | 155:8435094ec241 | 506 | #define ADC_InjectedSequence_1 ADC_Channel_1 /*!< ADC Injected sequence 1 */ |
mbed_official | 155:8435094ec241 | 507 | #define ADC_InjectedSequence_2 ADC_Channel_2 /*!< ADC Injected sequence 2 */ |
mbed_official | 155:8435094ec241 | 508 | #define ADC_InjectedSequence_3 ADC_Channel_3 /*!< ADC Injected sequence 3 */ |
mbed_official | 155:8435094ec241 | 509 | #define ADC_InjectedSequence_4 ADC_Channel_4 /*!< ADC Injected sequence 4 */ |
mbed_official | 155:8435094ec241 | 510 | #define IS_ADC_INJECTED_SEQUENCE(SEQUENCE) (((SEQUENCE) == ADC_InjectedSequence_1) || \ |
mbed_official | 155:8435094ec241 | 511 | ((SEQUENCE) == ADC_InjectedSequence_2) || \ |
mbed_official | 155:8435094ec241 | 512 | ((SEQUENCE) == ADC_InjectedSequence_3) || \ |
mbed_official | 155:8435094ec241 | 513 | ((SEQUENCE) == ADC_InjectedSequence_4)) |
mbed_official | 155:8435094ec241 | 514 | /** |
mbed_official | 155:8435094ec241 | 515 | * @} |
mbed_official | 155:8435094ec241 | 516 | */ |
mbed_official | 155:8435094ec241 | 517 | |
mbed_official | 155:8435094ec241 | 518 | /** @defgroup ADC_analog_watchdog_selection |
mbed_official | 155:8435094ec241 | 519 | * @{ |
mbed_official | 155:8435094ec241 | 520 | */ |
mbed_official | 155:8435094ec241 | 521 | |
mbed_official | 155:8435094ec241 | 522 | #define ADC_AnalogWatchdog_SingleRegEnable ((uint32_t)0x00C00000) /*!< ADC Analog watchdog single regular mode */ |
mbed_official | 155:8435094ec241 | 523 | #define ADC_AnalogWatchdog_SingleInjecEnable ((uint32_t)0x01400000) /*!< ADC Analog watchdog single injected mode */ |
mbed_official | 155:8435094ec241 | 524 | #define ADC_AnalogWatchdog_SingleRegOrInjecEnable ((uint32_t)0x01C00000) /*!< ADC Analog watchdog single regular or injected mode */ |
mbed_official | 155:8435094ec241 | 525 | #define ADC_AnalogWatchdog_AllRegEnable ((uint32_t)0x00800000) /*!< ADC Analog watchdog all regular mode */ |
mbed_official | 155:8435094ec241 | 526 | #define ADC_AnalogWatchdog_AllInjecEnable ((uint32_t)0x01000000) /*!< ADC Analog watchdog all injected mode */ |
mbed_official | 155:8435094ec241 | 527 | #define ADC_AnalogWatchdog_AllRegAllInjecEnable ((uint32_t)0x01800000) /*!< ADC Analog watchdog all regular and all injected mode */ |
mbed_official | 155:8435094ec241 | 528 | #define ADC_AnalogWatchdog_None ((uint32_t)0x00000000) /*!< ADC Analog watchdog off */ |
mbed_official | 155:8435094ec241 | 529 | |
mbed_official | 155:8435094ec241 | 530 | #define IS_ADC_ANALOG_WATCHDOG(WATCHDOG) (((WATCHDOG) == ADC_AnalogWatchdog_SingleRegEnable) || \ |
mbed_official | 155:8435094ec241 | 531 | ((WATCHDOG) == ADC_AnalogWatchdog_SingleInjecEnable) || \ |
mbed_official | 155:8435094ec241 | 532 | ((WATCHDOG) == ADC_AnalogWatchdog_SingleRegOrInjecEnable) || \ |
mbed_official | 155:8435094ec241 | 533 | ((WATCHDOG) == ADC_AnalogWatchdog_AllRegEnable) || \ |
mbed_official | 155:8435094ec241 | 534 | ((WATCHDOG) == ADC_AnalogWatchdog_AllInjecEnable) || \ |
mbed_official | 155:8435094ec241 | 535 | ((WATCHDOG) == ADC_AnalogWatchdog_AllRegAllInjecEnable) || \ |
mbed_official | 155:8435094ec241 | 536 | ((WATCHDOG) == ADC_AnalogWatchdog_None)) |
mbed_official | 155:8435094ec241 | 537 | /** |
mbed_official | 155:8435094ec241 | 538 | * @} |
mbed_official | 155:8435094ec241 | 539 | */ |
mbed_official | 155:8435094ec241 | 540 | |
mbed_official | 155:8435094ec241 | 541 | /** @defgroup ADC_Calibration_Mode_definition |
mbed_official | 155:8435094ec241 | 542 | * @{ |
mbed_official | 155:8435094ec241 | 543 | */ |
mbed_official | 155:8435094ec241 | 544 | #define ADC_CalibrationMode_Single ((uint32_t)0x00000000) /*!< ADC Calibration for single ended channel */ |
mbed_official | 155:8435094ec241 | 545 | #define ADC_CalibrationMode_Differential ((uint32_t)0x40000000) /*!< ADC Calibration for differential channel */ |
mbed_official | 155:8435094ec241 | 546 | |
mbed_official | 155:8435094ec241 | 547 | #define IS_ADC_CALIBRATION_MODE(MODE) (((MODE) == ADC_CalibrationMode_Single) ||((MODE) == ADC_CalibrationMode_Differential)) |
mbed_official | 155:8435094ec241 | 548 | |
mbed_official | 155:8435094ec241 | 549 | /** |
mbed_official | 155:8435094ec241 | 550 | * @} |
mbed_official | 155:8435094ec241 | 551 | */ |
mbed_official | 155:8435094ec241 | 552 | |
mbed_official | 155:8435094ec241 | 553 | /** @defgroup ADC_DMA_Mode_definition |
mbed_official | 155:8435094ec241 | 554 | * @{ |
mbed_official | 155:8435094ec241 | 555 | */ |
mbed_official | 155:8435094ec241 | 556 | #define ADC_DMAMode_OneShot ((uint32_t)0x00000000) /*!< ADC DMA Oneshot mode */ |
mbed_official | 155:8435094ec241 | 557 | #define ADC_DMAMode_Circular ((uint32_t)0x00000002) /*!< ADC DMA circular mode */ |
mbed_official | 155:8435094ec241 | 558 | |
mbed_official | 155:8435094ec241 | 559 | #define IS_ADC_DMA_MODE(MODE) (((MODE) == ADC_DMAMode_OneShot) || ((MODE) == ADC_DMAMode_Circular)) |
mbed_official | 155:8435094ec241 | 560 | /** |
mbed_official | 155:8435094ec241 | 561 | * @} |
mbed_official | 155:8435094ec241 | 562 | */ |
mbed_official | 155:8435094ec241 | 563 | |
mbed_official | 155:8435094ec241 | 564 | /** @defgroup ADC_interrupts_definition |
mbed_official | 155:8435094ec241 | 565 | * @{ |
mbed_official | 155:8435094ec241 | 566 | */ |
mbed_official | 155:8435094ec241 | 567 | |
mbed_official | 155:8435094ec241 | 568 | #define ADC_IT_RDY ((uint16_t)0x0001) /*!< ADC Ready (ADRDY) interrupt source */ |
mbed_official | 155:8435094ec241 | 569 | #define ADC_IT_EOSMP ((uint16_t)0x0002) /*!< ADC End of Sampling interrupt source */ |
mbed_official | 155:8435094ec241 | 570 | #define ADC_IT_EOC ((uint16_t)0x0004) /*!< ADC End of Regular Conversion interrupt source */ |
mbed_official | 155:8435094ec241 | 571 | #define ADC_IT_EOS ((uint16_t)0x0008) /*!< ADC End of Regular sequence of Conversions interrupt source */ |
mbed_official | 155:8435094ec241 | 572 | #define ADC_IT_OVR ((uint16_t)0x0010) /*!< ADC overrun interrupt source */ |
mbed_official | 155:8435094ec241 | 573 | #define ADC_IT_JEOC ((uint16_t)0x0020) /*!< ADC End of Injected Conversion interrupt source */ |
mbed_official | 155:8435094ec241 | 574 | #define ADC_IT_JEOS ((uint16_t)0x0040) /*!< ADC End of Injected sequence of Conversions interrupt source */ |
mbed_official | 155:8435094ec241 | 575 | #define ADC_IT_AWD1 ((uint16_t)0x0080) /*!< ADC Analog watchdog 1 interrupt source */ |
mbed_official | 155:8435094ec241 | 576 | #define ADC_IT_AWD2 ((uint16_t)0x0100) /*!< ADC Analog watchdog 2 interrupt source */ |
mbed_official | 155:8435094ec241 | 577 | #define ADC_IT_AWD3 ((uint16_t)0x0200) /*!< ADC Analog watchdog 3 interrupt source */ |
mbed_official | 155:8435094ec241 | 578 | #define ADC_IT_JQOVF ((uint16_t)0x0400) /*!< ADC Injected Context Queue Overflow interrupt source */ |
mbed_official | 155:8435094ec241 | 579 | |
mbed_official | 155:8435094ec241 | 580 | |
mbed_official | 155:8435094ec241 | 581 | #define IS_ADC_IT(IT) ((((IT) & (uint16_t)0xF800) == 0x0000) && ((IT) != 0x0000)) |
mbed_official | 155:8435094ec241 | 582 | |
mbed_official | 155:8435094ec241 | 583 | #define IS_ADC_GET_IT(IT) (((IT) == ADC_IT_RDY) || ((IT) == ADC_IT_EOSMP) || \ |
mbed_official | 155:8435094ec241 | 584 | ((IT) == ADC_IT_EOC) || ((IT) == ADC_IT_EOS) || \ |
mbed_official | 155:8435094ec241 | 585 | ((IT) == ADC_IT_OVR) || ((IT) == ADC_IT_EOS) || \ |
mbed_official | 155:8435094ec241 | 586 | ((IT) == ADC_IT_JEOS) || ((IT) == ADC_IT_AWD1) || \ |
mbed_official | 155:8435094ec241 | 587 | ((IT) == ADC_IT_AWD2) || ((IT) == ADC_IT_AWD3) || \ |
mbed_official | 155:8435094ec241 | 588 | ((IT) == ADC_IT_JQOVF)) |
mbed_official | 155:8435094ec241 | 589 | /** |
mbed_official | 155:8435094ec241 | 590 | * @} |
mbed_official | 155:8435094ec241 | 591 | */ |
mbed_official | 155:8435094ec241 | 592 | |
mbed_official | 155:8435094ec241 | 593 | /** @defgroup ADC_flags_definition |
mbed_official | 155:8435094ec241 | 594 | * @{ |
mbed_official | 155:8435094ec241 | 595 | */ |
mbed_official | 155:8435094ec241 | 596 | |
mbed_official | 155:8435094ec241 | 597 | #define ADC_FLAG_RDY ((uint16_t)0x0001) /*!< ADC Ready (ADRDY) flag */ |
mbed_official | 155:8435094ec241 | 598 | #define ADC_FLAG_EOSMP ((uint16_t)0x0002) /*!< ADC End of Sampling flag */ |
mbed_official | 155:8435094ec241 | 599 | #define ADC_FLAG_EOC ((uint16_t)0x0004) /*!< ADC End of Regular Conversion flag */ |
mbed_official | 155:8435094ec241 | 600 | #define ADC_FLAG_EOS ((uint16_t)0x0008) /*!< ADC End of Regular sequence of Conversions flag */ |
mbed_official | 155:8435094ec241 | 601 | #define ADC_FLAG_OVR ((uint16_t)0x0010) /*!< ADC overrun flag */ |
mbed_official | 155:8435094ec241 | 602 | #define ADC_FLAG_JEOC ((uint16_t)0x0020) /*!< ADC End of Injected Conversion flag */ |
mbed_official | 155:8435094ec241 | 603 | #define ADC_FLAG_JEOS ((uint16_t)0x0040) /*!< ADC End of Injected sequence of Conversions flag */ |
mbed_official | 155:8435094ec241 | 604 | #define ADC_FLAG_AWD1 ((uint16_t)0x0080) /*!< ADC Analog watchdog 1 flag */ |
mbed_official | 155:8435094ec241 | 605 | #define ADC_FLAG_AWD2 ((uint16_t)0x0100) /*!< ADC Analog watchdog 2 flag */ |
mbed_official | 155:8435094ec241 | 606 | #define ADC_FLAG_AWD3 ((uint16_t)0x0200) /*!< ADC Analog watchdog 3 flag */ |
mbed_official | 155:8435094ec241 | 607 | #define ADC_FLAG_JQOVF ((uint16_t)0x0400) /*!< ADC Injected Context Queue Overflow flag */ |
mbed_official | 155:8435094ec241 | 608 | |
mbed_official | 155:8435094ec241 | 609 | #define IS_ADC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint16_t)0xF800) == 0x0000) && ((FLAG) != 0x0000)) |
mbed_official | 155:8435094ec241 | 610 | #define IS_ADC_GET_FLAG(FLAG) (((FLAG) == ADC_FLAG_RDY) || ((FLAG) == ADC_FLAG_EOSMP) || \ |
mbed_official | 155:8435094ec241 | 611 | ((FLAG) == ADC_FLAG_EOC) || ((FLAG) == ADC_FLAG_EOS) || \ |
mbed_official | 155:8435094ec241 | 612 | ((FLAG) == ADC_FLAG_OVR) || ((FLAG) == ADC_FLAG_JEOC) || \ |
mbed_official | 155:8435094ec241 | 613 | ((FLAG) == ADC_FLAG_JEOS) || ((FLAG) == ADC_FLAG_AWD1) || \ |
mbed_official | 155:8435094ec241 | 614 | ((FLAG) == ADC_FLAG_AWD2) || ((FLAG) == ADC_FLAG_AWD3) || \ |
mbed_official | 155:8435094ec241 | 615 | ((FLAG) == ADC_FLAG_JQOVF)) |
mbed_official | 155:8435094ec241 | 616 | /** |
mbed_official | 155:8435094ec241 | 617 | * @} |
mbed_official | 155:8435094ec241 | 618 | */ |
mbed_official | 155:8435094ec241 | 619 | |
mbed_official | 155:8435094ec241 | 620 | /** @defgroup ADC_Common_flags_definition |
mbed_official | 155:8435094ec241 | 621 | * @{ |
mbed_official | 155:8435094ec241 | 622 | */ |
mbed_official | 155:8435094ec241 | 623 | |
mbed_official | 155:8435094ec241 | 624 | #define ADC_FLAG_MSTRDY ((uint32_t)0x00000001) /*!< ADC Master Ready (ADRDY) flag */ |
mbed_official | 155:8435094ec241 | 625 | #define ADC_FLAG_MSTEOSMP ((uint32_t)0x00000002) /*!< ADC Master End of Sampling flag */ |
mbed_official | 155:8435094ec241 | 626 | #define ADC_FLAG_MSTEOC ((uint32_t)0x00000004) /*!< ADC Master End of Regular Conversion flag */ |
mbed_official | 155:8435094ec241 | 627 | #define ADC_FLAG_MSTEOS ((uint32_t)0x00000008) /*!< ADC Master End of Regular sequence of Conversions flag */ |
mbed_official | 155:8435094ec241 | 628 | #define ADC_FLAG_MSTOVR ((uint32_t)0x00000010) /*!< ADC Master overrun flag */ |
mbed_official | 155:8435094ec241 | 629 | #define ADC_FLAG_MSTJEOC ((uint32_t)0x00000020) /*!< ADC Master End of Injected Conversion flag */ |
mbed_official | 155:8435094ec241 | 630 | #define ADC_FLAG_MSTJEOS ((uint32_t)0x00000040) /*!< ADC Master End of Injected sequence of Conversions flag */ |
mbed_official | 155:8435094ec241 | 631 | #define ADC_FLAG_MSTAWD1 ((uint32_t)0x00000080) /*!< ADC Master Analog watchdog 1 flag */ |
mbed_official | 155:8435094ec241 | 632 | #define ADC_FLAG_MSTAWD2 ((uint32_t)0x00000100) /*!< ADC Master Analog watchdog 2 flag */ |
mbed_official | 155:8435094ec241 | 633 | #define ADC_FLAG_MSTAWD3 ((uint32_t)0x00000200) /*!< ADC Master Analog watchdog 3 flag */ |
mbed_official | 155:8435094ec241 | 634 | #define ADC_FLAG_MSTJQOVF ((uint32_t)0x00000400) /*!< ADC Master Injected Context Queue Overflow flag */ |
mbed_official | 155:8435094ec241 | 635 | |
mbed_official | 155:8435094ec241 | 636 | #define ADC_FLAG_SLVRDY ((uint32_t)0x00010000) /*!< ADC Slave Ready (ADRDY) flag */ |
mbed_official | 155:8435094ec241 | 637 | #define ADC_FLAG_SLVEOSMP ((uint32_t)0x00020000) /*!< ADC Slave End of Sampling flag */ |
mbed_official | 155:8435094ec241 | 638 | #define ADC_FLAG_SLVEOC ((uint32_t)0x00040000) /*!< ADC Slave End of Regular Conversion flag */ |
mbed_official | 155:8435094ec241 | 639 | #define ADC_FLAG_SLVEOS ((uint32_t)0x00080000) /*!< ADC Slave End of Regular sequence of Conversions flag */ |
mbed_official | 155:8435094ec241 | 640 | #define ADC_FLAG_SLVOVR ((uint32_t)0x00100000) /*!< ADC Slave overrun flag */ |
mbed_official | 155:8435094ec241 | 641 | #define ADC_FLAG_SLVJEOC ((uint32_t)0x00200000) /*!< ADC Slave End of Injected Conversion flag */ |
mbed_official | 155:8435094ec241 | 642 | #define ADC_FLAG_SLVJEOS ((uint32_t)0x00400000) /*!< ADC Slave End of Injected sequence of Conversions flag */ |
mbed_official | 155:8435094ec241 | 643 | #define ADC_FLAG_SLVAWD1 ((uint32_t)0x00800000) /*!< ADC Slave Analog watchdog 1 flag */ |
mbed_official | 155:8435094ec241 | 644 | #define ADC_FLAG_SLVAWD2 ((uint32_t)0x01000000) /*!< ADC Slave Analog watchdog 2 flag */ |
mbed_official | 155:8435094ec241 | 645 | #define ADC_FLAG_SLVAWD3 ((uint32_t)0x02000000) /*!< ADC Slave Analog watchdog 3 flag */ |
mbed_official | 155:8435094ec241 | 646 | #define ADC_FLAG_SLVJQOVF ((uint32_t)0x04000000) /*!< ADC Slave Injected Context Queue Overflow flag */ |
mbed_official | 155:8435094ec241 | 647 | |
mbed_official | 155:8435094ec241 | 648 | #define IS_ADC_CLEAR_COMMONFLAG(FLAG) ((((FLAG) & (uint32_t)0xF800F800) == 0x0000) && ((FLAG) != 0x00000000)) |
mbed_official | 155:8435094ec241 | 649 | #define IS_ADC_GET_COMMONFLAG(FLAG) (((FLAG) == ADC_FLAG_MSTRDY) || ((FLAG) == ADC_FLAG_MSTEOSMP) || \ |
mbed_official | 155:8435094ec241 | 650 | ((FLAG) == ADC_FLAG_MSTEOC) || ((FLAG) == ADC_FLAG_MSTEOS) || \ |
mbed_official | 155:8435094ec241 | 651 | ((FLAG) == ADC_FLAG_MSTOVR) || ((FLAG) == ADC_FLAG_MSTEOS) || \ |
mbed_official | 155:8435094ec241 | 652 | ((FLAG) == ADC_FLAG_MSTJEOS) || ((FLAG) == ADC_FLAG_MSTAWD1) || \ |
mbed_official | 155:8435094ec241 | 653 | ((FLAG) == ADC_FLAG_MSTAWD2) || ((FLAG) == ADC_FLAG_MSTAWD3) || \ |
mbed_official | 155:8435094ec241 | 654 | ((FLAG) == ADC_FLAG_MSTJQOVF) || \ |
mbed_official | 155:8435094ec241 | 655 | ((FLAG) == ADC_FLAG_SLVRDY) || ((FLAG) == ADC_FLAG_SLVEOSMP) || \ |
mbed_official | 155:8435094ec241 | 656 | ((FLAG) == ADC_FLAG_SLVEOC) || ((FLAG) == ADC_FLAG_SLVEOS) || \ |
mbed_official | 155:8435094ec241 | 657 | ((FLAG) == ADC_FLAG_SLVOVR) || ((FLAG) == ADC_FLAG_SLVEOS) || \ |
mbed_official | 155:8435094ec241 | 658 | ((FLAG) == ADC_FLAG_SLVJEOS) || ((FLAG) == ADC_FLAG_SLVAWD1) || \ |
mbed_official | 155:8435094ec241 | 659 | ((FLAG) == ADC_FLAG_SLVAWD2) || ((FLAG) == ADC_FLAG_SLVAWD3) || \ |
mbed_official | 155:8435094ec241 | 660 | ((FLAG) == ADC_FLAG_SLVJQOVF)) |
mbed_official | 155:8435094ec241 | 661 | /** |
mbed_official | 155:8435094ec241 | 662 | * @} |
mbed_official | 155:8435094ec241 | 663 | */ |
mbed_official | 155:8435094ec241 | 664 | |
mbed_official | 155:8435094ec241 | 665 | /** @defgroup ADC_thresholds |
mbed_official | 155:8435094ec241 | 666 | * @{ |
mbed_official | 155:8435094ec241 | 667 | */ |
mbed_official | 155:8435094ec241 | 668 | |
mbed_official | 155:8435094ec241 | 669 | #define IS_ADC_THRESHOLD(THRESHOLD) ((THRESHOLD) <= 0xFFF) |
mbed_official | 155:8435094ec241 | 670 | |
mbed_official | 155:8435094ec241 | 671 | /** |
mbed_official | 155:8435094ec241 | 672 | * @} |
mbed_official | 155:8435094ec241 | 673 | */ |
mbed_official | 155:8435094ec241 | 674 | |
mbed_official | 155:8435094ec241 | 675 | /** @defgroup ADC_injected_offset |
mbed_official | 155:8435094ec241 | 676 | * @{ |
mbed_official | 155:8435094ec241 | 677 | */ |
mbed_official | 155:8435094ec241 | 678 | |
mbed_official | 155:8435094ec241 | 679 | #define IS_ADC_OFFSET(OFFSET) ((OFFSET) <= 0xFFF) |
mbed_official | 155:8435094ec241 | 680 | |
mbed_official | 155:8435094ec241 | 681 | /** |
mbed_official | 155:8435094ec241 | 682 | * @} |
mbed_official | 155:8435094ec241 | 683 | */ |
mbed_official | 155:8435094ec241 | 684 | |
mbed_official | 155:8435094ec241 | 685 | /** @defgroup ADC_injected_length |
mbed_official | 155:8435094ec241 | 686 | * @{ |
mbed_official | 155:8435094ec241 | 687 | */ |
mbed_official | 155:8435094ec241 | 688 | |
mbed_official | 155:8435094ec241 | 689 | #define IS_ADC_INJECTED_LENGTH(LENGTH) (((LENGTH) >= 0x1) && ((LENGTH) <= 0x4)) |
mbed_official | 155:8435094ec241 | 690 | |
mbed_official | 155:8435094ec241 | 691 | /** |
mbed_official | 155:8435094ec241 | 692 | * @} |
mbed_official | 155:8435094ec241 | 693 | */ |
mbed_official | 155:8435094ec241 | 694 | |
mbed_official | 155:8435094ec241 | 695 | |
mbed_official | 155:8435094ec241 | 696 | /** @defgroup ADC_regular_length |
mbed_official | 155:8435094ec241 | 697 | * @{ |
mbed_official | 155:8435094ec241 | 698 | */ |
mbed_official | 155:8435094ec241 | 699 | |
mbed_official | 155:8435094ec241 | 700 | #define IS_ADC_REGULAR_LENGTH(LENGTH) (((LENGTH) >= 0x1) && ((LENGTH) <= 0x10)) |
mbed_official | 155:8435094ec241 | 701 | /** |
mbed_official | 155:8435094ec241 | 702 | * @} |
mbed_official | 155:8435094ec241 | 703 | */ |
mbed_official | 155:8435094ec241 | 704 | |
mbed_official | 155:8435094ec241 | 705 | /** @defgroup ADC_regular_discontinuous_mode_number |
mbed_official | 155:8435094ec241 | 706 | * @{ |
mbed_official | 155:8435094ec241 | 707 | */ |
mbed_official | 155:8435094ec241 | 708 | |
mbed_official | 155:8435094ec241 | 709 | #define IS_ADC_REGULAR_DISC_NUMBER(NUMBER) (((NUMBER) >= 0x1) && ((NUMBER) <= 0x8)) |
mbed_official | 155:8435094ec241 | 710 | |
mbed_official | 155:8435094ec241 | 711 | /** |
mbed_official | 155:8435094ec241 | 712 | * @} |
mbed_official | 155:8435094ec241 | 713 | */ |
mbed_official | 155:8435094ec241 | 714 | |
mbed_official | 155:8435094ec241 | 715 | /** @defgroup ADC_two_sampling_delay_number |
mbed_official | 155:8435094ec241 | 716 | * @{ |
mbed_official | 155:8435094ec241 | 717 | */ |
mbed_official | 155:8435094ec241 | 718 | #define IS_ADC_TWOSAMPLING_DELAY(DELAY) (((DELAY) <= 0xF)) |
mbed_official | 155:8435094ec241 | 719 | |
mbed_official | 155:8435094ec241 | 720 | /** |
mbed_official | 155:8435094ec241 | 721 | * @} |
mbed_official | 155:8435094ec241 | 722 | */ |
mbed_official | 155:8435094ec241 | 723 | /** |
mbed_official | 155:8435094ec241 | 724 | * @} |
mbed_official | 155:8435094ec241 | 725 | */ |
mbed_official | 155:8435094ec241 | 726 | |
mbed_official | 155:8435094ec241 | 727 | |
mbed_official | 155:8435094ec241 | 728 | /* Exported macro ------------------------------------------------------------*/ |
mbed_official | 155:8435094ec241 | 729 | /* Exported functions ------------------------------------------------------- */ |
mbed_official | 155:8435094ec241 | 730 | |
mbed_official | 155:8435094ec241 | 731 | /* Function used to set the ADC configuration to the default reset state *****/ |
mbed_official | 155:8435094ec241 | 732 | void ADC_DeInit(ADC_TypeDef* ADCx); |
mbed_official | 155:8435094ec241 | 733 | |
mbed_official | 155:8435094ec241 | 734 | /* Initialization and Configuration functions *********************************/ |
mbed_official | 155:8435094ec241 | 735 | void ADC_Init(ADC_TypeDef* ADCx, ADC_InitTypeDef* ADC_InitStruct); |
mbed_official | 155:8435094ec241 | 736 | void ADC_StructInit(ADC_InitTypeDef* ADC_InitStruct); |
mbed_official | 155:8435094ec241 | 737 | void ADC_InjectedInit(ADC_TypeDef* ADCx, ADC_InjectedInitTypeDef* ADC_InjectedInitStruct); |
mbed_official | 155:8435094ec241 | 738 | void ADC_InjectedStructInit(ADC_InjectedInitTypeDef* ADC_InjectedInitStruct); |
mbed_official | 155:8435094ec241 | 739 | void ADC_CommonInit(ADC_TypeDef* ADCx, ADC_CommonInitTypeDef* ADC_CommonInitStruct); |
mbed_official | 155:8435094ec241 | 740 | void ADC_CommonStructInit(ADC_CommonInitTypeDef* ADC_CommonInitStruct); |
mbed_official | 155:8435094ec241 | 741 | |
mbed_official | 155:8435094ec241 | 742 | void ADC_Cmd(ADC_TypeDef* ADCx, FunctionalState NewState); |
mbed_official | 155:8435094ec241 | 743 | void ADC_StartCalibration(ADC_TypeDef* ADCx); |
mbed_official | 155:8435094ec241 | 744 | uint32_t ADC_GetCalibrationValue(ADC_TypeDef* ADCx); |
mbed_official | 155:8435094ec241 | 745 | void ADC_SetCalibrationValue(ADC_TypeDef* ADCx, uint32_t ADC_Calibration); |
mbed_official | 155:8435094ec241 | 746 | void ADC_SelectCalibrationMode(ADC_TypeDef* ADCx, uint32_t ADC_CalibrationMode); |
mbed_official | 155:8435094ec241 | 747 | FlagStatus ADC_GetCalibrationStatus(ADC_TypeDef* ADCx); |
mbed_official | 155:8435094ec241 | 748 | void ADC_DisableCmd(ADC_TypeDef* ADCx); |
mbed_official | 155:8435094ec241 | 749 | FlagStatus ADC_GetDisableCmdStatus(ADC_TypeDef* ADCx); |
mbed_official | 155:8435094ec241 | 750 | void ADC_VoltageRegulatorCmd(ADC_TypeDef* ADCx, FunctionalState NewState); |
mbed_official | 155:8435094ec241 | 751 | void ADC_SelectDifferentialMode(ADC_TypeDef* ADCx, uint8_t ADC_Channel, FunctionalState NewState); |
mbed_official | 155:8435094ec241 | 752 | void ADC_SelectQueueOfContextMode(ADC_TypeDef* ADCx, FunctionalState NewState); |
mbed_official | 155:8435094ec241 | 753 | void ADC_AutoDelayCmd(ADC_TypeDef* ADCx, FunctionalState NewState); |
mbed_official | 155:8435094ec241 | 754 | |
mbed_official | 155:8435094ec241 | 755 | /* Analog Watchdog configuration functions ************************************/ |
mbed_official | 155:8435094ec241 | 756 | void ADC_AnalogWatchdogCmd(ADC_TypeDef* ADCx, uint32_t ADC_AnalogWatchdog); |
mbed_official | 155:8435094ec241 | 757 | void ADC_AnalogWatchdog1ThresholdsConfig(ADC_TypeDef* ADCx, uint16_t HighThreshold, uint16_t LowThreshold); |
mbed_official | 155:8435094ec241 | 758 | void ADC_AnalogWatchdog2ThresholdsConfig(ADC_TypeDef* ADCx, uint8_t HighThreshold, uint8_t LowThreshold); |
mbed_official | 155:8435094ec241 | 759 | void ADC_AnalogWatchdog3ThresholdsConfig(ADC_TypeDef* ADCx, uint8_t HighThreshold, uint8_t LowThreshold); |
mbed_official | 155:8435094ec241 | 760 | void ADC_AnalogWatchdog1SingleChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel); |
mbed_official | 155:8435094ec241 | 761 | void ADC_AnalogWatchdog2SingleChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel); |
mbed_official | 155:8435094ec241 | 762 | void ADC_AnalogWatchdog3SingleChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel); |
mbed_official | 155:8435094ec241 | 763 | |
mbed_official | 155:8435094ec241 | 764 | /* Temperature Sensor, Vrefint and Vbat management function */ |
mbed_official | 155:8435094ec241 | 765 | void ADC_TempSensorCmd(ADC_TypeDef* ADCx, FunctionalState NewState); |
mbed_official | 155:8435094ec241 | 766 | void ADC_VrefintCmd(ADC_TypeDef* ADCx, FunctionalState NewState); |
mbed_official | 155:8435094ec241 | 767 | void ADC_VbatCmd(ADC_TypeDef* ADCx, FunctionalState NewState); |
mbed_official | 155:8435094ec241 | 768 | |
mbed_official | 155:8435094ec241 | 769 | /* Channels Configuration functions ***********************************/ |
mbed_official | 155:8435094ec241 | 770 | void ADC_RegularChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel, uint8_t Rank, uint8_t ADC_SampleTime); |
mbed_official | 155:8435094ec241 | 771 | void ADC_RegularChannelSequencerLengthConfig(ADC_TypeDef* ADCx, uint8_t SequencerLength); |
mbed_official | 155:8435094ec241 | 772 | void ADC_ExternalTriggerConfig(ADC_TypeDef* ADCx, uint16_t ADC_ExternalTrigConvEvent, uint16_t ADC_ExternalTrigEventEdge); |
mbed_official | 155:8435094ec241 | 773 | |
mbed_official | 155:8435094ec241 | 774 | void ADC_StartConversion(ADC_TypeDef* ADCx); |
mbed_official | 155:8435094ec241 | 775 | FlagStatus ADC_GetStartConversionStatus(ADC_TypeDef* ADCx); |
mbed_official | 155:8435094ec241 | 776 | void ADC_StopConversion(ADC_TypeDef* ADCx); |
mbed_official | 155:8435094ec241 | 777 | void ADC_DiscModeChannelCountConfig(ADC_TypeDef* ADCx, uint8_t Number); |
mbed_official | 155:8435094ec241 | 778 | void ADC_DiscModeCmd(ADC_TypeDef* ADCx, FunctionalState NewState); |
mbed_official | 155:8435094ec241 | 779 | uint16_t ADC_GetConversionValue(ADC_TypeDef* ADCx); |
mbed_official | 155:8435094ec241 | 780 | uint32_t ADC_GetDualModeConversionValue(ADC_TypeDef* ADCx); |
mbed_official | 155:8435094ec241 | 781 | |
mbed_official | 155:8435094ec241 | 782 | void ADC_SetChannelOffset1(ADC_TypeDef* ADCx, uint8_t ADC_Channel, uint16_t Offset); |
mbed_official | 155:8435094ec241 | 783 | void ADC_SetChannelOffset2(ADC_TypeDef* ADCx, uint8_t ADC_Channel, uint16_t Offset); |
mbed_official | 155:8435094ec241 | 784 | void ADC_SetChannelOffset3(ADC_TypeDef* ADCx, uint8_t ADC_Channel, uint16_t Offset); |
mbed_official | 155:8435094ec241 | 785 | void ADC_SetChannelOffset4(ADC_TypeDef* ADCx, uint8_t ADC_Channel, uint16_t Offset); |
mbed_official | 155:8435094ec241 | 786 | |
mbed_official | 155:8435094ec241 | 787 | void ADC_ChannelOffset1Cmd(ADC_TypeDef* ADCx, FunctionalState NewState); |
mbed_official | 155:8435094ec241 | 788 | void ADC_ChannelOffset2Cmd(ADC_TypeDef* ADCx, FunctionalState NewState); |
mbed_official | 155:8435094ec241 | 789 | void ADC_ChannelOffset3Cmd(ADC_TypeDef* ADCx, FunctionalState NewState); |
mbed_official | 155:8435094ec241 | 790 | void ADC_ChannelOffset4Cmd(ADC_TypeDef* ADCx, FunctionalState NewState); |
mbed_official | 155:8435094ec241 | 791 | |
mbed_official | 155:8435094ec241 | 792 | /* Regular Channels DMA Configuration functions *******************************/ |
mbed_official | 155:8435094ec241 | 793 | void ADC_DMACmd(ADC_TypeDef* ADCx, FunctionalState NewState); |
mbed_official | 155:8435094ec241 | 794 | void ADC_DMAConfig(ADC_TypeDef* ADCx, uint32_t ADC_DMAMode); |
mbed_official | 155:8435094ec241 | 795 | |
mbed_official | 155:8435094ec241 | 796 | /* Injected channels Configuration functions **********************************/ |
mbed_official | 155:8435094ec241 | 797 | void ADC_InjectedChannelSampleTimeConfig(ADC_TypeDef* ADCx, uint8_t ADC_InjectedChannel, uint8_t ADC_SampleTime); |
mbed_official | 155:8435094ec241 | 798 | void ADC_StartInjectedConversion(ADC_TypeDef* ADCx); |
mbed_official | 155:8435094ec241 | 799 | FlagStatus ADC_GetStartInjectedConversionStatus(ADC_TypeDef* ADCx); |
mbed_official | 155:8435094ec241 | 800 | void ADC_StopInjectedConversion(ADC_TypeDef* ADCx); |
mbed_official | 155:8435094ec241 | 801 | void ADC_AutoInjectedConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState); |
mbed_official | 155:8435094ec241 | 802 | void ADC_InjectedDiscModeCmd(ADC_TypeDef* ADCx, FunctionalState NewState); |
mbed_official | 155:8435094ec241 | 803 | uint16_t ADC_GetInjectedConversionValue(ADC_TypeDef* ADCx, uint8_t ADC_InjectedChannel); |
mbed_official | 155:8435094ec241 | 804 | |
mbed_official | 155:8435094ec241 | 805 | /* ADC Dual Modes Configuration functions *************************************/ |
mbed_official | 155:8435094ec241 | 806 | FlagStatus ADC_GetCommonFlagStatus(ADC_TypeDef* ADCx, uint32_t ADC_FLAG); |
mbed_official | 155:8435094ec241 | 807 | void ADC_ClearCommonFlag(ADC_TypeDef* ADCx, uint32_t ADC_FLAG); |
mbed_official | 155:8435094ec241 | 808 | |
mbed_official | 155:8435094ec241 | 809 | /* Interrupts and flags management functions **********************************/ |
mbed_official | 155:8435094ec241 | 810 | void ADC_ITConfig(ADC_TypeDef* ADCx, uint32_t ADC_IT, FunctionalState NewState); |
mbed_official | 155:8435094ec241 | 811 | FlagStatus ADC_GetFlagStatus(ADC_TypeDef* ADCx, uint32_t ADC_FLAG); |
mbed_official | 155:8435094ec241 | 812 | void ADC_ClearFlag(ADC_TypeDef* ADCx, uint32_t ADC_FLAG); |
mbed_official | 155:8435094ec241 | 813 | ITStatus ADC_GetITStatus(ADC_TypeDef* ADCx, uint32_t ADC_IT); |
mbed_official | 155:8435094ec241 | 814 | void ADC_ClearITPendingBit(ADC_TypeDef* ADCx, uint32_t ADC_IT); |
mbed_official | 155:8435094ec241 | 815 | |
mbed_official | 155:8435094ec241 | 816 | #ifdef __cplusplus |
mbed_official | 155:8435094ec241 | 817 | } |
mbed_official | 155:8435094ec241 | 818 | #endif |
mbed_official | 155:8435094ec241 | 819 | |
mbed_official | 155:8435094ec241 | 820 | #endif /*__STM32F30x_ADC_H */ |
mbed_official | 155:8435094ec241 | 821 | |
mbed_official | 155:8435094ec241 | 822 | /** |
mbed_official | 155:8435094ec241 | 823 | * @} |
mbed_official | 155:8435094ec241 | 824 | */ |
mbed_official | 155:8435094ec241 | 825 | |
mbed_official | 155:8435094ec241 | 826 | /** |
mbed_official | 155:8435094ec241 | 827 | * @} |
mbed_official | 155:8435094ec241 | 828 | */ |
mbed_official | 155:8435094ec241 | 829 | |
mbed_official | 155:8435094ec241 | 830 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |