ADCEMLIB
Detailed Description
Analog to Digital Converter (ADC) Peripheral API.
This module contains functions to control the ADC peripheral of Silicon Labs 32-bit MCUs and SoCs. The ADC is used to convert analog signals into a digital representation.
Data Structures |
|
struct | ADC_Init_TypeDef |
struct | ADC_InitScan_TypeDef |
struct | ADC_InitScanInput_TypeDef |
struct | ADC_InitSingle_TypeDef |
Macros |
|
#define | ADC_CTRLX_VREFSEL_REG 0x80UL |
#define | ADC_INIT_DEFAULT |
#define | ADC_INITSCAN_DEFAULT |
#define | ADC_INITSINGLE_DEFAULT |
#define | ADC_SCANINPUTSEL_GROUP_NONE 0xFFU |
#define | ADC_SCANINPUTSEL_NONE |
#define | adcPosSelAREG adcPosSelDVDD |
#define | adcPosSelIO0 adcPosSelIOVDD |
#define | adcPosSelPDBU adcPosSelDECOUPLE |
#define | adcPosSelVREGOUTPA adcPosSelPAVDD |
Enumerations |
|
enum |
ADC_AcqTime_TypeDef
{
adcAcqTime1 = _ADC_SINGLECTRL_AT_1CYCLE, adcAcqTime2 = _ADC_SINGLECTRL_AT_2CYCLES, adcAcqTime4 = _ADC_SINGLECTRL_AT_4CYCLES, adcAcqTime8 = _ADC_SINGLECTRL_AT_8CYCLES, adcAcqTime16 = _ADC_SINGLECTRL_AT_16CYCLES, adcAcqTime32 = _ADC_SINGLECTRL_AT_32CYCLES, adcAcqTime64 = _ADC_SINGLECTRL_AT_64CYCLES, adcAcqTime128 = _ADC_SINGLECTRL_AT_128CYCLES, adcAcqTime256 = _ADC_SINGLECTRL_AT_256CYCLES } |
enum |
ADC_EM2ClockConfig_TypeDef
{
adcEm2Disabled = 0, adcEm2ClockOnDemand = ADC_CTRL_ADCCLKMODE_ASYNC | ADC_CTRL_ASYNCCLKEN_ASNEEDED, adcEm2ClockAlwaysOn = ADC_CTRL_ADCCLKMODE_ASYNC | ADC_CTRL_ASYNCCLKEN_ALWAYSON } |
enum |
ADC_NegSel_TypeDef
{
adcNegSelAPORT0XCH0 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH0, adcNegSelAPORT0XCH1 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH1, adcNegSelAPORT0XCH2 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH2, adcNegSelAPORT0XCH3 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH3, adcNegSelAPORT0XCH4 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH4, adcNegSelAPORT0XCH5 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH5, adcNegSelAPORT0XCH6 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH6, adcNegSelAPORT0XCH7 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH7, adcNegSelAPORT0XCH8 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH8, adcNegSelAPORT0XCH9 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH9, adcNegSelAPORT0XCH10 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH10, adcNegSelAPORT0XCH11 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH11, adcNegSelAPORT0XCH12 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH12, adcNegSelAPORT0XCH13 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH13, adcNegSelAPORT0XCH14 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH14, adcNegSelAPORT0XCH15 = _ADC_SINGLECTRL_NEGSEL_APORT0XCH15, adcNegSelAPORT0YCH0 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH0, adcNegSelAPORT0YCH1 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH1, adcNegSelAPORT0YCH2 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH2, adcNegSelAPORT0YCH3 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH3, adcNegSelAPORT0YCH4 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH4, adcNegSelAPORT0YCH5 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH5, adcNegSelAPORT0YCH6 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH6, adcNegSelAPORT0YCH7 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH7, adcNegSelAPORT0YCH8 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH8, adcNegSelAPORT0YCH9 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH9, adcNegSelAPORT0YCH10 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH10, adcNegSelAPORT0YCH11 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH11, adcNegSelAPORT0YCH12 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH12, adcNegSelAPORT0YCH13 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH13, adcNegSelAPORT0YCH14 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH14, adcNegSelAPORT0YCH15 = _ADC_SINGLECTRL_NEGSEL_APORT0YCH15, adcNegSelAPORT1XCH0 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH0, adcNegSelAPORT1YCH1 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH1, adcNegSelAPORT1XCH2 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH2, adcNegSelAPORT1YCH3 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH3, adcNegSelAPORT1XCH4 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH4, adcNegSelAPORT1YCH5 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH5, adcNegSelAPORT1XCH6 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH6, adcNegSelAPORT1YCH7 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH7, adcNegSelAPORT1XCH8 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH8, adcNegSelAPORT1YCH9 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH9, adcNegSelAPORT1XCH10 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH10, adcNegSelAPORT1YCH11 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH11, adcNegSelAPORT1XCH12 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH12, adcNegSelAPORT1YCH13 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH13, adcNegSelAPORT1XCH14 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH14, adcNegSelAPORT1YCH15 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH15, adcNegSelAPORT1XCH16 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH16, adcNegSelAPORT1YCH17 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH17, adcNegSelAPORT1XCH18 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH18, adcNegSelAPORT1YCH19 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH19, adcNegSelAPORT1XCH20 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH20, adcNegSelAPORT1YCH21 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH21, adcNegSelAPORT1XCH22 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH22, adcNegSelAPORT1YCH23 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH23, adcNegSelAPORT1XCH24 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH24, adcNegSelAPORT1YCH25 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH25, adcNegSelAPORT1XCH26 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH26, adcNegSelAPORT1YCH27 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH27, adcNegSelAPORT1XCH28 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH28, adcNegSelAPORT1YCH29 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH29, adcNegSelAPORT1XCH30 = _ADC_SINGLECTRL_NEGSEL_APORT1XCH30, adcNegSelAPORT1YCH31 = _ADC_SINGLECTRL_NEGSEL_APORT1YCH31, adcNegSelAPORT2YCH0 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH0, adcNegSelAPORT2XCH1 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH1, adcNegSelAPORT2YCH2 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH2, adcNegSelAPORT2XCH3 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH3, adcNegSelAPORT2YCH4 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH4, adcNegSelAPORT2XCH5 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH5, adcNegSelAPORT2YCH6 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH6, adcNegSelAPORT2XCH7 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH7, adcNegSelAPORT2YCH8 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH8, adcNegSelAPORT2XCH9 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH9, adcNegSelAPORT2YCH10 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH10, adcNegSelAPORT2XCH11 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH11, adcNegSelAPORT2YCH12 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH12, adcNegSelAPORT2XCH13 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH13, adcNegSelAPORT2YCH14 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH14, adcNegSelAPORT2XCH15 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH15, adcNegSelAPORT2YCH16 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH16, adcNegSelAPORT2XCH17 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH17, adcNegSelAPORT2YCH18 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH18, adcNegSelAPORT2XCH19 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH19, adcNegSelAPORT2YCH20 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH20, adcNegSelAPORT2XCH21 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH21, adcNegSelAPORT2YCH22 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH22, adcNegSelAPORT2XCH23 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH23, adcNegSelAPORT2YCH24 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH24, adcNegSelAPORT2XCH25 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH25, adcNegSelAPORT2YCH26 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH26, adcNegSelAPORT2XCH27 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH27, adcNegSelAPORT2YCH28 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH28, adcNegSelAPORT2XCH29 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH29, adcNegSelAPORT2YCH30 = _ADC_SINGLECTRL_NEGSEL_APORT2YCH30, adcNegSelAPORT2XCH31 = _ADC_SINGLECTRL_NEGSEL_APORT2XCH31, adcNegSelAPORT3XCH0 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH0, adcNegSelAPORT3YCH1 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH1, adcNegSelAPORT3XCH2 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH2, adcNegSelAPORT3YCH3 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH3, adcNegSelAPORT3XCH4 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH4, adcNegSelAPORT3YCH5 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH5, adcNegSelAPORT3XCH6 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH6, adcNegSelAPORT3YCH7 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH7, adcNegSelAPORT3XCH8 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH8, adcNegSelAPORT3YCH9 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH9, adcNegSelAPORT3XCH10 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH10, adcNegSelAPORT3YCH11 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH11, adcNegSelAPORT3XCH12 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH12, adcNegSelAPORT3YCH13 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH13, adcNegSelAPORT3XCH14 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH14, adcNegSelAPORT3YCH15 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH15, adcNegSelAPORT3XCH16 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH16, adcNegSelAPORT3YCH17 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH17, adcNegSelAPORT3XCH18 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH18, adcNegSelAPORT3YCH19 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH19, adcNegSelAPORT3XCH20 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH20, adcNegSelAPORT3YCH21 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH21, adcNegSelAPORT3XCH22 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH22, adcNegSelAPORT3YCH23 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH23, adcNegSelAPORT3XCH24 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH24, adcNegSelAPORT3YCH25 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH25, adcNegSelAPORT3XCH26 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH26, adcNegSelAPORT3YCH27 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH27, adcNegSelAPORT3XCH28 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH28, adcNegSelAPORT3YCH29 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH29, adcNegSelAPORT3XCH30 = _ADC_SINGLECTRL_NEGSEL_APORT3XCH30, adcNegSelAPORT3YCH31 = _ADC_SINGLECTRL_NEGSEL_APORT3YCH31, adcNegSelAPORT4YCH0 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH0, adcNegSelAPORT4XCH1 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH1, adcNegSelAPORT4YCH2 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH2, adcNegSelAPORT4XCH3 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH3, adcNegSelAPORT4YCH4 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH4, adcNegSelAPORT4XCH5 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH5, adcNegSelAPORT4YCH6 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH6, adcNegSelAPORT4XCH7 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH7, adcNegSelAPORT4YCH8 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH8, adcNegSelAPORT4XCH9 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH9, adcNegSelAPORT4YCH10 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH10, adcNegSelAPORT4XCH11 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH11, adcNegSelAPORT4YCH12 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH12, adcNegSelAPORT4XCH13 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH13, adcNegSelAPORT4YCH14 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH14, adcNegSelAPORT4XCH15 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH15, adcNegSelAPORT4YCH16 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH16, adcNegSelAPORT4XCH17 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH17, adcNegSelAPORT4YCH18 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH18, adcNegSelAPORT4XCH19 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH19, adcNegSelAPORT4YCH20 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH20, adcNegSelAPORT4XCH21 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH21, adcNegSelAPORT4YCH22 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH22, adcNegSelAPORT4XCH23 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH23, adcNegSelAPORT4YCH24 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH24, adcNegSelAPORT4XCH25 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH25, adcNegSelAPORT4YCH26 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH26, adcNegSelAPORT4XCH27 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH27, adcNegSelAPORT4YCH28 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH28, adcNegSelAPORT4XCH29 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH29, adcNegSelAPORT4YCH30 = _ADC_SINGLECTRL_NEGSEL_APORT4YCH30, adcNegSelAPORT4XCH31 = _ADC_SINGLECTRL_NEGSEL_APORT4XCH31, adcNegSelTESTN = _ADC_SINGLECTRL_NEGSEL_TESTN, adcNegSelDEFAULT = _ADC_SINGLECTRL_NEGSEL_DEFAULT, adcNegSelVSS = _ADC_SINGLECTRL_NEGSEL_VSS } |
enum |
ADC_OvsRateSel_TypeDef
{
adcOvsRateSel2 = _ADC_CTRL_OVSRSEL_X2, adcOvsRateSel4 = _ADC_CTRL_OVSRSEL_X4, adcOvsRateSel8 = _ADC_CTRL_OVSRSEL_X8, adcOvsRateSel16 = _ADC_CTRL_OVSRSEL_X16, adcOvsRateSel32 = _ADC_CTRL_OVSRSEL_X32, adcOvsRateSel64 = _ADC_CTRL_OVSRSEL_X64, adcOvsRateSel128 = _ADC_CTRL_OVSRSEL_X128, adcOvsRateSel256 = _ADC_CTRL_OVSRSEL_X256, adcOvsRateSel512 = _ADC_CTRL_OVSRSEL_X512, adcOvsRateSel1024 = _ADC_CTRL_OVSRSEL_X1024, adcOvsRateSel2048 = _ADC_CTRL_OVSRSEL_X2048, adcOvsRateSel4096 = _ADC_CTRL_OVSRSEL_X4096 } |
enum |
ADC_PosSel_TypeDef
{
adcPosSelAPORT0XCH0 = _ADC_SINGLECTRL_POSSEL_APORT0XCH0, adcPosSelAPORT0XCH1 = _ADC_SINGLECTRL_POSSEL_APORT0XCH1, adcPosSelAPORT0XCH2 = _ADC_SINGLECTRL_POSSEL_APORT0XCH2, adcPosSelAPORT0XCH3 = _ADC_SINGLECTRL_POSSEL_APORT0XCH3, adcPosSelAPORT0XCH4 = _ADC_SINGLECTRL_POSSEL_APORT0XCH4, adcPosSelAPORT0XCH5 = _ADC_SINGLECTRL_POSSEL_APORT0XCH5, adcPosSelAPORT0XCH6 = _ADC_SINGLECTRL_POSSEL_APORT0XCH6, adcPosSelAPORT0XCH7 = _ADC_SINGLECTRL_POSSEL_APORT0XCH7, adcPosSelAPORT0XCH8 = _ADC_SINGLECTRL_POSSEL_APORT0XCH8, adcPosSelAPORT0XCH9 = _ADC_SINGLECTRL_POSSEL_APORT0XCH9, adcPosSelAPORT0XCH10 = _ADC_SINGLECTRL_POSSEL_APORT0XCH10, adcPosSelAPORT0XCH11 = _ADC_SINGLECTRL_POSSEL_APORT0XCH11, adcPosSelAPORT0XCH12 = _ADC_SINGLECTRL_POSSEL_APORT0XCH12, adcPosSelAPORT0XCH13 = _ADC_SINGLECTRL_POSSEL_APORT0XCH13, adcPosSelAPORT0XCH14 = _ADC_SINGLECTRL_POSSEL_APORT0XCH14, adcPosSelAPORT0XCH15 = _ADC_SINGLECTRL_POSSEL_APORT0XCH15, adcPosSelAPORT0YCH0 = _ADC_SINGLECTRL_POSSEL_APORT0YCH0, adcPosSelAPORT0YCH1 = _ADC_SINGLECTRL_POSSEL_APORT0YCH1, adcPosSelAPORT0YCH2 = _ADC_SINGLECTRL_POSSEL_APORT0YCH2, adcPosSelAPORT0YCH3 = _ADC_SINGLECTRL_POSSEL_APORT0YCH3, adcPosSelAPORT0YCH4 = _ADC_SINGLECTRL_POSSEL_APORT0YCH4, adcPosSelAPORT0YCH5 = _ADC_SINGLECTRL_POSSEL_APORT0YCH5, adcPosSelAPORT0YCH6 = _ADC_SINGLECTRL_POSSEL_APORT0YCH6, adcPosSelAPORT0YCH7 = _ADC_SINGLECTRL_POSSEL_APORT0YCH7, adcPosSelAPORT0YCH8 = _ADC_SINGLECTRL_POSSEL_APORT0YCH8, adcPosSelAPORT0YCH9 = _ADC_SINGLECTRL_POSSEL_APORT0YCH9, adcPosSelAPORT0YCH10 = _ADC_SINGLECTRL_POSSEL_APORT0YCH10, adcPosSelAPORT0YCH11 = _ADC_SINGLECTRL_POSSEL_APORT0YCH11, adcPosSelAPORT0YCH12 = _ADC_SINGLECTRL_POSSEL_APORT0YCH12, adcPosSelAPORT0YCH13 = _ADC_SINGLECTRL_POSSEL_APORT0YCH13, adcPosSelAPORT0YCH14 = _ADC_SINGLECTRL_POSSEL_APORT0YCH14, adcPosSelAPORT0YCH15 = _ADC_SINGLECTRL_POSSEL_APORT0YCH15, adcPosSelAPORT1XCH0 = _ADC_SINGLECTRL_POSSEL_APORT1XCH0, adcPosSelAPORT1YCH1 = _ADC_SINGLECTRL_POSSEL_APORT1YCH1, adcPosSelAPORT1XCH2 = _ADC_SINGLECTRL_POSSEL_APORT1XCH2, adcPosSelAPORT1YCH3 = _ADC_SINGLECTRL_POSSEL_APORT1YCH3, adcPosSelAPORT1XCH4 = _ADC_SINGLECTRL_POSSEL_APORT1XCH4, adcPosSelAPORT1YCH5 = _ADC_SINGLECTRL_POSSEL_APORT1YCH5, adcPosSelAPORT1XCH6 = _ADC_SINGLECTRL_POSSEL_APORT1XCH6, adcPosSelAPORT1YCH7 = _ADC_SINGLECTRL_POSSEL_APORT1YCH7, adcPosSelAPORT1XCH8 = _ADC_SINGLECTRL_POSSEL_APORT1XCH8, adcPosSelAPORT1YCH9 = _ADC_SINGLECTRL_POSSEL_APORT1YCH9, adcPosSelAPORT1XCH10 = _ADC_SINGLECTRL_POSSEL_APORT1XCH10, adcPosSelAPORT1YCH11 = _ADC_SINGLECTRL_POSSEL_APORT1YCH11, adcPosSelAPORT1XCH12 = _ADC_SINGLECTRL_POSSEL_APORT1XCH12, adcPosSelAPORT1YCH13 = _ADC_SINGLECTRL_POSSEL_APORT1YCH13, adcPosSelAPORT1XCH14 = _ADC_SINGLECTRL_POSSEL_APORT1XCH14, adcPosSelAPORT1YCH15 = _ADC_SINGLECTRL_POSSEL_APORT1YCH15, adcPosSelAPORT1XCH16 = _ADC_SINGLECTRL_POSSEL_APORT1XCH16, adcPosSelAPORT1YCH17 = _ADC_SINGLECTRL_POSSEL_APORT1YCH17, adcPosSelAPORT1XCH18 = _ADC_SINGLECTRL_POSSEL_APORT1XCH18, adcPosSelAPORT1YCH19 = _ADC_SINGLECTRL_POSSEL_APORT1YCH19, adcPosSelAPORT1XCH20 = _ADC_SINGLECTRL_POSSEL_APORT1XCH20, adcPosSelAPORT1YCH21 = _ADC_SINGLECTRL_POSSEL_APORT1YCH21, adcPosSelAPORT1XCH22 = _ADC_SINGLECTRL_POSSEL_APORT1XCH22, adcPosSelAPORT1YCH23 = _ADC_SINGLECTRL_POSSEL_APORT1YCH23, adcPosSelAPORT1XCH24 = _ADC_SINGLECTRL_POSSEL_APORT1XCH24, adcPosSelAPORT1YCH25 = _ADC_SINGLECTRL_POSSEL_APORT1YCH25, adcPosSelAPORT1XCH26 = _ADC_SINGLECTRL_POSSEL_APORT1XCH26, adcPosSelAPORT1YCH27 = _ADC_SINGLECTRL_POSSEL_APORT1YCH27, adcPosSelAPORT1XCH28 = _ADC_SINGLECTRL_POSSEL_APORT1XCH28, adcPosSelAPORT1YCH29 = _ADC_SINGLECTRL_POSSEL_APORT1YCH29, adcPosSelAPORT1XCH30 = _ADC_SINGLECTRL_POSSEL_APORT1XCH30, adcPosSelAPORT1YCH31 = _ADC_SINGLECTRL_POSSEL_APORT1YCH31, adcPosSelAPORT2YCH0 = _ADC_SINGLECTRL_POSSEL_APORT2YCH0, adcPosSelAPORT2XCH1 = _ADC_SINGLECTRL_POSSEL_APORT2XCH1, adcPosSelAPORT2YCH2 = _ADC_SINGLECTRL_POSSEL_APORT2YCH2, adcPosSelAPORT2XCH3 = _ADC_SINGLECTRL_POSSEL_APORT2XCH3, adcPosSelAPORT2YCH4 = _ADC_SINGLECTRL_POSSEL_APORT2YCH4, adcPosSelAPORT2XCH5 = _ADC_SINGLECTRL_POSSEL_APORT2XCH5, adcPosSelAPORT2YCH6 = _ADC_SINGLECTRL_POSSEL_APORT2YCH6, adcPosSelAPORT2XCH7 = _ADC_SINGLECTRL_POSSEL_APORT2XCH7, adcPosSelAPORT2YCH8 = _ADC_SINGLECTRL_POSSEL_APORT2YCH8, adcPosSelAPORT2XCH9 = _ADC_SINGLECTRL_POSSEL_APORT2XCH9, adcPosSelAPORT2YCH10 = _ADC_SINGLECTRL_POSSEL_APORT2YCH10, adcPosSelAPORT2XCH11 = _ADC_SINGLECTRL_POSSEL_APORT2XCH11, adcPosSelAPORT2YCH12 = _ADC_SINGLECTRL_POSSEL_APORT2YCH12, adcPosSelAPORT2XCH13 = _ADC_SINGLECTRL_POSSEL_APORT2XCH13, adcPosSelAPORT2YCH14 = _ADC_SINGLECTRL_POSSEL_APORT2YCH14, adcPosSelAPORT2XCH15 = _ADC_SINGLECTRL_POSSEL_APORT2XCH15, adcPosSelAPORT2YCH16 = _ADC_SINGLECTRL_POSSEL_APORT2YCH16, adcPosSelAPORT2XCH17 = _ADC_SINGLECTRL_POSSEL_APORT2XCH17, adcPosSelAPORT2YCH18 = _ADC_SINGLECTRL_POSSEL_APORT2YCH18, adcPosSelAPORT2XCH19 = _ADC_SINGLECTRL_POSSEL_APORT2XCH19, adcPosSelAPORT2YCH20 = _ADC_SINGLECTRL_POSSEL_APORT2YCH20, adcPosSelAPORT2XCH21 = _ADC_SINGLECTRL_POSSEL_APORT2XCH21, adcPosSelAPORT2YCH22 = _ADC_SINGLECTRL_POSSEL_APORT2YCH22, adcPosSelAPORT2XCH23 = _ADC_SINGLECTRL_POSSEL_APORT2XCH23, adcPosSelAPORT2YCH24 = _ADC_SINGLECTRL_POSSEL_APORT2YCH24, adcPosSelAPORT2XCH25 = _ADC_SINGLECTRL_POSSEL_APORT2XCH25, adcPosSelAPORT2YCH26 = _ADC_SINGLECTRL_POSSEL_APORT2YCH26, adcPosSelAPORT2XCH27 = _ADC_SINGLECTRL_POSSEL_APORT2XCH27, adcPosSelAPORT2YCH28 = _ADC_SINGLECTRL_POSSEL_APORT2YCH28, adcPosSelAPORT2XCH29 = _ADC_SINGLECTRL_POSSEL_APORT2XCH29, adcPosSelAPORT2YCH30 = _ADC_SINGLECTRL_POSSEL_APORT2YCH30, adcPosSelAPORT2XCH31 = _ADC_SINGLECTRL_POSSEL_APORT2XCH31, adcPosSelAPORT3XCH0 = _ADC_SINGLECTRL_POSSEL_APORT3XCH0, adcPosSelAPORT3YCH1 = _ADC_SINGLECTRL_POSSEL_APORT3YCH1, adcPosSelAPORT3XCH2 = _ADC_SINGLECTRL_POSSEL_APORT3XCH2, adcPosSelAPORT3YCH3 = _ADC_SINGLECTRL_POSSEL_APORT3YCH3, adcPosSelAPORT3XCH4 = _ADC_SINGLECTRL_POSSEL_APORT3XCH4, adcPosSelAPORT3YCH5 = _ADC_SINGLECTRL_POSSEL_APORT3YCH5, adcPosSelAPORT3XCH6 = _ADC_SINGLECTRL_POSSEL_APORT3XCH6, adcPosSelAPORT3YCH7 = _ADC_SINGLECTRL_POSSEL_APORT3YCH7, adcPosSelAPORT3XCH8 = _ADC_SINGLECTRL_POSSEL_APORT3XCH8, adcPosSelAPORT3YCH9 = _ADC_SINGLECTRL_POSSEL_APORT3YCH9, adcPosSelAPORT3XCH10 = _ADC_SINGLECTRL_POSSEL_APORT3XCH10, adcPosSelAPORT3YCH11 = _ADC_SINGLECTRL_POSSEL_APORT3YCH11, adcPosSelAPORT3XCH12 = _ADC_SINGLECTRL_POSSEL_APORT3XCH12, adcPosSelAPORT3YCH13 = _ADC_SINGLECTRL_POSSEL_APORT3YCH13, adcPosSelAPORT3XCH14 = _ADC_SINGLECTRL_POSSEL_APORT3XCH14, adcPosSelAPORT3YCH15 = _ADC_SINGLECTRL_POSSEL_APORT3YCH15, adcPosSelAPORT3XCH16 = _ADC_SINGLECTRL_POSSEL_APORT3XCH16, adcPosSelAPORT3YCH17 = _ADC_SINGLECTRL_POSSEL_APORT3YCH17, adcPosSelAPORT3XCH18 = _ADC_SINGLECTRL_POSSEL_APORT3XCH18, adcPosSelAPORT3YCH19 = _ADC_SINGLECTRL_POSSEL_APORT3YCH19, adcPosSelAPORT3XCH20 = _ADC_SINGLECTRL_POSSEL_APORT3XCH20, adcPosSelAPORT3YCH21 = _ADC_SINGLECTRL_POSSEL_APORT3YCH21, adcPosSelAPORT3XCH22 = _ADC_SINGLECTRL_POSSEL_APORT3XCH22, adcPosSelAPORT3YCH23 = _ADC_SINGLECTRL_POSSEL_APORT3YCH23, adcPosSelAPORT3XCH24 = _ADC_SINGLECTRL_POSSEL_APORT3XCH24, adcPosSelAPORT3YCH25 = _ADC_SINGLECTRL_POSSEL_APORT3YCH25, adcPosSelAPORT3XCH26 = _ADC_SINGLECTRL_POSSEL_APORT3XCH26, adcPosSelAPORT3YCH27 = _ADC_SINGLECTRL_POSSEL_APORT3YCH27, adcPosSelAPORT3XCH28 = _ADC_SINGLECTRL_POSSEL_APORT3XCH28, adcPosSelAPORT3YCH29 = _ADC_SINGLECTRL_POSSEL_APORT3YCH29, adcPosSelAPORT3XCH30 = _ADC_SINGLECTRL_POSSEL_APORT3XCH30, adcPosSelAPORT3YCH31 = _ADC_SINGLECTRL_POSSEL_APORT3YCH31, adcPosSelAPORT4YCH0 = _ADC_SINGLECTRL_POSSEL_APORT4YCH0, adcPosSelAPORT4XCH1 = _ADC_SINGLECTRL_POSSEL_APORT4XCH1, adcPosSelAPORT4YCH2 = _ADC_SINGLECTRL_POSSEL_APORT4YCH2, adcPosSelAPORT4XCH3 = _ADC_SINGLECTRL_POSSEL_APORT4XCH3, adcPosSelAPORT4YCH4 = _ADC_SINGLECTRL_POSSEL_APORT4YCH4, adcPosSelAPORT4XCH5 = _ADC_SINGLECTRL_POSSEL_APORT4XCH5, adcPosSelAPORT4YCH6 = _ADC_SINGLECTRL_POSSEL_APORT4YCH6, adcPosSelAPORT4XCH7 = _ADC_SINGLECTRL_POSSEL_APORT4XCH7, adcPosSelAPORT4YCH8 = _ADC_SINGLECTRL_POSSEL_APORT4YCH8, adcPosSelAPORT4XCH9 = _ADC_SINGLECTRL_POSSEL_APORT4XCH9, adcPosSelAPORT4YCH10 = _ADC_SINGLECTRL_POSSEL_APORT4YCH10, adcPosSelAPORT4XCH11 = _ADC_SINGLECTRL_POSSEL_APORT4XCH11, adcPosSelAPORT4YCH12 = _ADC_SINGLECTRL_POSSEL_APORT4YCH12, adcPosSelAPORT4XCH13 = _ADC_SINGLECTRL_POSSEL_APORT4XCH13, adcPosSelAPORT4YCH14 = _ADC_SINGLECTRL_POSSEL_APORT4YCH14, adcPosSelAPORT4XCH15 = _ADC_SINGLECTRL_POSSEL_APORT4XCH15, adcPosSelAPORT4YCH16 = _ADC_SINGLECTRL_POSSEL_APORT4YCH16, adcPosSelAPORT4XCH17 = _ADC_SINGLECTRL_POSSEL_APORT4XCH17, adcPosSelAPORT4YCH18 = _ADC_SINGLECTRL_POSSEL_APORT4YCH18, adcPosSelAPORT4XCH19 = _ADC_SINGLECTRL_POSSEL_APORT4XCH19, adcPosSelAPORT4YCH20 = _ADC_SINGLECTRL_POSSEL_APORT4YCH20, adcPosSelAPORT4XCH21 = _ADC_SINGLECTRL_POSSEL_APORT4XCH21, adcPosSelAPORT4YCH22 = _ADC_SINGLECTRL_POSSEL_APORT4YCH22, adcPosSelAPORT4XCH23 = _ADC_SINGLECTRL_POSSEL_APORT4XCH23, adcPosSelAPORT4YCH24 = _ADC_SINGLECTRL_POSSEL_APORT4YCH24, adcPosSelAPORT4XCH25 = _ADC_SINGLECTRL_POSSEL_APORT4XCH25, adcPosSelAPORT4YCH26 = _ADC_SINGLECTRL_POSSEL_APORT4YCH26, adcPosSelAPORT4XCH27 = _ADC_SINGLECTRL_POSSEL_APORT4XCH27, adcPosSelAPORT4YCH28 = _ADC_SINGLECTRL_POSSEL_APORT4YCH28, adcPosSelAPORT4XCH29 = _ADC_SINGLECTRL_POSSEL_APORT4XCH29, adcPosSelAPORT4YCH30 = _ADC_SINGLECTRL_POSSEL_APORT4YCH30, adcPosSelAPORT4XCH31 = _ADC_SINGLECTRL_POSSEL_APORT4XCH31, adcPosSelAVDD = _ADC_SINGLECTRL_POSSEL_AVDD, adcPosSelBUVDD = _ADC_SINGLECTRL_POSSEL_BU, adcPosSelDVDD = _ADC_SINGLECTRL_POSSEL_AREG, adcPosSelPAVDD = _ADC_SINGLECTRL_POSSEL_VREGOUTPA, adcPosSelDECOUPLE = _ADC_SINGLECTRL_POSSEL_PDBU, adcPosSelIOVDD = _ADC_SINGLECTRL_POSSEL_IO0, adcPosSelOPA2 = _ADC_SINGLECTRL_POSSEL_OPA2, adcPosSelOPA3 = _ADC_SINGLECTRL_POSSEL_OPA3, adcPosSelTEMP = _ADC_SINGLECTRL_POSSEL_TEMP, adcPosSelDAC0OUT0 = _ADC_SINGLECTRL_POSSEL_DAC0OUT0, adcPosSelDAC0OUT1 = _ADC_SINGLECTRL_POSSEL_DAC0OUT1, adcPosSelSUBLSB = _ADC_SINGLECTRL_POSSEL_SUBLSB, adcPosSelDEFAULT = _ADC_SINGLECTRL_POSSEL_DEFAULT, adcPosSelVSS = _ADC_SINGLECTRL_POSSEL_VSS } |
enum |
ADC_PRSSEL_TypeDef
{
adcPRSSELCh0 = _ADC_SINGLECTRLX_PRSSEL_PRSCH0, adcPRSSELCh1 = _ADC_SINGLECTRLX_PRSSEL_PRSCH1, adcPRSSELCh2 = _ADC_SINGLECTRLX_PRSSEL_PRSCH2, adcPRSSELCh3 = _ADC_SINGLECTRLX_PRSSEL_PRSCH3, adcPRSSELCh4 = _ADC_SINGLECTRLX_PRSSEL_PRSCH4, adcPRSSELCh5 = _ADC_SINGLECTRLX_PRSSEL_PRSCH5, adcPRSSELCh6 = _ADC_SINGLECTRLX_PRSSEL_PRSCH6, adcPRSSELCh7 = _ADC_SINGLECTRLX_PRSSEL_PRSCH7, adcPRSSELCh8 = _ADC_SINGLECTRLX_PRSSEL_PRSCH8, adcPRSSELCh9 = _ADC_SINGLECTRLX_PRSSEL_PRSCH9, adcPRSSELCh10 = _ADC_SINGLECTRLX_PRSSEL_PRSCH10, adcPRSSELCh11 = _ADC_SINGLECTRLX_PRSSEL_PRSCH11 } |
enum |
ADC_Ref_TypeDef
{
adcRef1V25 = _ADC_SINGLECTRL_REF_1V25, adcRef2V5 = _ADC_SINGLECTRL_REF_2V5, adcRefVDD = _ADC_SINGLECTRL_REF_VDD, adcRef5V = _ADC_SINGLECTRL_REF_5V, adcRefExtSingle = _ADC_SINGLECTRL_REF_EXTSINGLE, adcRef2xExtDiff = _ADC_SINGLECTRL_REF_2XEXTDIFF, adcRef2xVDD = _ADC_SINGLECTRL_REF_2XVDD, adcRefVBGR = _ADC_SINGLECTRLX_VREFSEL_VBGR | ADC_CTRLX_VREFSEL_REG, adcRefVddxAtt = _ADC_SINGLECTRLX_VREFSEL_VDDXWATT | ADC_CTRLX_VREFSEL_REG, adcRefVPxAtt = _ADC_SINGLECTRLX_VREFSEL_VREFPWATT | ADC_CTRLX_VREFSEL_REG, adcRefP = _ADC_SINGLECTRLX_VREFSEL_VREFP | ADC_CTRLX_VREFSEL_REG, adcRefVEntropy = _ADC_SINGLECTRLX_VREFSEL_VENTROPY | ADC_CTRLX_VREFSEL_REG, adcRefVPNxAtt = _ADC_SINGLECTRLX_VREFSEL_VREFPNWATT | ADC_CTRLX_VREFSEL_REG, adcRefPN = _ADC_SINGLECTRLX_VREFSEL_VREFPN | ADC_CTRLX_VREFSEL_REG } |
enum |
ADC_Res_TypeDef
{
adcRes12Bit = _ADC_SINGLECTRL_RES_12BIT, adcRes8Bit = _ADC_SINGLECTRL_RES_8BIT, adcRes6Bit = _ADC_SINGLECTRL_RES_6BIT, adcResOVS = _ADC_SINGLECTRL_RES_OVS } |
enum |
ADC_ScanInputGroup_TypeDef
{
adcScanInputGroup0 = 0, adcScanInputGroup1 = 1, adcScanInputGroup2 = 2, adcScanInputGroup3 = 3 } |
enum |
ADC_ScanNegInput_TypeDef
{
adcScanNegInput1 = 1, adcScanNegInput3 = 3, adcScanNegInput5 = 5, adcScanNegInput7 = 7, adcScanNegInput8 = 8, adcScanNegInput10 = 10, adcScanNegInput12 = 12, adcScanNegInput14 = 14, adcScanNegInputDefault = 0xFF } |
enum |
ADC_Start_TypeDef
{
adcStartSingle = ADC_CMD_SINGLESTART, adcStartScan = ADC_CMD_SCANSTART, adcStartScanAndSingle = ADC_CMD_SCANSTART | ADC_CMD_SINGLESTART } |
enum |
ADC_Warmup_TypeDef
{
adcWarmupNormal = _ADC_CTRL_WARMUPMODE_NORMAL, adcWarmupKeepInStandby = _ADC_CTRL_WARMUPMODE_KEEPINSTANDBY, adcWarmupKeepInSlowAcq = _ADC_CTRL_WARMUPMODE_KEEPINSLOWACC, adcWarmupKeepADCWarm = _ADC_CTRL_WARMUPMODE_KEEPADCWARM } |
Functions |
|
uint32_t | ADC_DataIdScanGet ( ADC_TypeDef *adc, uint32_t *scanId) |
Get scan result and scan select ID.
|
|
__STATIC_INLINE uint32_t | ADC_DataScanGet ( ADC_TypeDef *adc) |
Get scan result.
|
|
__STATIC_INLINE uint32_t | ADC_DataScanPeek ( ADC_TypeDef *adc) |
Peek scan result.
|
|
__STATIC_INLINE uint32_t | ADC_DataSingleGet ( ADC_TypeDef *adc) |
Get single conversion result.
|
|
__STATIC_INLINE uint32_t | ADC_DataSinglePeek ( ADC_TypeDef *adc) |
Peek single conversion result.
|
|
void | ADC_Init ( ADC_TypeDef *adc, const ADC_Init_TypeDef *init) |
Initialize ADC.
|
|
void | ADC_InitScan ( ADC_TypeDef *adc, const ADC_InitScan_TypeDef *init) |
Initialize ADC scan sequence.
|
|
void | ADC_InitSingle ( ADC_TypeDef *adc, const ADC_InitSingle_TypeDef *init) |
Initialize single ADC sample conversion.
|
|
__STATIC_INLINE void | ADC_IntClear ( ADC_TypeDef *adc, uint32_t flags) |
Clear one or more pending ADC interrupts.
|
|
__STATIC_INLINE void | ADC_IntDisable ( ADC_TypeDef *adc, uint32_t flags) |
Disable one or more ADC interrupts.
|
|
__STATIC_INLINE void | ADC_IntEnable ( ADC_TypeDef *adc, uint32_t flags) |
Enable one or more ADC interrupts.
|
|
__STATIC_INLINE uint32_t | ADC_IntGet ( ADC_TypeDef *adc) |
Get pending ADC interrupt flags.
|
|
__STATIC_INLINE uint32_t | ADC_IntGetEnabled ( ADC_TypeDef *adc) |
Get enabled and pending ADC interrupt flags. Useful for handling more interrupt sources in the same interrupt handler.
|
|
__STATIC_INLINE void | ADC_IntSet ( ADC_TypeDef *adc, uint32_t flags) |
Set one or more pending ADC interrupts from SW.
|
|
uint8_t | ADC_PrescaleCalc (uint32_t adcFreq, uint32_t hfperFreq) |
Calculate prescaler value used to determine ADC clock.
|
|
void | ADC_Reset ( ADC_TypeDef *adc) |
Reset ADC to same state as after a HW reset.
|
|
uint32_t | ADC_ScanDifferentialInputAdd ( ADC_InitScan_TypeDef *scanInit, ADC_ScanInputGroup_TypeDef inputGroup, ADC_PosSel_TypeDef posSel, ADC_ScanNegInput_TypeDef negInput) |
Initialize ADC scan differential input configuration.
|
|
void | ADC_ScanInputClear ( ADC_InitScan_TypeDef *scanInit) |
Clear ADC scan input configuration.
|
|
uint32_t | ADC_ScanSingleEndedInputAdd ( ADC_InitScan_TypeDef *scanInit, ADC_ScanInputGroup_TypeDef inputGroup, ADC_PosSel_TypeDef singleEndedSel) |
Initialize ADC scan single-ended input configuration.
|
|
__STATIC_INLINE void | ADC_Start ( ADC_TypeDef *adc, ADC_Start_TypeDef cmd) |
Start scan sequence and/or single conversion.
|
|
uint8_t | ADC_TimebaseCalc (uint32_t hfperFreq) |
Calculate timebase value in order to get a timebase providing at least 1us.
|
|
Macro Definition Documentation
#define ADC_CTRLX_VREFSEL_REG 0x80UL |
Single and scan mode voltage references. Using unshifted enums and or in ADC_CTRLX_VREFSEL_REG to select the extension register CTRLX_VREFSEL.
Definition at line
189
of file
em_adc.h
.
Referenced by ADC_InitScan() , and ADC_InitSingle() .
#define ADC_INIT_DEFAULT |
Default config for ADC init structure.
Definition at line
838
of file
em_adc.h
.
Referenced by adcInit() , MIC_init() , and TOUCH_Init() .
#define ADC_INITSCAN_DEFAULT |
Default config for ADC scan init structure.
Definition at line
940
of file
em_adc.h
.
Referenced by MIC_init() .
#define ADC_INITSINGLE_DEFAULT |
Default config for ADC single conversion init structure.
Definition at line
1039
of file
em_adc.h
.
Referenced by adcInit() .
#define ADC_SCANINPUTSEL_NONE |
efr32mg12p_adc.h:1595
efr32mg12p_adc.h:1635
efr32mg12p_adc.h:1515
efr32mg12p_adc.h:1555
Definition at line
697
of file
em_adc.h
.
Enumeration Type Documentation
enum ADC_AcqTime_TypeDef |
Acquisition time (in ADC clock cycles).
Definition at line
60
of file
em_adc.h
.
ADC EM2 clock configuration
Definition at line
769
of file
em_adc.h
.
enum ADC_NegSel_TypeDef |
Negative input selection for single and scan coversion.
Definition at line
519
of file
em_adc.h
.
Oversample rate select.
Definition at line
87
of file
em_adc.h
.
enum ADC_PosSel_TypeDef |
Positive input selection for single and scan coversion.
Definition at line
331
of file
em_adc.h
.
enum ADC_PRSSEL_TypeDef |
Peripheral Reflex System signal used to trigger single sample.
Definition at line
126
of file
em_adc.h
.
enum ADC_Ref_TypeDef |
Definition at line
191
of file
em_adc.h
.
enum ADC_Res_TypeDef |
enum ADC_Start_TypeDef |
enum ADC_Warmup_TypeDef |
Warm-up mode.
Definition at line
736
of file
em_adc.h
.
Function Documentation
uint32_t ADC_DataIdScanGet | ( | ADC_TypeDef * |
adc,
|
uint32_t * |
scanId
|
||
) |
Get scan result and scan select ID.
- Note
- Only use if scan data valid. This function does not check the DV flag. The return value is intended to be used as a index for the scan select ID.
- Parameters
-
[in] adc
Pointer to ADC peripheral register block. [out] scanId
Scan select ID of first data in scan FIFO.
- Returns
- First scan data in scan FIFO.
Definition at line
957
of file
em_adc.c
.
References _ADC_SCANDATAX_DATA_MASK , _ADC_SCANDATAX_DATA_SHIFT , _ADC_SCANDATAX_SCANINPUTID_MASK , _ADC_SCANDATAX_SCANINPUTID_SHIFT , and ADC_TypeDef::SCANDATAX .
__STATIC_INLINE uint32_t ADC_DataScanGet | ( | ADC_TypeDef * |
adc
|
) |
Get scan result.
- Note
- Check data valid flag before calling this function.
- Parameters
-
[in] adc
Pointer to ADC peripheral register block.
- Returns
- Scan conversion data.
Definition at line
1109
of file
em_adc.h
.
References ADC_TypeDef::SCANDATA .
__STATIC_INLINE uint32_t ADC_DataScanPeek | ( | ADC_TypeDef * |
adc
|
) |
Peek scan result.
- Note
- Check data valid flag before calling this function.
- Parameters
-
[in] adc
Pointer to ADC peripheral register block.
- Returns
- Scan conversion data.
Definition at line
1127
of file
em_adc.h
.
References ADC_TypeDef::SCANDATAP .
__STATIC_INLINE uint32_t ADC_DataSingleGet | ( | ADC_TypeDef * |
adc
|
) |
Get single conversion result.
- Note
- Check data valid flag before calling this function.
- Parameters
-
[in] adc
Pointer to ADC peripheral register block.
- Returns
- Single conversion data.
Definition at line
1073
of file
em_adc.h
.
References ADC_TypeDef::SINGLEDATA .
Referenced by ADC0_IRQHandler() , and getAdcSample() .
__STATIC_INLINE uint32_t ADC_DataSinglePeek | ( | ADC_TypeDef * |
adc
|
) |
Peek single conversion result.
- Note
- Check data valid flag before calling this function.
- Parameters
-
[in] adc
Pointer to ADC peripheral register block.
- Returns
- Single conversion data.
Definition at line
1091
of file
em_adc.h
.
References ADC_TypeDef::SINGLEDATAP .
void ADC_Init | ( | ADC_TypeDef * |
adc,
|
const ADC_Init_TypeDef * |
init
|
||
) |
Initialize ADC.
Initializes common parts for both single conversion and scan sequence. In addition, single and/or scan control configuration must be done, please refer to ADC_InitSingle() and ADC_InitScan() respectively. For ADC architectures with the ADCn->SCANINPUTSEL register, use ADC_ScanSingleEndedInputAdd() to configure single-ended scan inputs or ADC_ScanDifferentialInputAdd() to configure differential scan inputs. ADC_ScanInputClear() is also provided for applications that need to update the input configuration.
- Note
- This function will stop any ongoing conversion.
- Parameters
-
[in] adc
Pointer to ADC peripheral register block. [in] init
Pointer to ADC initialization structure.
Definition at line
384
of file
em_adc.c
.
References _ADC_CTRL_ADCCLKMODE_MASK , _ADC_CTRL_ASYNCCLKEN_MASK , _ADC_CTRL_OVSRSEL_SHIFT , _ADC_CTRL_PRESC_MASK , _ADC_CTRL_PRESC_SHIFT , _ADC_CTRL_TIMEBASE_MASK , _ADC_CTRL_TIMEBASE_SHIFT , _ADC_CTRL_WARMUPMODE_SHIFT , ADC0 , ADC_CMD_SCANSTOP , ADC_CMD_SINGLESTOP , ADC_CTRL_ADCCLKMODE_SYNC , ADC_CTRL_TAILGATE , ADC_IFC_SCANUF , ADC_IntClear() , ADC_PrescaleCalc() , BUS_RegMaskedWrite() , ADC_TypeDef::CMD , ADC_TypeDef::CTRL , ADC_Init_TypeDef::em2ClockConfig , ADC_Init_TypeDef::ovsRateSel , ADC_Init_TypeDef::prescale , ADC_Init_TypeDef::tailgate , ADC_Init_TypeDef::timebase , and ADC_Init_TypeDef::warmUpMode .
Referenced by adcInit() , MIC_init() , and TOUCH_Init() .
void ADC_InitScan | ( | ADC_TypeDef * |
adc,
|
const ADC_InitScan_TypeDef * |
init
|
||
) |
Initialize ADC scan sequence.
Please refer to ADC_Start() for starting scan sequence.
When selecting an external reference, the gain and offset calibration must be set explicitly (CAL register). For other references, the calibration is updated with values defined during manufacturing. For ADC architectures with the ADCn->SCANINPUTSEL register, use ADC_ScanSingleEndedInputAdd() to configure single-ended scan inputs or ADC_ScanDifferentialInputAdd() to configure differential scan inputs. ADC_ScanInputClear() is also provided for applications that need to update the input configuration.
- Note
- This function will stop any ongoing scan sequence.
- Parameters
-
[in] adc
Pointer to ADC peripheral register block. [in] init
Pointer to ADC initialization structure.
Definition at line
689
of file
em_adc.c
.
References _ADC_CTRL_SCANDMAWU_SHIFT , _ADC_SCANCTRL_AT_SHIFT , _ADC_SCANCTRL_REF_SHIFT , _ADC_SCANCTRL_RES_SHIFT , _ADC_SCANCTRLX_FIFOOFACT_MASK , _ADC_SCANCTRLX_PRSSEL_MASK , _ADC_SCANCTRLX_PRSSEL_SHIFT , _ADC_SCANCTRLX_VREFSEL_MASK , _ADC_SCANCTRLX_VREFSEL_SHIFT , _ADC_STATUS_PROGERR_MASK , ADC_InitScan_TypeDef::acqTime , ADC_CMD_SCANSTOP , ADC_CTRLX_VREFSEL_REG , ADC_SCANCTRL_ADJ_LEFT , ADC_SCANCTRL_DIFF , ADC_SCANCTRL_PRSEN , ADC_SCANCTRL_REF_CONF , ADC_SCANCTRL_REP , ADC_SCANCTRLX_FIFOOFACT_OVERWRITE , BUS_RegBitWrite() , ADC_TypeDef::CMD , ADC_TypeDef::CTRL , ADC_InitScan_TypeDef::diff , ADC_InitScan_TypeDef::fifoOverwrite , ADC_InitScan_TypeDef::leftAdjust , ADC_InitScan_TypeDef::prsEnable , ADC_InitScan_TypeDef::prsSel , ADC_InitScan_TypeDef::reference , ADC_InitScan_TypeDef::rep , ADC_InitScan_TypeDef::resolution , ADC_TypeDef::SCANCTRL , ADC_TypeDef::SCANCTRLX , ADC_InitScan_TypeDef::scanDmaEm2Wu , ADC_InitScan_TypeDef::scanInputConfig , ADC_InitScanInput_TypeDef::scanInputEn , ADC_TypeDef::SCANINPUTSEL , ADC_InitScanInput_TypeDef::scanInputSel , ADC_TypeDef::SCANMASK , ADC_TypeDef::SCANNEGSEL , ADC_InitScanInput_TypeDef::scanNegSel , and ADC_TypeDef::STATUS .
Referenced by MIC_init() .
void ADC_InitSingle | ( | ADC_TypeDef * |
adc,
|
const ADC_InitSingle_TypeDef * |
init
|
||
) |
Initialize single ADC sample conversion.
Please refer to ADC_Start() for starting single conversion.
When selecting an external reference, the gain and offset calibration must be set explicitly (CAL register). For other references, the calibration is updated with values defined during manufacturing.
- Note
- This function will stop any ongoing single conversion.
- This function will set the BIASPROG_GPBIASACC bit when selecting the internal temperature sensor and clear the bit otherwise. Any application that depends on the state of the BIASPROG_GPBIASACC bit should modify it after a call to this function.
- Parameters
-
[in] adc
Pointer to ADC peripheral register block. [in] init
Pointer to ADC initialization structure.
Definition at line
826
of file
em_adc.c
.
References _ADC_BIASPROG_GPBIASACC_SHIFT , _ADC_CTRL_SINGLEDMAWU_SHIFT , _ADC_SINGLECTRL_AT_MASK , _ADC_SINGLECTRL_AT_SHIFT , _ADC_SINGLECTRL_NEGSEL_SHIFT , _ADC_SINGLECTRL_POSSEL_MASK , _ADC_SINGLECTRL_POSSEL_SHIFT , _ADC_SINGLECTRL_REF_SHIFT , _ADC_SINGLECTRL_RES_SHIFT , _ADC_SINGLECTRLX_FIFOOFACT_MASK , _ADC_SINGLECTRLX_PRSSEL_MASK , _ADC_SINGLECTRLX_PRSSEL_SHIFT , _ADC_SINGLECTRLX_VREFSEL_MASK , _ADC_SINGLECTRLX_VREFSEL_SHIFT , _ADC_STATUS_PROGERR_MASK , ADC_InitSingle_TypeDef::acqTime , ADC_CMD_SINGLESTOP , ADC_CTRLX_VREFSEL_REG , ADC_SINGLECTRL_ADJ_LEFT , ADC_SINGLECTRL_DIFF , ADC_SINGLECTRL_PRSEN , ADC_SINGLECTRL_REF_CONF , ADC_SINGLECTRL_REP , ADC_SINGLECTRLX_FIFOOFACT_OVERWRITE , adcAcqTime8 , adcRef1V25 , ADC_TypeDef::BIASPROG , BUS_RegBitWrite() , ADC_TypeDef::CMD , ADC_TypeDef::CTRL , ADC_InitSingle_TypeDef::diff , ADC_InitSingle_TypeDef::fifoOverwrite , ADC_InitSingle_TypeDef::leftAdjust , ADC_InitSingle_TypeDef::negSel , ADC_InitSingle_TypeDef::posSel , ADC_InitSingle_TypeDef::prsEnable , ADC_InitSingle_TypeDef::prsSel , ADC_InitSingle_TypeDef::reference , ADC_InitSingle_TypeDef::rep , ADC_InitSingle_TypeDef::resolution , ADC_TypeDef::SINGLECTRL , ADC_TypeDef::SINGLECTRLX , ADC_InitSingle_TypeDef::singleDmaEm2Wu , and ADC_TypeDef::STATUS .
Referenced by ADC0_IRQHandler() , adcInit() , and TOUCH_Init() .
__STATIC_INLINE void ADC_IntClear | ( | ADC_TypeDef * |
adc,
|
uint32_t |
flags
|
||
) |
Clear one or more pending ADC interrupts.
- Parameters
-
[in] adc
Pointer to ADC peripheral register block. [in] flags
Pending ADC interrupt source to clear. Use a bitwise logic OR combination of valid interrupt flags for the ADC module (ADC_IF_nnn).
Definition at line
1166
of file
em_adc.h
.
References ADC_TypeDef::IFC .
Referenced by ADC0_IRQHandler() , ADC_Init() , and TOUCH_Init() .
__STATIC_INLINE void ADC_IntDisable | ( | ADC_TypeDef * |
adc,
|
uint32_t |
flags
|
||
) |
Disable one or more ADC interrupts.
- Parameters
-
[in] adc
Pointer to ADC peripheral register block. [in] flags
ADC interrupt sources to disable. Use a bitwise logic OR combination of valid interrupt flags for the ADC module (ADC_IF_nnn).
Definition at line
1182
of file
em_adc.h
.
References ADC_TypeDef::IEN .
Referenced by TOUCH_GetPos() , and TOUCH_Init() .
__STATIC_INLINE void ADC_IntEnable | ( | ADC_TypeDef * |
adc,
|
uint32_t |
flags
|
||
) |
Enable one or more ADC interrupts.
- Note
- Depending on the use, a pending interrupt may already be set prior to enabling the interrupt. Consider using ADC_IntClear() prior to enabling if such a pending interrupt should be ignored.
- Parameters
-
[in] adc
Pointer to ADC peripheral register block. [in] flags
ADC interrupt sources to enable. Use a bitwise logic OR combination of valid interrupt flags for the ADC module (ADC_IF_nnn).
Definition at line
1203
of file
em_adc.h
.
References ADC_TypeDef::IEN .
Referenced by TOUCH_GetPos() , and TOUCH_Init() .
__STATIC_INLINE uint32_t ADC_IntGet | ( | ADC_TypeDef * |
adc
|
) |
Get pending ADC interrupt flags.
- Note
- The event bits are not cleared by the use of this function.
- Parameters
-
[in] adc
Pointer to ADC peripheral register block.
- Returns
- ADC interrupt sources pending. A bitwise logic OR combination of valid interrupt flags for the ADC module (ADC_IF_nnn).
Definition at line
1222
of file
em_adc.h
.
References ADC_TypeDef::IF .
Referenced by getAdcSample() .
__STATIC_INLINE uint32_t ADC_IntGetEnabled | ( | ADC_TypeDef * |
adc
|
) |
Get enabled and pending ADC interrupt flags. Useful for handling more interrupt sources in the same interrupt handler.
- Parameters
-
[in] adc
Pointer to ADC peripheral register block.
- Note
- Interrupt flags are not cleared by the use of this function.
- Returns
-
Pending and enabled ADC interrupt sources. The return value is the bitwise AND combination of
- the OR combination of enabled interrupt sources in ADCx_IEN_nnn register (ADCx_IEN_nnn) and
- the OR combination of valid interrupt flags of the ADC module (ADCx_IF_nnn).
Definition at line
1246
of file
em_adc.h
.
References ADC_TypeDef::IEN , and ADC_TypeDef::IF .
__STATIC_INLINE void ADC_IntSet | ( | ADC_TypeDef * |
adc,
|
uint32_t |
flags
|
||
) |
Set one or more pending ADC interrupts from SW.
- Parameters
-
[in] adc
Pointer to ADC peripheral register block. [in] flags
ADC interrupt sources to set to pending. Use a bitwise logic OR combination of valid interrupt flags for the ADC module (ADC_IF_nnn).
Definition at line
1269
of file
em_adc.h
.
References ADC_TypeDef::IFS .
uint8_t ADC_PrescaleCalc | ( | uint32_t |
adcFreq,
|
uint32_t |
hfperFreq
|
||
) |
Calculate prescaler value used to determine ADC clock.
The ADC clock is given by: HFPERCLK / (prescale + 1).
- Note
- The return value is clamped to the max prescaler value hardware supports.
- Parameters
-
[in] adcFreq
ADC frequency wanted. The frequency will automatically be adjusted to be within valid range according to reference manual. [in] hfperFreq
Frequency in Hz of reference HFPER clock. Set to 0 to use currently defined HFPER clock setting.
- Returns
-
Prescaler value to use for ADC in order to achieve a clock value <=
adcFreq
.
Definition at line
988
of file
em_adc.c
.
References _ADC_CTRL_PRESC_MASK , _ADC_CTRL_PRESC_SHIFT , CMU_ClockFreqGet() , and cmuClock_HFPER .
Referenced by ADC_Init() , adcInit() , MIC_init() , and TOUCH_Init() .
void ADC_Reset | ( | ADC_TypeDef * |
adc
|
) |
Reset ADC to same state as after a HW reset.
- Note
- The ROUTE register is NOT reset by this function, in order to allow for centralized setup of this feature.
- Parameters
-
[in] adc
Pointer to ADC peripheral register block.
Definition at line
1029
of file
em_adc.c
.
References _ADC_BIASPROG_RESETVALUE , _ADC_CTRL_RESETVALUE , _ADC_IEN_RESETVALUE , _ADC_IFC_MASK , _ADC_SCANCTRL_RESETVALUE , _ADC_SCANCTRLX_RESETVALUE , _ADC_SCANINPUTSEL_RESETVALUE , _ADC_SCANMASK_RESETVALUE , _ADC_SCANNEGSEL_RESETVALUE , _ADC_SINGLECTRL_RESETVALUE , _ADC_SINGLECTRLX_RESETVALUE , ADC_CMD_SCANSTOP , ADC_CMD_SINGLESTOP , ADC_SCANFIFOCLEAR_SCANFIFOCLEAR , ADC_SINGLEFIFOCLEAR_SINGLEFIFOCLEAR , adcRef1V25 , ADC_TypeDef::BIASPROG , ADC_TypeDef::CMD , ADC_TypeDef::CTRL , ADC_TypeDef::IEN , ADC_TypeDef::IFC , ADC_TypeDef::SCANCTRL , ADC_TypeDef::SCANCTRLX , ADC_TypeDef::SCANFIFOCLEAR , ADC_TypeDef::SCANINPUTSEL , ADC_TypeDef::SCANMASK , ADC_TypeDef::SCANNEGSEL , ADC_TypeDef::SINGLECTRL , ADC_TypeDef::SINGLECTRLX , and ADC_TypeDef::SINGLEFIFOCLEAR .
uint32_t ADC_ScanDifferentialInputAdd | ( | ADC_InitScan_TypeDef * |
scanInit,
|
ADC_ScanInputGroup_TypeDef |
inputGroup,
|
||
ADC_PosSel_TypeDef |
posSel,
|
||
ADC_ScanNegInput_TypeDef |
negInput
|
||
) |
Initialize ADC scan differential input configuration.
Set configuration for ADC scan conversion with differential inputs. The ADC_InitScan_TypeDef struct updated by this function should be passed to ADC_InitScan() .
- Parameters
-
[in] scanInit
Struct to hold the scan and input configuration. [in] inputGroup
ADC scan input group. See section 25.3.4 in the reference manual for more information. [in] posSel
APORT bus pair select. The negative terminal is implicitly selected by the positive terminal. [in] negInput
ADC scan alternative negative input. Set to adcScanNegInputDefault to select default negative input (implicit from posSel).
- Returns
- Scan ID of selected ADC input. ee section 25.3.4 in the reference manual for more information. Note that the returned integer represents the bit position in ADCn_SCANMASK set by this function. The accumulated mask is stored in scanInit->scanInputConfig->scanInputEn.
Definition at line
551
of file
em_adc.c
.
References _ADC_SCANNEGSEL_INPUT0NEGSEL_INPUT1 , _ADC_SCANNEGSEL_INPUT0NEGSEL_INPUT3 , _ADC_SCANNEGSEL_INPUT0NEGSEL_INPUT5 , _ADC_SCANNEGSEL_INPUT0NEGSEL_INPUT7 , _ADC_SCANNEGSEL_INPUT0NEGSEL_MASK , _ADC_SCANNEGSEL_INPUT0NEGSEL_SHIFT , _ADC_SCANNEGSEL_INPUT11NEGSEL_MASK , _ADC_SCANNEGSEL_INPUT11NEGSEL_SHIFT , _ADC_SCANNEGSEL_INPUT13NEGSEL_MASK , _ADC_SCANNEGSEL_INPUT13NEGSEL_SHIFT , _ADC_SCANNEGSEL_INPUT15NEGSEL_MASK , _ADC_SCANNEGSEL_INPUT15NEGSEL_SHIFT , _ADC_SCANNEGSEL_INPUT2NEGSEL_MASK , _ADC_SCANNEGSEL_INPUT2NEGSEL_SHIFT , _ADC_SCANNEGSEL_INPUT4NEGSEL_MASK , _ADC_SCANNEGSEL_INPUT4NEGSEL_SHIFT , _ADC_SCANNEGSEL_INPUT6NEGSEL_MASK , _ADC_SCANNEGSEL_INPUT6NEGSEL_SHIFT , _ADC_SCANNEGSEL_INPUT9NEGSEL_INPUT10 , _ADC_SCANNEGSEL_INPUT9NEGSEL_INPUT12 , _ADC_SCANNEGSEL_INPUT9NEGSEL_INPUT14 , _ADC_SCANNEGSEL_INPUT9NEGSEL_INPUT8 , _ADC_SCANNEGSEL_INPUT9NEGSEL_MASK , _ADC_SCANNEGSEL_INPUT9NEGSEL_SHIFT , ADC_ScanSingleEndedInputAdd() , ADC_InitScan_TypeDef::diff , ADC_InitScan_TypeDef::scanInputConfig , and ADC_InitScanInput_TypeDef::scanNegSel .
void ADC_ScanInputClear | ( | ADC_InitScan_TypeDef * |
scanInit
|
) |
Clear ADC scan input configuration.
- Parameters
-
[in] scanInit
Struct to hold the scan configuration, input configuration.
Definition at line
444
of file
em_adc.c
.
References _ADC_SCANNEGSEL_RESETVALUE , ADC_InitScan_TypeDef::scanInputConfig , ADC_InitScanInput_TypeDef::scanInputEn , ADC_InitScanInput_TypeDef::scanInputSel , and ADC_InitScanInput_TypeDef::scanNegSel .
Referenced by MIC_init() .
uint32_t ADC_ScanSingleEndedInputAdd | ( | ADC_InitScan_TypeDef * |
scanInit,
|
ADC_ScanInputGroup_TypeDef |
inputGroup,
|
||
ADC_PosSel_TypeDef |
singleEndedSel
|
||
) |
Initialize ADC scan single-ended input configuration.
Set configuration for ADC scan conversion with single-ended inputs. The ADC_InitScan_TypeDef struct updated from this function should be passed to ADC_InitScan() .
- Parameters
-
[in] inputGroup
ADC scan input group. See section 25.3.4 in the reference manual for more information. [in] singleEndedSel
APORT select.
- Returns
- Scan ID of selected ADC input. ee section 25.3.4 in the reference manual for more information. Note that the returned integer represents the bit position in ADCn_SCANMASK set by this function. The accumulated mask is stored in scanInit->scanInputConfig->scanInputEn.
Definition at line
478
of file
em_adc.c
.
References ADC_InitScan_TypeDef::diff , ADC_InitScan_TypeDef::scanInputConfig , ADC_InitScanInput_TypeDef::scanInputEn , and ADC_InitScanInput_TypeDef::scanInputSel .
Referenced by ADC_ScanDifferentialInputAdd() , and MIC_init() .
__STATIC_INLINE void ADC_Start | ( | ADC_TypeDef * |
adc,
|
ADC_Start_TypeDef |
cmd
|
||
) |
Start scan sequence and/or single conversion.
- Parameters
-
[in] adc
Pointer to ADC peripheral register block. [in] cmd
Command indicating which type of sampling to start.
Definition at line
1284
of file
em_adc.h
.
References ADC_TypeDef::CMD .
Referenced by ADC0_IRQHandler() , getAdcSample() , and TOUCH_Init() .
uint8_t ADC_TimebaseCalc | ( | uint32_t |
hfperFreq
|
) |
Calculate timebase value in order to get a timebase providing at least 1us.
- Parameters
-
[in] hfperFreq
Frequency in Hz of reference HFPER clock. Set to 0 to use currently defined HFPER clock setting.
- Returns
- Timebase value to use for ADC in order to achieve at least 1 us.
Definition at line
1080
of file
em_adc.c
.
References CMU_ClockFreqGet() , and cmuClock_HFPER .
Referenced by adcInit() , and MIC_init() .