The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
TARGET_EFM32GG_STK3700/TOOLCHAIN_ARM_MICRO/em_adc.h@171:3a7713b1edbc, 2018-11-08 (annotated)
- Committer:
- AnnaBridge
- Date:
- Thu Nov 08 11:45:42 2018 +0000
- Revision:
- 171:3a7713b1edbc
- Parent:
- TARGET_EFM32GG11_STK3701/TARGET_Silicon_Labs/TARGET_EFM32/emlib/inc/em_adc.h@170:e95d10626187
mbed library. Release version 164
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AnnaBridge | 170:e95d10626187 | 1 | /***************************************************************************//** |
AnnaBridge | 170:e95d10626187 | 2 | * @file em_adc.h |
AnnaBridge | 170:e95d10626187 | 3 | * @brief Analog to Digital Converter (ADC) peripheral API |
AnnaBridge | 170:e95d10626187 | 4 | * @version 5.3.3 |
AnnaBridge | 170:e95d10626187 | 5 | ******************************************************************************* |
AnnaBridge | 170:e95d10626187 | 6 | * # License |
AnnaBridge | 170:e95d10626187 | 7 | * <b>Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com</b> |
AnnaBridge | 170:e95d10626187 | 8 | ******************************************************************************* |
AnnaBridge | 170:e95d10626187 | 9 | * |
AnnaBridge | 170:e95d10626187 | 10 | * Permission is granted to anyone to use this software for any purpose, |
AnnaBridge | 170:e95d10626187 | 11 | * including commercial applications, and to alter it and redistribute it |
AnnaBridge | 170:e95d10626187 | 12 | * freely, subject to the following restrictions: |
AnnaBridge | 170:e95d10626187 | 13 | * |
AnnaBridge | 170:e95d10626187 | 14 | * 1. The origin of this software must not be misrepresented; you must not |
AnnaBridge | 170:e95d10626187 | 15 | * claim that you wrote the original software. |
AnnaBridge | 170:e95d10626187 | 16 | * 2. Altered source versions must be plainly marked as such, and must not be |
AnnaBridge | 170:e95d10626187 | 17 | * misrepresented as being the original software. |
AnnaBridge | 170:e95d10626187 | 18 | * 3. This notice may not be removed or altered from any source distribution. |
AnnaBridge | 170:e95d10626187 | 19 | * |
AnnaBridge | 170:e95d10626187 | 20 | * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Labs has no |
AnnaBridge | 170:e95d10626187 | 21 | * obligation to support this Software. Silicon Labs is providing the |
AnnaBridge | 170:e95d10626187 | 22 | * Software "AS IS", with no express or implied warranties of any kind, |
AnnaBridge | 170:e95d10626187 | 23 | * including, but not limited to, any implied warranties of merchantability |
AnnaBridge | 170:e95d10626187 | 24 | * or fitness for any particular purpose or warranties against infringement |
AnnaBridge | 170:e95d10626187 | 25 | * of any proprietary rights of a third party. |
AnnaBridge | 170:e95d10626187 | 26 | * |
AnnaBridge | 170:e95d10626187 | 27 | * Silicon Labs will not be liable for any consequential, incidental, or |
AnnaBridge | 170:e95d10626187 | 28 | * special damages, or any other relief, or for any claim by any third party, |
AnnaBridge | 170:e95d10626187 | 29 | * arising from your use of this Software. |
AnnaBridge | 170:e95d10626187 | 30 | * |
AnnaBridge | 170:e95d10626187 | 31 | ******************************************************************************/ |
AnnaBridge | 170:e95d10626187 | 32 | |
AnnaBridge | 170:e95d10626187 | 33 | #ifndef EM_ADC_H |
AnnaBridge | 170:e95d10626187 | 34 | #define EM_ADC_H |
AnnaBridge | 170:e95d10626187 | 35 | |
AnnaBridge | 170:e95d10626187 | 36 | #include "em_device.h" |
AnnaBridge | 170:e95d10626187 | 37 | #if defined(ADC_COUNT) && (ADC_COUNT > 0) |
AnnaBridge | 170:e95d10626187 | 38 | |
AnnaBridge | 170:e95d10626187 | 39 | #include <stdbool.h> |
AnnaBridge | 170:e95d10626187 | 40 | |
AnnaBridge | 170:e95d10626187 | 41 | #ifdef __cplusplus |
AnnaBridge | 170:e95d10626187 | 42 | extern "C" { |
AnnaBridge | 170:e95d10626187 | 43 | #endif |
AnnaBridge | 170:e95d10626187 | 44 | |
AnnaBridge | 170:e95d10626187 | 45 | /***************************************************************************//** |
AnnaBridge | 170:e95d10626187 | 46 | * @addtogroup emlib |
AnnaBridge | 170:e95d10626187 | 47 | * @{ |
AnnaBridge | 170:e95d10626187 | 48 | ******************************************************************************/ |
AnnaBridge | 170:e95d10626187 | 49 | |
AnnaBridge | 170:e95d10626187 | 50 | /***************************************************************************//** |
AnnaBridge | 170:e95d10626187 | 51 | * @addtogroup ADC |
AnnaBridge | 170:e95d10626187 | 52 | * @{ |
AnnaBridge | 170:e95d10626187 | 53 | ******************************************************************************/ |
AnnaBridge | 170:e95d10626187 | 54 | |
AnnaBridge | 170:e95d10626187 | 55 | /******************************************************************************* |
AnnaBridge | 170:e95d10626187 | 56 | ******************************** ENUMS ************************************ |
AnnaBridge | 170:e95d10626187 | 57 | ******************************************************************************/ |
AnnaBridge | 170:e95d10626187 | 58 | |
AnnaBridge | 170:e95d10626187 | 59 | /** Acquisition time (in ADC clock cycles). */ |
AnnaBridge | 170:e95d10626187 | 60 | typedef enum { |
AnnaBridge | 170:e95d10626187 | 61 | adcAcqTime1 = _ADC_SINGLECTRL_AT_1CYCLE, /**< 1 clock cycle. */ |
AnnaBridge | 170:e95d10626187 | 62 | adcAcqTime2 = _ADC_SINGLECTRL_AT_2CYCLES, /**< 2 clock cycles. */ |
AnnaBridge | 170:e95d10626187 | 63 | adcAcqTime4 = _ADC_SINGLECTRL_AT_4CYCLES, /**< 4 clock cycles. */ |
AnnaBridge | 170:e95d10626187 | 64 | adcAcqTime8 = _ADC_SINGLECTRL_AT_8CYCLES, /**< 8 clock cycles. */ |
AnnaBridge | 170:e95d10626187 | 65 | adcAcqTime16 = _ADC_SINGLECTRL_AT_16CYCLES, /**< 16 clock cycles. */ |
AnnaBridge | 170:e95d10626187 | 66 | adcAcqTime32 = _ADC_SINGLECTRL_AT_32CYCLES, /**< 32 clock cycles. */ |
AnnaBridge | 170:e95d10626187 | 67 | adcAcqTime64 = _ADC_SINGLECTRL_AT_64CYCLES, /**< 64 clock cycles. */ |
AnnaBridge | 170:e95d10626187 | 68 | adcAcqTime128 = _ADC_SINGLECTRL_AT_128CYCLES, /**< 128 clock cycles. */ |
AnnaBridge | 170:e95d10626187 | 69 | adcAcqTime256 = _ADC_SINGLECTRL_AT_256CYCLES /**< 256 clock cycles. */ |
AnnaBridge | 170:e95d10626187 | 70 | } ADC_AcqTime_TypeDef; |
AnnaBridge | 170:e95d10626187 | 71 | |
AnnaBridge | 170:e95d10626187 | 72 | #if defined(_ADC_CTRL_LPFMODE_MASK) |
AnnaBridge | 170:e95d10626187 | 73 | /** Lowpass filter mode. */ |
AnnaBridge | 170:e95d10626187 | 74 | typedef enum { |
AnnaBridge | 170:e95d10626187 | 75 | /** No filter or decoupling capacitor. */ |
AnnaBridge | 170:e95d10626187 | 76 | adcLPFilterBypass = _ADC_CTRL_LPFMODE_BYPASS, |
AnnaBridge | 170:e95d10626187 | 77 | |
AnnaBridge | 170:e95d10626187 | 78 | /** On-chip RC filter. */ |
AnnaBridge | 170:e95d10626187 | 79 | adcLPFilterRC = _ADC_CTRL_LPFMODE_RCFILT, |
AnnaBridge | 170:e95d10626187 | 80 | |
AnnaBridge | 170:e95d10626187 | 81 | /** On-chip decoupling capacitor. */ |
AnnaBridge | 170:e95d10626187 | 82 | adcLPFilterDeCap = _ADC_CTRL_LPFMODE_DECAP |
AnnaBridge | 170:e95d10626187 | 83 | } ADC_LPFilter_TypeDef; |
AnnaBridge | 170:e95d10626187 | 84 | #endif |
AnnaBridge | 170:e95d10626187 | 85 | |
AnnaBridge | 170:e95d10626187 | 86 | /** Oversample rate select. */ |
AnnaBridge | 170:e95d10626187 | 87 | typedef enum { |
AnnaBridge | 170:e95d10626187 | 88 | /** 2 samples per conversion result. */ |
AnnaBridge | 170:e95d10626187 | 89 | adcOvsRateSel2 = _ADC_CTRL_OVSRSEL_X2, |
AnnaBridge | 170:e95d10626187 | 90 | |
AnnaBridge | 170:e95d10626187 | 91 | /** 4 samples per conversion result. */ |
AnnaBridge | 170:e95d10626187 | 92 | adcOvsRateSel4 = _ADC_CTRL_OVSRSEL_X4, |
AnnaBridge | 170:e95d10626187 | 93 | |
AnnaBridge | 170:e95d10626187 | 94 | /** 8 samples per conversion result. */ |
AnnaBridge | 170:e95d10626187 | 95 | adcOvsRateSel8 = _ADC_CTRL_OVSRSEL_X8, |
AnnaBridge | 170:e95d10626187 | 96 | |
AnnaBridge | 170:e95d10626187 | 97 | /** 16 samples per conversion result. */ |
AnnaBridge | 170:e95d10626187 | 98 | adcOvsRateSel16 = _ADC_CTRL_OVSRSEL_X16, |
AnnaBridge | 170:e95d10626187 | 99 | |
AnnaBridge | 170:e95d10626187 | 100 | /** 32 samples per conversion result. */ |
AnnaBridge | 170:e95d10626187 | 101 | adcOvsRateSel32 = _ADC_CTRL_OVSRSEL_X32, |
AnnaBridge | 170:e95d10626187 | 102 | |
AnnaBridge | 170:e95d10626187 | 103 | /** 64 samples per conversion result. */ |
AnnaBridge | 170:e95d10626187 | 104 | adcOvsRateSel64 = _ADC_CTRL_OVSRSEL_X64, |
AnnaBridge | 170:e95d10626187 | 105 | |
AnnaBridge | 170:e95d10626187 | 106 | /** 128 samples per conversion result. */ |
AnnaBridge | 170:e95d10626187 | 107 | adcOvsRateSel128 = _ADC_CTRL_OVSRSEL_X128, |
AnnaBridge | 170:e95d10626187 | 108 | |
AnnaBridge | 170:e95d10626187 | 109 | /** 256 samples per conversion result. */ |
AnnaBridge | 170:e95d10626187 | 110 | adcOvsRateSel256 = _ADC_CTRL_OVSRSEL_X256, |
AnnaBridge | 170:e95d10626187 | 111 | |
AnnaBridge | 170:e95d10626187 | 112 | /** 512 samples per conversion result. */ |
AnnaBridge | 170:e95d10626187 | 113 | adcOvsRateSel512 = _ADC_CTRL_OVSRSEL_X512, |
AnnaBridge | 170:e95d10626187 | 114 | |
AnnaBridge | 170:e95d10626187 | 115 | /** 1024 samples per conversion result. */ |
AnnaBridge | 170:e95d10626187 | 116 | adcOvsRateSel1024 = _ADC_CTRL_OVSRSEL_X1024, |
AnnaBridge | 170:e95d10626187 | 117 | |
AnnaBridge | 170:e95d10626187 | 118 | /** 2048 samples per conversion result. */ |
AnnaBridge | 170:e95d10626187 | 119 | adcOvsRateSel2048 = _ADC_CTRL_OVSRSEL_X2048, |
AnnaBridge | 170:e95d10626187 | 120 | |
AnnaBridge | 170:e95d10626187 | 121 | /** 4096 samples per conversion result. */ |
AnnaBridge | 170:e95d10626187 | 122 | adcOvsRateSel4096 = _ADC_CTRL_OVSRSEL_X4096 |
AnnaBridge | 170:e95d10626187 | 123 | } ADC_OvsRateSel_TypeDef; |
AnnaBridge | 170:e95d10626187 | 124 | |
AnnaBridge | 170:e95d10626187 | 125 | /** Peripheral Reflex System signal used to trigger single sample. */ |
AnnaBridge | 170:e95d10626187 | 126 | typedef enum { |
AnnaBridge | 170:e95d10626187 | 127 | #if defined(_ADC_SINGLECTRL_PRSSEL_MASK) |
AnnaBridge | 170:e95d10626187 | 128 | adcPRSSELCh0 = _ADC_SINGLECTRL_PRSSEL_PRSCH0, /**< PRS channel 0. */ |
AnnaBridge | 170:e95d10626187 | 129 | adcPRSSELCh1 = _ADC_SINGLECTRL_PRSSEL_PRSCH1, /**< PRS channel 1. */ |
AnnaBridge | 170:e95d10626187 | 130 | adcPRSSELCh2 = _ADC_SINGLECTRL_PRSSEL_PRSCH2, /**< PRS channel 2. */ |
AnnaBridge | 170:e95d10626187 | 131 | adcPRSSELCh3 = _ADC_SINGLECTRL_PRSSEL_PRSCH3, /**< PRS channel 3. */ |
AnnaBridge | 170:e95d10626187 | 132 | #if defined(_ADC_SINGLECTRL_PRSSEL_PRSCH4) |
AnnaBridge | 170:e95d10626187 | 133 | adcPRSSELCh4 = _ADC_SINGLECTRL_PRSSEL_PRSCH4, /**< PRS channel 4. */ |
AnnaBridge | 170:e95d10626187 | 134 | #endif |
AnnaBridge | 170:e95d10626187 | 135 | #if defined(_ADC_SINGLECTRL_PRSSEL_PRSCH5) |
AnnaBridge | 170:e95d10626187 | 136 | adcPRSSELCh5 = _ADC_SINGLECTRL_PRSSEL_PRSCH5, /**< PRS channel 5. */ |
AnnaBridge | 170:e95d10626187 | 137 | #endif |
AnnaBridge | 170:e95d10626187 | 138 | #if defined(_ADC_SINGLECTRL_PRSSEL_PRSCH6) |
AnnaBridge | 170:e95d10626187 | 139 | adcPRSSELCh6 = _ADC_SINGLECTRL_PRSSEL_PRSCH6, /**< PRS channel 6. */ |
AnnaBridge | 170:e95d10626187 | 140 | #endif |
AnnaBridge | 170:e95d10626187 | 141 | #if defined(_ADC_SINGLECTRL_PRSSEL_PRSCH7) |
AnnaBridge | 170:e95d10626187 | 142 | adcPRSSELCh7 = _ADC_SINGLECTRL_PRSSEL_PRSCH7, /**< PRS channel 7. */ |
AnnaBridge | 170:e95d10626187 | 143 | #endif |
AnnaBridge | 170:e95d10626187 | 144 | #if defined(_ADC_SINGLECTRL_PRSSEL_PRSCH8) |
AnnaBridge | 170:e95d10626187 | 145 | adcPRSSELCh8 = _ADC_SINGLECTRL_PRSSEL_PRSCH8, /**< PRS channel 8. */ |
AnnaBridge | 170:e95d10626187 | 146 | #endif |
AnnaBridge | 170:e95d10626187 | 147 | #if defined(_ADC_SINGLECTRL_PRSSEL_PRSCH9) |
AnnaBridge | 170:e95d10626187 | 148 | adcPRSSELCh9 = _ADC_SINGLECTRL_PRSSEL_PRSCH9, /**< PRS channel 9. */ |
AnnaBridge | 170:e95d10626187 | 149 | #endif |
AnnaBridge | 170:e95d10626187 | 150 | #if defined(_ADC_SINGLECTRL_PRSSEL_PRSCH10) |
AnnaBridge | 170:e95d10626187 | 151 | adcPRSSELCh10 = _ADC_SINGLECTRL_PRSSEL_PRSCH10, /**< PRS channel 10. */ |
AnnaBridge | 170:e95d10626187 | 152 | #endif |
AnnaBridge | 170:e95d10626187 | 153 | #if defined(_ADC_SINGLECTRL_PRSSEL_PRSCH11) |
AnnaBridge | 170:e95d10626187 | 154 | adcPRSSELCh11 = _ADC_SINGLECTRL_PRSSEL_PRSCH11, /**< PRS channel 11. */ |
AnnaBridge | 170:e95d10626187 | 155 | #endif |
AnnaBridge | 170:e95d10626187 | 156 | #elif defined(_ADC_SINGLECTRLX_PRSSEL_MASK) |
AnnaBridge | 170:e95d10626187 | 157 | adcPRSSELCh0 = _ADC_SINGLECTRLX_PRSSEL_PRSCH0, /**< PRS channel 0. */ |
AnnaBridge | 170:e95d10626187 | 158 | adcPRSSELCh1 = _ADC_SINGLECTRLX_PRSSEL_PRSCH1, /**< PRS channel 1. */ |
AnnaBridge | 170:e95d10626187 | 159 | adcPRSSELCh2 = _ADC_SINGLECTRLX_PRSSEL_PRSCH2, /**< PRS channel 2. */ |
AnnaBridge | 170:e95d10626187 | 160 | adcPRSSELCh3 = _ADC_SINGLECTRLX_PRSSEL_PRSCH3, /**< PRS channel 3. */ |
AnnaBridge | 170:e95d10626187 | 161 | adcPRSSELCh4 = _ADC_SINGLECTRLX_PRSSEL_PRSCH4, /**< PRS channel 4. */ |
AnnaBridge | 170:e95d10626187 | 162 | adcPRSSELCh5 = _ADC_SINGLECTRLX_PRSSEL_PRSCH5, /**< PRS channel 5. */ |
AnnaBridge | 170:e95d10626187 | 163 | adcPRSSELCh6 = _ADC_SINGLECTRLX_PRSSEL_PRSCH6, /**< PRS channel 6. */ |
AnnaBridge | 170:e95d10626187 | 164 | adcPRSSELCh7 = _ADC_SINGLECTRLX_PRSSEL_PRSCH7, /**< PRS channel 7. */ |
AnnaBridge | 170:e95d10626187 | 165 | #if defined(_ADC_SINGLECTRLX_PRSSEL_PRSCH8) |
AnnaBridge | 170:e95d10626187 | 166 | adcPRSSELCh8 = _ADC_SINGLECTRLX_PRSSEL_PRSCH8, /**< PRS channel 8. */ |
AnnaBridge | 170:e95d10626187 | 167 | #endif |
AnnaBridge | 170:e95d10626187 | 168 | #if defined(_ADC_SINGLECTRLX_PRSSEL_PRSCH9) |
AnnaBridge | 170:e95d10626187 | 169 | adcPRSSELCh9 = _ADC_SINGLECTRLX_PRSSEL_PRSCH9, /**< PRS channel 9. */ |
AnnaBridge | 170:e95d10626187 | 170 | #endif |
AnnaBridge | 170:e95d10626187 | 171 | #if defined(_ADC_SINGLECTRLX_PRSSEL_PRSCH10) |
AnnaBridge | 170:e95d10626187 | 172 | adcPRSSELCh10 = _ADC_SINGLECTRLX_PRSSEL_PRSCH10, /**< PRS channel 10. */ |
AnnaBridge | 170:e95d10626187 | 173 | #endif |
AnnaBridge | 170:e95d10626187 | 174 | #if defined(_ADC_SINGLECTRLX_PRSSEL_PRSCH11) |
AnnaBridge | 170:e95d10626187 | 175 | adcPRSSELCh11 = _ADC_SINGLECTRLX_PRSSEL_PRSCH11, /**< PRS channel 11. */ |
AnnaBridge | 170:e95d10626187 | 176 | #endif |
AnnaBridge | 170:e95d10626187 | 177 | #if defined(_ADC_SINGLECTRLX_PRSSEL_PRSCH12) |
AnnaBridge | 170:e95d10626187 | 178 | adcPRSSELCh12 = _ADC_SINGLECTRLX_PRSSEL_PRSCH12, /**< PRS channel 12. */ |
AnnaBridge | 170:e95d10626187 | 179 | adcPRSSELCh13 = _ADC_SINGLECTRLX_PRSSEL_PRSCH13, /**< PRS channel 13. */ |
AnnaBridge | 170:e95d10626187 | 180 | adcPRSSELCh14 = _ADC_SINGLECTRLX_PRSSEL_PRSCH14, /**< PRS channel 14. */ |
AnnaBridge | 170:e95d10626187 | 181 | adcPRSSELCh15 = _ADC_SINGLECTRLX_PRSSEL_PRSCH15, /**< PRS channel 15. */ |
AnnaBridge | 170:e95d10626187 | 182 | #endif |
AnnaBridge | 170:e95d10626187 | 183 | #endif |
AnnaBridge | 170:e95d10626187 | 184 | } ADC_PRSSEL_TypeDef; |
AnnaBridge | 170:e95d10626187 | 185 | |
AnnaBridge | 170:e95d10626187 | 186 | /** Single and scan mode voltage references. Using unshifted enums and or |
AnnaBridge | 170:e95d10626187 | 187 | in ADC_CTRLX_VREFSEL_REG to select the extension register CTRLX_VREFSEL. */ |
AnnaBridge | 170:e95d10626187 | 188 | #if defined(_ADC_SCANCTRLX_VREFSEL_MASK) |
AnnaBridge | 170:e95d10626187 | 189 | #define ADC_CTRLX_VREFSEL_REG 0x80 |
AnnaBridge | 170:e95d10626187 | 190 | #endif |
AnnaBridge | 170:e95d10626187 | 191 | typedef enum { |
AnnaBridge | 170:e95d10626187 | 192 | /** Internal 1.25V reference. */ |
AnnaBridge | 170:e95d10626187 | 193 | adcRef1V25 = _ADC_SINGLECTRL_REF_1V25, |
AnnaBridge | 170:e95d10626187 | 194 | |
AnnaBridge | 170:e95d10626187 | 195 | /** Internal 2.5V reference. */ |
AnnaBridge | 170:e95d10626187 | 196 | adcRef2V5 = _ADC_SINGLECTRL_REF_2V5, |
AnnaBridge | 170:e95d10626187 | 197 | |
AnnaBridge | 170:e95d10626187 | 198 | /** Buffered VDD. */ |
AnnaBridge | 170:e95d10626187 | 199 | adcRefVDD = _ADC_SINGLECTRL_REF_VDD, |
AnnaBridge | 170:e95d10626187 | 200 | |
AnnaBridge | 170:e95d10626187 | 201 | #if defined(_ADC_SINGLECTRL_REF_5VDIFF) |
AnnaBridge | 170:e95d10626187 | 202 | /** Internal differential 5V reference. */ |
AnnaBridge | 170:e95d10626187 | 203 | adcRef5VDIFF = _ADC_SINGLECTRL_REF_5VDIFF, |
AnnaBridge | 170:e95d10626187 | 204 | #endif |
AnnaBridge | 170:e95d10626187 | 205 | |
AnnaBridge | 170:e95d10626187 | 206 | #if defined(_ADC_SINGLECTRL_REF_5V) |
AnnaBridge | 170:e95d10626187 | 207 | /** Internal 5V reference. */ |
AnnaBridge | 170:e95d10626187 | 208 | adcRef5V = _ADC_SINGLECTRL_REF_5V, |
AnnaBridge | 170:e95d10626187 | 209 | #endif |
AnnaBridge | 170:e95d10626187 | 210 | |
AnnaBridge | 170:e95d10626187 | 211 | /** Single ended external reference from pin 6. */ |
AnnaBridge | 170:e95d10626187 | 212 | adcRefExtSingle = _ADC_SINGLECTRL_REF_EXTSINGLE, |
AnnaBridge | 170:e95d10626187 | 213 | |
AnnaBridge | 170:e95d10626187 | 214 | /** Differential external reference from pin 6 and 7. */ |
AnnaBridge | 170:e95d10626187 | 215 | adcRef2xExtDiff = _ADC_SINGLECTRL_REF_2XEXTDIFF, |
AnnaBridge | 170:e95d10626187 | 216 | |
AnnaBridge | 170:e95d10626187 | 217 | /** Unbuffered 2xVDD. */ |
AnnaBridge | 170:e95d10626187 | 218 | adcRef2xVDD = _ADC_SINGLECTRL_REF_2XVDD, |
AnnaBridge | 170:e95d10626187 | 219 | |
AnnaBridge | 170:e95d10626187 | 220 | #if defined(_ADC_SINGLECTRLX_VREFSEL_VBGR) |
AnnaBridge | 170:e95d10626187 | 221 | /** Custom VFS: Internal Bandgap reference */ |
AnnaBridge | 170:e95d10626187 | 222 | adcRefVBGR = _ADC_SINGLECTRLX_VREFSEL_VBGR | ADC_CTRLX_VREFSEL_REG, |
AnnaBridge | 170:e95d10626187 | 223 | #endif |
AnnaBridge | 170:e95d10626187 | 224 | |
AnnaBridge | 170:e95d10626187 | 225 | #if defined(_ADC_SINGLECTRLX_VREFSEL_VDDXWATT) |
AnnaBridge | 170:e95d10626187 | 226 | /** Custom VFS: Scaled AVDD: AVDD * VREFATT */ |
AnnaBridge | 170:e95d10626187 | 227 | adcRefVddxAtt = _ADC_SINGLECTRLX_VREFSEL_VDDXWATT | ADC_CTRLX_VREFSEL_REG, |
AnnaBridge | 170:e95d10626187 | 228 | #endif |
AnnaBridge | 170:e95d10626187 | 229 | |
AnnaBridge | 170:e95d10626187 | 230 | #if defined(_ADC_SINGLECTRLX_VREFSEL_VREFPWATT) |
AnnaBridge | 170:e95d10626187 | 231 | /** Custom VFS: Scaled singled ended external reference from pin 6: |
AnnaBridge | 170:e95d10626187 | 232 | VREFP * VREFATT */ |
AnnaBridge | 170:e95d10626187 | 233 | adcRefVPxAtt = _ADC_SINGLECTRLX_VREFSEL_VREFPWATT | ADC_CTRLX_VREFSEL_REG, |
AnnaBridge | 170:e95d10626187 | 234 | #endif |
AnnaBridge | 170:e95d10626187 | 235 | |
AnnaBridge | 170:e95d10626187 | 236 | #if defined(_ADC_SINGLECTRLX_VREFSEL_VREFP) |
AnnaBridge | 170:e95d10626187 | 237 | /** Custom VFS: Raw single ended external reference from pin 6. */ |
AnnaBridge | 170:e95d10626187 | 238 | adcRefP = _ADC_SINGLECTRLX_VREFSEL_VREFP | ADC_CTRLX_VREFSEL_REG, |
AnnaBridge | 170:e95d10626187 | 239 | #endif |
AnnaBridge | 170:e95d10626187 | 240 | |
AnnaBridge | 170:e95d10626187 | 241 | #if defined(_ADC_SINGLECTRLX_VREFSEL_VENTROPY) |
AnnaBridge | 170:e95d10626187 | 242 | /** Custom VFS: Special mode for entropy generation */ |
AnnaBridge | 170:e95d10626187 | 243 | adcRefVEntropy = _ADC_SINGLECTRLX_VREFSEL_VENTROPY | ADC_CTRLX_VREFSEL_REG, |
AnnaBridge | 170:e95d10626187 | 244 | #endif |
AnnaBridge | 170:e95d10626187 | 245 | |
AnnaBridge | 170:e95d10626187 | 246 | #if defined(_ADC_SINGLECTRLX_VREFSEL_VREFPNWATT) |
AnnaBridge | 170:e95d10626187 | 247 | /** Custom VFS: Scaled differential external Vref from pin 6 and 7: |
AnnaBridge | 170:e95d10626187 | 248 | (VREFP - VREFN) * VREFATT */ |
AnnaBridge | 170:e95d10626187 | 249 | adcRefVPNxAtt = _ADC_SINGLECTRLX_VREFSEL_VREFPNWATT | ADC_CTRLX_VREFSEL_REG, |
AnnaBridge | 170:e95d10626187 | 250 | #endif |
AnnaBridge | 170:e95d10626187 | 251 | |
AnnaBridge | 170:e95d10626187 | 252 | #if defined(_ADC_SINGLECTRLX_VREFSEL_VREFPN) |
AnnaBridge | 170:e95d10626187 | 253 | /** Custom VFS: Raw differential external Vref from pin 6 and 7: |
AnnaBridge | 170:e95d10626187 | 254 | VREFP - VREFN */ |
AnnaBridge | 170:e95d10626187 | 255 | adcRefPN = _ADC_SINGLECTRLX_VREFSEL_VREFPN | ADC_CTRLX_VREFSEL_REG, |
AnnaBridge | 170:e95d10626187 | 256 | #endif |
AnnaBridge | 170:e95d10626187 | 257 | } ADC_Ref_TypeDef; |
AnnaBridge | 170:e95d10626187 | 258 | |
AnnaBridge | 170:e95d10626187 | 259 | /** @cond DO_NOT_INCLUDE_WITH_DOXYGEN */ |
AnnaBridge | 170:e95d10626187 | 260 | /* Deprecated enum names */ |
AnnaBridge | 170:e95d10626187 | 261 | #if !defined(_ADC_SINGLECTRL_REF_5VDIFF) |
AnnaBridge | 170:e95d10626187 | 262 | #define adcRef5VDIFF adcRef5V |
AnnaBridge | 170:e95d10626187 | 263 | #endif |
AnnaBridge | 170:e95d10626187 | 264 | /** @endcond */ |
AnnaBridge | 170:e95d10626187 | 265 | |
AnnaBridge | 170:e95d10626187 | 266 | /** Sample resolution. */ |
AnnaBridge | 170:e95d10626187 | 267 | typedef enum { |
AnnaBridge | 170:e95d10626187 | 268 | adcRes12Bit = _ADC_SINGLECTRL_RES_12BIT, /**< 12 bit sampling. */ |
AnnaBridge | 170:e95d10626187 | 269 | adcRes8Bit = _ADC_SINGLECTRL_RES_8BIT, /**< 8 bit sampling. */ |
AnnaBridge | 170:e95d10626187 | 270 | adcRes6Bit = _ADC_SINGLECTRL_RES_6BIT, /**< 6 bit sampling. */ |
AnnaBridge | 170:e95d10626187 | 271 | adcResOVS = _ADC_SINGLECTRL_RES_OVS /**< Oversampling. */ |
AnnaBridge | 170:e95d10626187 | 272 | } ADC_Res_TypeDef; |
AnnaBridge | 170:e95d10626187 | 273 | |
AnnaBridge | 170:e95d10626187 | 274 | #if defined(_ADC_SINGLECTRL_INPUTSEL_MASK) |
AnnaBridge | 170:e95d10626187 | 275 | /** Single sample input selection. */ |
AnnaBridge | 170:e95d10626187 | 276 | typedef enum { |
AnnaBridge | 170:e95d10626187 | 277 | /* Differential mode disabled */ |
AnnaBridge | 170:e95d10626187 | 278 | adcSingleInputCh0 = _ADC_SINGLECTRL_INPUTSEL_CH0, /**< Channel 0. */ |
AnnaBridge | 170:e95d10626187 | 279 | adcSingleInputCh1 = _ADC_SINGLECTRL_INPUTSEL_CH1, /**< Channel 1. */ |
AnnaBridge | 170:e95d10626187 | 280 | adcSingleInputCh2 = _ADC_SINGLECTRL_INPUTSEL_CH2, /**< Channel 2. */ |
AnnaBridge | 170:e95d10626187 | 281 | adcSingleInputCh3 = _ADC_SINGLECTRL_INPUTSEL_CH3, /**< Channel 3. */ |
AnnaBridge | 170:e95d10626187 | 282 | adcSingleInputCh4 = _ADC_SINGLECTRL_INPUTSEL_CH4, /**< Channel 4. */ |
AnnaBridge | 170:e95d10626187 | 283 | adcSingleInputCh5 = _ADC_SINGLECTRL_INPUTSEL_CH5, /**< Channel 5. */ |
AnnaBridge | 170:e95d10626187 | 284 | adcSingleInputCh6 = _ADC_SINGLECTRL_INPUTSEL_CH6, /**< Channel 6. */ |
AnnaBridge | 170:e95d10626187 | 285 | adcSingleInputCh7 = _ADC_SINGLECTRL_INPUTSEL_CH7, /**< Channel 7. */ |
AnnaBridge | 170:e95d10626187 | 286 | adcSingleInputTemp = _ADC_SINGLECTRL_INPUTSEL_TEMP, /**< Temperature reference. */ |
AnnaBridge | 170:e95d10626187 | 287 | adcSingleInputVDDDiv3 = _ADC_SINGLECTRL_INPUTSEL_VDDDIV3, /**< VDD divided by 3. */ |
AnnaBridge | 170:e95d10626187 | 288 | adcSingleInputVDD = _ADC_SINGLECTRL_INPUTSEL_VDD, /**< VDD. */ |
AnnaBridge | 170:e95d10626187 | 289 | adcSingleInputVSS = _ADC_SINGLECTRL_INPUTSEL_VSS, /**< VSS. */ |
AnnaBridge | 170:e95d10626187 | 290 | adcSingleInputVrefDiv2 = _ADC_SINGLECTRL_INPUTSEL_VREFDIV2, /**< Vref divided by 2. */ |
AnnaBridge | 170:e95d10626187 | 291 | adcSingleInputDACOut0 = _ADC_SINGLECTRL_INPUTSEL_DAC0OUT0, /**< DAC output 0. */ |
AnnaBridge | 170:e95d10626187 | 292 | adcSingleInputDACOut1 = _ADC_SINGLECTRL_INPUTSEL_DAC0OUT1, /**< DAC output 1. */ |
AnnaBridge | 170:e95d10626187 | 293 | adcSingleInputATEST = 15, /**< ATEST. */ |
AnnaBridge | 170:e95d10626187 | 294 | |
AnnaBridge | 170:e95d10626187 | 295 | /* Differential mode enabled */ |
AnnaBridge | 170:e95d10626187 | 296 | adcSingleInputCh0Ch1 = _ADC_SINGLECTRL_INPUTSEL_CH0CH1, /**< Positive Ch0, negative Ch1. */ |
AnnaBridge | 170:e95d10626187 | 297 | adcSingleInputCh2Ch3 = _ADC_SINGLECTRL_INPUTSEL_CH2CH3, /**< Positive Ch2, negative Ch3. */ |
AnnaBridge | 170:e95d10626187 | 298 | adcSingleInputCh4Ch5 = _ADC_SINGLECTRL_INPUTSEL_CH4CH5, /**< Positive Ch4, negative Ch5. */ |
AnnaBridge | 170:e95d10626187 | 299 | adcSingleInputCh6Ch7 = _ADC_SINGLECTRL_INPUTSEL_CH6CH7, /**< Positive Ch6, negative Ch7. */ |
AnnaBridge | 170:e95d10626187 | 300 | adcSingleInputDiff0 = 4 /**< Differential 0. */ |
AnnaBridge | 170:e95d10626187 | 301 | } ADC_SingleInput_TypeDef; |
AnnaBridge | 170:e95d10626187 | 302 | |
AnnaBridge | 170:e95d10626187 | 303 | /** @cond DO_NOT_INCLUDE_WITH_DOXYGEN */ |
AnnaBridge | 170:e95d10626187 | 304 | /* Deprecated enum names */ |
AnnaBridge | 170:e95d10626187 | 305 | #define adcSingleInpCh0 adcSingleInputCh0 |
AnnaBridge | 170:e95d10626187 | 306 | #define adcSingleInpCh1 adcSingleInputCh1 |
AnnaBridge | 170:e95d10626187 | 307 | #define adcSingleInpCh2 adcSingleInputCh2 |
AnnaBridge | 170:e95d10626187 | 308 | #define adcSingleInpCh3 adcSingleInputCh3 |
AnnaBridge | 170:e95d10626187 | 309 | #define adcSingleInpCh4 adcSingleInputCh4 |
AnnaBridge | 170:e95d10626187 | 310 | #define adcSingleInpCh5 adcSingleInputCh5 |
AnnaBridge | 170:e95d10626187 | 311 | #define adcSingleInpCh6 adcSingleInputCh6 |
AnnaBridge | 170:e95d10626187 | 312 | #define adcSingleInpCh7 adcSingleInputCh7 |
AnnaBridge | 170:e95d10626187 | 313 | #define adcSingleInpTemp adcSingleInputTemp |
AnnaBridge | 170:e95d10626187 | 314 | #define adcSingleInpVDDDiv3 adcSingleInputVDDDiv3 |
AnnaBridge | 170:e95d10626187 | 315 | #define adcSingleInpVDD adcSingleInputVDD |
AnnaBridge | 170:e95d10626187 | 316 | #define adcSingleInpVSS adcSingleInputVSS |
AnnaBridge | 170:e95d10626187 | 317 | #define adcSingleInpVrefDiv2 adcSingleInputVrefDiv2 |
AnnaBridge | 170:e95d10626187 | 318 | #define adcSingleInpDACOut0 adcSingleInputDACOut0 |
AnnaBridge | 170:e95d10626187 | 319 | #define adcSingleInpDACOut1 adcSingleInputDACOut1 |
AnnaBridge | 170:e95d10626187 | 320 | #define adcSingleInpATEST adcSingleInputATEST |
AnnaBridge | 170:e95d10626187 | 321 | #define adcSingleInpCh0Ch1 adcSingleInputCh0Ch1 |
AnnaBridge | 170:e95d10626187 | 322 | #define adcSingleInpCh2Ch3 adcSingleInputCh2Ch3 |
AnnaBridge | 170:e95d10626187 | 323 | #define adcSingleInpCh4Ch5 adcSingleInputCh4Ch5 |
AnnaBridge | 170:e95d10626187 | 324 | #define adcSingleInpCh6Ch7 adcSingleInputCh6Ch7 |
AnnaBridge | 170:e95d10626187 | 325 | #define adcSingleInpDiff0 adcSingleInputDiff0 |
AnnaBridge | 170:e95d10626187 | 326 | /** @endcond */ |
AnnaBridge | 170:e95d10626187 | 327 | #endif |
AnnaBridge | 170:e95d10626187 | 328 | |
AnnaBridge | 170:e95d10626187 | 329 | #if defined(_ADC_SINGLECTRL_POSSEL_MASK) |
AnnaBridge | 170:e95d10626187 | 330 | /** Positive input selection for single and scan coversion. */ |
AnnaBridge | 170:e95d10626187 | 331 | typedef enum { |
AnnaBridge | 170:e95d10626187 | 332 | adcPosSelAPORT0XCH0 = _ADC_SINGLECTRL_POSSEL_APORT0XCH0, |
AnnaBridge | 170:e95d10626187 | 333 | adcPosSelAPORT0XCH1 = _ADC_SINGLECTRL_POSSEL_APORT0XCH1, |
AnnaBridge | 170:e95d10626187 | 334 | adcPosSelAPORT0XCH2 = _ADC_SINGLECTRL_POSSEL_APORT0XCH2, |
AnnaBridge | 170:e95d10626187 | 335 | adcPosSelAPORT0XCH3 = _ADC_SINGLECTRL_POSSEL_APORT0XCH3, |
AnnaBridge | 170:e95d10626187 | 336 | adcPosSelAPORT0XCH4 = _ADC_SINGLECTRL_POSSEL_APORT0XCH4, |
AnnaBridge | 170:e95d10626187 | 337 | adcPosSelAPORT0XCH5 = _ADC_SINGLECTRL_POSSEL_APORT0XCH5, |
AnnaBridge | 170:e95d10626187 | 338 | adcPosSelAPORT0XCH6 = _ADC_SINGLECTRL_POSSEL_APORT0XCH6, |
AnnaBridge | 170:e95d10626187 | 339 | adcPosSelAPORT0XCH7 = _ADC_SINGLECTRL_POSSEL_APORT0XCH7, |
AnnaBridge | 170:e95d10626187 | 340 | adcPosSelAPORT0XCH8 = _ADC_SINGLECTRL_POSSEL_APORT0XCH8, |
AnnaBridge | 170:e95d10626187 | 341 | adcPosSelAPORT0XCH9 = _ADC_SINGLECTRL_POSSEL_APORT0XCH9, |
AnnaBridge | 170:e95d10626187 | 342 | adcPosSelAPORT0XCH10 = _ADC_SINGLECTRL_POSSEL_APORT0XCH10, |
AnnaBridge | 170:e95d10626187 | 343 | adcPosSelAPORT0XCH11 = _ADC_SINGLECTRL_POSSEL_APORT0XCH11, |
AnnaBridge | 170:e95d10626187 | 344 | adcPosSelAPORT0XCH12 = _ADC_SINGLECTRL_POSSEL_APORT0XCH12, |
AnnaBridge | 170:e95d10626187 | 345 | adcPosSelAPORT0XCH13 = _ADC_SINGLECTRL_POSSEL_APORT0XCH13, |
AnnaBridge | 170:e95d10626187 | 346 | adcPosSelAPORT0XCH14 = _ADC_SINGLECTRL_POSSEL_APORT0XCH14, |
AnnaBridge | 170:e95d10626187 | 347 | adcPosSelAPORT0XCH15 = _ADC_SINGLECTRL_POSSEL_APORT0XCH15, |
AnnaBridge | 170:e95d10626187 | 348 | adcPosSelAPORT0YCH0 = _ADC_SINGLECTRL_POSSEL_APORT0YCH0, |
AnnaBridge | 170:e95d10626187 | 349 | adcPosSelAPORT0YCH1 = _ADC_SINGLECTRL_POSSEL_APORT0YCH1, |
AnnaBridge | 170:e95d10626187 | 350 | adcPosSelAPORT0YCH2 = _ADC_SINGLECTRL_POSSEL_APORT0YCH2, |
AnnaBridge | 170:e95d10626187 | 351 | adcPosSelAPORT0YCH3 = _ADC_SINGLECTRL_POSSEL_APORT0YCH3, |
AnnaBridge | 170:e95d10626187 | 352 | adcPosSelAPORT0YCH4 = _ADC_SINGLECTRL_POSSEL_APORT0YCH4, |
AnnaBridge | 170:e95d10626187 | 353 | adcPosSelAPORT0YCH5 = _ADC_SINGLECTRL_POSSEL_APORT0YCH5, |
AnnaBridge | 170:e95d10626187 | 354 | adcPosSelAPORT0YCH6 = _ADC_SINGLECTRL_POSSEL_APORT0YCH6, |
AnnaBridge | 170:e95d10626187 | 355 | adcPosSelAPORT0YCH7 = _ADC_SINGLECTRL_POSSEL_APORT0YCH7, |
AnnaBridge | 170:e95d10626187 | 356 | adcPosSelAPORT0YCH8 = _ADC_SINGLECTRL_POSSEL_APORT0YCH8, |
AnnaBridge | 170:e95d10626187 | 357 | adcPosSelAPORT0YCH9 = _ADC_SINGLECTRL_POSSEL_APORT0YCH9, |
AnnaBridge | 170:e95d10626187 | 358 | adcPosSelAPORT0YCH10 = _ADC_SINGLECTRL_POSSEL_APORT0YCH10, |
AnnaBridge | 170:e95d10626187 | 359 | adcPosSelAPORT0YCH11 = _ADC_SINGLECTRL_POSSEL_APORT0YCH11, |
AnnaBridge | 170:e95d10626187 | 360 | adcPosSelAPORT0YCH12 = _ADC_SINGLECTRL_POSSEL_APORT0YCH12, |
AnnaBridge | 170:e95d10626187 | 361 | adcPosSelAPORT0YCH13 = _ADC_SINGLECTRL_POSSEL_APORT0YCH13, |
AnnaBridge | 170:e95d10626187 | 362 | adcPosSelAPORT0YCH14 = _ADC_SINGLECTRL_POSSEL_APORT0YCH14, |
AnnaBridge | 170:e95d10626187 | 363 | adcPosSelAPORT0YCH15 = _ADC_SINGLECTRL_POSSEL_APORT0YCH15, |
AnnaBridge | 170:e95d10626187 | 364 | adcPosSelAPORT1XCH0 = _ADC_SINGLECTRL_POSSEL_APORT1XCH0, |
AnnaBridge | 170:e95d10626187 | 365 | adcPosSelAPORT1YCH1 = _ADC_SINGLECTRL_POSSEL_APORT1YCH1, |
AnnaBridge | 170:e95d10626187 | 366 | adcPosSelAPORT1XCH2 = _ADC_SINGLECTRL_POSSEL_APORT1XCH2, |
AnnaBridge | 170:e95d10626187 | 367 | adcPosSelAPORT1YCH3 = _ADC_SINGLECTRL_POSSEL_APORT1YCH3, |
AnnaBridge | 170:e95d10626187 | 368 | adcPosSelAPORT1XCH4 = _ADC_SINGLECTRL_POSSEL_APORT1XCH4, |
AnnaBridge | 170:e95d10626187 | 369 | adcPosSelAPORT1YCH5 = _ADC_SINGLECTRL_POSSEL_APORT1YCH5, |
AnnaBridge | 170:e95d10626187 | 370 | adcPosSelAPORT1XCH6 = _ADC_SINGLECTRL_POSSEL_APORT1XCH6, |
AnnaBridge | 170:e95d10626187 | 371 | adcPosSelAPORT1YCH7 = _ADC_SINGLECTRL_POSSEL_APORT1YCH7, |
AnnaBridge | 170:e95d10626187 | 372 | adcPosSelAPORT1XCH8 = _ADC_SINGLECTRL_POSSEL_APORT1XCH8, |
AnnaBridge | 170:e95d10626187 | 373 | adcPosSelAPORT1YCH9 = _ADC_SINGLECTRL_POSSEL_APORT1YCH9, |
AnnaBridge | 170:e95d10626187 | 374 | adcPosSelAPORT1XCH10 = _ADC_SINGLECTRL_POSSEL_APORT1XCH10, |
AnnaBridge | 170:e95d10626187 | 375 | adcPosSelAPORT1YCH11 = _ADC_SINGLECTRL_POSSEL_APORT1YCH11, |
AnnaBridge | 170:e95d10626187 | 376 | adcPosSelAPORT1XCH12 = _ADC_SINGLECTRL_POSSEL_APORT1XCH12, |
AnnaBridge | 170:e95d10626187 | 377 | adcPosSelAPORT1YCH13 = _ADC_SINGLECTRL_POSSEL_APORT1YCH13, |
AnnaBridge | 170:e95d10626187 | 378 | adcPosSelAPORT1XCH14 = _ADC_SINGLECTRL_POSSEL_APORT1XCH14, |
AnnaBridge | 170:e95d10626187 | 379 | adcPosSelAPORT1YCH15 = _ADC_SINGLECTRL_POSSEL_APORT1YCH15, |
AnnaBridge | 170:e95d10626187 | 380 | adcPosSelAPORT1XCH16 = _ADC_SINGLECTRL_POSSEL_APORT1XCH16, |
AnnaBridge | 170:e95d10626187 | 381 | adcPosSelAPORT1YCH17 = _ADC_SINGLECTRL_POSSEL_APORT1YCH17, |
AnnaBridge | 170:e95d10626187 | 382 | adcPosSelAPORT1XCH18 = _ADC_SINGLECTRL_POSSEL_APORT1XCH18, |
AnnaBridge | 170:e95d10626187 | 383 | adcPosSelAPORT1YCH19 = _ADC_SINGLECTRL_POSSEL_APORT1YCH19, |
AnnaBridge | 170:e95d10626187 | 384 | adcPosSelAPORT1XCH20 = _ADC_SINGLECTRL_POSSEL_APORT1XCH20, |
AnnaBridge | 170:e95d10626187 | 385 | adcPosSelAPORT1YCH21 = _ADC_SINGLECTRL_POSSEL_APORT1YCH21, |
AnnaBridge | 170:e95d10626187 | 386 | adcPosSelAPORT1XCH22 = _ADC_SINGLECTRL_POSSEL_APORT1XCH22, |
AnnaBridge | 170:e95d10626187 | 387 | adcPosSelAPORT1YCH23 = _ADC_SINGLECTRL_POSSEL_APORT1YCH23, |
AnnaBridge | 170:e95d10626187 | 388 | adcPosSelAPORT1XCH24 = _ADC_SINGLECTRL_POSSEL_APORT1XCH24, |
AnnaBridge | 170:e95d10626187 | 389 | adcPosSelAPORT1YCH25 = _ADC_SINGLECTRL_POSSEL_APORT1YCH25, |
AnnaBridge | 170:e95d10626187 | 390 | adcPosSelAPORT1XCH26 = _ADC_SINGLECTRL_POSSEL_APORT1XCH26, |
AnnaBridge | 170:e95d10626187 | 391 | adcPosSelAPORT1YCH27 = _ADC_SINGLECTRL_POSSEL_APORT1YCH27, |
AnnaBridge | 170:e95d10626187 | 392 | adcPosSelAPORT1XCH28 = _ADC_SINGLECTRL_POSSEL_APORT1XCH28, |
AnnaBridge | 170:e95d10626187 | 393 | adcPosSelAPORT1YCH29 = _ADC_SINGLECTRL_POSSEL_APORT1YCH29, |
AnnaBridge | 170:e95d10626187 | 394 | adcPosSelAPORT1XCH30 = _ADC_SINGLECTRL_POSSEL_APORT1XCH30, |
AnnaBridge | 170:e95d10626187 | 395 | adcPosSelAPORT1YCH31 = _ADC_SINGLECTRL_POSSEL_APORT1YCH31, |
AnnaBridge | 170:e95d10626187 | 396 | adcPosSelAPORT2YCH0 = _ADC_SINGLECTRL_POSSEL_APORT2YCH0, |
AnnaBridge | 170:e95d10626187 | 397 | adcPosSelAPORT2XCH1 = _ADC_SINGLECTRL_POSSEL_APORT2XCH1, |
AnnaBridge | 170:e95d10626187 | 398 | adcPosSelAPORT2YCH2 = _ADC_SINGLECTRL_POSSEL_APORT2YCH2, |
AnnaBridge | 170:e95d10626187 | 399 | adcPosSelAPORT2XCH3 = _ADC_SINGLECTRL_POSSEL_APORT2XCH3, |
AnnaBridge | 170:e95d10626187 | 400 | adcPosSelAPORT2YCH4 = _ADC_SINGLECTRL_POSSEL_APORT2YCH4, |
AnnaBridge | 170:e95d10626187 | 401 | adcPosSelAPORT2XCH5 = _ADC_SINGLECTRL_POSSEL_APORT2XCH5, |
AnnaBridge | 170:e95d10626187 | 402 | adcPosSelAPORT2YCH6 = _ADC_SINGLECTRL_POSSEL_APORT2YCH6, |
AnnaBridge | 170:e95d10626187 | 403 | adcPosSelAPORT2XCH7 = _ADC_SINGLECTRL_POSSEL_APORT2XCH7, |
AnnaBridge | 170:e95d10626187 | 404 | adcPosSelAPORT2YCH8 = _ADC_SINGLECTRL_POSSEL_APORT2YCH8, |
AnnaBridge | 170:e95d10626187 | 405 | adcPosSelAPORT2XCH9 = _ADC_SINGLECTRL_POSSEL_APORT2XCH9, |
AnnaBridge | 170:e95d10626187 | 406 | adcPosSelAPORT2YCH10 = _ADC_SINGLECTRL_POSSEL_APORT2YCH10, |
AnnaBridge | 170:e95d10626187 | 407 | adcPosSelAPORT2XCH11 = _ADC_SINGLECTRL_POSSEL_APORT2XCH11, |
AnnaBridge | 170:e95d10626187 | 408 | adcPosSelAPORT2YCH12 = _ADC_SINGLECTRL_POSSEL_APORT2YCH12, |
AnnaBridge | 170:e95d10626187 | 409 | adcPosSelAPORT2XCH13 = _ADC_SINGLECTRL_POSSEL_APORT2XCH13, |
AnnaBridge | 170:e95d10626187 | 410 | adcPosSelAPORT2YCH14 = _ADC_SINGLECTRL_POSSEL_APORT2YCH14, |
AnnaBridge | 170:e95d10626187 | 411 | adcPosSelAPORT2XCH15 = _ADC_SINGLECTRL_POSSEL_APORT2XCH15, |
AnnaBridge | 170:e95d10626187 | 412 | adcPosSelAPORT2YCH16 = _ADC_SINGLECTRL_POSSEL_APORT2YCH16, |
AnnaBridge | 170:e95d10626187 | 413 | adcPosSelAPORT2XCH17 = _ADC_SINGLECTRL_POSSEL_APORT2XCH17, |
AnnaBridge | 170:e95d10626187 | 414 | adcPosSelAPORT2YCH18 = _ADC_SINGLECTRL_POSSEL_APORT2YCH18, |
AnnaBridge | 170:e95d10626187 | 415 | adcPosSelAPORT2XCH19 = _ADC_SINGLECTRL_POSSEL_APORT2XCH19, |
AnnaBridge | 170:e95d10626187 | 416 | adcPosSelAPORT2YCH20 = _ADC_SINGLECTRL_POSSEL_APORT2YCH20, |
AnnaBridge | 170:e95d10626187 | 417 | adcPosSelAPORT2XCH21 = _ADC_SINGLECTRL_POSSEL_APORT2XCH21, |
AnnaBridge | 170:e95d10626187 | 418 | adcPosSelAPORT2YCH22 = _ADC_SINGLECTRL_POSSEL_APORT2YCH22, |
AnnaBridge | 170:e95d10626187 | 419 | adcPosSelAPORT2XCH23 = _ADC_SINGLECTRL_POSSEL_APORT2XCH23, |
AnnaBridge | 170:e95d10626187 | 420 | adcPosSelAPORT2YCH24 = _ADC_SINGLECTRL_POSSEL_APORT2YCH24, |
AnnaBridge | 170:e95d10626187 | 421 | adcPosSelAPORT2XCH25 = _ADC_SINGLECTRL_POSSEL_APORT2XCH25, |
AnnaBridge | 170:e95d10626187 | 422 | adcPosSelAPORT2YCH26 = _ADC_SINGLECTRL_POSSEL_APORT2YCH26, |
AnnaBridge | 170:e95d10626187 | 423 | adcPosSelAPORT2XCH27 = _ADC_SINGLECTRL_POSSEL_APORT2XCH27, |
AnnaBridge | 170:e95d10626187 | 424 | adcPosSelAPORT2YCH28 = _ADC_SINGLECTRL_POSSEL_APORT2YCH28, |
AnnaBridge | 170:e95d10626187 | 425 | adcPosSelAPORT2XCH29 = _ADC_SINGLECTRL_POSSEL_APORT2XCH29, |
AnnaBridge | 170:e95d10626187 | 426 | adcPosSelAPORT2YCH30 = _ADC_SINGLECTRL_POSSEL_APORT2YCH30, |
AnnaBridge | 170:e95d10626187 | 427 | adcPosSelAPORT2XCH31 = _ADC_SINGLECTRL_POSSEL_APORT2XCH31, |
AnnaBridge | 170:e95d10626187 | 428 | adcPosSelAPORT3XCH0 = _ADC_SINGLECTRL_POSSEL_APORT3XCH0, |
AnnaBridge | 170:e95d10626187 | 429 | adcPosSelAPORT3YCH1 = _ADC_SINGLECTRL_POSSEL_APORT3YCH1, |
AnnaBridge | 170:e95d10626187 | 430 | adcPosSelAPORT3XCH2 = _ADC_SINGLECTRL_POSSEL_APORT3XCH2, |
AnnaBridge | 170:e95d10626187 | 431 | adcPosSelAPORT3YCH3 = _ADC_SINGLECTRL_POSSEL_APORT3YCH3, |
AnnaBridge | 170:e95d10626187 | 432 | adcPosSelAPORT3XCH4 = _ADC_SINGLECTRL_POSSEL_APORT3XCH4, |
AnnaBridge | 170:e95d10626187 | 433 | adcPosSelAPORT3YCH5 = _ADC_SINGLECTRL_POSSEL_APORT3YCH5, |
AnnaBridge | 170:e95d10626187 | 434 | adcPosSelAPORT3XCH6 = _ADC_SINGLECTRL_POSSEL_APORT3XCH6, |
AnnaBridge | 170:e95d10626187 | 435 | adcPosSelAPORT3YCH7 = _ADC_SINGLECTRL_POSSEL_APORT3YCH7, |
AnnaBridge | 170:e95d10626187 | 436 | adcPosSelAPORT3XCH8 = _ADC_SINGLECTRL_POSSEL_APORT3XCH8, |
AnnaBridge | 170:e95d10626187 | 437 | adcPosSelAPORT3YCH9 = _ADC_SINGLECTRL_POSSEL_APORT3YCH9, |
AnnaBridge | 170:e95d10626187 | 438 | adcPosSelAPORT3XCH10 = _ADC_SINGLECTRL_POSSEL_APORT3XCH10, |
AnnaBridge | 170:e95d10626187 | 439 | adcPosSelAPORT3YCH11 = _ADC_SINGLECTRL_POSSEL_APORT3YCH11, |
AnnaBridge | 170:e95d10626187 | 440 | adcPosSelAPORT3XCH12 = _ADC_SINGLECTRL_POSSEL_APORT3XCH12, |
AnnaBridge | 170:e95d10626187 | 441 | adcPosSelAPORT3YCH13 = _ADC_SINGLECTRL_POSSEL_APORT3YCH13, |
AnnaBridge | 170:e95d10626187 | 442 | adcPosSelAPORT3XCH14 = _ADC_SINGLECTRL_POSSEL_APORT3XCH14, |
AnnaBridge | 170:e95d10626187 | 443 | adcPosSelAPORT3YCH15 = _ADC_SINGLECTRL_POSSEL_APORT3YCH15, |
AnnaBridge | 170:e95d10626187 | 444 | adcPosSelAPORT3XCH16 = _ADC_SINGLECTRL_POSSEL_APORT3XCH16, |
AnnaBridge | 170:e95d10626187 | 445 | adcPosSelAPORT3YCH17 = _ADC_SINGLECTRL_POSSEL_APORT3YCH17, |
AnnaBridge | 170:e95d10626187 | 446 | adcPosSelAPORT3XCH18 = _ADC_SINGLECTRL_POSSEL_APORT3XCH18, |
AnnaBridge | 170:e95d10626187 | 447 | adcPosSelAPORT3YCH19 = _ADC_SINGLECTRL_POSSEL_APORT3YCH19, |
AnnaBridge | 170:e95d10626187 | 448 | adcPosSelAPORT3XCH20 = _ADC_SINGLECTRL_POSSEL_APORT3XCH20, |
AnnaBridge | 170:e95d10626187 | 449 | adcPosSelAPORT3YCH21 = _ADC_SINGLECTRL_POSSEL_APORT3YCH21, |
AnnaBridge | 170:e95d10626187 | 450 | adcPosSelAPORT3XCH22 = _ADC_SINGLECTRL_POSSEL_APORT3XCH22, |
AnnaBridge | 170:e95d10626187 | 451 | adcPosSelAPORT3YCH23 = _ADC_SINGLECTRL_POSSEL_APORT3YCH23, |
AnnaBridge | 170:e95d10626187 | 452 | adcPosSelAPORT3XCH24 = _ADC_SINGLECTRL_POSSEL_APORT3XCH24, |
AnnaBridge | 170:e95d10626187 | 453 | adcPosSelAPORT3YCH25 = _ADC_SINGLECTRL_POSSEL_APORT3YCH25, |
AnnaBridge | 170:e95d10626187 | 454 | adcPosSelAPORT3XCH26 = _ADC_SINGLECTRL_POSSEL_APORT3XCH26, |
AnnaBridge | 170:e95d10626187 | 455 | adcPosSelAPORT3YCH27 = _ADC_SINGLECTRL_POSSEL_APORT3YCH27, |
AnnaBridge | 170:e95d10626187 | 456 | adcPosSelAPORT3XCH28 = _ADC_SINGLECTRL_POSSEL_APORT3XCH28, |
AnnaBridge | 170:e95d10626187 | 457 | adcPosSelAPORT3YCH29 = _ADC_SINGLECTRL_POSSEL_APORT3YCH29, |
AnnaBridge | 170:e95d10626187 | 458 | adcPosSelAPORT3XCH30 = _ADC_SINGLECTRL_POSSEL_APORT3XCH30, |
AnnaBridge | 170:e95d10626187 | 459 | adcPosSelAPORT3YCH31 = _ADC_SINGLECTRL_POSSEL_APORT3YCH31, |
AnnaBridge | 170:e95d10626187 | 460 | adcPosSelAPORT4YCH0 = _ADC_SINGLECTRL_POSSEL_APORT4YCH0, |
AnnaBridge | 170:e95d10626187 | 461 | adcPosSelAPORT4XCH1 = _ADC_SINGLECTRL_POSSEL_APORT4XCH1, |
AnnaBridge | 170:e95d10626187 | 462 | adcPosSelAPORT4YCH2 = _ADC_SINGLECTRL_POSSEL_APORT4YCH2, |
AnnaBridge | 170:e95d10626187 | 463 | adcPosSelAPORT4XCH3 = _ADC_SINGLECTRL_POSSEL_APORT4XCH3, |
AnnaBridge | 170:e95d10626187 | 464 | adcPosSelAPORT4YCH4 = _ADC_SINGLECTRL_POSSEL_APORT4YCH4, |
AnnaBridge | 170:e95d10626187 | 465 | adcPosSelAPORT4XCH5 = _ADC_SINGLECTRL_POSSEL_APORT4XCH5, |
AnnaBridge | 170:e95d10626187 | 466 | adcPosSelAPORT4YCH6 = _ADC_SINGLECTRL_POSSEL_APORT4YCH6, |
AnnaBridge | 170:e95d10626187 | 467 | adcPosSelAPORT4XCH7 = _ADC_SINGLECTRL_POSSEL_APORT4XCH7, |
AnnaBridge | 170:e95d10626187 | 468 | adcPosSelAPORT4YCH8 = _ADC_SINGLECTRL_POSSEL_APORT4YCH8, |
AnnaBridge | 170:e95d10626187 | 469 | adcPosSelAPORT4XCH9 = _ADC_SINGLECTRL_POSSEL_APORT4XCH9, |
AnnaBridge | 170:e95d10626187 | 470 | adcPosSelAPORT4YCH10 = _ADC_SINGLECTRL_POSSEL_APORT4YCH10, |
AnnaBridge | 170:e95d10626187 | 471 | adcPosSelAPORT4XCH11 = _ADC_SINGLECTRL_POSSEL_APORT4XCH11, |
AnnaBridge | 170:e95d10626187 | 472 | adcPosSelAPORT4YCH12 = _ADC_SINGLECTRL_POSSEL_APORT4YCH12, |
AnnaBridge | 170:e95d10626187 | 473 | adcPosSelAPORT4XCH13 = _ADC_SINGLECTRL_POSSEL_APORT4XCH13, |
AnnaBridge | 170:e95d10626187 | 474 | adcPosSelAPORT4YCH14 = _ADC_SINGLECTRL_POSSEL_APORT4YCH14, |
AnnaBridge | 170:e95d10626187 | 475 | adcPosSelAPORT4XCH15 = _ADC_SINGLECTRL_POSSEL_APORT4XCH15, |
AnnaBridge | 170:e95d10626187 | 476 | adcPosSelAPORT4YCH16 = _ADC_SINGLECTRL_POSSEL_APORT4YCH16, |
AnnaBridge | 170:e95d10626187 | 477 | adcPosSelAPORT4XCH17 = _ADC_SINGLECTRL_POSSEL_APORT4XCH17, |
AnnaBridge | 170:e95d10626187 | 478 | adcPosSelAPORT4YCH18 = _ADC_SINGLECTRL_POSSEL_APORT4YCH18, |
AnnaBridge | 170:e95d10626187 | 479 | adcPosSelAPORT4XCH19 = _ADC_SINGLECTRL_POSSEL_APORT4XCH19, |
AnnaBridge | 170:e95d10626187 | 480 | adcPosSelAPORT4YCH20 = _ADC_SINGLECTRL_POSSEL_APORT4YCH20, |
AnnaBridge | 170:e95d10626187 | 481 | adcPosSelAPORT4XCH21 = _ADC_SINGLECTRL_POSSEL_APORT4XCH21, |
AnnaBridge | 170:e95d10626187 | 482 | adcPosSelAPORT4YCH22 = _ADC_SINGLECTRL_POSSEL_APORT4YCH22, |
AnnaBridge | 170:e95d10626187 | 483 | adcPosSelAPORT4XCH23 = _ADC_SINGLECTRL_POSSEL_APORT4XCH23, |
AnnaBridge | 170:e95d10626187 | 484 | adcPosSelAPORT4YCH24 = _ADC_SINGLECTRL_POSSEL_APORT4YCH24, |
AnnaBridge | 170:e95d10626187 | 485 | adcPosSelAPORT4XCH25 = _ADC_SINGLECTRL_POSSEL_APORT4XCH25, |
AnnaBridge | 170:e95d10626187 | 486 | adcPosSelAPORT4YCH26 = _ADC_SINGLECTRL_POSSEL_APORT4YCH26, |
AnnaBridge | 170:e95d10626187 | 487 | adcPosSelAPORT4XCH27 = _ADC_SINGLECTRL_POSSEL_APORT4XCH27, |
AnnaBridge | 170:e95d10626187 | 488 | adcPosSelAPORT4YCH28 = _ADC_SINGLECTRL_POSSEL_APORT4YCH28, |
AnnaBridge | 170:e95d10626187 | 489 | adcPosSelAPORT4XCH29 = _ADC_SINGLECTRL_POSSEL_APORT4XCH29, |
AnnaBridge | 170:e95d10626187 | 490 | adcPosSelAPORT4YCH30 = _ADC_SINGLECTRL_POSSEL_APORT4YCH30, |
AnnaBridge | 170:e95d10626187 | 491 | adcPosSelAPORT4XCH31 = _ADC_SINGLECTRL_POSSEL_APORT4XCH31, |
AnnaBridge | 170:e95d10626187 | 492 | adcPosSelAVDD = _ADC_SINGLECTRL_POSSEL_AVDD, |
AnnaBridge | 170:e95d10626187 | 493 | #if defined(_ADC_SINGLECTRL_POSSEL_BU) |
AnnaBridge | 170:e95d10626187 | 494 | adcPosSelBUVDD = _ADC_SINGLECTRL_POSSEL_BU, |
AnnaBridge | 170:e95d10626187 | 495 | #endif |
AnnaBridge | 170:e95d10626187 | 496 | adcPosSelDVDD = _ADC_SINGLECTRL_POSSEL_AREG, |
AnnaBridge | 170:e95d10626187 | 497 | adcPosSelPAVDD = _ADC_SINGLECTRL_POSSEL_VREGOUTPA, |
AnnaBridge | 170:e95d10626187 | 498 | adcPosSelDECOUPLE = _ADC_SINGLECTRL_POSSEL_PDBU, |
AnnaBridge | 170:e95d10626187 | 499 | adcPosSelIOVDD = _ADC_SINGLECTRL_POSSEL_IO0, |
AnnaBridge | 170:e95d10626187 | 500 | adcPosSelOPA2 = _ADC_SINGLECTRL_POSSEL_OPA2, |
AnnaBridge | 170:e95d10626187 | 501 | adcPosSelOPA3 = _ADC_SINGLECTRL_POSSEL_OPA3, |
AnnaBridge | 170:e95d10626187 | 502 | adcPosSelTEMP = _ADC_SINGLECTRL_POSSEL_TEMP, |
AnnaBridge | 170:e95d10626187 | 503 | adcPosSelDAC0OUT0 = _ADC_SINGLECTRL_POSSEL_DAC0OUT0, |
AnnaBridge | 170:e95d10626187 | 504 | adcPosSelDAC0OUT1 = _ADC_SINGLECTRL_POSSEL_DAC0OUT1, |
AnnaBridge | 170:e95d10626187 | 505 | adcPosSelSUBLSB = _ADC_SINGLECTRL_POSSEL_SUBLSB, |
AnnaBridge | 170:e95d10626187 | 506 | adcPosSelDEFAULT = _ADC_SINGLECTRL_POSSEL_DEFAULT, |
AnnaBridge | 170:e95d10626187 | 507 | adcPosSelVSS = _ADC_SINGLECTRL_POSSEL_VSS |
AnnaBridge | 170:e95d10626187 | 508 | } ADC_PosSel_TypeDef; |
AnnaBridge | 170:e95d10626187 | 509 | |
AnnaBridge | 170:e95d10626187 | 510 | /* Map legacy or incorrectly named select enums to correct enums. */ |
AnnaBridge | 170:e95d10626187 | 511 | #define adcPosSelIO0 adcPosSelIOVDD |
AnnaBridge | 170:e95d10626187 | 512 | #define adcPosSelVREGOUTPA adcPosSelPAVDD |
AnnaBridge | 170:e95d10626187 | 513 | #define adcPosSelAREG adcPosSelDVDD |
AnnaBridge | 170:e95d10626187 | 514 | #define adcPosSelPDBU adcPosSelDECOUPLE |
AnnaBridge | 170:e95d10626187 | 515 | #endif |
AnnaBridge | 170:e95d10626187 | 516 | |
AnnaBridge | 170:e95d10626187 | 517 | #if defined(_ADC_SINGLECTRL_NEGSEL_MASK) |
AnnaBridge | 170:e95d10626187 | 518 | /** Negative input selection for single and scan coversion. */ |
AnnaBridge | 170:e95d10626187 | 519 | typedef enum { |
AnnaBridge | 170:e95d10626187 | 520 | adcNegSelAPORT0XCH0 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH0, |
AnnaBridge | 170:e95d10626187 | 521 | adcNegSelAPORT0XCH1 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH1, |
AnnaBridge | 170:e95d10626187 | 522 | adcNegSelAPORT0XCH2 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH2, |
AnnaBridge | 170:e95d10626187 | 523 | adcNegSelAPORT0XCH3 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH3, |
AnnaBridge | 170:e95d10626187 | 524 | adcNegSelAPORT0XCH4 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH4, |
AnnaBridge | 170:e95d10626187 | 525 | adcNegSelAPORT0XCH5 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH5, |
AnnaBridge | 170:e95d10626187 | 526 | adcNegSelAPORT0XCH6 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH6, |
AnnaBridge | 170:e95d10626187 | 527 | adcNegSelAPORT0XCH7 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH7, |
AnnaBridge | 170:e95d10626187 | 528 | adcNegSelAPORT0XCH8 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH8, |
AnnaBridge | 170:e95d10626187 | 529 | adcNegSelAPORT0XCH9 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH9, |
AnnaBridge | 170:e95d10626187 | 530 | adcNegSelAPORT0XCH10 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH10, |
AnnaBridge | 170:e95d10626187 | 531 | adcNegSelAPORT0XCH11 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH11, |
AnnaBridge | 170:e95d10626187 | 532 | adcNegSelAPORT0XCH12 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH12, |
AnnaBridge | 170:e95d10626187 | 533 | adcNegSelAPORT0XCH13 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH13, |
AnnaBridge | 170:e95d10626187 | 534 | adcNegSelAPORT0XCH14 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH14, |
AnnaBridge | 170:e95d10626187 | 535 | adcNegSelAPORT0XCH15 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH15, |
AnnaBridge | 170:e95d10626187 | 536 | adcNegSelAPORT0YCH0 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH0, |
AnnaBridge | 170:e95d10626187 | 537 | adcNegSelAPORT0YCH1 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH1, |
AnnaBridge | 170:e95d10626187 | 538 | adcNegSelAPORT0YCH2 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH2, |
AnnaBridge | 170:e95d10626187 | 539 | adcNegSelAPORT0YCH3 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH3, |
AnnaBridge | 170:e95d10626187 | 540 | adcNegSelAPORT0YCH4 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH4, |
AnnaBridge | 170:e95d10626187 | 541 | adcNegSelAPORT0YCH5 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH5, |
AnnaBridge | 170:e95d10626187 | 542 | adcNegSelAPORT0YCH6 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH6, |
AnnaBridge | 170:e95d10626187 | 543 | adcNegSelAPORT0YCH7 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH7, |
AnnaBridge | 170:e95d10626187 | 544 | adcNegSelAPORT0YCH8 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH8, |
AnnaBridge | 170:e95d10626187 | 545 | adcNegSelAPORT0YCH9 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH9, |
AnnaBridge | 170:e95d10626187 | 546 | adcNegSelAPORT0YCH10 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH10, |
AnnaBridge | 170:e95d10626187 | 547 | adcNegSelAPORT0YCH11 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH11, |
AnnaBridge | 170:e95d10626187 | 548 | adcNegSelAPORT0YCH12 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH12, |
AnnaBridge | 170:e95d10626187 | 549 | adcNegSelAPORT0YCH13 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH13, |
AnnaBridge | 170:e95d10626187 | 550 | adcNegSelAPORT0YCH14 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH14, |
AnnaBridge | 170:e95d10626187 | 551 | adcNegSelAPORT0YCH15 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH15, |
AnnaBridge | 170:e95d10626187 | 552 | adcNegSelAPORT1XCH0 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH0, |
AnnaBridge | 170:e95d10626187 | 553 | adcNegSelAPORT1YCH1 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH1, |
AnnaBridge | 170:e95d10626187 | 554 | adcNegSelAPORT1XCH2 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH2, |
AnnaBridge | 170:e95d10626187 | 555 | adcNegSelAPORT1YCH3 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH3, |
AnnaBridge | 170:e95d10626187 | 556 | adcNegSelAPORT1XCH4 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH4, |
AnnaBridge | 170:e95d10626187 | 557 | adcNegSelAPORT1YCH5 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH5, |
AnnaBridge | 170:e95d10626187 | 558 | adcNegSelAPORT1XCH6 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH6, |
AnnaBridge | 170:e95d10626187 | 559 | adcNegSelAPORT1YCH7 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH7, |
AnnaBridge | 170:e95d10626187 | 560 | adcNegSelAPORT1XCH8 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH8, |
AnnaBridge | 170:e95d10626187 | 561 | adcNegSelAPORT1YCH9 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH9, |
AnnaBridge | 170:e95d10626187 | 562 | adcNegSelAPORT1XCH10 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH10, |
AnnaBridge | 170:e95d10626187 | 563 | adcNegSelAPORT1YCH11 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH11, |
AnnaBridge | 170:e95d10626187 | 564 | adcNegSelAPORT1XCH12 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH12, |
AnnaBridge | 170:e95d10626187 | 565 | adcNegSelAPORT1YCH13 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH13, |
AnnaBridge | 170:e95d10626187 | 566 | adcNegSelAPORT1XCH14 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH14, |
AnnaBridge | 170:e95d10626187 | 567 | adcNegSelAPORT1YCH15 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH15, |
AnnaBridge | 170:e95d10626187 | 568 | adcNegSelAPORT1XCH16 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH16, |
AnnaBridge | 170:e95d10626187 | 569 | adcNegSelAPORT1YCH17 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH17, |
AnnaBridge | 170:e95d10626187 | 570 | adcNegSelAPORT1XCH18 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH18, |
AnnaBridge | 170:e95d10626187 | 571 | adcNegSelAPORT1YCH19 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH19, |
AnnaBridge | 170:e95d10626187 | 572 | adcNegSelAPORT1XCH20 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH20, |
AnnaBridge | 170:e95d10626187 | 573 | adcNegSelAPORT1YCH21 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH21, |
AnnaBridge | 170:e95d10626187 | 574 | adcNegSelAPORT1XCH22 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH22, |
AnnaBridge | 170:e95d10626187 | 575 | adcNegSelAPORT1YCH23 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH23, |
AnnaBridge | 170:e95d10626187 | 576 | adcNegSelAPORT1XCH24 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH24, |
AnnaBridge | 170:e95d10626187 | 577 | adcNegSelAPORT1YCH25 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH25, |
AnnaBridge | 170:e95d10626187 | 578 | adcNegSelAPORT1XCH26 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH26, |
AnnaBridge | 170:e95d10626187 | 579 | adcNegSelAPORT1YCH27 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH27, |
AnnaBridge | 170:e95d10626187 | 580 | adcNegSelAPORT1XCH28 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH28, |
AnnaBridge | 170:e95d10626187 | 581 | adcNegSelAPORT1YCH29 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH29, |
AnnaBridge | 170:e95d10626187 | 582 | adcNegSelAPORT1XCH30 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH30, |
AnnaBridge | 170:e95d10626187 | 583 | adcNegSelAPORT1YCH31 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH31, |
AnnaBridge | 170:e95d10626187 | 584 | adcNegSelAPORT2YCH0 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH0, |
AnnaBridge | 170:e95d10626187 | 585 | adcNegSelAPORT2XCH1 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH1, |
AnnaBridge | 170:e95d10626187 | 586 | adcNegSelAPORT2YCH2 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH2, |
AnnaBridge | 170:e95d10626187 | 587 | adcNegSelAPORT2XCH3 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH3, |
AnnaBridge | 170:e95d10626187 | 588 | adcNegSelAPORT2YCH4 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH4, |
AnnaBridge | 170:e95d10626187 | 589 | adcNegSelAPORT2XCH5 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH5, |
AnnaBridge | 170:e95d10626187 | 590 | adcNegSelAPORT2YCH6 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH6, |
AnnaBridge | 170:e95d10626187 | 591 | adcNegSelAPORT2XCH7 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH7, |
AnnaBridge | 170:e95d10626187 | 592 | adcNegSelAPORT2YCH8 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH8, |
AnnaBridge | 170:e95d10626187 | 593 | adcNegSelAPORT2XCH9 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH9, |
AnnaBridge | 170:e95d10626187 | 594 | adcNegSelAPORT2YCH10 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH10, |
AnnaBridge | 170:e95d10626187 | 595 | adcNegSelAPORT2XCH11 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH11, |
AnnaBridge | 170:e95d10626187 | 596 | adcNegSelAPORT2YCH12 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH12, |
AnnaBridge | 170:e95d10626187 | 597 | adcNegSelAPORT2XCH13 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH13, |
AnnaBridge | 170:e95d10626187 | 598 | adcNegSelAPORT2YCH14 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH14, |
AnnaBridge | 170:e95d10626187 | 599 | adcNegSelAPORT2XCH15 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH15, |
AnnaBridge | 170:e95d10626187 | 600 | adcNegSelAPORT2YCH16 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH16, |
AnnaBridge | 170:e95d10626187 | 601 | adcNegSelAPORT2XCH17 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH17, |
AnnaBridge | 170:e95d10626187 | 602 | adcNegSelAPORT2YCH18 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH18, |
AnnaBridge | 170:e95d10626187 | 603 | adcNegSelAPORT2XCH19 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH19, |
AnnaBridge | 170:e95d10626187 | 604 | adcNegSelAPORT2YCH20 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH20, |
AnnaBridge | 170:e95d10626187 | 605 | adcNegSelAPORT2XCH21 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH21, |
AnnaBridge | 170:e95d10626187 | 606 | adcNegSelAPORT2YCH22 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH22, |
AnnaBridge | 170:e95d10626187 | 607 | adcNegSelAPORT2XCH23 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH23, |
AnnaBridge | 170:e95d10626187 | 608 | adcNegSelAPORT2YCH24 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH24, |
AnnaBridge | 170:e95d10626187 | 609 | adcNegSelAPORT2XCH25 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH25, |
AnnaBridge | 170:e95d10626187 | 610 | adcNegSelAPORT2YCH26 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH26, |
AnnaBridge | 170:e95d10626187 | 611 | adcNegSelAPORT2XCH27 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH27, |
AnnaBridge | 170:e95d10626187 | 612 | adcNegSelAPORT2YCH28 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH28, |
AnnaBridge | 170:e95d10626187 | 613 | adcNegSelAPORT2XCH29 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH29, |
AnnaBridge | 170:e95d10626187 | 614 | adcNegSelAPORT2YCH30 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH30, |
AnnaBridge | 170:e95d10626187 | 615 | adcNegSelAPORT2XCH31 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH31, |
AnnaBridge | 170:e95d10626187 | 616 | adcNegSelAPORT3XCH0 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH0, |
AnnaBridge | 170:e95d10626187 | 617 | adcNegSelAPORT3YCH1 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH1, |
AnnaBridge | 170:e95d10626187 | 618 | adcNegSelAPORT3XCH2 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH2, |
AnnaBridge | 170:e95d10626187 | 619 | adcNegSelAPORT3YCH3 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH3, |
AnnaBridge | 170:e95d10626187 | 620 | adcNegSelAPORT3XCH4 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH4, |
AnnaBridge | 170:e95d10626187 | 621 | adcNegSelAPORT3YCH5 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH5, |
AnnaBridge | 170:e95d10626187 | 622 | adcNegSelAPORT3XCH6 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH6, |
AnnaBridge | 170:e95d10626187 | 623 | adcNegSelAPORT3YCH7 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH7, |
AnnaBridge | 170:e95d10626187 | 624 | adcNegSelAPORT3XCH8 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH8, |
AnnaBridge | 170:e95d10626187 | 625 | adcNegSelAPORT3YCH9 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH9, |
AnnaBridge | 170:e95d10626187 | 626 | adcNegSelAPORT3XCH10 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH10, |
AnnaBridge | 170:e95d10626187 | 627 | adcNegSelAPORT3YCH11 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH11, |
AnnaBridge | 170:e95d10626187 | 628 | adcNegSelAPORT3XCH12 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH12, |
AnnaBridge | 170:e95d10626187 | 629 | adcNegSelAPORT3YCH13 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH13, |
AnnaBridge | 170:e95d10626187 | 630 | adcNegSelAPORT3XCH14 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH14, |
AnnaBridge | 170:e95d10626187 | 631 | adcNegSelAPORT3YCH15 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH15, |
AnnaBridge | 170:e95d10626187 | 632 | adcNegSelAPORT3XCH16 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH16, |
AnnaBridge | 170:e95d10626187 | 633 | adcNegSelAPORT3YCH17 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH17, |
AnnaBridge | 170:e95d10626187 | 634 | adcNegSelAPORT3XCH18 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH18, |
AnnaBridge | 170:e95d10626187 | 635 | adcNegSelAPORT3YCH19 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH19, |
AnnaBridge | 170:e95d10626187 | 636 | adcNegSelAPORT3XCH20 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH20, |
AnnaBridge | 170:e95d10626187 | 637 | adcNegSelAPORT3YCH21 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH21, |
AnnaBridge | 170:e95d10626187 | 638 | adcNegSelAPORT3XCH22 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH22, |
AnnaBridge | 170:e95d10626187 | 639 | adcNegSelAPORT3YCH23 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH23, |
AnnaBridge | 170:e95d10626187 | 640 | adcNegSelAPORT3XCH24 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH24, |
AnnaBridge | 170:e95d10626187 | 641 | adcNegSelAPORT3YCH25 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH25, |
AnnaBridge | 170:e95d10626187 | 642 | adcNegSelAPORT3XCH26 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH26, |
AnnaBridge | 170:e95d10626187 | 643 | adcNegSelAPORT3YCH27 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH27, |
AnnaBridge | 170:e95d10626187 | 644 | adcNegSelAPORT3XCH28 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH28, |
AnnaBridge | 170:e95d10626187 | 645 | adcNegSelAPORT3YCH29 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH29, |
AnnaBridge | 170:e95d10626187 | 646 | adcNegSelAPORT3XCH30 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH30, |
AnnaBridge | 170:e95d10626187 | 647 | adcNegSelAPORT3YCH31 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH31, |
AnnaBridge | 170:e95d10626187 | 648 | adcNegSelAPORT4YCH0 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH0, |
AnnaBridge | 170:e95d10626187 | 649 | adcNegSelAPORT4XCH1 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH1, |
AnnaBridge | 170:e95d10626187 | 650 | adcNegSelAPORT4YCH2 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH2, |
AnnaBridge | 170:e95d10626187 | 651 | adcNegSelAPORT4XCH3 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH3, |
AnnaBridge | 170:e95d10626187 | 652 | adcNegSelAPORT4YCH4 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH4, |
AnnaBridge | 170:e95d10626187 | 653 | adcNegSelAPORT4XCH5 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH5, |
AnnaBridge | 170:e95d10626187 | 654 | adcNegSelAPORT4YCH6 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH6, |
AnnaBridge | 170:e95d10626187 | 655 | adcNegSelAPORT4XCH7 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH7, |
AnnaBridge | 170:e95d10626187 | 656 | adcNegSelAPORT4YCH8 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH8, |
AnnaBridge | 170:e95d10626187 | 657 | adcNegSelAPORT4XCH9 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH9, |
AnnaBridge | 170:e95d10626187 | 658 | adcNegSelAPORT4YCH10 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH10, |
AnnaBridge | 170:e95d10626187 | 659 | adcNegSelAPORT4XCH11 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH11, |
AnnaBridge | 170:e95d10626187 | 660 | adcNegSelAPORT4YCH12 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH12, |
AnnaBridge | 170:e95d10626187 | 661 | adcNegSelAPORT4XCH13 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH13, |
AnnaBridge | 170:e95d10626187 | 662 | adcNegSelAPORT4YCH14 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH14, |
AnnaBridge | 170:e95d10626187 | 663 | adcNegSelAPORT4XCH15 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH15, |
AnnaBridge | 170:e95d10626187 | 664 | adcNegSelAPORT4YCH16 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH16, |
AnnaBridge | 170:e95d10626187 | 665 | adcNegSelAPORT4XCH17 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH17, |
AnnaBridge | 170:e95d10626187 | 666 | adcNegSelAPORT4YCH18 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH18, |
AnnaBridge | 170:e95d10626187 | 667 | adcNegSelAPORT4XCH19 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH19, |
AnnaBridge | 170:e95d10626187 | 668 | adcNegSelAPORT4YCH20 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH20, |
AnnaBridge | 170:e95d10626187 | 669 | adcNegSelAPORT4XCH21 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH21, |
AnnaBridge | 170:e95d10626187 | 670 | adcNegSelAPORT4YCH22 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH22, |
AnnaBridge | 170:e95d10626187 | 671 | adcNegSelAPORT4XCH23 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH23, |
AnnaBridge | 170:e95d10626187 | 672 | adcNegSelAPORT4YCH24 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH24, |
AnnaBridge | 170:e95d10626187 | 673 | adcNegSelAPORT4XCH25 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH25, |
AnnaBridge | 170:e95d10626187 | 674 | adcNegSelAPORT4YCH26 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH26, |
AnnaBridge | 170:e95d10626187 | 675 | adcNegSelAPORT4XCH27 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH27, |
AnnaBridge | 170:e95d10626187 | 676 | adcNegSelAPORT4YCH28 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH28, |
AnnaBridge | 170:e95d10626187 | 677 | adcNegSelAPORT4XCH29 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH29, |
AnnaBridge | 170:e95d10626187 | 678 | adcNegSelAPORT4YCH30 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH30, |
AnnaBridge | 170:e95d10626187 | 679 | adcNegSelAPORT4XCH31 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH31, |
AnnaBridge | 170:e95d10626187 | 680 | adcNegSelTESTN = _ADC_SINGLECTRL_NEGSEL_TESTN, |
AnnaBridge | 170:e95d10626187 | 681 | adcNegSelDEFAULT = _ADC_SINGLECTRL_NEGSEL_DEFAULT, |
AnnaBridge | 170:e95d10626187 | 682 | adcNegSelVSS = _ADC_SINGLECTRL_NEGSEL_VSS |
AnnaBridge | 170:e95d10626187 | 683 | } ADC_NegSel_TypeDef; |
AnnaBridge | 170:e95d10626187 | 684 | #endif |
AnnaBridge | 170:e95d10626187 | 685 | |
AnnaBridge | 170:e95d10626187 | 686 | #if defined(_ADC_SCANINPUTSEL_MASK) |
AnnaBridge | 170:e95d10626187 | 687 | /* ADC scan input groups */ |
AnnaBridge | 170:e95d10626187 | 688 | typedef enum { |
AnnaBridge | 170:e95d10626187 | 689 | adcScanInputGroup0 = 0, |
AnnaBridge | 170:e95d10626187 | 690 | adcScanInputGroup1 = 1, |
AnnaBridge | 170:e95d10626187 | 691 | adcScanInputGroup2 = 2, |
AnnaBridge | 170:e95d10626187 | 692 | adcScanInputGroup3 = 3, |
AnnaBridge | 170:e95d10626187 | 693 | } ADC_ScanInputGroup_TypeDef; |
AnnaBridge | 170:e95d10626187 | 694 | |
AnnaBridge | 170:e95d10626187 | 695 | /* Define none selected for ADC_SCANINPUTSEL */ |
AnnaBridge | 170:e95d10626187 | 696 | #define ADC_SCANINPUTSEL_GROUP_NONE 0xFFU |
AnnaBridge | 170:e95d10626187 | 697 | #define ADC_SCANINPUTSEL_NONE ((ADC_SCANINPUTSEL_GROUP_NONE \ |
AnnaBridge | 170:e95d10626187 | 698 | << _ADC_SCANINPUTSEL_INPUT0TO7SEL_SHIFT) \ |
AnnaBridge | 170:e95d10626187 | 699 | | (ADC_SCANINPUTSEL_GROUP_NONE \ |
AnnaBridge | 170:e95d10626187 | 700 | << _ADC_SCANINPUTSEL_INPUT8TO15SEL_SHIFT) \ |
AnnaBridge | 170:e95d10626187 | 701 | | (ADC_SCANINPUTSEL_GROUP_NONE \ |
AnnaBridge | 170:e95d10626187 | 702 | << _ADC_SCANINPUTSEL_INPUT16TO23SEL_SHIFT) \ |
AnnaBridge | 170:e95d10626187 | 703 | | (ADC_SCANINPUTSEL_GROUP_NONE \ |
AnnaBridge | 170:e95d10626187 | 704 | << _ADC_SCANINPUTSEL_INPUT24TO31SEL_SHIFT)) |
AnnaBridge | 170:e95d10626187 | 705 | |
AnnaBridge | 170:e95d10626187 | 706 | /* ADC scan alternative negative inputs */ |
AnnaBridge | 170:e95d10626187 | 707 | typedef enum { |
AnnaBridge | 170:e95d10626187 | 708 | adcScanNegInput1 = 1, |
AnnaBridge | 170:e95d10626187 | 709 | adcScanNegInput3 = 3, |
AnnaBridge | 170:e95d10626187 | 710 | adcScanNegInput5 = 5, |
AnnaBridge | 170:e95d10626187 | 711 | adcScanNegInput7 = 7, |
AnnaBridge | 170:e95d10626187 | 712 | adcScanNegInput8 = 8, |
AnnaBridge | 170:e95d10626187 | 713 | adcScanNegInput10 = 10, |
AnnaBridge | 170:e95d10626187 | 714 | adcScanNegInput12 = 12, |
AnnaBridge | 170:e95d10626187 | 715 | adcScanNegInput14 = 14, |
AnnaBridge | 170:e95d10626187 | 716 | adcScanNegInputDefault = 0xFF, |
AnnaBridge | 170:e95d10626187 | 717 | } ADC_ScanNegInput_TypeDef; |
AnnaBridge | 170:e95d10626187 | 718 | #endif |
AnnaBridge | 170:e95d10626187 | 719 | |
AnnaBridge | 170:e95d10626187 | 720 | /** ADC Start command. */ |
AnnaBridge | 170:e95d10626187 | 721 | typedef enum { |
AnnaBridge | 170:e95d10626187 | 722 | /** Start single conversion. */ |
AnnaBridge | 170:e95d10626187 | 723 | adcStartSingle = ADC_CMD_SINGLESTART, |
AnnaBridge | 170:e95d10626187 | 724 | |
AnnaBridge | 170:e95d10626187 | 725 | /** Start scan sequence. */ |
AnnaBridge | 170:e95d10626187 | 726 | adcStartScan = ADC_CMD_SCANSTART, |
AnnaBridge | 170:e95d10626187 | 727 | |
AnnaBridge | 170:e95d10626187 | 728 | /** |
AnnaBridge | 170:e95d10626187 | 729 | * Start scan sequence and single conversion, typically used when tailgating |
AnnaBridge | 170:e95d10626187 | 730 | * single conversion after scan sequence. |
AnnaBridge | 170:e95d10626187 | 731 | */ |
AnnaBridge | 170:e95d10626187 | 732 | adcStartScanAndSingle = ADC_CMD_SCANSTART | ADC_CMD_SINGLESTART |
AnnaBridge | 170:e95d10626187 | 733 | } ADC_Start_TypeDef; |
AnnaBridge | 170:e95d10626187 | 734 | |
AnnaBridge | 170:e95d10626187 | 735 | /** Warm-up mode. */ |
AnnaBridge | 170:e95d10626187 | 736 | typedef enum { |
AnnaBridge | 170:e95d10626187 | 737 | /** ADC shutdown after each conversion. */ |
AnnaBridge | 170:e95d10626187 | 738 | adcWarmupNormal = _ADC_CTRL_WARMUPMODE_NORMAL, |
AnnaBridge | 170:e95d10626187 | 739 | |
AnnaBridge | 170:e95d10626187 | 740 | #if defined(_ADC_CTRL_WARMUPMODE_FASTBG) |
AnnaBridge | 170:e95d10626187 | 741 | /** Do not warm-up bandgap references. */ |
AnnaBridge | 170:e95d10626187 | 742 | adcWarmupFastBG = _ADC_CTRL_WARMUPMODE_FASTBG, |
AnnaBridge | 170:e95d10626187 | 743 | #endif |
AnnaBridge | 170:e95d10626187 | 744 | |
AnnaBridge | 170:e95d10626187 | 745 | #if defined(_ADC_CTRL_WARMUPMODE_KEEPSCANREFWARM) |
AnnaBridge | 170:e95d10626187 | 746 | /** Reference selected for scan mode kept warm.*/ |
AnnaBridge | 170:e95d10626187 | 747 | adcWarmupKeepScanRefWarm = _ADC_CTRL_WARMUPMODE_KEEPSCANREFWARM, |
AnnaBridge | 170:e95d10626187 | 748 | #endif |
AnnaBridge | 170:e95d10626187 | 749 | |
AnnaBridge | 170:e95d10626187 | 750 | #if defined(_ADC_CTRL_WARMUPMODE_KEEPINSTANDBY) |
AnnaBridge | 170:e95d10626187 | 751 | /** ADC is kept in standby mode between conversion. 1us warmup time needed |
AnnaBridge | 170:e95d10626187 | 752 | before next conversion. */ |
AnnaBridge | 170:e95d10626187 | 753 | adcWarmupKeepInStandby = _ADC_CTRL_WARMUPMODE_KEEPINSTANDBY, |
AnnaBridge | 170:e95d10626187 | 754 | #endif |
AnnaBridge | 170:e95d10626187 | 755 | |
AnnaBridge | 170:e95d10626187 | 756 | #if defined(_ADC_CTRL_WARMUPMODE_KEEPINSLOWACC) |
AnnaBridge | 170:e95d10626187 | 757 | /** ADC is kept in slow acquisition mode between conversions. 1us warmup |
AnnaBridge | 170:e95d10626187 | 758 | time needed before next conversion. */ |
AnnaBridge | 170:e95d10626187 | 759 | adcWarmupKeepInSlowAcq = _ADC_CTRL_WARMUPMODE_KEEPINSLOWACC, |
AnnaBridge | 170:e95d10626187 | 760 | #endif |
AnnaBridge | 170:e95d10626187 | 761 | |
AnnaBridge | 170:e95d10626187 | 762 | /** ADC and reference selected for scan mode kept warmup, allowing |
AnnaBridge | 170:e95d10626187 | 763 | continuous conversion. */ |
AnnaBridge | 170:e95d10626187 | 764 | adcWarmupKeepADCWarm = _ADC_CTRL_WARMUPMODE_KEEPADCWARM, |
AnnaBridge | 170:e95d10626187 | 765 | } ADC_Warmup_TypeDef; |
AnnaBridge | 170:e95d10626187 | 766 | |
AnnaBridge | 170:e95d10626187 | 767 | #if defined(_ADC_CTRL_ADCCLKMODE_MASK) |
AnnaBridge | 170:e95d10626187 | 768 | /** ADC EM2 clock configuration */ |
AnnaBridge | 170:e95d10626187 | 769 | typedef enum { |
AnnaBridge | 170:e95d10626187 | 770 | adcEm2Disabled = 0, |
AnnaBridge | 170:e95d10626187 | 771 | adcEm2ClockOnDemand = ADC_CTRL_ADCCLKMODE_ASYNC | ADC_CTRL_ASYNCCLKEN_ASNEEDED, |
AnnaBridge | 170:e95d10626187 | 772 | adcEm2ClockAlwaysOn = ADC_CTRL_ADCCLKMODE_ASYNC | ADC_CTRL_ASYNCCLKEN_ALWAYSON, |
AnnaBridge | 170:e95d10626187 | 773 | } ADC_EM2ClockConfig_TypeDef; |
AnnaBridge | 170:e95d10626187 | 774 | #endif |
AnnaBridge | 170:e95d10626187 | 775 | |
AnnaBridge | 170:e95d10626187 | 776 | /******************************************************************************* |
AnnaBridge | 170:e95d10626187 | 777 | ******************************* STRUCTS *********************************** |
AnnaBridge | 170:e95d10626187 | 778 | ******************************************************************************/ |
AnnaBridge | 170:e95d10626187 | 779 | |
AnnaBridge | 170:e95d10626187 | 780 | /** ADC init structure, common for single conversion and scan sequence. */ |
AnnaBridge | 170:e95d10626187 | 781 | typedef struct { |
AnnaBridge | 170:e95d10626187 | 782 | /** |
AnnaBridge | 170:e95d10626187 | 783 | * Oversampling rate select. In order to have any effect, oversampling must |
AnnaBridge | 170:e95d10626187 | 784 | * be enabled for single/scan mode. |
AnnaBridge | 170:e95d10626187 | 785 | */ |
AnnaBridge | 170:e95d10626187 | 786 | ADC_OvsRateSel_TypeDef ovsRateSel; |
AnnaBridge | 170:e95d10626187 | 787 | |
AnnaBridge | 170:e95d10626187 | 788 | #if defined(_ADC_CTRL_LPFMODE_MASK) |
AnnaBridge | 170:e95d10626187 | 789 | /** Lowpass or decoupling capacitor filter to use. */ |
AnnaBridge | 170:e95d10626187 | 790 | ADC_LPFilter_TypeDef lpfMode; |
AnnaBridge | 170:e95d10626187 | 791 | #endif |
AnnaBridge | 170:e95d10626187 | 792 | |
AnnaBridge | 170:e95d10626187 | 793 | /** Warm-up mode to use for ADC. */ |
AnnaBridge | 170:e95d10626187 | 794 | ADC_Warmup_TypeDef warmUpMode; |
AnnaBridge | 170:e95d10626187 | 795 | |
AnnaBridge | 170:e95d10626187 | 796 | /** |
AnnaBridge | 170:e95d10626187 | 797 | * Timebase used for ADC warm up. Select N to give (N+1)HFPERCLK cycles. |
AnnaBridge | 170:e95d10626187 | 798 | * (Additional delay is added for bandgap references, please refer to the |
AnnaBridge | 170:e95d10626187 | 799 | * reference manual.) Normally, N should be selected so that the timebase |
AnnaBridge | 170:e95d10626187 | 800 | * is at least 1 us. See ADC_TimebaseCalc() for a way to obtain |
AnnaBridge | 170:e95d10626187 | 801 | * a suggested timebase of at least 1 us. |
AnnaBridge | 170:e95d10626187 | 802 | */ |
AnnaBridge | 170:e95d10626187 | 803 | uint8_t timebase; |
AnnaBridge | 170:e95d10626187 | 804 | |
AnnaBridge | 170:e95d10626187 | 805 | /** Clock division factor N, ADC clock = HFPERCLK / (N + 1). */ |
AnnaBridge | 170:e95d10626187 | 806 | uint8_t prescale; |
AnnaBridge | 170:e95d10626187 | 807 | |
AnnaBridge | 170:e95d10626187 | 808 | /** Enable/disable conversion tailgating. */ |
AnnaBridge | 170:e95d10626187 | 809 | bool tailgate; |
AnnaBridge | 170:e95d10626187 | 810 | |
AnnaBridge | 170:e95d10626187 | 811 | /** ADC EM2 clock configuration */ |
AnnaBridge | 170:e95d10626187 | 812 | #if defined(_ADC_CTRL_ADCCLKMODE_MASK) |
AnnaBridge | 170:e95d10626187 | 813 | ADC_EM2ClockConfig_TypeDef em2ClockConfig; |
AnnaBridge | 170:e95d10626187 | 814 | #endif |
AnnaBridge | 170:e95d10626187 | 815 | } ADC_Init_TypeDef; |
AnnaBridge | 170:e95d10626187 | 816 | |
AnnaBridge | 170:e95d10626187 | 817 | /** Default config for ADC init structure. */ |
AnnaBridge | 170:e95d10626187 | 818 | #if defined(_ADC_CTRL_LPFMODE_MASK) && (!defined(_ADC_CTRL_ADCCLKMODE_MASK)) |
AnnaBridge | 170:e95d10626187 | 819 | #define ADC_INIT_DEFAULT \ |
AnnaBridge | 170:e95d10626187 | 820 | { \ |
AnnaBridge | 170:e95d10626187 | 821 | adcOvsRateSel2, /* 2x oversampling (if enabled). */ \ |
AnnaBridge | 170:e95d10626187 | 822 | adcLPFilterBypass, /* No input filter selected. */ \ |
AnnaBridge | 170:e95d10626187 | 823 | adcWarmupNormal, /* ADC shutdown after each conversion. */ \ |
AnnaBridge | 170:e95d10626187 | 824 | _ADC_CTRL_TIMEBASE_DEFAULT, /* Use HW default value. */ \ |
AnnaBridge | 170:e95d10626187 | 825 | _ADC_CTRL_PRESC_DEFAULT, /* Use HW default value. */ \ |
AnnaBridge | 170:e95d10626187 | 826 | false /* Do not use tailgate. */ \ |
AnnaBridge | 170:e95d10626187 | 827 | } |
AnnaBridge | 170:e95d10626187 | 828 | #elif (!defined(_ADC_CTRL_LPFMODE_MASK)) && (!defined(_ADC_CTRL_ADCCLKMODE_MASK)) |
AnnaBridge | 170:e95d10626187 | 829 | #define ADC_INIT_DEFAULT \ |
AnnaBridge | 170:e95d10626187 | 830 | { \ |
AnnaBridge | 170:e95d10626187 | 831 | adcOvsRateSel2, /* 2x oversampling (if enabled). */ \ |
AnnaBridge | 170:e95d10626187 | 832 | adcWarmupNormal, /* ADC shutdown after each conversion. */ \ |
AnnaBridge | 170:e95d10626187 | 833 | _ADC_CTRL_TIMEBASE_DEFAULT, /* Use HW default value. */ \ |
AnnaBridge | 170:e95d10626187 | 834 | _ADC_CTRL_PRESC_DEFAULT, /* Use HW default value. */ \ |
AnnaBridge | 170:e95d10626187 | 835 | false /* Do not use tailgate. */ \ |
AnnaBridge | 170:e95d10626187 | 836 | } |
AnnaBridge | 170:e95d10626187 | 837 | #elif (!defined(_ADC_CTRL_LPFMODE_MASK)) && defined(_ADC_CTRL_ADCCLKMODE_MASK) |
AnnaBridge | 170:e95d10626187 | 838 | #define ADC_INIT_DEFAULT \ |
AnnaBridge | 170:e95d10626187 | 839 | { \ |
AnnaBridge | 170:e95d10626187 | 840 | adcOvsRateSel2, /* 2x oversampling (if enabled). */ \ |
AnnaBridge | 170:e95d10626187 | 841 | adcWarmupNormal, /* ADC shutdown after each conversion. */ \ |
AnnaBridge | 170:e95d10626187 | 842 | _ADC_CTRL_TIMEBASE_DEFAULT, /* Use HW default value. */ \ |
AnnaBridge | 170:e95d10626187 | 843 | _ADC_CTRL_PRESC_DEFAULT, /* Use HW default value. */ \ |
AnnaBridge | 170:e95d10626187 | 844 | false, /* Do not use tailgate. */ \ |
AnnaBridge | 170:e95d10626187 | 845 | adcEm2Disabled /* ADC disabled in EM2 */ \ |
AnnaBridge | 170:e95d10626187 | 846 | } |
AnnaBridge | 170:e95d10626187 | 847 | #endif |
AnnaBridge | 170:e95d10626187 | 848 | |
AnnaBridge | 170:e95d10626187 | 849 | /** Scan input configuration */ |
AnnaBridge | 170:e95d10626187 | 850 | typedef struct { |
AnnaBridge | 170:e95d10626187 | 851 | /** Input range select to be applied to ADC_SCANINPUTSEL. */ |
AnnaBridge | 170:e95d10626187 | 852 | uint32_t scanInputSel; |
AnnaBridge | 170:e95d10626187 | 853 | |
AnnaBridge | 170:e95d10626187 | 854 | /** Input enable mask */ |
AnnaBridge | 170:e95d10626187 | 855 | uint32_t scanInputEn; |
AnnaBridge | 170:e95d10626187 | 856 | |
AnnaBridge | 170:e95d10626187 | 857 | /** Alternative negative input */ |
AnnaBridge | 170:e95d10626187 | 858 | uint32_t scanNegSel; |
AnnaBridge | 170:e95d10626187 | 859 | } ADC_InitScanInput_TypeDef; |
AnnaBridge | 170:e95d10626187 | 860 | |
AnnaBridge | 170:e95d10626187 | 861 | /** Scan sequence init structure. */ |
AnnaBridge | 170:e95d10626187 | 862 | typedef struct { |
AnnaBridge | 170:e95d10626187 | 863 | /** |
AnnaBridge | 170:e95d10626187 | 864 | * Peripheral reflex system trigger selection. Only applicable if @p prsEnable |
AnnaBridge | 170:e95d10626187 | 865 | * is enabled. |
AnnaBridge | 170:e95d10626187 | 866 | */ |
AnnaBridge | 170:e95d10626187 | 867 | ADC_PRSSEL_TypeDef prsSel; |
AnnaBridge | 170:e95d10626187 | 868 | |
AnnaBridge | 170:e95d10626187 | 869 | /** Acquisition time (in ADC clock cycles). */ |
AnnaBridge | 170:e95d10626187 | 870 | ADC_AcqTime_TypeDef acqTime; |
AnnaBridge | 170:e95d10626187 | 871 | |
AnnaBridge | 170:e95d10626187 | 872 | /** |
AnnaBridge | 170:e95d10626187 | 873 | * Sample reference selection. Notice that for external references, the |
AnnaBridge | 170:e95d10626187 | 874 | * ADC calibration register must be set explicitly. |
AnnaBridge | 170:e95d10626187 | 875 | */ |
AnnaBridge | 170:e95d10626187 | 876 | ADC_Ref_TypeDef reference; |
AnnaBridge | 170:e95d10626187 | 877 | |
AnnaBridge | 170:e95d10626187 | 878 | /** Sample resolution. */ |
AnnaBridge | 170:e95d10626187 | 879 | ADC_Res_TypeDef resolution; |
AnnaBridge | 170:e95d10626187 | 880 | |
AnnaBridge | 170:e95d10626187 | 881 | #if defined(_ADC_SCANCTRL_INPUTMASK_MASK) |
AnnaBridge | 170:e95d10626187 | 882 | /** |
AnnaBridge | 170:e95d10626187 | 883 | * Scan input selection. If single ended (@p diff is false), use logical |
AnnaBridge | 170:e95d10626187 | 884 | * combination of ADC_SCANCTRL_INPUTMASK_CHx defines. If differential input |
AnnaBridge | 170:e95d10626187 | 885 | * (@p diff is true), use logical combination of ADC_SCANCTRL_INPUTMASK_CHxCHy |
AnnaBridge | 170:e95d10626187 | 886 | * defines. (Notice underscore prefix for defines used.) |
AnnaBridge | 170:e95d10626187 | 887 | */ |
AnnaBridge | 170:e95d10626187 | 888 | uint32_t input; |
AnnaBridge | 170:e95d10626187 | 889 | #endif |
AnnaBridge | 170:e95d10626187 | 890 | |
AnnaBridge | 170:e95d10626187 | 891 | #if defined(_ADC_SCANINPUTSEL_MASK) |
AnnaBridge | 170:e95d10626187 | 892 | /** |
AnnaBridge | 170:e95d10626187 | 893 | * Scan input configuration. @ref Use ADC_ScanInputClear(), @ref ADC_ScanSingleEndedInputAdd() |
AnnaBridge | 170:e95d10626187 | 894 | * or @ref ADC_ScanDifferentialInputAdd() to update this struct. |
AnnaBridge | 170:e95d10626187 | 895 | */ |
AnnaBridge | 170:e95d10626187 | 896 | ADC_InitScanInput_TypeDef scanInputConfig; |
AnnaBridge | 170:e95d10626187 | 897 | #endif |
AnnaBridge | 170:e95d10626187 | 898 | |
AnnaBridge | 170:e95d10626187 | 899 | /** Select if single ended or differential input. */ |
AnnaBridge | 170:e95d10626187 | 900 | bool diff; |
AnnaBridge | 170:e95d10626187 | 901 | |
AnnaBridge | 170:e95d10626187 | 902 | /** Peripheral reflex system trigger enable. */ |
AnnaBridge | 170:e95d10626187 | 903 | bool prsEnable; |
AnnaBridge | 170:e95d10626187 | 904 | |
AnnaBridge | 170:e95d10626187 | 905 | /** Select if left adjustment should be done. */ |
AnnaBridge | 170:e95d10626187 | 906 | bool leftAdjust; |
AnnaBridge | 170:e95d10626187 | 907 | |
AnnaBridge | 170:e95d10626187 | 908 | /** Select if continuous conversion until explicit stop. */ |
AnnaBridge | 170:e95d10626187 | 909 | bool rep; |
AnnaBridge | 170:e95d10626187 | 910 | |
AnnaBridge | 170:e95d10626187 | 911 | /** When true, DMA is available in EM2 for scan conversion */ |
AnnaBridge | 170:e95d10626187 | 912 | #if defined(_ADC_CTRL_SCANDMAWU_MASK) |
AnnaBridge | 170:e95d10626187 | 913 | bool scanDmaEm2Wu; |
AnnaBridge | 170:e95d10626187 | 914 | #endif |
AnnaBridge | 170:e95d10626187 | 915 | |
AnnaBridge | 170:e95d10626187 | 916 | #if defined(_ADC_SCANCTRLX_FIFOOFACT_MASK) |
AnnaBridge | 170:e95d10626187 | 917 | /** When true, the FIFO overwrites old data when full. If false, then the FIFO discards new data. |
AnnaBridge | 170:e95d10626187 | 918 | The SINGLEOF IRQ is triggered in both cases. */ |
AnnaBridge | 170:e95d10626187 | 919 | bool fifoOverwrite; |
AnnaBridge | 170:e95d10626187 | 920 | #endif |
AnnaBridge | 170:e95d10626187 | 921 | } ADC_InitScan_TypeDef; |
AnnaBridge | 170:e95d10626187 | 922 | |
AnnaBridge | 170:e95d10626187 | 923 | /** Default config for ADC scan init structure. */ |
AnnaBridge | 170:e95d10626187 | 924 | #if defined(_ADC_SCANCTRL_INPUTMASK_MASK) |
AnnaBridge | 170:e95d10626187 | 925 | #define ADC_INITSCAN_DEFAULT \ |
AnnaBridge | 170:e95d10626187 | 926 | { \ |
AnnaBridge | 170:e95d10626187 | 927 | adcPRSSELCh0, /* PRS ch0 (if enabled). */ \ |
AnnaBridge | 170:e95d10626187 | 928 | adcAcqTime1, /* 1 ADC_CLK cycle acquisition time. */ \ |
AnnaBridge | 170:e95d10626187 | 929 | adcRef1V25, /* 1.25V internal reference. */ \ |
AnnaBridge | 170:e95d10626187 | 930 | adcRes12Bit, /* 12 bit resolution. */ \ |
AnnaBridge | 170:e95d10626187 | 931 | 0, /* No input selected. */ \ |
AnnaBridge | 170:e95d10626187 | 932 | false, /* Single-ended input. */ \ |
AnnaBridge | 170:e95d10626187 | 933 | false, /* PRS disabled. */ \ |
AnnaBridge | 170:e95d10626187 | 934 | false, /* Right adjust. */ \ |
AnnaBridge | 170:e95d10626187 | 935 | false, /* Deactivate conversion after one scan sequence. */ \ |
AnnaBridge | 170:e95d10626187 | 936 | } |
AnnaBridge | 170:e95d10626187 | 937 | #endif |
AnnaBridge | 170:e95d10626187 | 938 | |
AnnaBridge | 170:e95d10626187 | 939 | #if defined(_ADC_SCANINPUTSEL_MASK) |
AnnaBridge | 170:e95d10626187 | 940 | #define ADC_INITSCAN_DEFAULT \ |
AnnaBridge | 170:e95d10626187 | 941 | { \ |
AnnaBridge | 170:e95d10626187 | 942 | adcPRSSELCh0, /* PRS ch0 (if enabled). */ \ |
AnnaBridge | 170:e95d10626187 | 943 | adcAcqTime1, /* 1 ADC_CLK cycle acquisition time. */ \ |
AnnaBridge | 170:e95d10626187 | 944 | adcRef1V25, /* 1.25V internal reference. */ \ |
AnnaBridge | 170:e95d10626187 | 945 | adcRes12Bit, /* 12 bit resolution. */ \ |
AnnaBridge | 170:e95d10626187 | 946 | { \ |
AnnaBridge | 170:e95d10626187 | 947 | /* Initialization should match values set by @ref ADC_ScanInputClear() */ \ |
AnnaBridge | 170:e95d10626187 | 948 | ADC_SCANINPUTSEL_NONE, /* Default ADC inputs */ \ |
AnnaBridge | 170:e95d10626187 | 949 | 0, /* Default input mask (all off) */ \ |
AnnaBridge | 170:e95d10626187 | 950 | _ADC_SCANNEGSEL_RESETVALUE,/* Default negative select for positive ternimal */ \ |
AnnaBridge | 170:e95d10626187 | 951 | }, \ |
AnnaBridge | 170:e95d10626187 | 952 | false, /* Single-ended input. */ \ |
AnnaBridge | 170:e95d10626187 | 953 | false, /* PRS disabled. */ \ |
AnnaBridge | 170:e95d10626187 | 954 | false, /* Right adjust. */ \ |
AnnaBridge | 170:e95d10626187 | 955 | false, /* Deactivate conversion after one scan sequence. */ \ |
AnnaBridge | 170:e95d10626187 | 956 | false, /* No EM2 DMA wakeup from scan FIFO DVL */ \ |
AnnaBridge | 170:e95d10626187 | 957 | false /* Discard new data on full FIFO. */ \ |
AnnaBridge | 170:e95d10626187 | 958 | } |
AnnaBridge | 170:e95d10626187 | 959 | #endif |
AnnaBridge | 170:e95d10626187 | 960 | |
AnnaBridge | 170:e95d10626187 | 961 | /** Single conversion init structure. */ |
AnnaBridge | 170:e95d10626187 | 962 | typedef struct { |
AnnaBridge | 170:e95d10626187 | 963 | /** |
AnnaBridge | 170:e95d10626187 | 964 | * Peripheral reflex system trigger selection. Only applicable if @p prsEnable |
AnnaBridge | 170:e95d10626187 | 965 | * is enabled. |
AnnaBridge | 170:e95d10626187 | 966 | */ |
AnnaBridge | 170:e95d10626187 | 967 | ADC_PRSSEL_TypeDef prsSel; |
AnnaBridge | 170:e95d10626187 | 968 | |
AnnaBridge | 170:e95d10626187 | 969 | /** Acquisition time (in ADC clock cycles). */ |
AnnaBridge | 170:e95d10626187 | 970 | ADC_AcqTime_TypeDef acqTime; |
AnnaBridge | 170:e95d10626187 | 971 | |
AnnaBridge | 170:e95d10626187 | 972 | /** |
AnnaBridge | 170:e95d10626187 | 973 | * Sample reference selection. Notice that for external references, the |
AnnaBridge | 170:e95d10626187 | 974 | * ADC calibration register must be set explicitly. |
AnnaBridge | 170:e95d10626187 | 975 | */ |
AnnaBridge | 170:e95d10626187 | 976 | ADC_Ref_TypeDef reference; |
AnnaBridge | 170:e95d10626187 | 977 | |
AnnaBridge | 170:e95d10626187 | 978 | /** Sample resolution. */ |
AnnaBridge | 170:e95d10626187 | 979 | ADC_Res_TypeDef resolution; |
AnnaBridge | 170:e95d10626187 | 980 | |
AnnaBridge | 170:e95d10626187 | 981 | #if defined(_ADC_SINGLECTRL_INPUTSEL_MASK) |
AnnaBridge | 170:e95d10626187 | 982 | /** |
AnnaBridge | 170:e95d10626187 | 983 | * Sample input selection, use single ended or differential input according |
AnnaBridge | 170:e95d10626187 | 984 | * to setting of @p diff. |
AnnaBridge | 170:e95d10626187 | 985 | */ |
AnnaBridge | 170:e95d10626187 | 986 | ADC_SingleInput_TypeDef input; |
AnnaBridge | 170:e95d10626187 | 987 | #endif |
AnnaBridge | 170:e95d10626187 | 988 | |
AnnaBridge | 170:e95d10626187 | 989 | #if defined(_ADC_SINGLECTRL_POSSEL_MASK) |
AnnaBridge | 170:e95d10626187 | 990 | /** Select positive input for for single channel conversion mode. */ |
AnnaBridge | 170:e95d10626187 | 991 | ADC_PosSel_TypeDef posSel; |
AnnaBridge | 170:e95d10626187 | 992 | #endif |
AnnaBridge | 170:e95d10626187 | 993 | |
AnnaBridge | 170:e95d10626187 | 994 | #if defined(_ADC_SINGLECTRL_NEGSEL_MASK) |
AnnaBridge | 170:e95d10626187 | 995 | /** Select negative input for single channel conversion mode. Negative input is grounded |
AnnaBridge | 170:e95d10626187 | 996 | for single ended (non-differential) converison. */ |
AnnaBridge | 170:e95d10626187 | 997 | ADC_NegSel_TypeDef negSel; |
AnnaBridge | 170:e95d10626187 | 998 | #endif |
AnnaBridge | 170:e95d10626187 | 999 | |
AnnaBridge | 170:e95d10626187 | 1000 | /** Select if single ended or differential input. */ |
AnnaBridge | 170:e95d10626187 | 1001 | bool diff; |
AnnaBridge | 170:e95d10626187 | 1002 | |
AnnaBridge | 170:e95d10626187 | 1003 | /** Peripheral reflex system trigger enable. */ |
AnnaBridge | 170:e95d10626187 | 1004 | bool prsEnable; |
AnnaBridge | 170:e95d10626187 | 1005 | |
AnnaBridge | 170:e95d10626187 | 1006 | /** Select if left adjustment should be done. */ |
AnnaBridge | 170:e95d10626187 | 1007 | bool leftAdjust; |
AnnaBridge | 170:e95d10626187 | 1008 | |
AnnaBridge | 170:e95d10626187 | 1009 | /** Select if continuous conversion until explicit stop. */ |
AnnaBridge | 170:e95d10626187 | 1010 | bool rep; |
AnnaBridge | 170:e95d10626187 | 1011 | |
AnnaBridge | 170:e95d10626187 | 1012 | #if defined(_ADC_CTRL_SINGLEDMAWU_MASK) |
AnnaBridge | 170:e95d10626187 | 1013 | /** When true, DMA is available in EM2 for single conversion */ |
AnnaBridge | 170:e95d10626187 | 1014 | bool singleDmaEm2Wu; |
AnnaBridge | 170:e95d10626187 | 1015 | #endif |
AnnaBridge | 170:e95d10626187 | 1016 | |
AnnaBridge | 170:e95d10626187 | 1017 | #if defined(_ADC_SINGLECTRLX_FIFOOFACT_MASK) |
AnnaBridge | 170:e95d10626187 | 1018 | /** When true, the FIFO overwrites old data when full. If false, then the FIFO discards new data. |
AnnaBridge | 170:e95d10626187 | 1019 | The SCANOF IRQ is triggered in both cases. */ |
AnnaBridge | 170:e95d10626187 | 1020 | bool fifoOverwrite; |
AnnaBridge | 170:e95d10626187 | 1021 | #endif |
AnnaBridge | 170:e95d10626187 | 1022 | } ADC_InitSingle_TypeDef; |
AnnaBridge | 170:e95d10626187 | 1023 | |
AnnaBridge | 170:e95d10626187 | 1024 | /** Default config for ADC single conversion init structure. */ |
AnnaBridge | 170:e95d10626187 | 1025 | #if defined(_ADC_SINGLECTRL_INPUTSEL_MASK) |
AnnaBridge | 170:e95d10626187 | 1026 | #define ADC_INITSINGLE_DEFAULT \ |
AnnaBridge | 170:e95d10626187 | 1027 | { \ |
AnnaBridge | 170:e95d10626187 | 1028 | adcPRSSELCh0, /* PRS ch0 (if enabled). */ \ |
AnnaBridge | 170:e95d10626187 | 1029 | adcAcqTime1, /* 1 ADC_CLK cycle acquisition time. */ \ |
AnnaBridge | 170:e95d10626187 | 1030 | adcRef1V25, /* 1.25V internal reference. */ \ |
AnnaBridge | 170:e95d10626187 | 1031 | adcRes12Bit, /* 12 bit resolution. */ \ |
AnnaBridge | 170:e95d10626187 | 1032 | adcSingleInpCh0, /* CH0 input selected. */ \ |
AnnaBridge | 170:e95d10626187 | 1033 | false, /* Single ended input. */ \ |
AnnaBridge | 170:e95d10626187 | 1034 | false, /* PRS disabled. */ \ |
AnnaBridge | 170:e95d10626187 | 1035 | false, /* Right adjust. */ \ |
AnnaBridge | 170:e95d10626187 | 1036 | false /* Deactivate conversion after one scan sequence. */ \ |
AnnaBridge | 170:e95d10626187 | 1037 | } |
AnnaBridge | 170:e95d10626187 | 1038 | #else |
AnnaBridge | 170:e95d10626187 | 1039 | #define ADC_INITSINGLE_DEFAULT \ |
AnnaBridge | 170:e95d10626187 | 1040 | { \ |
AnnaBridge | 170:e95d10626187 | 1041 | adcPRSSELCh0, /* PRS ch0 (if enabled). */ \ |
AnnaBridge | 170:e95d10626187 | 1042 | adcAcqTime1, /* 1 ADC_CLK cycle acquisition time. */ \ |
AnnaBridge | 170:e95d10626187 | 1043 | adcRef1V25, /* 1.25V internal reference. */ \ |
AnnaBridge | 170:e95d10626187 | 1044 | adcRes12Bit, /* 12 bit resolution. */ \ |
AnnaBridge | 170:e95d10626187 | 1045 | adcPosSelAPORT0XCH0, /* Select node BUS0XCH0 as posSel */ \ |
AnnaBridge | 170:e95d10626187 | 1046 | adcNegSelVSS, /* Select VSS as negSel */ \ |
AnnaBridge | 170:e95d10626187 | 1047 | false, /* Single ended input. */ \ |
AnnaBridge | 170:e95d10626187 | 1048 | false, /* PRS disabled. */ \ |
AnnaBridge | 170:e95d10626187 | 1049 | false, /* Right adjust. */ \ |
AnnaBridge | 170:e95d10626187 | 1050 | false, /* Deactivate conversion after one scan sequence. */ \ |
AnnaBridge | 170:e95d10626187 | 1051 | false, /* No EM2 DMA wakeup from single FIFO DVL */ \ |
AnnaBridge | 170:e95d10626187 | 1052 | false /* Discard new data on full FIFO. */ \ |
AnnaBridge | 170:e95d10626187 | 1053 | } |
AnnaBridge | 170:e95d10626187 | 1054 | #endif |
AnnaBridge | 170:e95d10626187 | 1055 | |
AnnaBridge | 170:e95d10626187 | 1056 | /******************************************************************************* |
AnnaBridge | 170:e95d10626187 | 1057 | ***************************** PROTOTYPES ********************************** |
AnnaBridge | 170:e95d10626187 | 1058 | ******************************************************************************/ |
AnnaBridge | 170:e95d10626187 | 1059 | |
AnnaBridge | 170:e95d10626187 | 1060 | /***************************************************************************//** |
AnnaBridge | 170:e95d10626187 | 1061 | * @brief |
AnnaBridge | 170:e95d10626187 | 1062 | * Get single conversion result. |
AnnaBridge | 170:e95d10626187 | 1063 | * |
AnnaBridge | 170:e95d10626187 | 1064 | * @note |
AnnaBridge | 170:e95d10626187 | 1065 | * Check data valid flag before calling this function. |
AnnaBridge | 170:e95d10626187 | 1066 | * |
AnnaBridge | 170:e95d10626187 | 1067 | * @param[in] adc |
AnnaBridge | 170:e95d10626187 | 1068 | * Pointer to ADC peripheral register block. |
AnnaBridge | 170:e95d10626187 | 1069 | * |
AnnaBridge | 170:e95d10626187 | 1070 | * @return |
AnnaBridge | 170:e95d10626187 | 1071 | * Single conversion data. |
AnnaBridge | 170:e95d10626187 | 1072 | ******************************************************************************/ |
AnnaBridge | 170:e95d10626187 | 1073 | __STATIC_INLINE uint32_t ADC_DataSingleGet(ADC_TypeDef *adc) |
AnnaBridge | 170:e95d10626187 | 1074 | { |
AnnaBridge | 170:e95d10626187 | 1075 | return adc->SINGLEDATA; |
AnnaBridge | 170:e95d10626187 | 1076 | } |
AnnaBridge | 170:e95d10626187 | 1077 | |
AnnaBridge | 170:e95d10626187 | 1078 | /***************************************************************************//** |
AnnaBridge | 170:e95d10626187 | 1079 | * @brief |
AnnaBridge | 170:e95d10626187 | 1080 | * Peek single conversion result. |
AnnaBridge | 170:e95d10626187 | 1081 | * |
AnnaBridge | 170:e95d10626187 | 1082 | * @note |
AnnaBridge | 170:e95d10626187 | 1083 | * Check data valid flag before calling this function. |
AnnaBridge | 170:e95d10626187 | 1084 | * |
AnnaBridge | 170:e95d10626187 | 1085 | * @param[in] adc |
AnnaBridge | 170:e95d10626187 | 1086 | * Pointer to ADC peripheral register block. |
AnnaBridge | 170:e95d10626187 | 1087 | * |
AnnaBridge | 170:e95d10626187 | 1088 | * @return |
AnnaBridge | 170:e95d10626187 | 1089 | * Single conversion data. |
AnnaBridge | 170:e95d10626187 | 1090 | ******************************************************************************/ |
AnnaBridge | 170:e95d10626187 | 1091 | __STATIC_INLINE uint32_t ADC_DataSinglePeek(ADC_TypeDef *adc) |
AnnaBridge | 170:e95d10626187 | 1092 | { |
AnnaBridge | 170:e95d10626187 | 1093 | return adc->SINGLEDATAP; |
AnnaBridge | 170:e95d10626187 | 1094 | } |
AnnaBridge | 170:e95d10626187 | 1095 | |
AnnaBridge | 170:e95d10626187 | 1096 | /***************************************************************************//** |
AnnaBridge | 170:e95d10626187 | 1097 | * @brief |
AnnaBridge | 170:e95d10626187 | 1098 | * Get scan result. |
AnnaBridge | 170:e95d10626187 | 1099 | * |
AnnaBridge | 170:e95d10626187 | 1100 | * @note |
AnnaBridge | 170:e95d10626187 | 1101 | * Check data valid flag before calling this function. |
AnnaBridge | 170:e95d10626187 | 1102 | * |
AnnaBridge | 170:e95d10626187 | 1103 | * @param[in] adc |
AnnaBridge | 170:e95d10626187 | 1104 | * Pointer to ADC peripheral register block. |
AnnaBridge | 170:e95d10626187 | 1105 | * |
AnnaBridge | 170:e95d10626187 | 1106 | * @return |
AnnaBridge | 170:e95d10626187 | 1107 | * Scan conversion data. |
AnnaBridge | 170:e95d10626187 | 1108 | ******************************************************************************/ |
AnnaBridge | 170:e95d10626187 | 1109 | __STATIC_INLINE uint32_t ADC_DataScanGet(ADC_TypeDef *adc) |
AnnaBridge | 170:e95d10626187 | 1110 | { |
AnnaBridge | 170:e95d10626187 | 1111 | return adc->SCANDATA; |
AnnaBridge | 170:e95d10626187 | 1112 | } |
AnnaBridge | 170:e95d10626187 | 1113 | |
AnnaBridge | 170:e95d10626187 | 1114 | /***************************************************************************//** |
AnnaBridge | 170:e95d10626187 | 1115 | * @brief |
AnnaBridge | 170:e95d10626187 | 1116 | * Peek scan result. |
AnnaBridge | 170:e95d10626187 | 1117 | * |
AnnaBridge | 170:e95d10626187 | 1118 | * @note |
AnnaBridge | 170:e95d10626187 | 1119 | * Check data valid flag before calling this function. |
AnnaBridge | 170:e95d10626187 | 1120 | * |
AnnaBridge | 170:e95d10626187 | 1121 | * @param[in] adc |
AnnaBridge | 170:e95d10626187 | 1122 | * Pointer to ADC peripheral register block. |
AnnaBridge | 170:e95d10626187 | 1123 | * |
AnnaBridge | 170:e95d10626187 | 1124 | * @return |
AnnaBridge | 170:e95d10626187 | 1125 | * Scan conversion data. |
AnnaBridge | 170:e95d10626187 | 1126 | ******************************************************************************/ |
AnnaBridge | 170:e95d10626187 | 1127 | __STATIC_INLINE uint32_t ADC_DataScanPeek(ADC_TypeDef *adc) |
AnnaBridge | 170:e95d10626187 | 1128 | { |
AnnaBridge | 170:e95d10626187 | 1129 | return adc->SCANDATAP; |
AnnaBridge | 170:e95d10626187 | 1130 | } |
AnnaBridge | 170:e95d10626187 | 1131 | |
AnnaBridge | 170:e95d10626187 | 1132 | #if defined(_ADC_SCANDATAX_MASK) |
AnnaBridge | 170:e95d10626187 | 1133 | uint32_t ADC_DataIdScanGet(ADC_TypeDef *adc, uint32_t *scanId); |
AnnaBridge | 170:e95d10626187 | 1134 | #endif |
AnnaBridge | 170:e95d10626187 | 1135 | |
AnnaBridge | 170:e95d10626187 | 1136 | void ADC_Init(ADC_TypeDef *adc, const ADC_Init_TypeDef *init); |
AnnaBridge | 170:e95d10626187 | 1137 | void ADC_Reset(ADC_TypeDef *adc); |
AnnaBridge | 170:e95d10626187 | 1138 | void ADC_InitScan(ADC_TypeDef *adc, const ADC_InitScan_TypeDef *init); |
AnnaBridge | 170:e95d10626187 | 1139 | |
AnnaBridge | 170:e95d10626187 | 1140 | #if defined(_ADC_SCANINPUTSEL_MASK) |
AnnaBridge | 170:e95d10626187 | 1141 | void ADC_ScanInputClear(ADC_InitScan_TypeDef *scanInit); |
AnnaBridge | 170:e95d10626187 | 1142 | uint32_t ADC_ScanSingleEndedInputAdd(ADC_InitScan_TypeDef *scanInit, |
AnnaBridge | 170:e95d10626187 | 1143 | ADC_ScanInputGroup_TypeDef inputGroup, |
AnnaBridge | 170:e95d10626187 | 1144 | ADC_PosSel_TypeDef singleEndedSel); |
AnnaBridge | 170:e95d10626187 | 1145 | uint32_t ADC_ScanDifferentialInputAdd(ADC_InitScan_TypeDef *scanInit, |
AnnaBridge | 170:e95d10626187 | 1146 | ADC_ScanInputGroup_TypeDef inputGroup, |
AnnaBridge | 170:e95d10626187 | 1147 | ADC_PosSel_TypeDef posSel, |
AnnaBridge | 170:e95d10626187 | 1148 | ADC_ScanNegInput_TypeDef adcScanNegInput); |
AnnaBridge | 170:e95d10626187 | 1149 | #endif |
AnnaBridge | 170:e95d10626187 | 1150 | |
AnnaBridge | 170:e95d10626187 | 1151 | void ADC_InitSingle(ADC_TypeDef *adc, const ADC_InitSingle_TypeDef *init); |
AnnaBridge | 170:e95d10626187 | 1152 | uint8_t ADC_TimebaseCalc(uint32_t hfperFreq); |
AnnaBridge | 170:e95d10626187 | 1153 | uint8_t ADC_PrescaleCalc(uint32_t adcFreq, uint32_t hfperFreq); |
AnnaBridge | 170:e95d10626187 | 1154 | |
AnnaBridge | 170:e95d10626187 | 1155 | /***************************************************************************//** |
AnnaBridge | 170:e95d10626187 | 1156 | * @brief |
AnnaBridge | 170:e95d10626187 | 1157 | * Clear one or more pending ADC interrupts. |
AnnaBridge | 170:e95d10626187 | 1158 | * |
AnnaBridge | 170:e95d10626187 | 1159 | * @param[in] adc |
AnnaBridge | 170:e95d10626187 | 1160 | * Pointer to ADC peripheral register block. |
AnnaBridge | 170:e95d10626187 | 1161 | * |
AnnaBridge | 170:e95d10626187 | 1162 | * @param[in] flags |
AnnaBridge | 170:e95d10626187 | 1163 | * Pending ADC interrupt source to clear. Use a bitwise logic OR combination |
AnnaBridge | 170:e95d10626187 | 1164 | * of valid interrupt flags for the ADC module (ADC_IF_nnn). |
AnnaBridge | 170:e95d10626187 | 1165 | ******************************************************************************/ |
AnnaBridge | 170:e95d10626187 | 1166 | __STATIC_INLINE void ADC_IntClear(ADC_TypeDef *adc, uint32_t flags) |
AnnaBridge | 170:e95d10626187 | 1167 | { |
AnnaBridge | 170:e95d10626187 | 1168 | adc->IFC = flags; |
AnnaBridge | 170:e95d10626187 | 1169 | } |
AnnaBridge | 170:e95d10626187 | 1170 | |
AnnaBridge | 170:e95d10626187 | 1171 | /***************************************************************************//** |
AnnaBridge | 170:e95d10626187 | 1172 | * @brief |
AnnaBridge | 170:e95d10626187 | 1173 | * Disable one or more ADC interrupts. |
AnnaBridge | 170:e95d10626187 | 1174 | * |
AnnaBridge | 170:e95d10626187 | 1175 | * @param[in] adc |
AnnaBridge | 170:e95d10626187 | 1176 | * Pointer to ADC peripheral register block. |
AnnaBridge | 170:e95d10626187 | 1177 | * |
AnnaBridge | 170:e95d10626187 | 1178 | * @param[in] flags |
AnnaBridge | 170:e95d10626187 | 1179 | * ADC interrupt sources to disable. Use a bitwise logic OR combination of |
AnnaBridge | 170:e95d10626187 | 1180 | * valid interrupt flags for the ADC module (ADC_IF_nnn). |
AnnaBridge | 170:e95d10626187 | 1181 | ******************************************************************************/ |
AnnaBridge | 170:e95d10626187 | 1182 | __STATIC_INLINE void ADC_IntDisable(ADC_TypeDef *adc, uint32_t flags) |
AnnaBridge | 170:e95d10626187 | 1183 | { |
AnnaBridge | 170:e95d10626187 | 1184 | adc->IEN &= ~flags; |
AnnaBridge | 170:e95d10626187 | 1185 | } |
AnnaBridge | 170:e95d10626187 | 1186 | |
AnnaBridge | 170:e95d10626187 | 1187 | /***************************************************************************//** |
AnnaBridge | 170:e95d10626187 | 1188 | * @brief |
AnnaBridge | 170:e95d10626187 | 1189 | * Enable one or more ADC interrupts. |
AnnaBridge | 170:e95d10626187 | 1190 | * |
AnnaBridge | 170:e95d10626187 | 1191 | * @note |
AnnaBridge | 170:e95d10626187 | 1192 | * Depending on the use, a pending interrupt may already be set prior to |
AnnaBridge | 170:e95d10626187 | 1193 | * enabling the interrupt. Consider using ADC_IntClear() prior to enabling |
AnnaBridge | 170:e95d10626187 | 1194 | * if such a pending interrupt should be ignored. |
AnnaBridge | 170:e95d10626187 | 1195 | * |
AnnaBridge | 170:e95d10626187 | 1196 | * @param[in] adc |
AnnaBridge | 170:e95d10626187 | 1197 | * Pointer to ADC peripheral register block. |
AnnaBridge | 170:e95d10626187 | 1198 | * |
AnnaBridge | 170:e95d10626187 | 1199 | * @param[in] flags |
AnnaBridge | 170:e95d10626187 | 1200 | * ADC interrupt sources to enable. Use a bitwise logic OR combination of |
AnnaBridge | 170:e95d10626187 | 1201 | * valid interrupt flags for the ADC module (ADC_IF_nnn). |
AnnaBridge | 170:e95d10626187 | 1202 | ******************************************************************************/ |
AnnaBridge | 170:e95d10626187 | 1203 | __STATIC_INLINE void ADC_IntEnable(ADC_TypeDef *adc, uint32_t flags) |
AnnaBridge | 170:e95d10626187 | 1204 | { |
AnnaBridge | 170:e95d10626187 | 1205 | adc->IEN |= flags; |
AnnaBridge | 170:e95d10626187 | 1206 | } |
AnnaBridge | 170:e95d10626187 | 1207 | |
AnnaBridge | 170:e95d10626187 | 1208 | /***************************************************************************//** |
AnnaBridge | 170:e95d10626187 | 1209 | * @brief |
AnnaBridge | 170:e95d10626187 | 1210 | * Get pending ADC interrupt flags. |
AnnaBridge | 170:e95d10626187 | 1211 | * |
AnnaBridge | 170:e95d10626187 | 1212 | * @note |
AnnaBridge | 170:e95d10626187 | 1213 | * The event bits are not cleared by the use of this function. |
AnnaBridge | 170:e95d10626187 | 1214 | * |
AnnaBridge | 170:e95d10626187 | 1215 | * @param[in] adc |
AnnaBridge | 170:e95d10626187 | 1216 | * Pointer to ADC peripheral register block. |
AnnaBridge | 170:e95d10626187 | 1217 | * |
AnnaBridge | 170:e95d10626187 | 1218 | * @return |
AnnaBridge | 170:e95d10626187 | 1219 | * ADC interrupt sources pending. A bitwise logic OR combination of valid |
AnnaBridge | 170:e95d10626187 | 1220 | * interrupt flags for the ADC module (ADC_IF_nnn). |
AnnaBridge | 170:e95d10626187 | 1221 | ******************************************************************************/ |
AnnaBridge | 170:e95d10626187 | 1222 | __STATIC_INLINE uint32_t ADC_IntGet(ADC_TypeDef *adc) |
AnnaBridge | 170:e95d10626187 | 1223 | { |
AnnaBridge | 170:e95d10626187 | 1224 | return adc->IF; |
AnnaBridge | 170:e95d10626187 | 1225 | } |
AnnaBridge | 170:e95d10626187 | 1226 | |
AnnaBridge | 170:e95d10626187 | 1227 | /***************************************************************************//** |
AnnaBridge | 170:e95d10626187 | 1228 | * @brief |
AnnaBridge | 170:e95d10626187 | 1229 | * Get enabled and pending ADC interrupt flags. |
AnnaBridge | 170:e95d10626187 | 1230 | * Useful for handling more interrupt sources in the same interrupt handler. |
AnnaBridge | 170:e95d10626187 | 1231 | * |
AnnaBridge | 170:e95d10626187 | 1232 | * @param[in] adc |
AnnaBridge | 170:e95d10626187 | 1233 | * Pointer to ADC peripheral register block. |
AnnaBridge | 170:e95d10626187 | 1234 | * |
AnnaBridge | 170:e95d10626187 | 1235 | * @note |
AnnaBridge | 170:e95d10626187 | 1236 | * Interrupt flags are not cleared by the use of this function. |
AnnaBridge | 170:e95d10626187 | 1237 | * |
AnnaBridge | 170:e95d10626187 | 1238 | * @return |
AnnaBridge | 170:e95d10626187 | 1239 | * Pending and enabled ADC interrupt sources. |
AnnaBridge | 170:e95d10626187 | 1240 | * The return value is the bitwise AND combination of |
AnnaBridge | 170:e95d10626187 | 1241 | * - the OR combination of enabled interrupt sources in ADCx_IEN_nnn |
AnnaBridge | 170:e95d10626187 | 1242 | * register (ADCx_IEN_nnn) and |
AnnaBridge | 170:e95d10626187 | 1243 | * - the OR combination of valid interrupt flags of the ADC module |
AnnaBridge | 170:e95d10626187 | 1244 | * (ADCx_IF_nnn). |
AnnaBridge | 170:e95d10626187 | 1245 | ******************************************************************************/ |
AnnaBridge | 170:e95d10626187 | 1246 | __STATIC_INLINE uint32_t ADC_IntGetEnabled(ADC_TypeDef *adc) |
AnnaBridge | 170:e95d10626187 | 1247 | { |
AnnaBridge | 170:e95d10626187 | 1248 | uint32_t ien; |
AnnaBridge | 170:e95d10626187 | 1249 | |
AnnaBridge | 170:e95d10626187 | 1250 | /* Store ADCx->IEN in temporary variable in order to define explicit order |
AnnaBridge | 170:e95d10626187 | 1251 | * of volatile accesses. */ |
AnnaBridge | 170:e95d10626187 | 1252 | ien = adc->IEN; |
AnnaBridge | 170:e95d10626187 | 1253 | |
AnnaBridge | 170:e95d10626187 | 1254 | /* Bitwise AND of pending and enabled interrupts */ |
AnnaBridge | 170:e95d10626187 | 1255 | return adc->IF & ien; |
AnnaBridge | 170:e95d10626187 | 1256 | } |
AnnaBridge | 170:e95d10626187 | 1257 | |
AnnaBridge | 170:e95d10626187 | 1258 | /***************************************************************************//** |
AnnaBridge | 170:e95d10626187 | 1259 | * @brief |
AnnaBridge | 170:e95d10626187 | 1260 | * Set one or more pending ADC interrupts from SW. |
AnnaBridge | 170:e95d10626187 | 1261 | * |
AnnaBridge | 170:e95d10626187 | 1262 | * @param[in] adc |
AnnaBridge | 170:e95d10626187 | 1263 | * Pointer to ADC peripheral register block. |
AnnaBridge | 170:e95d10626187 | 1264 | * |
AnnaBridge | 170:e95d10626187 | 1265 | * @param[in] flags |
AnnaBridge | 170:e95d10626187 | 1266 | * ADC interrupt sources to set to pending. Use a bitwise logic OR combination |
AnnaBridge | 170:e95d10626187 | 1267 | * of valid interrupt flags for the ADC module (ADC_IF_nnn). |
AnnaBridge | 170:e95d10626187 | 1268 | ******************************************************************************/ |
AnnaBridge | 170:e95d10626187 | 1269 | __STATIC_INLINE void ADC_IntSet(ADC_TypeDef *adc, uint32_t flags) |
AnnaBridge | 170:e95d10626187 | 1270 | { |
AnnaBridge | 170:e95d10626187 | 1271 | adc->IFS = flags; |
AnnaBridge | 170:e95d10626187 | 1272 | } |
AnnaBridge | 170:e95d10626187 | 1273 | |
AnnaBridge | 170:e95d10626187 | 1274 | /***************************************************************************//** |
AnnaBridge | 170:e95d10626187 | 1275 | * @brief |
AnnaBridge | 170:e95d10626187 | 1276 | * Start scan sequence and/or single conversion. |
AnnaBridge | 170:e95d10626187 | 1277 | * |
AnnaBridge | 170:e95d10626187 | 1278 | * @param[in] adc |
AnnaBridge | 170:e95d10626187 | 1279 | * Pointer to ADC peripheral register block. |
AnnaBridge | 170:e95d10626187 | 1280 | * |
AnnaBridge | 170:e95d10626187 | 1281 | * @param[in] cmd |
AnnaBridge | 170:e95d10626187 | 1282 | * Command indicating which type of sampling to start. |
AnnaBridge | 170:e95d10626187 | 1283 | ******************************************************************************/ |
AnnaBridge | 170:e95d10626187 | 1284 | __STATIC_INLINE void ADC_Start(ADC_TypeDef *adc, ADC_Start_TypeDef cmd) |
AnnaBridge | 170:e95d10626187 | 1285 | { |
AnnaBridge | 170:e95d10626187 | 1286 | adc->CMD = (uint32_t)cmd; |
AnnaBridge | 170:e95d10626187 | 1287 | } |
AnnaBridge | 170:e95d10626187 | 1288 | |
AnnaBridge | 170:e95d10626187 | 1289 | /** @} (end addtogroup ADC) */ |
AnnaBridge | 170:e95d10626187 | 1290 | /** @} (end addtogroup emlib) */ |
AnnaBridge | 170:e95d10626187 | 1291 | |
AnnaBridge | 170:e95d10626187 | 1292 | #ifdef __cplusplus |
AnnaBridge | 170:e95d10626187 | 1293 | } |
AnnaBridge | 170:e95d10626187 | 1294 | #endif |
AnnaBridge | 170:e95d10626187 | 1295 | |
AnnaBridge | 170:e95d10626187 | 1296 | #endif /* defined(ADC_COUNT) && (ADC_COUNT > 0) */ |
AnnaBridge | 170:e95d10626187 | 1297 | #endif /* EM_ADC_H */ |