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