EFR32 Blue Gecko 13 Software Documentation
efr32bg13-doc-5.1.2
|
Analog comparator (ACMP) Peripheral API.
The Analog Comparator is used to compare the voltage of two analog inputs, with a digital output indicating which input voltage is higher. Inputs can either be one of the selectable internal references or from external pins. Response time and thereby also the current consumption can be configured by altering the current supply to the comparator.
The ACMP is available down to EM3 and is able to wakeup the system when input signals pass a certain threshold. Use ACMP_IntEnable to enable an edge interrupt to use this functionality.
Here is an example of how to use the em_acmp.h API for comparing an input pin to an internal 2.5V reference voltage.
The ACMP also contains specialized hardware for capacitive sensing. This module contains the function ACMP_CapsenseInit for initializing the ACMP for capacitive sensing and the function ACMP_CapsenseChannelSet for selecting the current capsense channel.
For applications that require capacitive sensing it is recommended to use a library like cslib which is provided by Silicon Labs.
Data Structures | |
struct | ACMP_CapsenseInit_TypeDef |
struct | ACMP_Init_TypeDef |
struct | ACMP_VAConfig_TypeDef |
struct | ACMP_VBConfig_TypeDef |
Macros | |
#define | ACMP_CAPSENSE_INIT_DEFAULT |
#define | ACMP_INIT_DEFAULT |
#define | ACMP_VACONFIG_DEFAULT |
#define | ACMP_VBCONFIG_DEFAULT |
Enumerations | |
enum | ACMP_Accuracy_TypeDef { acmpAccuracyLow = _ACMP_CTRL_ACCURACY_LOW, acmpAccuracyHigh = _ACMP_CTRL_ACCURACY_HIGH } |
enum | ACMP_CapsenseResistor_TypeDef { acmpResistor0 = _ACMP_INPUTSEL_CSRESSEL_RES0, acmpResistor1 = _ACMP_INPUTSEL_CSRESSEL_RES1, acmpResistor2 = _ACMP_INPUTSEL_CSRESSEL_RES2, acmpResistor3 = _ACMP_INPUTSEL_CSRESSEL_RES3, acmpResistor4 = _ACMP_INPUTSEL_CSRESSEL_RES4, acmpResistor5 = _ACMP_INPUTSEL_CSRESSEL_RES5, acmpResistor6 = _ACMP_INPUTSEL_CSRESSEL_RES6, acmpResistor7 = _ACMP_INPUTSEL_CSRESSEL_RES7 } |
enum | ACMP_Channel_TypeDef { acmpInputAPORT0XCH0 = _ACMP_INPUTSEL_POSSEL_APORT0XCH0, acmpInputAPORT0XCH1 = _ACMP_INPUTSEL_POSSEL_APORT0XCH1, acmpInputAPORT0XCH2 = _ACMP_INPUTSEL_POSSEL_APORT0XCH2, acmpInputAPORT0XCH3 = _ACMP_INPUTSEL_POSSEL_APORT0XCH3, acmpInputAPORT0XCH4 = _ACMP_INPUTSEL_POSSEL_APORT0XCH4, acmpInputAPORT0XCH5 = _ACMP_INPUTSEL_POSSEL_APORT0XCH5, acmpInputAPORT0XCH6 = _ACMP_INPUTSEL_POSSEL_APORT0XCH6, acmpInputAPORT0XCH7 = _ACMP_INPUTSEL_POSSEL_APORT0XCH7, acmpInputAPORT0XCH8 = _ACMP_INPUTSEL_POSSEL_APORT0XCH8, acmpInputAPORT0XCH9 = _ACMP_INPUTSEL_POSSEL_APORT0XCH9, acmpInputAPORT0XCH10 = _ACMP_INPUTSEL_POSSEL_APORT0XCH10, acmpInputAPORT0XCH11 = _ACMP_INPUTSEL_POSSEL_APORT0XCH11, acmpInputAPORT0XCH12 = _ACMP_INPUTSEL_POSSEL_APORT0XCH12, acmpInputAPORT0XCH13 = _ACMP_INPUTSEL_POSSEL_APORT0XCH13, acmpInputAPORT0XCH14 = _ACMP_INPUTSEL_POSSEL_APORT0XCH14, acmpInputAPORT0XCH15 = _ACMP_INPUTSEL_POSSEL_APORT0XCH15, acmpInputAPORT0YCH0 = _ACMP_INPUTSEL_POSSEL_APORT0YCH0, acmpInputAPORT0YCH1 = _ACMP_INPUTSEL_POSSEL_APORT0YCH1, acmpInputAPORT0YCH2 = _ACMP_INPUTSEL_POSSEL_APORT0YCH2, acmpInputAPORT0YCH3 = _ACMP_INPUTSEL_POSSEL_APORT0YCH3, acmpInputAPORT0YCH4 = _ACMP_INPUTSEL_POSSEL_APORT0YCH4, acmpInputAPORT0YCH5 = _ACMP_INPUTSEL_POSSEL_APORT0YCH5, acmpInputAPORT0YCH6 = _ACMP_INPUTSEL_POSSEL_APORT0YCH6, acmpInputAPORT0YCH7 = _ACMP_INPUTSEL_POSSEL_APORT0YCH7, acmpInputAPORT0YCH8 = _ACMP_INPUTSEL_POSSEL_APORT0YCH8, acmpInputAPORT0YCH9 = _ACMP_INPUTSEL_POSSEL_APORT0YCH9, acmpInputAPORT0YCH10 = _ACMP_INPUTSEL_POSSEL_APORT0YCH10, acmpInputAPORT0YCH11 = _ACMP_INPUTSEL_POSSEL_APORT0YCH11, acmpInputAPORT0YCH12 = _ACMP_INPUTSEL_POSSEL_APORT0YCH12, acmpInputAPORT0YCH13 = _ACMP_INPUTSEL_POSSEL_APORT0YCH13, acmpInputAPORT0YCH14 = _ACMP_INPUTSEL_POSSEL_APORT0YCH14, acmpInputAPORT0YCH15 = _ACMP_INPUTSEL_POSSEL_APORT0YCH15, acmpInputAPORT1XCH0 = _ACMP_INPUTSEL_POSSEL_APORT1XCH0, acmpInputAPORT1YCH1 = _ACMP_INPUTSEL_POSSEL_APORT1YCH1, acmpInputAPORT1XCH2 = _ACMP_INPUTSEL_POSSEL_APORT1XCH2, acmpInputAPORT1YCH3 = _ACMP_INPUTSEL_POSSEL_APORT1YCH3, acmpInputAPORT1XCH4 = _ACMP_INPUTSEL_POSSEL_APORT1XCH4, acmpInputAPORT1YCH5 = _ACMP_INPUTSEL_POSSEL_APORT1YCH5, acmpInputAPORT1XCH6 = _ACMP_INPUTSEL_POSSEL_APORT1XCH6, acmpInputAPORT1YCH7 = _ACMP_INPUTSEL_POSSEL_APORT1YCH7, acmpInputAPORT1XCH8 = _ACMP_INPUTSEL_POSSEL_APORT1XCH8, acmpInputAPORT1YCH9 = _ACMP_INPUTSEL_POSSEL_APORT1YCH9, acmpInputAPORT1XCH10 = _ACMP_INPUTSEL_POSSEL_APORT1XCH10, acmpInputAPORT1YCH11 = _ACMP_INPUTSEL_POSSEL_APORT1YCH11, acmpInputAPORT1XCH12 = _ACMP_INPUTSEL_POSSEL_APORT1XCH12, acmpInputAPORT1YCH13 = _ACMP_INPUTSEL_POSSEL_APORT1YCH13, acmpInputAPORT1XCH14 = _ACMP_INPUTSEL_POSSEL_APORT1XCH14, acmpInputAPORT1YCH15 = _ACMP_INPUTSEL_POSSEL_APORT1YCH15, acmpInputAPORT1XCH16 = _ACMP_INPUTSEL_POSSEL_APORT1XCH16, acmpInputAPORT1YCH17 = _ACMP_INPUTSEL_POSSEL_APORT1YCH17, acmpInputAPORT1XCH18 = _ACMP_INPUTSEL_POSSEL_APORT1XCH18, acmpInputAPORT1YCH19 = _ACMP_INPUTSEL_POSSEL_APORT1YCH19, acmpInputAPORT1XCH20 = _ACMP_INPUTSEL_POSSEL_APORT1XCH20, acmpInputAPORT1YCH21 = _ACMP_INPUTSEL_POSSEL_APORT1YCH21, acmpInputAPORT1XCH22 = _ACMP_INPUTSEL_POSSEL_APORT1XCH22, acmpInputAPORT1YCH23 = _ACMP_INPUTSEL_POSSEL_APORT1YCH23, acmpInputAPORT1XCH24 = _ACMP_INPUTSEL_POSSEL_APORT1XCH24, acmpInputAPORT1YCH25 = _ACMP_INPUTSEL_POSSEL_APORT1YCH25, acmpInputAPORT1XCH26 = _ACMP_INPUTSEL_POSSEL_APORT1XCH26, acmpInputAPORT1YCH27 = _ACMP_INPUTSEL_POSSEL_APORT1YCH27, acmpInputAPORT1XCH28 = _ACMP_INPUTSEL_POSSEL_APORT1XCH28, acmpInputAPORT1YCH29 = _ACMP_INPUTSEL_POSSEL_APORT1YCH29, acmpInputAPORT1XCH30 = _ACMP_INPUTSEL_POSSEL_APORT1XCH30, acmpInputAPORT1YCH31 = _ACMP_INPUTSEL_POSSEL_APORT1YCH31, acmpInputAPORT2YCH0 = _ACMP_INPUTSEL_POSSEL_APORT2YCH0, acmpInputAPORT2XCH1 = _ACMP_INPUTSEL_POSSEL_APORT2XCH1, acmpInputAPORT2YCH2 = _ACMP_INPUTSEL_POSSEL_APORT2YCH2, acmpInputAPORT2XCH3 = _ACMP_INPUTSEL_POSSEL_APORT2XCH3, acmpInputAPORT2YCH4 = _ACMP_INPUTSEL_POSSEL_APORT2YCH4, acmpInputAPORT2XCH5 = _ACMP_INPUTSEL_POSSEL_APORT2XCH5, acmpInputAPORT2YCH6 = _ACMP_INPUTSEL_POSSEL_APORT2YCH6, acmpInputAPORT2XCH7 = _ACMP_INPUTSEL_POSSEL_APORT2XCH7, acmpInputAPORT2YCH8 = _ACMP_INPUTSEL_POSSEL_APORT2YCH8, acmpInputAPORT2XCH9 = _ACMP_INPUTSEL_POSSEL_APORT2XCH9, acmpInputAPORT2YCH10 = _ACMP_INPUTSEL_POSSEL_APORT2YCH10, acmpInputAPORT2XCH11 = _ACMP_INPUTSEL_POSSEL_APORT2XCH11, acmpInputAPORT2YCH12 = _ACMP_INPUTSEL_POSSEL_APORT2YCH12, acmpInputAPORT2XCH13 = _ACMP_INPUTSEL_POSSEL_APORT2XCH13, acmpInputAPORT2YCH14 = _ACMP_INPUTSEL_POSSEL_APORT2YCH14, acmpInputAPORT2XCH15 = _ACMP_INPUTSEL_POSSEL_APORT2XCH15, acmpInputAPORT2YCH16 = _ACMP_INPUTSEL_POSSEL_APORT2YCH16, acmpInputAPORT2XCH17 = _ACMP_INPUTSEL_POSSEL_APORT2XCH17, acmpInputAPORT2YCH18 = _ACMP_INPUTSEL_POSSEL_APORT2YCH18, acmpInputAPORT2XCH19 = _ACMP_INPUTSEL_POSSEL_APORT2XCH19, acmpInputAPORT2YCH20 = _ACMP_INPUTSEL_POSSEL_APORT2YCH20, acmpInputAPORT2XCH21 = _ACMP_INPUTSEL_POSSEL_APORT2XCH21, acmpInputAPORT2YCH22 = _ACMP_INPUTSEL_POSSEL_APORT2YCH22, acmpInputAPORT2XCH23 = _ACMP_INPUTSEL_POSSEL_APORT2XCH23, acmpInputAPORT2YCH24 = _ACMP_INPUTSEL_POSSEL_APORT2YCH24, acmpInputAPORT2XCH25 = _ACMP_INPUTSEL_POSSEL_APORT2XCH25, acmpInputAPORT2YCH26 = _ACMP_INPUTSEL_POSSEL_APORT2YCH26, acmpInputAPORT2XCH27 = _ACMP_INPUTSEL_POSSEL_APORT2XCH27, acmpInputAPORT2YCH28 = _ACMP_INPUTSEL_POSSEL_APORT2YCH28, acmpInputAPORT2XCH29 = _ACMP_INPUTSEL_POSSEL_APORT2XCH29, acmpInputAPORT2YCH30 = _ACMP_INPUTSEL_POSSEL_APORT2YCH30, acmpInputAPORT2XCH31 = _ACMP_INPUTSEL_POSSEL_APORT2XCH31, acmpInputAPORT3XCH0 = _ACMP_INPUTSEL_POSSEL_APORT3XCH0, acmpInputAPORT3YCH1 = _ACMP_INPUTSEL_POSSEL_APORT3YCH1, acmpInputAPORT3XCH2 = _ACMP_INPUTSEL_POSSEL_APORT3XCH2, acmpInputAPORT3YCH3 = _ACMP_INPUTSEL_POSSEL_APORT3YCH3, acmpInputAPORT3XCH4 = _ACMP_INPUTSEL_POSSEL_APORT3XCH4, acmpInputAPORT3YCH5 = _ACMP_INPUTSEL_POSSEL_APORT3YCH5, acmpInputAPORT3XCH6 = _ACMP_INPUTSEL_POSSEL_APORT3XCH6, acmpInputAPORT3YCH7 = _ACMP_INPUTSEL_POSSEL_APORT3YCH7, acmpInputAPORT3XCH8 = _ACMP_INPUTSEL_POSSEL_APORT3XCH8, acmpInputAPORT3YCH9 = _ACMP_INPUTSEL_POSSEL_APORT3YCH9, acmpInputAPORT3XCH10 = _ACMP_INPUTSEL_POSSEL_APORT3XCH10, acmpInputAPORT3YCH11 = _ACMP_INPUTSEL_POSSEL_APORT3YCH11, acmpInputAPORT3XCH12 = _ACMP_INPUTSEL_POSSEL_APORT3XCH12, acmpInputAPORT3YCH13 = _ACMP_INPUTSEL_POSSEL_APORT3YCH13, acmpInputAPORT3XCH14 = _ACMP_INPUTSEL_POSSEL_APORT3XCH14, acmpInputAPORT3YCH15 = _ACMP_INPUTSEL_POSSEL_APORT3YCH15, acmpInputAPORT3XCH16 = _ACMP_INPUTSEL_POSSEL_APORT3XCH16, acmpInputAPORT3YCH17 = _ACMP_INPUTSEL_POSSEL_APORT3YCH17, acmpInputAPORT3XCH18 = _ACMP_INPUTSEL_POSSEL_APORT3XCH18, acmpInputAPORT3YCH19 = _ACMP_INPUTSEL_POSSEL_APORT3YCH19, acmpInputAPORT3XCH20 = _ACMP_INPUTSEL_POSSEL_APORT3XCH20, acmpInputAPORT3YCH21 = _ACMP_INPUTSEL_POSSEL_APORT3YCH21, acmpInputAPORT3XCH22 = _ACMP_INPUTSEL_POSSEL_APORT3XCH22, acmpInputAPORT3YCH23 = _ACMP_INPUTSEL_POSSEL_APORT3YCH23, acmpInputAPORT3XCH24 = _ACMP_INPUTSEL_POSSEL_APORT3XCH24, acmpInputAPORT3YCH25 = _ACMP_INPUTSEL_POSSEL_APORT3YCH25, acmpInputAPORT3XCH26 = _ACMP_INPUTSEL_POSSEL_APORT3XCH26, acmpInputAPORT3YCH27 = _ACMP_INPUTSEL_POSSEL_APORT3YCH27, acmpInputAPORT3XCH28 = _ACMP_INPUTSEL_POSSEL_APORT3XCH28, acmpInputAPORT3YCH29 = _ACMP_INPUTSEL_POSSEL_APORT3YCH29, acmpInputAPORT3XCH30 = _ACMP_INPUTSEL_POSSEL_APORT3XCH30, acmpInputAPORT3YCH31 = _ACMP_INPUTSEL_POSSEL_APORT3YCH31, acmpInputAPORT4YCH0 = _ACMP_INPUTSEL_POSSEL_APORT4YCH0, acmpInputAPORT4XCH1 = _ACMP_INPUTSEL_POSSEL_APORT4XCH1, acmpInputAPORT4YCH2 = _ACMP_INPUTSEL_POSSEL_APORT4YCH2, acmpInputAPORT4XCH3 = _ACMP_INPUTSEL_POSSEL_APORT4XCH3, acmpInputAPORT4YCH4 = _ACMP_INPUTSEL_POSSEL_APORT4YCH4, acmpInputAPORT4XCH5 = _ACMP_INPUTSEL_POSSEL_APORT4XCH5, acmpInputAPORT4YCH6 = _ACMP_INPUTSEL_POSSEL_APORT4YCH6, acmpInputAPORT4XCH7 = _ACMP_INPUTSEL_POSSEL_APORT4XCH7, acmpInputAPORT4YCH8 = _ACMP_INPUTSEL_POSSEL_APORT4YCH8, acmpInputAPORT4XCH9 = _ACMP_INPUTSEL_POSSEL_APORT4XCH9, acmpInputAPORT4YCH10 = _ACMP_INPUTSEL_POSSEL_APORT4YCH10, acmpInputAPORT4XCH11 = _ACMP_INPUTSEL_POSSEL_APORT4XCH11, acmpInputAPORT4YCH12 = _ACMP_INPUTSEL_POSSEL_APORT4YCH12, acmpInputAPORT4XCH13 = _ACMP_INPUTSEL_POSSEL_APORT4XCH13, acmpInputAPORT4YCH16 = _ACMP_INPUTSEL_POSSEL_APORT4YCH16, acmpInputAPORT4XCH17 = _ACMP_INPUTSEL_POSSEL_APORT4XCH17, acmpInputAPORT4YCH18 = _ACMP_INPUTSEL_POSSEL_APORT4YCH18, acmpInputAPORT4XCH19 = _ACMP_INPUTSEL_POSSEL_APORT4XCH19, acmpInputAPORT4YCH20 = _ACMP_INPUTSEL_POSSEL_APORT4YCH20, acmpInputAPORT4XCH21 = _ACMP_INPUTSEL_POSSEL_APORT4XCH21, acmpInputAPORT4YCH22 = _ACMP_INPUTSEL_POSSEL_APORT4YCH22, acmpInputAPORT4XCH23 = _ACMP_INPUTSEL_POSSEL_APORT4XCH23, acmpInputAPORT4YCH24 = _ACMP_INPUTSEL_POSSEL_APORT4YCH24, acmpInputAPORT4XCH25 = _ACMP_INPUTSEL_POSSEL_APORT4XCH25, acmpInputAPORT4YCH26 = _ACMP_INPUTSEL_POSSEL_APORT4YCH26, acmpInputAPORT4XCH27 = _ACMP_INPUTSEL_POSSEL_APORT4XCH27, acmpInputAPORT4YCH28 = _ACMP_INPUTSEL_POSSEL_APORT4YCH28, acmpInputAPORT4XCH29 = _ACMP_INPUTSEL_POSSEL_APORT4XCH29, acmpInputAPORT4YCH30 = _ACMP_INPUTSEL_POSSEL_APORT4YCH30, acmpInputAPORT4YCH14 = _ACMP_INPUTSEL_POSSEL_APORT4YCH14, acmpInputAPORT4XCH15 = _ACMP_INPUTSEL_POSSEL_APORT4XCH15, acmpInputAPORT4XCH31 = _ACMP_INPUTSEL_POSSEL_APORT4XCH31, acmpInputDACOUT0 = _ACMP_INPUTSEL_POSSEL_DACOUT0, acmpInputDACOUT1 = _ACMP_INPUTSEL_POSSEL_DACOUT1, acmpInputVLP = _ACMP_INPUTSEL_POSSEL_VLP, acmpInputVBDIV = _ACMP_INPUTSEL_POSSEL_VBDIV, acmpInputVADIV = _ACMP_INPUTSEL_POSSEL_VADIV, acmpInputVDD = _ACMP_INPUTSEL_POSSEL_VDD, acmpInputVSS = _ACMP_INPUTSEL_POSSEL_VSS } |
enum | ACMP_ExternalInput_Typedef { acmpExternalInputAPORT0X = _ACMP_EXTIFCTRL_APORTSEL_APORT0X, acmpExternalInputAPORT0Y = _ACMP_EXTIFCTRL_APORTSEL_APORT0Y, acmpExternalInputAPORT1X = _ACMP_EXTIFCTRL_APORTSEL_APORT1X, acmpExternalInputAPORT1Y = _ACMP_EXTIFCTRL_APORTSEL_APORT1Y, acmpExternalInputAPORT1XY = _ACMP_EXTIFCTRL_APORTSEL_APORT1XY, acmpExternalInputAPORT2X = _ACMP_EXTIFCTRL_APORTSEL_APORT2X, acmpExternalInputAPORT2Y = _ACMP_EXTIFCTRL_APORTSEL_APORT2Y, acmpExternalInputAPORT2YX = _ACMP_EXTIFCTRL_APORTSEL_APORT2YX, acmpExternalInputAPORT3X = _ACMP_EXTIFCTRL_APORTSEL_APORT3X, acmpExternalInputAPORT3Y = _ACMP_EXTIFCTRL_APORTSEL_APORT3Y, acmpExternalInputAPORT3XY = _ACMP_EXTIFCTRL_APORTSEL_APORT3XY, acmpExternalInputAPORT4X = _ACMP_EXTIFCTRL_APORTSEL_APORT4X, acmpExternalInputAPORT4Y = _ACMP_EXTIFCTRL_APORTSEL_APORT4Y, acmpExternalInputAPORT4YX = _ACMP_EXTIFCTRL_APORTSEL_APORT4YX } |
enum | ACMP_HysteresisLevel_TypeDef { acmpHysteresisLevel0 = _ACMP_HYSTERESIS0_HYST_HYST0, acmpHysteresisLevel1 = _ACMP_HYSTERESIS0_HYST_HYST1, acmpHysteresisLevel2 = _ACMP_HYSTERESIS0_HYST_HYST2, acmpHysteresisLevel3 = _ACMP_HYSTERESIS0_HYST_HYST3, acmpHysteresisLevel4 = _ACMP_HYSTERESIS0_HYST_HYST4, acmpHysteresisLevel5 = _ACMP_HYSTERESIS0_HYST_HYST5, acmpHysteresisLevel6 = _ACMP_HYSTERESIS0_HYST_HYST6, acmpHysteresisLevel7 = _ACMP_HYSTERESIS0_HYST_HYST7, acmpHysteresisLevel8 = _ACMP_HYSTERESIS0_HYST_HYST8, acmpHysteresisLevel9 = _ACMP_HYSTERESIS0_HYST_HYST9, acmpHysteresisLevel10 = _ACMP_HYSTERESIS0_HYST_HYST10, acmpHysteresisLevel11 = _ACMP_HYSTERESIS0_HYST_HYST11, acmpHysteresisLevel12 = _ACMP_HYSTERESIS0_HYST_HYST12, acmpHysteresisLevel13 = _ACMP_HYSTERESIS0_HYST_HYST13, acmpHysteresisLevel14 = _ACMP_HYSTERESIS0_HYST_HYST14, acmpHysteresisLevel15 = _ACMP_HYSTERESIS0_HYST_HYST15 } |
enum | ACMP_InputRange_TypeDef { acmpInputRangeFull = _ACMP_CTRL_INPUTRANGE_FULL, acmpInputRangeHigh = _ACMP_CTRL_INPUTRANGE_GTVDDDIV2, acmpInputRangeLow = _ACMP_CTRL_INPUTRANGE_LTVDDDIV2 } |
enum | ACMP_PowerSource_TypeDef { acmpPowerSourceAvdd = _ACMP_CTRL_PWRSEL_AVDD, acmpPowerSourceVddVreg = _ACMP_CTRL_PWRSEL_VREGVDD, acmpPowerSourceIOVdd0 = _ACMP_CTRL_PWRSEL_IOVDD0, acmpPowerSourceIOVdd1 = _ACMP_CTRL_PWRSEL_IOVDD1 } |
enum | ACMP_VAInput_TypeDef { acmpVAInputVDD = _ACMP_INPUTSEL_VASEL_VDD, acmpVAInputAPORT2YCH0 = _ACMP_INPUTSEL_VASEL_APORT2YCH0, acmpVAInputAPORT2YCH2 = _ACMP_INPUTSEL_VASEL_APORT2YCH2, acmpVAInputAPORT2YCH4 = _ACMP_INPUTSEL_VASEL_APORT2YCH4, acmpVAInputAPORT2YCH6 = _ACMP_INPUTSEL_VASEL_APORT2YCH6, acmpVAInputAPORT2YCH8 = _ACMP_INPUTSEL_VASEL_APORT2YCH8, acmpVAInputAPORT2YCH10 = _ACMP_INPUTSEL_VASEL_APORT2YCH10, acmpVAInputAPORT2YCH12 = _ACMP_INPUTSEL_VASEL_APORT2YCH12, acmpVAInputAPORT2YCH14 = _ACMP_INPUTSEL_VASEL_APORT2YCH14, acmpVAInputAPORT2YCH16 = _ACMP_INPUTSEL_VASEL_APORT2YCH16, acmpVAInputAPORT2YCH18 = _ACMP_INPUTSEL_VASEL_APORT2YCH18, acmpVAInputAPORT2YCH20 = _ACMP_INPUTSEL_VASEL_APORT2YCH20, acmpVAInputAPORT2YCH22 = _ACMP_INPUTSEL_VASEL_APORT2YCH22, acmpVAInputAPORT2YCH24 = _ACMP_INPUTSEL_VASEL_APORT2YCH24, acmpVAInputAPORT2YCH26 = _ACMP_INPUTSEL_VASEL_APORT2YCH26, acmpVAInputAPORT2YCH28 = _ACMP_INPUTSEL_VASEL_APORT2YCH28, acmpVAInputAPORT2YCH30 = _ACMP_INPUTSEL_VASEL_APORT2YCH30, acmpVAInputAPORT1XCH0 = _ACMP_INPUTSEL_VASEL_APORT1XCH0, acmpVAInputAPORT1YCH1 = _ACMP_INPUTSEL_VASEL_APORT1YCH1, acmpVAInputAPORT1XCH2 = _ACMP_INPUTSEL_VASEL_APORT1XCH2, acmpVAInputAPORT1YCH3 = _ACMP_INPUTSEL_VASEL_APORT1YCH3, acmpVAInputAPORT1XCH4 = _ACMP_INPUTSEL_VASEL_APORT1XCH4, acmpVAInputAPORT1YCH5 = _ACMP_INPUTSEL_VASEL_APORT1YCH5, acmpVAInputAPORT1XCH6 = _ACMP_INPUTSEL_VASEL_APORT1XCH6, acmpVAInputAPORT1YCH7 = _ACMP_INPUTSEL_VASEL_APORT1YCH7, acmpVAInputAPORT1XCH8 = _ACMP_INPUTSEL_VASEL_APORT1XCH8, acmpVAInputAPORT1YCH9 = _ACMP_INPUTSEL_VASEL_APORT1YCH9, acmpVAInputAPORT1XCH10 = _ACMP_INPUTSEL_VASEL_APORT1XCH10, acmpVAInputAPORT1YCH11 = _ACMP_INPUTSEL_VASEL_APORT1YCH11, acmpVAInputAPORT1XCH12 = _ACMP_INPUTSEL_VASEL_APORT1XCH12, acmpVAInputAPORT1YCH13 = _ACMP_INPUTSEL_VASEL_APORT1YCH13, acmpVAInputAPORT1XCH14 = _ACMP_INPUTSEL_VASEL_APORT1XCH14, acmpVAInputAPORT1YCH15 = _ACMP_INPUTSEL_VASEL_APORT1YCH15, acmpVAInputAPORT1XCH16 = _ACMP_INPUTSEL_VASEL_APORT1XCH16, acmpVAInputAPORT1YCH17 = _ACMP_INPUTSEL_VASEL_APORT1YCH17, acmpVAInputAPORT1XCH18 = _ACMP_INPUTSEL_VASEL_APORT1XCH18, acmpVAInputAPORT1YCH19 = _ACMP_INPUTSEL_VASEL_APORT1YCH19, acmpVAInputAPORT1XCH20 = _ACMP_INPUTSEL_VASEL_APORT1XCH20, acmpVAInputAPORT1YCH21 = _ACMP_INPUTSEL_VASEL_APORT1YCH21, acmpVAInputAPORT1XCH22 = _ACMP_INPUTSEL_VASEL_APORT1XCH22, acmpVAInputAPORT1YCH23 = _ACMP_INPUTSEL_VASEL_APORT1YCH23, acmpVAInputAPORT1XCH24 = _ACMP_INPUTSEL_VASEL_APORT1XCH24, acmpVAInputAPORT1YCH25 = _ACMP_INPUTSEL_VASEL_APORT1YCH25, acmpVAInputAPORT1XCH26 = _ACMP_INPUTSEL_VASEL_APORT1XCH26, acmpVAInputAPORT1YCH27 = _ACMP_INPUTSEL_VASEL_APORT1YCH27, acmpVAInputAPORT1XCH28 = _ACMP_INPUTSEL_VASEL_APORT1XCH28, acmpVAInputAPORT1YCH29 = _ACMP_INPUTSEL_VASEL_APORT1YCH29, acmpVAInputAPORT1XCH30 = _ACMP_INPUTSEL_VASEL_APORT1XCH30, acmpVAInputAPORT1YCH31 = _ACMP_INPUTSEL_VASEL_APORT1YCH31 } |
enum | ACMP_VBInput_TypeDef { acmpVBInput1V25 = _ACMP_INPUTSEL_VBSEL_1V25, acmpVBInput2V5 = _ACMP_INPUTSEL_VBSEL_2V5 } |
enum | ACMP_VLPInput_Typedef { acmpVLPInputVADIV = _ACMP_INPUTSEL_VLPSEL_VADIV, acmpVLPInputVBDIV = _ACMP_INPUTSEL_VLPSEL_VBDIV } |
Functions | |
void | ACMP_CapsenseChannelSet (ACMP_TypeDef *acmp, ACMP_Channel_TypeDef channel) |
Sets the ACMP channel used for capacative sensing. More... | |
void | ACMP_CapsenseInit (ACMP_TypeDef *acmp, const ACMP_CapsenseInit_TypeDef *init) |
Sets up the ACMP for use in capacative sense applications. More... | |
void | ACMP_ChannelSet (ACMP_TypeDef *acmp, ACMP_Channel_TypeDef negSel, ACMP_Channel_TypeDef posSel) |
Sets which channels should be used in ACMP comparisons. More... | |
void | ACMP_Disable (ACMP_TypeDef *acmp) |
Disables the ACMP. More... | |
void | ACMP_Enable (ACMP_TypeDef *acmp) |
Enables the ACMP. More... | |
void | ACMP_ExternalInputSelect (ACMP_TypeDef *acmp, ACMP_ExternalInput_Typedef aport) |
Select and enable an external input. More... | |
void | ACMP_GPIOSetup (ACMP_TypeDef *acmp, uint32_t location, bool enable, bool invert) |
Sets up GPIO output from the ACMP. More... | |
void | ACMP_Init (ACMP_TypeDef *acmp, const ACMP_Init_TypeDef *init) |
Initialize ACMP. More... | |
__STATIC_INLINE void | ACMP_IntClear (ACMP_TypeDef *acmp, uint32_t flags) |
Clear one or more pending ACMP interrupts. More... | |
__STATIC_INLINE void | ACMP_IntDisable (ACMP_TypeDef *acmp, uint32_t flags) |
Disable one or more ACMP interrupts. More... | |
__STATIC_INLINE void | ACMP_IntEnable (ACMP_TypeDef *acmp, uint32_t flags) |
Enable one or more ACMP interrupts. More... | |
__STATIC_INLINE uint32_t | ACMP_IntGet (ACMP_TypeDef *acmp) |
Get pending ACMP interrupt flags. More... | |
__STATIC_INLINE uint32_t | ACMP_IntGetEnabled (ACMP_TypeDef *acmp) |
Get enabled and pending ACMP interrupt flags. Useful for handling more interrupt sources in the same interrupt handler. More... | |
__STATIC_INLINE void | ACMP_IntSet (ACMP_TypeDef *acmp, uint32_t flags) |
Set one or more pending ACMP interrupts from SW. More... | |
void | ACMP_Reset (ACMP_TypeDef *acmp) |
Reset ACMP to same state as after a HW reset. More... | |
void | ACMP_VASetup (ACMP_TypeDef *acmp, const ACMP_VAConfig_TypeDef *vaconfig) |
Setup the VA Source. More... | |
void | ACMP_VBSetup (ACMP_TypeDef *acmp, const ACMP_VBConfig_TypeDef *vbconfig) |
Setup the VB Source. More... | |
#define ACMP_CAPSENSE_INIT_DEFAULT |
Default config for capacitive sense mode initialization.
Definition at line 610 of file em_acmp.h.
Referenced by CAPSENSE_Init().
#define ACMP_INIT_DEFAULT |
Default config for ACMP regular initialization.
#define ACMP_VACONFIG_DEFAULT |
#define ACMP_VBCONFIG_DEFAULT |
Resistor values used for the internal capacative sense resistor. See the datasheet for your device for details on each resistor value.
enum ACMP_Channel_TypeDef |
Hysteresis level. See datasheet for your device for details on each level.
ACMP Power source.
enum ACMP_VAInput_TypeDef |
enum ACMP_VBInput_TypeDef |
void ACMP_CapsenseChannelSet | ( | ACMP_TypeDef * | acmp, |
ACMP_Channel_TypeDef | channel | ||
) |
Sets the ACMP channel used for capacative sensing.
[in] | acmp | Pointer to ACMP peripheral register block. |
[in] | channel | The ACMP channel to use for capacative sensing (Possel). |
Definition at line 185 of file em_acmp.c.
References _ACMP_INPUTSEL_POSSEL_MASK, _ACMP_INPUTSEL_POSSEL_SHIFT, BUS_RegMaskedWrite(), and ACMP_TypeDef::INPUTSEL.
Referenced by CAPSENSE_Measure().
void ACMP_CapsenseInit | ( | ACMP_TypeDef * | acmp, |
const ACMP_CapsenseInit_TypeDef * | init | ||
) |
Sets up the ACMP for use in capacative sense applications.
This function sets up the ACMP for use in capacacitve sense applications. To use the capacative sense functionality in the ACMP you need to use the PRS output of the ACMP module to count the number of oscillations in the capacative sense circuit (possibly using a TIMER).
[in] | acmp | Pointer to ACMP peripheral register block. |
[in] | init | Pointer to initialization structure used to configure ACMP for capacative sensing operation. |
Definition at line 109 of file em_acmp.c.
References _ACMP_CTRL_ACCURACY_MASK, _ACMP_CTRL_BIASPROG_MASK, _ACMP_CTRL_BIASPROG_SHIFT, _ACMP_CTRL_EN_SHIFT, _ACMP_CTRL_FULLBIAS_SHIFT, _ACMP_HYSTERESIS0_DIVVA_SHIFT, _ACMP_HYSTERESIS0_HYST_SHIFT, _ACMP_HYSTERESIS1_DIVVA_SHIFT, _ACMP_HYSTERESIS1_HYST_SHIFT, _ACMP_INPUTSEL_CSRESSEL_SHIFT, ACMP_CTRL_ACCURACY_HIGH, ACMP_INPUTSEL_CSRESEN, ACMP_INPUTSEL_NEGSEL_VADIV, ACMP_INPUTSEL_VASEL_VDD, ACMP_CapsenseInit_TypeDef::biasProg, BUS_RegBitWrite(), ACMP_TypeDef::CTRL, ACMP_CapsenseInit_TypeDef::enable, ACMP_CapsenseInit_TypeDef::fullBias, ACMP_TypeDef::HYSTERESIS0, ACMP_TypeDef::HYSTERESIS1, ACMP_CapsenseInit_TypeDef::hysteresisLevel_0, ACMP_CapsenseInit_TypeDef::hysteresisLevel_1, ACMP_TypeDef::INPUTSEL, ACMP_CapsenseInit_TypeDef::resistor, ACMP_CapsenseInit_TypeDef::vddLevelHigh, and ACMP_CapsenseInit_TypeDef::vddLevelLow.
Referenced by CAPLESENSE_setupACMP(), and CAPSENSE_Init().
void ACMP_ChannelSet | ( | ACMP_TypeDef * | acmp, |
ACMP_Channel_TypeDef | negSel, | ||
ACMP_Channel_TypeDef | posSel | ||
) |
Sets which channels should be used in ACMP comparisons.
[in] | acmp | Pointer to the ACMP peripheral register block. |
negSel | Channel to use on the negative input to the ACMP. | |
posSel | Channel to use on the positive input to the ACMP. |
Definition at line 340 of file em_acmp.c.
References _ACMP_INPUTSEL_NEGSEL_MASK, _ACMP_INPUTSEL_NEGSEL_SHIFT, _ACMP_INPUTSEL_POSSEL_MASK, _ACMP_INPUTSEL_POSSEL_SHIFT, and ACMP_TypeDef::INPUTSEL.
void ACMP_Disable | ( | ACMP_TypeDef * | acmp | ) |
Disables the ACMP.
[in] | acmp | Pointer to ACMP peripheral register block. |
Definition at line 210 of file em_acmp.c.
References ACMP_CTRL_EN, and ACMP_TypeDef::CTRL.
Referenced by CAPSENSE_Sense().
void ACMP_Enable | ( | ACMP_TypeDef * | acmp | ) |
Enables the ACMP.
[in] | acmp | Pointer to ACMP peripheral register block. |
Definition at line 225 of file em_acmp.c.
References ACMP_CTRL_EN, and ACMP_TypeDef::CTRL.
Referenced by CAPSENSE_Sense().
void ACMP_ExternalInputSelect | ( | ACMP_TypeDef * | acmp, |
ACMP_ExternalInput_Typedef | aport | ||
) |
Select and enable an external input.
This is used when an external module needs to take control of the ACMP POSSEL field in order to configure the APORT input for the ACMP. Modules like LESENSE use this to change the ACMP input during a scan sequence.
[in] | acmp | Pointer to ACMP peripheral register block. |
[in] | aport | This parameter decides which APORT(s) the ACMP will use when it's being controlled by an external module. |
Definition at line 250 of file em_acmp.c.
References _ACMP_EXTIFCTRL_APORTSEL_SHIFT, ACMP_EXTIFCTRL_EN, ACMP_STATUS_EXTIFACT, ACMP_TypeDef::EXTIFCTRL, and ACMP_TypeDef::STATUS.
void ACMP_GPIOSetup | ( | ACMP_TypeDef * | acmp, |
uint32_t | location, | ||
bool | enable, | ||
bool | invert | ||
) |
Sets up GPIO output from the ACMP.
CMU_ClockEnable(cmuClock_GPIO, true);
[in] | acmp | Pointer to the ACMP peripheral register block. |
location | The pin location to use. See the datasheet for location to pin mappings. | |
enable | Enable or disable pin output. | |
invert | Invert output. |
Definition at line 305 of file em_acmp.c.
References _ACMP_CTRL_GPIOINV_MASK, _ACMP_CTRL_GPIOINV_SHIFT, _ACMP_ROUTELOC0_OUTLOC_SHIFT, ACMP_ROUTEPEN_OUTPEN, BUS_RegMaskedWrite(), ACMP_TypeDef::CTRL, ACMP_TypeDef::ROUTELOC0, and ACMP_TypeDef::ROUTEPEN.
Referenced by CAPLESENSE_setupACMP().
void ACMP_Init | ( | ACMP_TypeDef * | acmp, |
const ACMP_Init_TypeDef * | init | ||
) |
Initialize ACMP.
[in] | acmp | Pointer to the ACMP peripheral register block. |
[in] | init | Pointer to initialization structure used to configure ACMP for capacative sensing operation. |
Definition at line 374 of file em_acmp.c.
References _ACMP_CTRL_ACCURACY_MASK, _ACMP_CTRL_ACCURACY_SHIFT, _ACMP_CTRL_BIASPROG_MASK, _ACMP_CTRL_BIASPROG_SHIFT, _ACMP_CTRL_EN_SHIFT, _ACMP_CTRL_FULLBIAS_SHIFT, _ACMP_CTRL_IFALL_SHIFT, _ACMP_CTRL_INACTVAL_SHIFT, _ACMP_CTRL_INPUTRANGE_SHIFT, _ACMP_CTRL_IRISE_SHIFT, _ACMP_CTRL_PWRSEL_MASK, _ACMP_CTRL_PWRSEL_SHIFT, _ACMP_INPUTSEL_VLPSEL_MASK, _ACMP_INPUTSEL_VLPSEL_SHIFT, ACMP_Init_TypeDef::accuracy, ACMP_Init_TypeDef::biasProg, BUS_RegBitWrite(), ACMP_TypeDef::CTRL, ACMP_Init_TypeDef::enable, ACMP_Init_TypeDef::fullBias, ACMP_Init_TypeDef::inactiveValue, ACMP_Init_TypeDef::inputRange, ACMP_TypeDef::INPUTSEL, ACMP_Init_TypeDef::interruptOnFallingEdge, ACMP_Init_TypeDef::interruptOnRisingEdge, ACMP_Init_TypeDef::powerSource, and ACMP_Init_TypeDef::vlpInput.
__STATIC_INLINE void ACMP_IntClear | ( | ACMP_TypeDef * | acmp, |
uint32_t | flags | ||
) |
Clear one or more pending ACMP interrupts.
[in] | acmp | Pointer to ACMP peripheral register block. |
[in] | flags | Pending ACMP interrupt source to clear. Use a bitwise logic OR combination of valid interrupt flags for the ACMP module. The flags can be for instance ACMP_IFC_EDGE or ACMP_IFC_WARMUP. |
Definition at line 881 of file em_acmp.h.
References ACMP_TypeDef::IFC.
__STATIC_INLINE void ACMP_IntDisable | ( | ACMP_TypeDef * | acmp, |
uint32_t | flags | ||
) |
Disable one or more ACMP interrupts.
[in] | acmp | Pointer to ACMP peripheral register block. |
[in] | flags | ACMP interrupt sources to disable. Use a bitwise logic OR combination of valid interrupt flags for the ACMP module. The flags can be for instance ACMP_IEN_EDGE or ACMP_IEN_WARMUP. |
Definition at line 899 of file em_acmp.h.
References ACMP_TypeDef::IEN.
__STATIC_INLINE void ACMP_IntEnable | ( | ACMP_TypeDef * | acmp, |
uint32_t | flags | ||
) |
Enable one or more ACMP interrupts.
[in] | acmp | Pointer to ACMP peripheral register block. |
[in] | flags | ACMP interrupt sources to enable. Use a bitwise logic OR combination of valid interrupt flags for the ACMP module. The flags can be for instance ACMP_IEN_EDGE or ACMP_IEN_WARMUP. |
Definition at line 922 of file em_acmp.h.
References ACMP_TypeDef::IEN.
__STATIC_INLINE uint32_t ACMP_IntGet | ( | ACMP_TypeDef * | acmp | ) |
Get pending ACMP interrupt flags.
[in] | acmp | Pointer to ACMP peripheral register block. |
Definition at line 943 of file em_acmp.h.
References ACMP_TypeDef::IF.
__STATIC_INLINE uint32_t ACMP_IntGetEnabled | ( | ACMP_TypeDef * | acmp | ) |
Get enabled and pending ACMP interrupt flags. Useful for handling more interrupt sources in the same interrupt handler.
[in] | acmp | Pointer to ACMP peripheral register block. |
Definition at line 968 of file em_acmp.h.
References ACMP_TypeDef::IEN, and ACMP_TypeDef::IF.
__STATIC_INLINE void ACMP_IntSet | ( | ACMP_TypeDef * | acmp, |
uint32_t | flags | ||
) |
Set one or more pending ACMP interrupts from SW.
[in] | acmp | Pointer to ACMP peripheral register block. |
[in] | flags | ACMP interrupt sources to set to pending. Use a bitwise logic OR combination of valid interrupt flags for the ACMP module. The flags can be for instance ACMP_IFS_EDGE or ACMP_IFS_WARMUP. |
Definition at line 993 of file em_acmp.h.
References ACMP_TypeDef::IFS.
void ACMP_Reset | ( | ACMP_TypeDef * | acmp | ) |
Reset ACMP to same state as after a HW reset.
[in] | acmp | Pointer to the ACMP peripheral register block. |
Definition at line 270 of file em_acmp.c.
References _ACMP_CTRL_RESETVALUE, _ACMP_HYSTERESIS0_RESETVALUE, _ACMP_HYSTERESIS1_RESETVALUE, _ACMP_IEN_RESETVALUE, _ACMP_IF_MASK, _ACMP_INPUTSEL_RESETVALUE, ACMP_TypeDef::CTRL, ACMP_TypeDef::HYSTERESIS0, ACMP_TypeDef::HYSTERESIS1, ACMP_TypeDef::IEN, ACMP_TypeDef::IFC, and ACMP_TypeDef::INPUTSEL.
void ACMP_VASetup | ( | ACMP_TypeDef * | acmp, |
const ACMP_VAConfig_TypeDef * | vaconfig | ||
) |
Setup the VA Source.
[in] | acmp | Pointer to the ACMP peripheral register block. |
[in] | vaconfig | Pointer to the structure used to configure the VA source. This structure contains the input source as well as the 2 divider values. |
Definition at line 440 of file em_acmp.c.
References _ACMP_HYSTERESIS0_DIVVA_MASK, _ACMP_HYSTERESIS0_DIVVA_SHIFT, _ACMP_HYSTERESIS1_DIVVA_MASK, _ACMP_HYSTERESIS1_DIVVA_SHIFT, _ACMP_INPUTSEL_VASEL_MASK, _ACMP_INPUTSEL_VASEL_SHIFT, BUS_RegMaskedWrite(), ACMP_VAConfig_TypeDef::div0, ACMP_VAConfig_TypeDef::div1, ACMP_TypeDef::HYSTERESIS0, ACMP_TypeDef::HYSTERESIS1, ACMP_VAConfig_TypeDef::input, and ACMP_TypeDef::INPUTSEL.
void ACMP_VBSetup | ( | ACMP_TypeDef * | acmp, |
const ACMP_VBConfig_TypeDef * | vbconfig | ||
) |
Setup the VB Source.
[in] | acmp | Pointer to the ACMP peripheral register block. |
[in] | vbconfig | Pointer to the structure used to configure the VB source. This structure contains the input source as well as the 2 divider values. |
Definition at line 466 of file em_acmp.c.
References _ACMP_HYSTERESIS0_DIVVB_MASK, _ACMP_HYSTERESIS0_DIVVB_SHIFT, _ACMP_HYSTERESIS1_DIVVB_MASK, _ACMP_HYSTERESIS1_DIVVB_SHIFT, _ACMP_INPUTSEL_VBSEL_MASK, _ACMP_INPUTSEL_VBSEL_SHIFT, BUS_RegMaskedWrite(), ACMP_VBConfig_TypeDef::div0, ACMP_VBConfig_TypeDef::div1, ACMP_TypeDef::HYSTERESIS0, ACMP_TypeDef::HYSTERESIS1, ACMP_VBConfig_TypeDef::input, and ACMP_TypeDef::INPUTSEL.