Chapter 2. API Reference
• init_config:
adc_digi_init_config_t.
esp_err_t
adc_digi_read_bytes(uint8_t *buf, uint32_t length_max, uint32_t *out_length, uint32_t
Read bytes from Digital ADC through DMA.
Return
• ESP_ERR_INVALID_STATE Driver state is invalid. Usually it means the ADC sampling rate is
faster than the task processing rate.
• ESP_ERR_TIMEOUT Operation timed out
• ESP_OK On success
Parameters
• [out] buf: Buffer to read from ADC.
• [in] length_max: Expected length of data read from the ADC.
• [out] out_length: Real length of data read from the ADC via this API.
• [in] timeout_ms: Time to wait for data via this API, in millisecond.
esp_err_t
adc_digi_start(void)
Start the Digital ADC and DMA peripherals. After this, the hardware starts working.
Return
• ESP_ERR_INVALID_STATE Driver state is invalid.
• ESP_OK On success
esp_err_t
adc_digi_stop(void)
Stop the Digital ADC and DMA peripherals. After this, the hardware stops working.
Return
• ESP_ERR_INVALID_STATE Driver state is invalid.
• ESP_OK On success
esp_err_t
adc_digi_deinitialize(void)
Deinitialize the Digital ADC.
Return
• ESP_ERR_INVALID_STATE Driver state is invalid.
• ESP_OK On success
esp_err_t
adc_digi_controller_configure(const
Setting the digital controller.
Return
• ESP_ERR_INVALID_STATE Driver state is invalid.
• ESP_ERR_INVALID_ARG If the combination of arguments is invalid.
• ESP_OK On success
Parameters
• config: Pointer to digital controller paramter. Refer to adc_digi_config_t.
esp_err_t adc_digi_filter_reset(adc_digi_filter_idx_t
Reset adc digital controller filter.
Return
• ESP_OK Success
Parameters
• idx: Filter index.
esp_err_t adc_digi_filter_set_config(adc_digi_filter_idx_t
Set adc digital controller filter configuration.
Note For ESP32S2, Filter IDX0/IDX1 can only be used to filter all enabled channels of ADC1/ADC2 unit at
the same time.
Return
• ESP_OK Success
Parameters
Espressif Systems
Pointer
to
Digital
ADC
timeout_ms)
adc_digi_configuration_t
idx)
222
Submit Document Feedback
initilization
config.
*config)
idx,
adc_digi_filter_t
*config)
Refer
to
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?