|
HF Interface Wrapper 0.1.0-dev
Embedded C++ hardware abstraction layer
|
ESP32 ADC type definitions for hardware abstraction. More...
#include "BaseAdc.h"#include "EspTypes_Base.h"#include "HardwareTypes.h"#include "McuSelect.h"#include <esp_adc/adc_continuous.h>#include <esp_adc/adc_oneshot.h>Go to the source code of this file.
Classes | |
| struct | hf_adc_channel_config_t |
| ADC channel configuration structure. More... | |
| struct | hf_adc_continuous_config_t |
| ADC continuous mode configuration structure. More... | |
| struct | hf_adc_filter_config_t |
| ADC filter configuration structure. More... | |
| struct | hf_adc_monitor_config_t |
| ADC monitor configuration structure. More... | |
| struct | hf_adc_calibration_config_t |
| ADC calibration configuration structure. More... | |
| struct | hf_adc_unit_config_t |
| ADC unit configuration structure. More... | |
| struct | hf_adc_continuous_data_t |
| ADC continuous data structure. More... | |
| struct | hf_adc_monitor_event_t |
| ADC monitor event structure. More... | |
Typedefs | |
| using | hf_adc_continuous_callback_t |
| ADC continuous mode data callback function. | |
| using | hf_adc_monitor_callback_t = void (*)(const hf_adc_monitor_event_t* event, void* user_data) |
| ADC threshold monitor callback function. | |
Enumerations | |
| enum class | hf_adc_mode_t : uint8_t { ONESHOT = 0 , CONTINUOUS = 1 } |
| ADC operating modes supported by ESP32. More... | |
| enum class | hf_adc_atten_t : uint8_t { ATTEN_DB_0 = ADC_ATTEN_DB_0 , ATTEN_DB_2_5 = ADC_ATTEN_DB_2_5 , ATTEN_DB_6 = ADC_ATTEN_DB_6 , ATTEN_DB_12 = ADC_ATTEN_DB_12 } |
| ADC attenuation levels for ESP32 These control the input voltage range that can be measured Values must match ESP-IDF adc_atten_t enum. More... | |
| enum class | hf_adc_bitwidth_t : uint8_t { WIDTH_9BIT = ADC_BITWIDTH_9 , WIDTH_10BIT = ADC_BITWIDTH_10 , WIDTH_11BIT = ADC_BITWIDTH_11 , WIDTH_12BIT = ADC_BITWIDTH_12 , WIDTH_13BIT = ADC_BITWIDTH_13 , WIDTH_DEFAULT = ADC_BITWIDTH_DEFAULT } |
| ADC resolution/bit width settings for ESP32 Values must match ESP-IDF adc_bitwidth_t enum. More... | |
| enum class | hf_adc_filter_coeff_t : uint8_t { COEFF_2 = 0 , COEFF_4 = 1 , COEFF_8 = 2 , COEFF_16 = 3 , COEFF_64 = 4 } |
| ADC filter coefficient enumeration. More... | |
| enum class | hf_adc_monitor_event_type_t : uint8_t { HIGH_THRESH = 0 , LOW_THRESH = 1 } |
| ADC monitor event type enumeration. More... | |
Functions | |
| constexpr uint32_t | CalcFrameSize (uint32_t samples_per_frame, uint32_t enabled_channels) noexcept |
| Calculate frame size in bytes based on samples per frame and enabled channels. | |
| constexpr uint32_t | CalcBufferPoolSize (uint32_t samples_per_frame, uint32_t enabled_channels, uint32_t max_store_frames) noexcept |
| Calculate total buffer pool size based on frames and enabled channels. | |
| constexpr bool | IsValidContinuousConfig (uint32_t samples_per_frame, uint32_t enabled_channels, uint32_t max_store_frames) noexcept |
| Validate continuous mode configuration parameters. | |
| constexpr bool | IsValidFrameSize (uint32_t frame_size) noexcept |
| Validate that frame size is properly aligned. | |
| constexpr uint32_t | GetFrameResultCount (uint32_t frame_size) noexcept |
| Calculate number of conversion results that fit in a frame. | |
| constexpr hf_channel_id_t | GpioToAdcChannel (hf_pin_num_t gpio_pin) noexcept |
| Convert GPIO pin to ADC channel for ESP32. | |
| constexpr hf_pin_num_t | AdcChannelToGpio (hf_channel_id_t channel_id) noexcept |
| Convert ADC channel to GPIO pin for ESP32. | |
| constexpr uint32_t | GetMaxInputVoltage (hf_adc_atten_t atten) noexcept |
| Get maximum input voltage for given attenuation. | |
| constexpr uint32_t | GetMaxRawValue (hf_adc_bitwidth_t bitwidth) noexcept |
| Get maximum raw value for given bit width. | |
Variables | |
| constexpr uint32_t | HF_ESP32_ADC_DATA_BYTES_PER_CONV |
| Example of ISR-safe ADC callback implementation. | |
| constexpr uint32_t | HF_ESP32_ADC_MIN_FRAME_SIZE = 64 |
| Minimum frame size. | |
| constexpr uint32_t | HF_ESP32_ADC_MAX_FRAME_SIZE = 1024 |
| Maximum frame size. | |
| constexpr uint32_t | HF_ESP32_ADC_DEFAULT_FRAME_SIZE = 256 |
| Default frame size. | |
ESP32 ADC type definitions for hardware abstraction.
This header defines only the essential ADC-specific types and constants used by the EspAdc implementation. It follows a clean, minimal pattern providing only necessary types without redundant or duplicate definitions.
ADC continuous mode data callback function.
| data | Continuous data structure containing sampled data |
| user_data | User-provided data pointer |
| using hf_adc_monitor_callback_t = void (*)(const hf_adc_monitor_event_t* event, void* user_data) |
ADC threshold monitor callback function.
| event | Monitor event structure containing threshold event details |
| user_data | User-provided data pointer |
|
strong |
ADC attenuation levels for ESP32 These control the input voltage range that can be measured Values must match ESP-IDF adc_atten_t enum.
|
strong |
ADC resolution/bit width settings for ESP32 Values must match ESP-IDF adc_bitwidth_t enum.
|
strong |
|
strong |
|
strong |
|
inlineconstexprnoexcept |
Convert ADC channel to GPIO pin for ESP32.
| channel_id | ADC channel ID |
|
inlineconstexprnoexcept |
Calculate total buffer pool size based on frames and enabled channels.
| samples_per_frame | Number of samples per frame per enabled channel |
| enabled_channels | Number of enabled channels |
| max_store_frames | Maximum frames to store |
|
inlineconstexprnoexcept |
Calculate frame size in bytes based on samples per frame and enabled channels.
| samples_per_frame | Number of samples per frame per enabled channel |
| enabled_channels | Number of enabled channels |
|
inlineconstexprnoexcept |
Calculate number of conversion results that fit in a frame.
| frame_size | Frame size in bytes |
|
inlineconstexprnoexcept |
Get maximum input voltage for given attenuation.
| atten | Attenuation level |
|
inlineconstexprnoexcept |
Get maximum raw value for given bit width.
| bitwidth | ADC bit width |
|
inlineconstexprnoexcept |
Convert GPIO pin to ADC channel for ESP32.
| gpio_pin | GPIO pin number |
|
inlineconstexprnoexcept |
Validate continuous mode configuration parameters.
| samples_per_frame | Number of samples per frame per enabled channel |
| enabled_channels | Number of enabled channels |
| max_store_frames | Maximum frames to store |
|
inlineconstexprnoexcept |
Validate that frame size is properly aligned.
| frame_size | Frame size in bytes |
|
constexpr |
Example of ISR-safe ADC callback implementation.
ESP32 ADC continuous mode constants Bytes per conversion result from ESP-IDF
|
constexpr |
Default frame size.
|
constexpr |
Maximum frame size.
|
constexpr |
Minimum frame size.