Einstein Filho
/
MANGUEBAJA2019_BOX
Mangue Baja Box
mbed/TARGET_NUCLEO_F103RB/stm32f10x_adc.h@0:0dee8840a1c0, 2019-07-29 (annotated)
- Committer:
- einsteingustavo
- Date:
- Mon Jul 29 20:38:00 2019 +0000
- Revision:
- 0:0dee8840a1c0
Mangue Baja Box
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
einsteingustavo | 0:0dee8840a1c0 | 1 | /** |
einsteingustavo | 0:0dee8840a1c0 | 2 | ****************************************************************************** |
einsteingustavo | 0:0dee8840a1c0 | 3 | * @file stm32f10x_adc.h |
einsteingustavo | 0:0dee8840a1c0 | 4 | * @author MCD Application Team |
einsteingustavo | 0:0dee8840a1c0 | 5 | * @version V3.6.1 |
einsteingustavo | 0:0dee8840a1c0 | 6 | * @date 05-March-2012 |
einsteingustavo | 0:0dee8840a1c0 | 7 | * @brief This file contains all the functions prototypes for the ADC firmware |
einsteingustavo | 0:0dee8840a1c0 | 8 | * library. |
einsteingustavo | 0:0dee8840a1c0 | 9 | ******************************************************************************* |
einsteingustavo | 0:0dee8840a1c0 | 10 | * Copyright (c) 2014, STMicroelectronics |
einsteingustavo | 0:0dee8840a1c0 | 11 | * All rights reserved. |
einsteingustavo | 0:0dee8840a1c0 | 12 | * |
einsteingustavo | 0:0dee8840a1c0 | 13 | * Redistribution and use in source and binary forms, with or without |
einsteingustavo | 0:0dee8840a1c0 | 14 | * modification, are permitted provided that the following conditions are met: |
einsteingustavo | 0:0dee8840a1c0 | 15 | * |
einsteingustavo | 0:0dee8840a1c0 | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
einsteingustavo | 0:0dee8840a1c0 | 17 | * this list of conditions and the following disclaimer. |
einsteingustavo | 0:0dee8840a1c0 | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
einsteingustavo | 0:0dee8840a1c0 | 19 | * this list of conditions and the following disclaimer in the documentation |
einsteingustavo | 0:0dee8840a1c0 | 20 | * and/or other materials provided with the distribution. |
einsteingustavo | 0:0dee8840a1c0 | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
einsteingustavo | 0:0dee8840a1c0 | 22 | * may be used to endorse or promote products derived from this software |
einsteingustavo | 0:0dee8840a1c0 | 23 | * without specific prior written permission. |
einsteingustavo | 0:0dee8840a1c0 | 24 | * |
einsteingustavo | 0:0dee8840a1c0 | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
einsteingustavo | 0:0dee8840a1c0 | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
einsteingustavo | 0:0dee8840a1c0 | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
einsteingustavo | 0:0dee8840a1c0 | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
einsteingustavo | 0:0dee8840a1c0 | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
einsteingustavo | 0:0dee8840a1c0 | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
einsteingustavo | 0:0dee8840a1c0 | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
einsteingustavo | 0:0dee8840a1c0 | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
einsteingustavo | 0:0dee8840a1c0 | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
einsteingustavo | 0:0dee8840a1c0 | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
einsteingustavo | 0:0dee8840a1c0 | 35 | ******************************************************************************* |
einsteingustavo | 0:0dee8840a1c0 | 36 | */ |
einsteingustavo | 0:0dee8840a1c0 | 37 | |
einsteingustavo | 0:0dee8840a1c0 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
einsteingustavo | 0:0dee8840a1c0 | 39 | #ifndef __STM32F10x_ADC_H |
einsteingustavo | 0:0dee8840a1c0 | 40 | #define __STM32F10x_ADC_H |
einsteingustavo | 0:0dee8840a1c0 | 41 | |
einsteingustavo | 0:0dee8840a1c0 | 42 | #ifdef __cplusplus |
einsteingustavo | 0:0dee8840a1c0 | 43 | extern "C" { |
einsteingustavo | 0:0dee8840a1c0 | 44 | #endif |
einsteingustavo | 0:0dee8840a1c0 | 45 | |
einsteingustavo | 0:0dee8840a1c0 | 46 | /* Includes ------------------------------------------------------------------*/ |
einsteingustavo | 0:0dee8840a1c0 | 47 | #include "stm32f10x.h" |
einsteingustavo | 0:0dee8840a1c0 | 48 | |
einsteingustavo | 0:0dee8840a1c0 | 49 | /** @addtogroup STM32F10x_StdPeriph_Driver |
einsteingustavo | 0:0dee8840a1c0 | 50 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 51 | */ |
einsteingustavo | 0:0dee8840a1c0 | 52 | |
einsteingustavo | 0:0dee8840a1c0 | 53 | /** @addtogroup ADC |
einsteingustavo | 0:0dee8840a1c0 | 54 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 55 | */ |
einsteingustavo | 0:0dee8840a1c0 | 56 | |
einsteingustavo | 0:0dee8840a1c0 | 57 | /** @defgroup ADC_Exported_Types |
einsteingustavo | 0:0dee8840a1c0 | 58 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 59 | */ |
einsteingustavo | 0:0dee8840a1c0 | 60 | |
einsteingustavo | 0:0dee8840a1c0 | 61 | /** |
einsteingustavo | 0:0dee8840a1c0 | 62 | * @brief ADC Init structure definition |
einsteingustavo | 0:0dee8840a1c0 | 63 | */ |
einsteingustavo | 0:0dee8840a1c0 | 64 | |
einsteingustavo | 0:0dee8840a1c0 | 65 | typedef struct |
einsteingustavo | 0:0dee8840a1c0 | 66 | { |
einsteingustavo | 0:0dee8840a1c0 | 67 | uint32_t ADC_Mode; /*!< Configures the ADC to operate in independent or |
einsteingustavo | 0:0dee8840a1c0 | 68 | dual mode. |
einsteingustavo | 0:0dee8840a1c0 | 69 | This parameter can be a value of @ref ADC_mode */ |
einsteingustavo | 0:0dee8840a1c0 | 70 | |
einsteingustavo | 0:0dee8840a1c0 | 71 | FunctionalState ADC_ScanConvMode; /*!< Specifies whether the conversion is performed in |
einsteingustavo | 0:0dee8840a1c0 | 72 | Scan (multichannels) or Single (one channel) mode. |
einsteingustavo | 0:0dee8840a1c0 | 73 | This parameter can be set to ENABLE or DISABLE */ |
einsteingustavo | 0:0dee8840a1c0 | 74 | |
einsteingustavo | 0:0dee8840a1c0 | 75 | FunctionalState ADC_ContinuousConvMode; /*!< Specifies whether the conversion is performed in |
einsteingustavo | 0:0dee8840a1c0 | 76 | Continuous or Single mode. |
einsteingustavo | 0:0dee8840a1c0 | 77 | This parameter can be set to ENABLE or DISABLE. */ |
einsteingustavo | 0:0dee8840a1c0 | 78 | |
einsteingustavo | 0:0dee8840a1c0 | 79 | uint32_t ADC_ExternalTrigConv; /*!< Defines the external trigger used to start the analog |
einsteingustavo | 0:0dee8840a1c0 | 80 | to digital conversion of regular channels. This parameter |
einsteingustavo | 0:0dee8840a1c0 | 81 | can be a value of @ref ADC_external_trigger_sources_for_regular_channels_conversion */ |
einsteingustavo | 0:0dee8840a1c0 | 82 | |
einsteingustavo | 0:0dee8840a1c0 | 83 | uint32_t ADC_DataAlign; /*!< Specifies whether the ADC data alignment is left or right. |
einsteingustavo | 0:0dee8840a1c0 | 84 | This parameter can be a value of @ref ADC_data_align */ |
einsteingustavo | 0:0dee8840a1c0 | 85 | |
einsteingustavo | 0:0dee8840a1c0 | 86 | uint8_t ADC_NbrOfChannel; /*!< Specifies the number of ADC channels that will be converted |
einsteingustavo | 0:0dee8840a1c0 | 87 | using the sequencer for regular channel group. |
einsteingustavo | 0:0dee8840a1c0 | 88 | This parameter must range from 1 to 16. */ |
einsteingustavo | 0:0dee8840a1c0 | 89 | }ADC_InitTypeDef; |
einsteingustavo | 0:0dee8840a1c0 | 90 | /** |
einsteingustavo | 0:0dee8840a1c0 | 91 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 92 | */ |
einsteingustavo | 0:0dee8840a1c0 | 93 | |
einsteingustavo | 0:0dee8840a1c0 | 94 | /** @defgroup ADC_Exported_Constants |
einsteingustavo | 0:0dee8840a1c0 | 95 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 96 | */ |
einsteingustavo | 0:0dee8840a1c0 | 97 | |
einsteingustavo | 0:0dee8840a1c0 | 98 | #define IS_ADC_ALL_PERIPH(PERIPH) (((PERIPH) == ADC1) || \ |
einsteingustavo | 0:0dee8840a1c0 | 99 | ((PERIPH) == ADC2) || \ |
einsteingustavo | 0:0dee8840a1c0 | 100 | ((PERIPH) == ADC3)) |
einsteingustavo | 0:0dee8840a1c0 | 101 | |
einsteingustavo | 0:0dee8840a1c0 | 102 | #define IS_ADC_DMA_PERIPH(PERIPH) (((PERIPH) == ADC1) || \ |
einsteingustavo | 0:0dee8840a1c0 | 103 | ((PERIPH) == ADC3)) |
einsteingustavo | 0:0dee8840a1c0 | 104 | |
einsteingustavo | 0:0dee8840a1c0 | 105 | /** @defgroup ADC_mode |
einsteingustavo | 0:0dee8840a1c0 | 106 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 107 | */ |
einsteingustavo | 0:0dee8840a1c0 | 108 | |
einsteingustavo | 0:0dee8840a1c0 | 109 | #define ADC_Mode_Independent ((uint32_t)0x00000000) |
einsteingustavo | 0:0dee8840a1c0 | 110 | #define ADC_Mode_RegInjecSimult ((uint32_t)0x00010000) |
einsteingustavo | 0:0dee8840a1c0 | 111 | #define ADC_Mode_RegSimult_AlterTrig ((uint32_t)0x00020000) |
einsteingustavo | 0:0dee8840a1c0 | 112 | #define ADC_Mode_InjecSimult_FastInterl ((uint32_t)0x00030000) |
einsteingustavo | 0:0dee8840a1c0 | 113 | #define ADC_Mode_InjecSimult_SlowInterl ((uint32_t)0x00040000) |
einsteingustavo | 0:0dee8840a1c0 | 114 | #define ADC_Mode_InjecSimult ((uint32_t)0x00050000) |
einsteingustavo | 0:0dee8840a1c0 | 115 | #define ADC_Mode_RegSimult ((uint32_t)0x00060000) |
einsteingustavo | 0:0dee8840a1c0 | 116 | #define ADC_Mode_FastInterl ((uint32_t)0x00070000) |
einsteingustavo | 0:0dee8840a1c0 | 117 | #define ADC_Mode_SlowInterl ((uint32_t)0x00080000) |
einsteingustavo | 0:0dee8840a1c0 | 118 | #define ADC_Mode_AlterTrig ((uint32_t)0x00090000) |
einsteingustavo | 0:0dee8840a1c0 | 119 | |
einsteingustavo | 0:0dee8840a1c0 | 120 | #define IS_ADC_MODE(MODE) (((MODE) == ADC_Mode_Independent) || \ |
einsteingustavo | 0:0dee8840a1c0 | 121 | ((MODE) == ADC_Mode_RegInjecSimult) || \ |
einsteingustavo | 0:0dee8840a1c0 | 122 | ((MODE) == ADC_Mode_RegSimult_AlterTrig) || \ |
einsteingustavo | 0:0dee8840a1c0 | 123 | ((MODE) == ADC_Mode_InjecSimult_FastInterl) || \ |
einsteingustavo | 0:0dee8840a1c0 | 124 | ((MODE) == ADC_Mode_InjecSimult_SlowInterl) || \ |
einsteingustavo | 0:0dee8840a1c0 | 125 | ((MODE) == ADC_Mode_InjecSimult) || \ |
einsteingustavo | 0:0dee8840a1c0 | 126 | ((MODE) == ADC_Mode_RegSimult) || \ |
einsteingustavo | 0:0dee8840a1c0 | 127 | ((MODE) == ADC_Mode_FastInterl) || \ |
einsteingustavo | 0:0dee8840a1c0 | 128 | ((MODE) == ADC_Mode_SlowInterl) || \ |
einsteingustavo | 0:0dee8840a1c0 | 129 | ((MODE) == ADC_Mode_AlterTrig)) |
einsteingustavo | 0:0dee8840a1c0 | 130 | /** |
einsteingustavo | 0:0dee8840a1c0 | 131 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 132 | */ |
einsteingustavo | 0:0dee8840a1c0 | 133 | |
einsteingustavo | 0:0dee8840a1c0 | 134 | /** @defgroup ADC_external_trigger_sources_for_regular_channels_conversion |
einsteingustavo | 0:0dee8840a1c0 | 135 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 136 | */ |
einsteingustavo | 0:0dee8840a1c0 | 137 | |
einsteingustavo | 0:0dee8840a1c0 | 138 | #define ADC_ExternalTrigConv_T1_CC1 ((uint32_t)0x00000000) /*!< For ADC1 and ADC2 */ |
einsteingustavo | 0:0dee8840a1c0 | 139 | #define ADC_ExternalTrigConv_T1_CC2 ((uint32_t)0x00020000) /*!< For ADC1 and ADC2 */ |
einsteingustavo | 0:0dee8840a1c0 | 140 | #define ADC_ExternalTrigConv_T2_CC2 ((uint32_t)0x00060000) /*!< For ADC1 and ADC2 */ |
einsteingustavo | 0:0dee8840a1c0 | 141 | #define ADC_ExternalTrigConv_T3_TRGO ((uint32_t)0x00080000) /*!< For ADC1 and ADC2 */ |
einsteingustavo | 0:0dee8840a1c0 | 142 | #define ADC_ExternalTrigConv_T4_CC4 ((uint32_t)0x000A0000) /*!< For ADC1 and ADC2 */ |
einsteingustavo | 0:0dee8840a1c0 | 143 | #define ADC_ExternalTrigConv_Ext_IT11_TIM8_TRGO ((uint32_t)0x000C0000) /*!< For ADC1 and ADC2 */ |
einsteingustavo | 0:0dee8840a1c0 | 144 | |
einsteingustavo | 0:0dee8840a1c0 | 145 | #define ADC_ExternalTrigConv_T1_CC3 ((uint32_t)0x00040000) /*!< For ADC1, ADC2 and ADC3 */ |
einsteingustavo | 0:0dee8840a1c0 | 146 | #define ADC_ExternalTrigConv_None ((uint32_t)0x000E0000) /*!< For ADC1, ADC2 and ADC3 */ |
einsteingustavo | 0:0dee8840a1c0 | 147 | |
einsteingustavo | 0:0dee8840a1c0 | 148 | #define ADC_ExternalTrigConv_T3_CC1 ((uint32_t)0x00000000) /*!< For ADC3 only */ |
einsteingustavo | 0:0dee8840a1c0 | 149 | #define ADC_ExternalTrigConv_T2_CC3 ((uint32_t)0x00020000) /*!< For ADC3 only */ |
einsteingustavo | 0:0dee8840a1c0 | 150 | #define ADC_ExternalTrigConv_T8_CC1 ((uint32_t)0x00060000) /*!< For ADC3 only */ |
einsteingustavo | 0:0dee8840a1c0 | 151 | #define ADC_ExternalTrigConv_T8_TRGO ((uint32_t)0x00080000) /*!< For ADC3 only */ |
einsteingustavo | 0:0dee8840a1c0 | 152 | #define ADC_ExternalTrigConv_T5_CC1 ((uint32_t)0x000A0000) /*!< For ADC3 only */ |
einsteingustavo | 0:0dee8840a1c0 | 153 | #define ADC_ExternalTrigConv_T5_CC3 ((uint32_t)0x000C0000) /*!< For ADC3 only */ |
einsteingustavo | 0:0dee8840a1c0 | 154 | |
einsteingustavo | 0:0dee8840a1c0 | 155 | #define IS_ADC_EXT_TRIG(REGTRIG) (((REGTRIG) == ADC_ExternalTrigConv_T1_CC1) || \ |
einsteingustavo | 0:0dee8840a1c0 | 156 | ((REGTRIG) == ADC_ExternalTrigConv_T1_CC2) || \ |
einsteingustavo | 0:0dee8840a1c0 | 157 | ((REGTRIG) == ADC_ExternalTrigConv_T1_CC3) || \ |
einsteingustavo | 0:0dee8840a1c0 | 158 | ((REGTRIG) == ADC_ExternalTrigConv_T2_CC2) || \ |
einsteingustavo | 0:0dee8840a1c0 | 159 | ((REGTRIG) == ADC_ExternalTrigConv_T3_TRGO) || \ |
einsteingustavo | 0:0dee8840a1c0 | 160 | ((REGTRIG) == ADC_ExternalTrigConv_T4_CC4) || \ |
einsteingustavo | 0:0dee8840a1c0 | 161 | ((REGTRIG) == ADC_ExternalTrigConv_Ext_IT11_TIM8_TRGO) || \ |
einsteingustavo | 0:0dee8840a1c0 | 162 | ((REGTRIG) == ADC_ExternalTrigConv_None) || \ |
einsteingustavo | 0:0dee8840a1c0 | 163 | ((REGTRIG) == ADC_ExternalTrigConv_T3_CC1) || \ |
einsteingustavo | 0:0dee8840a1c0 | 164 | ((REGTRIG) == ADC_ExternalTrigConv_T2_CC3) || \ |
einsteingustavo | 0:0dee8840a1c0 | 165 | ((REGTRIG) == ADC_ExternalTrigConv_T8_CC1) || \ |
einsteingustavo | 0:0dee8840a1c0 | 166 | ((REGTRIG) == ADC_ExternalTrigConv_T8_TRGO) || \ |
einsteingustavo | 0:0dee8840a1c0 | 167 | ((REGTRIG) == ADC_ExternalTrigConv_T5_CC1) || \ |
einsteingustavo | 0:0dee8840a1c0 | 168 | ((REGTRIG) == ADC_ExternalTrigConv_T5_CC3)) |
einsteingustavo | 0:0dee8840a1c0 | 169 | /** |
einsteingustavo | 0:0dee8840a1c0 | 170 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 171 | */ |
einsteingustavo | 0:0dee8840a1c0 | 172 | |
einsteingustavo | 0:0dee8840a1c0 | 173 | /** @defgroup ADC_data_align |
einsteingustavo | 0:0dee8840a1c0 | 174 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 175 | */ |
einsteingustavo | 0:0dee8840a1c0 | 176 | |
einsteingustavo | 0:0dee8840a1c0 | 177 | #define ADC_DataAlign_Right ((uint32_t)0x00000000) |
einsteingustavo | 0:0dee8840a1c0 | 178 | #define ADC_DataAlign_Left ((uint32_t)0x00000800) |
einsteingustavo | 0:0dee8840a1c0 | 179 | #define IS_ADC_DATA_ALIGN(ALIGN) (((ALIGN) == ADC_DataAlign_Right) || \ |
einsteingustavo | 0:0dee8840a1c0 | 180 | ((ALIGN) == ADC_DataAlign_Left)) |
einsteingustavo | 0:0dee8840a1c0 | 181 | /** |
einsteingustavo | 0:0dee8840a1c0 | 182 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 183 | */ |
einsteingustavo | 0:0dee8840a1c0 | 184 | |
einsteingustavo | 0:0dee8840a1c0 | 185 | /** @defgroup ADC_channels |
einsteingustavo | 0:0dee8840a1c0 | 186 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 187 | */ |
einsteingustavo | 0:0dee8840a1c0 | 188 | |
einsteingustavo | 0:0dee8840a1c0 | 189 | #define ADC_Channel_0 ((uint8_t)0x00) |
einsteingustavo | 0:0dee8840a1c0 | 190 | #define ADC_Channel_1 ((uint8_t)0x01) |
einsteingustavo | 0:0dee8840a1c0 | 191 | #define ADC_Channel_2 ((uint8_t)0x02) |
einsteingustavo | 0:0dee8840a1c0 | 192 | #define ADC_Channel_3 ((uint8_t)0x03) |
einsteingustavo | 0:0dee8840a1c0 | 193 | #define ADC_Channel_4 ((uint8_t)0x04) |
einsteingustavo | 0:0dee8840a1c0 | 194 | #define ADC_Channel_5 ((uint8_t)0x05) |
einsteingustavo | 0:0dee8840a1c0 | 195 | #define ADC_Channel_6 ((uint8_t)0x06) |
einsteingustavo | 0:0dee8840a1c0 | 196 | #define ADC_Channel_7 ((uint8_t)0x07) |
einsteingustavo | 0:0dee8840a1c0 | 197 | #define ADC_Channel_8 ((uint8_t)0x08) |
einsteingustavo | 0:0dee8840a1c0 | 198 | #define ADC_Channel_9 ((uint8_t)0x09) |
einsteingustavo | 0:0dee8840a1c0 | 199 | #define ADC_Channel_10 ((uint8_t)0x0A) |
einsteingustavo | 0:0dee8840a1c0 | 200 | #define ADC_Channel_11 ((uint8_t)0x0B) |
einsteingustavo | 0:0dee8840a1c0 | 201 | #define ADC_Channel_12 ((uint8_t)0x0C) |
einsteingustavo | 0:0dee8840a1c0 | 202 | #define ADC_Channel_13 ((uint8_t)0x0D) |
einsteingustavo | 0:0dee8840a1c0 | 203 | #define ADC_Channel_14 ((uint8_t)0x0E) |
einsteingustavo | 0:0dee8840a1c0 | 204 | #define ADC_Channel_15 ((uint8_t)0x0F) |
einsteingustavo | 0:0dee8840a1c0 | 205 | #define ADC_Channel_16 ((uint8_t)0x10) |
einsteingustavo | 0:0dee8840a1c0 | 206 | #define ADC_Channel_17 ((uint8_t)0x11) |
einsteingustavo | 0:0dee8840a1c0 | 207 | |
einsteingustavo | 0:0dee8840a1c0 | 208 | #define ADC_Channel_TempSensor ((uint8_t)ADC_Channel_16) |
einsteingustavo | 0:0dee8840a1c0 | 209 | #define ADC_Channel_Vrefint ((uint8_t)ADC_Channel_17) |
einsteingustavo | 0:0dee8840a1c0 | 210 | |
einsteingustavo | 0:0dee8840a1c0 | 211 | #define IS_ADC_CHANNEL(CHANNEL) (((CHANNEL) == ADC_Channel_0) || ((CHANNEL) == ADC_Channel_1) || \ |
einsteingustavo | 0:0dee8840a1c0 | 212 | ((CHANNEL) == ADC_Channel_2) || ((CHANNEL) == ADC_Channel_3) || \ |
einsteingustavo | 0:0dee8840a1c0 | 213 | ((CHANNEL) == ADC_Channel_4) || ((CHANNEL) == ADC_Channel_5) || \ |
einsteingustavo | 0:0dee8840a1c0 | 214 | ((CHANNEL) == ADC_Channel_6) || ((CHANNEL) == ADC_Channel_7) || \ |
einsteingustavo | 0:0dee8840a1c0 | 215 | ((CHANNEL) == ADC_Channel_8) || ((CHANNEL) == ADC_Channel_9) || \ |
einsteingustavo | 0:0dee8840a1c0 | 216 | ((CHANNEL) == ADC_Channel_10) || ((CHANNEL) == ADC_Channel_11) || \ |
einsteingustavo | 0:0dee8840a1c0 | 217 | ((CHANNEL) == ADC_Channel_12) || ((CHANNEL) == ADC_Channel_13) || \ |
einsteingustavo | 0:0dee8840a1c0 | 218 | ((CHANNEL) == ADC_Channel_14) || ((CHANNEL) == ADC_Channel_15) || \ |
einsteingustavo | 0:0dee8840a1c0 | 219 | ((CHANNEL) == ADC_Channel_16) || ((CHANNEL) == ADC_Channel_17)) |
einsteingustavo | 0:0dee8840a1c0 | 220 | /** |
einsteingustavo | 0:0dee8840a1c0 | 221 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 222 | */ |
einsteingustavo | 0:0dee8840a1c0 | 223 | |
einsteingustavo | 0:0dee8840a1c0 | 224 | /** @defgroup ADC_sampling_time |
einsteingustavo | 0:0dee8840a1c0 | 225 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 226 | */ |
einsteingustavo | 0:0dee8840a1c0 | 227 | |
einsteingustavo | 0:0dee8840a1c0 | 228 | #define ADC_SampleTime_1Cycles5 ((uint8_t)0x00) |
einsteingustavo | 0:0dee8840a1c0 | 229 | #define ADC_SampleTime_7Cycles5 ((uint8_t)0x01) |
einsteingustavo | 0:0dee8840a1c0 | 230 | #define ADC_SampleTime_13Cycles5 ((uint8_t)0x02) |
einsteingustavo | 0:0dee8840a1c0 | 231 | #define ADC_SampleTime_28Cycles5 ((uint8_t)0x03) |
einsteingustavo | 0:0dee8840a1c0 | 232 | #define ADC_SampleTime_41Cycles5 ((uint8_t)0x04) |
einsteingustavo | 0:0dee8840a1c0 | 233 | #define ADC_SampleTime_55Cycles5 ((uint8_t)0x05) |
einsteingustavo | 0:0dee8840a1c0 | 234 | #define ADC_SampleTime_71Cycles5 ((uint8_t)0x06) |
einsteingustavo | 0:0dee8840a1c0 | 235 | #define ADC_SampleTime_239Cycles5 ((uint8_t)0x07) |
einsteingustavo | 0:0dee8840a1c0 | 236 | #define IS_ADC_SAMPLE_TIME(TIME) (((TIME) == ADC_SampleTime_1Cycles5) || \ |
einsteingustavo | 0:0dee8840a1c0 | 237 | ((TIME) == ADC_SampleTime_7Cycles5) || \ |
einsteingustavo | 0:0dee8840a1c0 | 238 | ((TIME) == ADC_SampleTime_13Cycles5) || \ |
einsteingustavo | 0:0dee8840a1c0 | 239 | ((TIME) == ADC_SampleTime_28Cycles5) || \ |
einsteingustavo | 0:0dee8840a1c0 | 240 | ((TIME) == ADC_SampleTime_41Cycles5) || \ |
einsteingustavo | 0:0dee8840a1c0 | 241 | ((TIME) == ADC_SampleTime_55Cycles5) || \ |
einsteingustavo | 0:0dee8840a1c0 | 242 | ((TIME) == ADC_SampleTime_71Cycles5) || \ |
einsteingustavo | 0:0dee8840a1c0 | 243 | ((TIME) == ADC_SampleTime_239Cycles5)) |
einsteingustavo | 0:0dee8840a1c0 | 244 | /** |
einsteingustavo | 0:0dee8840a1c0 | 245 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 246 | */ |
einsteingustavo | 0:0dee8840a1c0 | 247 | |
einsteingustavo | 0:0dee8840a1c0 | 248 | /** @defgroup ADC_external_trigger_sources_for_injected_channels_conversion |
einsteingustavo | 0:0dee8840a1c0 | 249 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 250 | */ |
einsteingustavo | 0:0dee8840a1c0 | 251 | |
einsteingustavo | 0:0dee8840a1c0 | 252 | #define ADC_ExternalTrigInjecConv_T2_TRGO ((uint32_t)0x00002000) /*!< For ADC1 and ADC2 */ |
einsteingustavo | 0:0dee8840a1c0 | 253 | #define ADC_ExternalTrigInjecConv_T2_CC1 ((uint32_t)0x00003000) /*!< For ADC1 and ADC2 */ |
einsteingustavo | 0:0dee8840a1c0 | 254 | #define ADC_ExternalTrigInjecConv_T3_CC4 ((uint32_t)0x00004000) /*!< For ADC1 and ADC2 */ |
einsteingustavo | 0:0dee8840a1c0 | 255 | #define ADC_ExternalTrigInjecConv_T4_TRGO ((uint32_t)0x00005000) /*!< For ADC1 and ADC2 */ |
einsteingustavo | 0:0dee8840a1c0 | 256 | #define ADC_ExternalTrigInjecConv_Ext_IT15_TIM8_CC4 ((uint32_t)0x00006000) /*!< For ADC1 and ADC2 */ |
einsteingustavo | 0:0dee8840a1c0 | 257 | |
einsteingustavo | 0:0dee8840a1c0 | 258 | #define ADC_ExternalTrigInjecConv_T1_TRGO ((uint32_t)0x00000000) /*!< For ADC1, ADC2 and ADC3 */ |
einsteingustavo | 0:0dee8840a1c0 | 259 | #define ADC_ExternalTrigInjecConv_T1_CC4 ((uint32_t)0x00001000) /*!< For ADC1, ADC2 and ADC3 */ |
einsteingustavo | 0:0dee8840a1c0 | 260 | #define ADC_ExternalTrigInjecConv_None ((uint32_t)0x00007000) /*!< For ADC1, ADC2 and ADC3 */ |
einsteingustavo | 0:0dee8840a1c0 | 261 | |
einsteingustavo | 0:0dee8840a1c0 | 262 | #define ADC_ExternalTrigInjecConv_T4_CC3 ((uint32_t)0x00002000) /*!< For ADC3 only */ |
einsteingustavo | 0:0dee8840a1c0 | 263 | #define ADC_ExternalTrigInjecConv_T8_CC2 ((uint32_t)0x00003000) /*!< For ADC3 only */ |
einsteingustavo | 0:0dee8840a1c0 | 264 | #define ADC_ExternalTrigInjecConv_T8_CC4 ((uint32_t)0x00004000) /*!< For ADC3 only */ |
einsteingustavo | 0:0dee8840a1c0 | 265 | #define ADC_ExternalTrigInjecConv_T5_TRGO ((uint32_t)0x00005000) /*!< For ADC3 only */ |
einsteingustavo | 0:0dee8840a1c0 | 266 | #define ADC_ExternalTrigInjecConv_T5_CC4 ((uint32_t)0x00006000) /*!< For ADC3 only */ |
einsteingustavo | 0:0dee8840a1c0 | 267 | |
einsteingustavo | 0:0dee8840a1c0 | 268 | #define IS_ADC_EXT_INJEC_TRIG(INJTRIG) (((INJTRIG) == ADC_ExternalTrigInjecConv_T1_TRGO) || \ |
einsteingustavo | 0:0dee8840a1c0 | 269 | ((INJTRIG) == ADC_ExternalTrigInjecConv_T1_CC4) || \ |
einsteingustavo | 0:0dee8840a1c0 | 270 | ((INJTRIG) == ADC_ExternalTrigInjecConv_T2_TRGO) || \ |
einsteingustavo | 0:0dee8840a1c0 | 271 | ((INJTRIG) == ADC_ExternalTrigInjecConv_T2_CC1) || \ |
einsteingustavo | 0:0dee8840a1c0 | 272 | ((INJTRIG) == ADC_ExternalTrigInjecConv_T3_CC4) || \ |
einsteingustavo | 0:0dee8840a1c0 | 273 | ((INJTRIG) == ADC_ExternalTrigInjecConv_T4_TRGO) || \ |
einsteingustavo | 0:0dee8840a1c0 | 274 | ((INJTRIG) == ADC_ExternalTrigInjecConv_Ext_IT15_TIM8_CC4) || \ |
einsteingustavo | 0:0dee8840a1c0 | 275 | ((INJTRIG) == ADC_ExternalTrigInjecConv_None) || \ |
einsteingustavo | 0:0dee8840a1c0 | 276 | ((INJTRIG) == ADC_ExternalTrigInjecConv_T4_CC3) || \ |
einsteingustavo | 0:0dee8840a1c0 | 277 | ((INJTRIG) == ADC_ExternalTrigInjecConv_T8_CC2) || \ |
einsteingustavo | 0:0dee8840a1c0 | 278 | ((INJTRIG) == ADC_ExternalTrigInjecConv_T8_CC4) || \ |
einsteingustavo | 0:0dee8840a1c0 | 279 | ((INJTRIG) == ADC_ExternalTrigInjecConv_T5_TRGO) || \ |
einsteingustavo | 0:0dee8840a1c0 | 280 | ((INJTRIG) == ADC_ExternalTrigInjecConv_T5_CC4)) |
einsteingustavo | 0:0dee8840a1c0 | 281 | /** |
einsteingustavo | 0:0dee8840a1c0 | 282 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 283 | */ |
einsteingustavo | 0:0dee8840a1c0 | 284 | |
einsteingustavo | 0:0dee8840a1c0 | 285 | /** @defgroup ADC_injected_channel_selection |
einsteingustavo | 0:0dee8840a1c0 | 286 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 287 | */ |
einsteingustavo | 0:0dee8840a1c0 | 288 | |
einsteingustavo | 0:0dee8840a1c0 | 289 | #define ADC_InjectedChannel_1 ((uint8_t)0x14) |
einsteingustavo | 0:0dee8840a1c0 | 290 | #define ADC_InjectedChannel_2 ((uint8_t)0x18) |
einsteingustavo | 0:0dee8840a1c0 | 291 | #define ADC_InjectedChannel_3 ((uint8_t)0x1C) |
einsteingustavo | 0:0dee8840a1c0 | 292 | #define ADC_InjectedChannel_4 ((uint8_t)0x20) |
einsteingustavo | 0:0dee8840a1c0 | 293 | #define IS_ADC_INJECTED_CHANNEL(CHANNEL) (((CHANNEL) == ADC_InjectedChannel_1) || \ |
einsteingustavo | 0:0dee8840a1c0 | 294 | ((CHANNEL) == ADC_InjectedChannel_2) || \ |
einsteingustavo | 0:0dee8840a1c0 | 295 | ((CHANNEL) == ADC_InjectedChannel_3) || \ |
einsteingustavo | 0:0dee8840a1c0 | 296 | ((CHANNEL) == ADC_InjectedChannel_4)) |
einsteingustavo | 0:0dee8840a1c0 | 297 | /** |
einsteingustavo | 0:0dee8840a1c0 | 298 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 299 | */ |
einsteingustavo | 0:0dee8840a1c0 | 300 | |
einsteingustavo | 0:0dee8840a1c0 | 301 | /** @defgroup ADC_analog_watchdog_selection |
einsteingustavo | 0:0dee8840a1c0 | 302 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 303 | */ |
einsteingustavo | 0:0dee8840a1c0 | 304 | |
einsteingustavo | 0:0dee8840a1c0 | 305 | #define ADC_AnalogWatchdog_SingleRegEnable ((uint32_t)0x00800200) |
einsteingustavo | 0:0dee8840a1c0 | 306 | #define ADC_AnalogWatchdog_SingleInjecEnable ((uint32_t)0x00400200) |
einsteingustavo | 0:0dee8840a1c0 | 307 | #define ADC_AnalogWatchdog_SingleRegOrInjecEnable ((uint32_t)0x00C00200) |
einsteingustavo | 0:0dee8840a1c0 | 308 | #define ADC_AnalogWatchdog_AllRegEnable ((uint32_t)0x00800000) |
einsteingustavo | 0:0dee8840a1c0 | 309 | #define ADC_AnalogWatchdog_AllInjecEnable ((uint32_t)0x00400000) |
einsteingustavo | 0:0dee8840a1c0 | 310 | #define ADC_AnalogWatchdog_AllRegAllInjecEnable ((uint32_t)0x00C00000) |
einsteingustavo | 0:0dee8840a1c0 | 311 | #define ADC_AnalogWatchdog_None ((uint32_t)0x00000000) |
einsteingustavo | 0:0dee8840a1c0 | 312 | |
einsteingustavo | 0:0dee8840a1c0 | 313 | #define IS_ADC_ANALOG_WATCHDOG(WATCHDOG) (((WATCHDOG) == ADC_AnalogWatchdog_SingleRegEnable) || \ |
einsteingustavo | 0:0dee8840a1c0 | 314 | ((WATCHDOG) == ADC_AnalogWatchdog_SingleInjecEnable) || \ |
einsteingustavo | 0:0dee8840a1c0 | 315 | ((WATCHDOG) == ADC_AnalogWatchdog_SingleRegOrInjecEnable) || \ |
einsteingustavo | 0:0dee8840a1c0 | 316 | ((WATCHDOG) == ADC_AnalogWatchdog_AllRegEnable) || \ |
einsteingustavo | 0:0dee8840a1c0 | 317 | ((WATCHDOG) == ADC_AnalogWatchdog_AllInjecEnable) || \ |
einsteingustavo | 0:0dee8840a1c0 | 318 | ((WATCHDOG) == ADC_AnalogWatchdog_AllRegAllInjecEnable) || \ |
einsteingustavo | 0:0dee8840a1c0 | 319 | ((WATCHDOG) == ADC_AnalogWatchdog_None)) |
einsteingustavo | 0:0dee8840a1c0 | 320 | /** |
einsteingustavo | 0:0dee8840a1c0 | 321 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 322 | */ |
einsteingustavo | 0:0dee8840a1c0 | 323 | |
einsteingustavo | 0:0dee8840a1c0 | 324 | /** @defgroup ADC_interrupts_definition |
einsteingustavo | 0:0dee8840a1c0 | 325 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 326 | */ |
einsteingustavo | 0:0dee8840a1c0 | 327 | |
einsteingustavo | 0:0dee8840a1c0 | 328 | #define ADC_IT_EOC ((uint16_t)0x0220) |
einsteingustavo | 0:0dee8840a1c0 | 329 | #define ADC_IT_AWD ((uint16_t)0x0140) |
einsteingustavo | 0:0dee8840a1c0 | 330 | #define ADC_IT_JEOC ((uint16_t)0x0480) |
einsteingustavo | 0:0dee8840a1c0 | 331 | |
einsteingustavo | 0:0dee8840a1c0 | 332 | #define IS_ADC_IT(IT) ((((IT) & (uint16_t)0xF81F) == 0x00) && ((IT) != 0x00)) |
einsteingustavo | 0:0dee8840a1c0 | 333 | |
einsteingustavo | 0:0dee8840a1c0 | 334 | #define IS_ADC_GET_IT(IT) (((IT) == ADC_IT_EOC) || ((IT) == ADC_IT_AWD) || \ |
einsteingustavo | 0:0dee8840a1c0 | 335 | ((IT) == ADC_IT_JEOC)) |
einsteingustavo | 0:0dee8840a1c0 | 336 | /** |
einsteingustavo | 0:0dee8840a1c0 | 337 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 338 | */ |
einsteingustavo | 0:0dee8840a1c0 | 339 | |
einsteingustavo | 0:0dee8840a1c0 | 340 | /** @defgroup ADC_flags_definition |
einsteingustavo | 0:0dee8840a1c0 | 341 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 342 | */ |
einsteingustavo | 0:0dee8840a1c0 | 343 | |
einsteingustavo | 0:0dee8840a1c0 | 344 | #define ADC_FLAG_AWD ((uint8_t)0x01) |
einsteingustavo | 0:0dee8840a1c0 | 345 | #define ADC_FLAG_EOC ((uint8_t)0x02) |
einsteingustavo | 0:0dee8840a1c0 | 346 | #define ADC_FLAG_JEOC ((uint8_t)0x04) |
einsteingustavo | 0:0dee8840a1c0 | 347 | #define ADC_FLAG_JSTRT ((uint8_t)0x08) |
einsteingustavo | 0:0dee8840a1c0 | 348 | #define ADC_FLAG_STRT ((uint8_t)0x10) |
einsteingustavo | 0:0dee8840a1c0 | 349 | #define IS_ADC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint8_t)0xE0) == 0x00) && ((FLAG) != 0x00)) |
einsteingustavo | 0:0dee8840a1c0 | 350 | #define IS_ADC_GET_FLAG(FLAG) (((FLAG) == ADC_FLAG_AWD) || ((FLAG) == ADC_FLAG_EOC) || \ |
einsteingustavo | 0:0dee8840a1c0 | 351 | ((FLAG) == ADC_FLAG_JEOC) || ((FLAG)== ADC_FLAG_JSTRT) || \ |
einsteingustavo | 0:0dee8840a1c0 | 352 | ((FLAG) == ADC_FLAG_STRT)) |
einsteingustavo | 0:0dee8840a1c0 | 353 | /** |
einsteingustavo | 0:0dee8840a1c0 | 354 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 355 | */ |
einsteingustavo | 0:0dee8840a1c0 | 356 | |
einsteingustavo | 0:0dee8840a1c0 | 357 | /** @defgroup ADC_thresholds |
einsteingustavo | 0:0dee8840a1c0 | 358 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 359 | */ |
einsteingustavo | 0:0dee8840a1c0 | 360 | |
einsteingustavo | 0:0dee8840a1c0 | 361 | #define IS_ADC_THRESHOLD(THRESHOLD) ((THRESHOLD) <= 0xFFF) |
einsteingustavo | 0:0dee8840a1c0 | 362 | |
einsteingustavo | 0:0dee8840a1c0 | 363 | /** |
einsteingustavo | 0:0dee8840a1c0 | 364 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 365 | */ |
einsteingustavo | 0:0dee8840a1c0 | 366 | |
einsteingustavo | 0:0dee8840a1c0 | 367 | /** @defgroup ADC_injected_offset |
einsteingustavo | 0:0dee8840a1c0 | 368 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 369 | */ |
einsteingustavo | 0:0dee8840a1c0 | 370 | |
einsteingustavo | 0:0dee8840a1c0 | 371 | #define IS_ADC_OFFSET(OFFSET) ((OFFSET) <= 0xFFF) |
einsteingustavo | 0:0dee8840a1c0 | 372 | |
einsteingustavo | 0:0dee8840a1c0 | 373 | /** |
einsteingustavo | 0:0dee8840a1c0 | 374 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 375 | */ |
einsteingustavo | 0:0dee8840a1c0 | 376 | |
einsteingustavo | 0:0dee8840a1c0 | 377 | /** @defgroup ADC_injected_length |
einsteingustavo | 0:0dee8840a1c0 | 378 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 379 | */ |
einsteingustavo | 0:0dee8840a1c0 | 380 | |
einsteingustavo | 0:0dee8840a1c0 | 381 | #define IS_ADC_INJECTED_LENGTH(LENGTH) (((LENGTH) >= 0x1) && ((LENGTH) <= 0x4)) |
einsteingustavo | 0:0dee8840a1c0 | 382 | |
einsteingustavo | 0:0dee8840a1c0 | 383 | /** |
einsteingustavo | 0:0dee8840a1c0 | 384 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 385 | */ |
einsteingustavo | 0:0dee8840a1c0 | 386 | |
einsteingustavo | 0:0dee8840a1c0 | 387 | /** @defgroup ADC_injected_rank |
einsteingustavo | 0:0dee8840a1c0 | 388 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 389 | */ |
einsteingustavo | 0:0dee8840a1c0 | 390 | |
einsteingustavo | 0:0dee8840a1c0 | 391 | #define IS_ADC_INJECTED_RANK(RANK) (((RANK) >= 0x1) && ((RANK) <= 0x4)) |
einsteingustavo | 0:0dee8840a1c0 | 392 | |
einsteingustavo | 0:0dee8840a1c0 | 393 | /** |
einsteingustavo | 0:0dee8840a1c0 | 394 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 395 | */ |
einsteingustavo | 0:0dee8840a1c0 | 396 | |
einsteingustavo | 0:0dee8840a1c0 | 397 | |
einsteingustavo | 0:0dee8840a1c0 | 398 | /** @defgroup ADC_regular_length |
einsteingustavo | 0:0dee8840a1c0 | 399 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 400 | */ |
einsteingustavo | 0:0dee8840a1c0 | 401 | |
einsteingustavo | 0:0dee8840a1c0 | 402 | #define IS_ADC_REGULAR_LENGTH(LENGTH) (((LENGTH) >= 0x1) && ((LENGTH) <= 0x10)) |
einsteingustavo | 0:0dee8840a1c0 | 403 | /** |
einsteingustavo | 0:0dee8840a1c0 | 404 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 405 | */ |
einsteingustavo | 0:0dee8840a1c0 | 406 | |
einsteingustavo | 0:0dee8840a1c0 | 407 | /** @defgroup ADC_regular_rank |
einsteingustavo | 0:0dee8840a1c0 | 408 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 409 | */ |
einsteingustavo | 0:0dee8840a1c0 | 410 | |
einsteingustavo | 0:0dee8840a1c0 | 411 | #define IS_ADC_REGULAR_RANK(RANK) (((RANK) >= 0x1) && ((RANK) <= 0x10)) |
einsteingustavo | 0:0dee8840a1c0 | 412 | |
einsteingustavo | 0:0dee8840a1c0 | 413 | /** |
einsteingustavo | 0:0dee8840a1c0 | 414 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 415 | */ |
einsteingustavo | 0:0dee8840a1c0 | 416 | |
einsteingustavo | 0:0dee8840a1c0 | 417 | /** @defgroup ADC_regular_discontinuous_mode_number |
einsteingustavo | 0:0dee8840a1c0 | 418 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 419 | */ |
einsteingustavo | 0:0dee8840a1c0 | 420 | |
einsteingustavo | 0:0dee8840a1c0 | 421 | #define IS_ADC_REGULAR_DISC_NUMBER(NUMBER) (((NUMBER) >= 0x1) && ((NUMBER) <= 0x8)) |
einsteingustavo | 0:0dee8840a1c0 | 422 | |
einsteingustavo | 0:0dee8840a1c0 | 423 | /** |
einsteingustavo | 0:0dee8840a1c0 | 424 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 425 | */ |
einsteingustavo | 0:0dee8840a1c0 | 426 | |
einsteingustavo | 0:0dee8840a1c0 | 427 | /** |
einsteingustavo | 0:0dee8840a1c0 | 428 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 429 | */ |
einsteingustavo | 0:0dee8840a1c0 | 430 | |
einsteingustavo | 0:0dee8840a1c0 | 431 | /** @defgroup ADC_Exported_Macros |
einsteingustavo | 0:0dee8840a1c0 | 432 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 433 | */ |
einsteingustavo | 0:0dee8840a1c0 | 434 | |
einsteingustavo | 0:0dee8840a1c0 | 435 | /** |
einsteingustavo | 0:0dee8840a1c0 | 436 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 437 | */ |
einsteingustavo | 0:0dee8840a1c0 | 438 | |
einsteingustavo | 0:0dee8840a1c0 | 439 | /** @defgroup ADC_Exported_Functions |
einsteingustavo | 0:0dee8840a1c0 | 440 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 441 | */ |
einsteingustavo | 0:0dee8840a1c0 | 442 | |
einsteingustavo | 0:0dee8840a1c0 | 443 | void ADC_DeInit(ADC_TypeDef* ADCx); |
einsteingustavo | 0:0dee8840a1c0 | 444 | void ADC_Init(ADC_TypeDef* ADCx, ADC_InitTypeDef* ADC_InitStruct); |
einsteingustavo | 0:0dee8840a1c0 | 445 | void ADC_StructInit(ADC_InitTypeDef* ADC_InitStruct); |
einsteingustavo | 0:0dee8840a1c0 | 446 | void ADC_Cmd(ADC_TypeDef* ADCx, FunctionalState NewState); |
einsteingustavo | 0:0dee8840a1c0 | 447 | void ADC_DMACmd(ADC_TypeDef* ADCx, FunctionalState NewState); |
einsteingustavo | 0:0dee8840a1c0 | 448 | void ADC_ITConfig(ADC_TypeDef* ADCx, uint16_t ADC_IT, FunctionalState NewState); |
einsteingustavo | 0:0dee8840a1c0 | 449 | void ADC_ResetCalibration(ADC_TypeDef* ADCx); |
einsteingustavo | 0:0dee8840a1c0 | 450 | FlagStatus ADC_GetResetCalibrationStatus(ADC_TypeDef* ADCx); |
einsteingustavo | 0:0dee8840a1c0 | 451 | void ADC_StartCalibration(ADC_TypeDef* ADCx); |
einsteingustavo | 0:0dee8840a1c0 | 452 | FlagStatus ADC_GetCalibrationStatus(ADC_TypeDef* ADCx); |
einsteingustavo | 0:0dee8840a1c0 | 453 | void ADC_SoftwareStartConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState); |
einsteingustavo | 0:0dee8840a1c0 | 454 | FlagStatus ADC_GetSoftwareStartConvStatus(ADC_TypeDef* ADCx); |
einsteingustavo | 0:0dee8840a1c0 | 455 | void ADC_DiscModeChannelCountConfig(ADC_TypeDef* ADCx, uint8_t Number); |
einsteingustavo | 0:0dee8840a1c0 | 456 | void ADC_DiscModeCmd(ADC_TypeDef* ADCx, FunctionalState NewState); |
einsteingustavo | 0:0dee8840a1c0 | 457 | void ADC_RegularChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel, uint8_t Rank, uint8_t ADC_SampleTime); |
einsteingustavo | 0:0dee8840a1c0 | 458 | void ADC_ExternalTrigConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState); |
einsteingustavo | 0:0dee8840a1c0 | 459 | uint16_t ADC_GetConversionValue(ADC_TypeDef* ADCx); |
einsteingustavo | 0:0dee8840a1c0 | 460 | uint32_t ADC_GetDualModeConversionValue(void); |
einsteingustavo | 0:0dee8840a1c0 | 461 | void ADC_AutoInjectedConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState); |
einsteingustavo | 0:0dee8840a1c0 | 462 | void ADC_InjectedDiscModeCmd(ADC_TypeDef* ADCx, FunctionalState NewState); |
einsteingustavo | 0:0dee8840a1c0 | 463 | void ADC_ExternalTrigInjectedConvConfig(ADC_TypeDef* ADCx, uint32_t ADC_ExternalTrigInjecConv); |
einsteingustavo | 0:0dee8840a1c0 | 464 | void ADC_ExternalTrigInjectedConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState); |
einsteingustavo | 0:0dee8840a1c0 | 465 | void ADC_SoftwareStartInjectedConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState); |
einsteingustavo | 0:0dee8840a1c0 | 466 | FlagStatus ADC_GetSoftwareStartInjectedConvCmdStatus(ADC_TypeDef* ADCx); |
einsteingustavo | 0:0dee8840a1c0 | 467 | void ADC_InjectedChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel, uint8_t Rank, uint8_t ADC_SampleTime); |
einsteingustavo | 0:0dee8840a1c0 | 468 | void ADC_InjectedSequencerLengthConfig(ADC_TypeDef* ADCx, uint8_t Length); |
einsteingustavo | 0:0dee8840a1c0 | 469 | void ADC_SetInjectedOffset(ADC_TypeDef* ADCx, uint8_t ADC_InjectedChannel, uint16_t Offset); |
einsteingustavo | 0:0dee8840a1c0 | 470 | uint16_t ADC_GetInjectedConversionValue(ADC_TypeDef* ADCx, uint8_t ADC_InjectedChannel); |
einsteingustavo | 0:0dee8840a1c0 | 471 | void ADC_AnalogWatchdogCmd(ADC_TypeDef* ADCx, uint32_t ADC_AnalogWatchdog); |
einsteingustavo | 0:0dee8840a1c0 | 472 | void ADC_AnalogWatchdogThresholdsConfig(ADC_TypeDef* ADCx, uint16_t HighThreshold, uint16_t LowThreshold); |
einsteingustavo | 0:0dee8840a1c0 | 473 | void ADC_AnalogWatchdogSingleChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel); |
einsteingustavo | 0:0dee8840a1c0 | 474 | void ADC_TempSensorVrefintCmd(FunctionalState NewState); |
einsteingustavo | 0:0dee8840a1c0 | 475 | FlagStatus ADC_GetFlagStatus(ADC_TypeDef* ADCx, uint8_t ADC_FLAG); |
einsteingustavo | 0:0dee8840a1c0 | 476 | void ADC_ClearFlag(ADC_TypeDef* ADCx, uint8_t ADC_FLAG); |
einsteingustavo | 0:0dee8840a1c0 | 477 | ITStatus ADC_GetITStatus(ADC_TypeDef* ADCx, uint16_t ADC_IT); |
einsteingustavo | 0:0dee8840a1c0 | 478 | void ADC_ClearITPendingBit(ADC_TypeDef* ADCx, uint16_t ADC_IT); |
einsteingustavo | 0:0dee8840a1c0 | 479 | |
einsteingustavo | 0:0dee8840a1c0 | 480 | #ifdef __cplusplus |
einsteingustavo | 0:0dee8840a1c0 | 481 | } |
einsteingustavo | 0:0dee8840a1c0 | 482 | #endif |
einsteingustavo | 0:0dee8840a1c0 | 483 | |
einsteingustavo | 0:0dee8840a1c0 | 484 | #endif /*__STM32F10x_ADC_H */ |
einsteingustavo | 0:0dee8840a1c0 | 485 | |
einsteingustavo | 0:0dee8840a1c0 | 486 | /** |
einsteingustavo | 0:0dee8840a1c0 | 487 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 488 | */ |
einsteingustavo | 0:0dee8840a1c0 | 489 | |
einsteingustavo | 0:0dee8840a1c0 | 490 | /** |
einsteingustavo | 0:0dee8840a1c0 | 491 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 492 | */ |
einsteingustavo | 0:0dee8840a1c0 | 493 | |
einsteingustavo | 0:0dee8840a1c0 | 494 | /** |
einsteingustavo | 0:0dee8840a1c0 | 495 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 496 | */ |
einsteingustavo | 0:0dee8840a1c0 | 497 | |
einsteingustavo | 0:0dee8840a1c0 | 498 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
einsteingustavo | 0:0dee8840a1c0 | 499 |