ADC Button Peripheral¶
Read status of buttons connected to an ADC input using a resistor ladder. Configuration provides for more than a singe ADC input to read several sets of buttons. For an example hardware implementation please refer to schematic of ESP32-LyraTD-MSC V2.2 Upper Board (PDF).
Application Examples¶
Implementation of this API is demonstrated in the following example:
API Reference¶
Header File¶
Functions¶
-
esp_periph_handle_t
periph_adc_button_init
(periph_adc_button_cfg_t *btn_cfg)¶ Create the button peripheral handle for esp_peripherals.
- Note
The handle created by this function is automatically destroyed when esp_periph_destroy is called.
- Return
The esp peripheral handle.
- Parameters
btn_cfg
: The button configuration.
Structures¶
-
struct
periph_adc_button_cfg_t
¶ The configuration of ADC Button.
Macros¶
-
ADC_BUTTON_STACK_SIZE
¶
-
ADC_BUTTON_TASK_PRIORITY
¶
-
ADC_BUTTON_TASK_CORE_ID
¶
-
PERIPH_ADC_BUTTON_DEFAULT_CONFIG
()¶
-
ADC_DEFAULT_ARR
()¶ ESP32 ADC1 channels and GPIO table ADC1_CHANNEL_0 - GPIO36 ADC1_CHANNEL_1 - GPIO37 ADC1_CHANNEL_2 - GPIO38 ADC1_CHANNEL_3 - GPIO39 ADC1_CHANNEL_4 - GPIO32 ADC1_CHANNEL_5 - GPIO33 ADC1_CHANNEL_6 - GPIO34 ADC1_CHANNEL_7 - GPIO35