HF Interface Wrapper 0.1.0-dev
Embedded C++ hardware abstraction layer
Loading...
Searching...
No Matches
EspAdc.h
Go to the documentation of this file.
1
27#pragma once
28
29#include "McuSelect.h"
30
31// Only compile for ESP32 family
32#ifdef HF_MCU_FAMILY_ESP32
33
34#include "BaseAdc.h"
35#include "PlatformMutex.h"
36#include "utils/EspTypes.h"
37
38#include <array>
39#include <atomic>
40#include <memory>
41#include <vector>
42
43// ESP-IDF C headers must be wrapped in extern "C" for C++ compatibility
44#ifdef __cplusplus
45extern "C" {
46#endif
47
48#include "driver/gpio.h"
49#include "esp_adc/adc_cali.h"
50#include "esp_adc/adc_cali_scheme.h"
51#include "esp_adc/adc_continuous.h"
52#include "esp_adc/adc_filter.h"
53#include "esp_adc/adc_monitor.h"
54#include "esp_adc/adc_oneshot.h"
55#include "esp_log.h"
56#include "esp_timer.h"
57
58#ifdef __cplusplus
59}
60#endif
61
62#include "PlatformMutex.h"
63
64//==============================================================================
65// ESP32 VARIANT-SPECIFIC ADC CONFIGURATION
66//==============================================================================
67
68// ESP32-C6 Configuration
69#if defined(HF_MCU_ESP32C6)
70#define HF_ESP32_ADC_MAX_UNITS 1
71#define HF_ESP32_ADC_MAX_CHANNELS 7
72#define HF_ESP32_ADC_MAX_FILTERS 2
73#define HF_ESP32_ADC_MAX_MONITORS 2
74#define HF_ESP32_ADC_MAX_RAW_VALUE 4095
75#define HF_ESP32_ADC_REFERENCE_VOLTAGE_MV 1100
76#define HF_ESP32_ADC_MAX_SAMPLING_FREQ 100000
77#define HF_ESP32_ADC_MIN_SAMPLING_FREQ 10
78#define HF_ESP32_ADC_DEFAULT_SAMPLING_FREQ 1000
79#define HF_ESP32_ADC_DMA_BUFFER_SIZE_MIN 256
80#define HF_ESP32_ADC_DMA_BUFFER_SIZE_MAX 4096
81#define HF_ESP32_ADC_DMA_BUFFER_SIZE_DEFAULT 1024
82
83#define HF_ESP32_ADC_ONESHOT_CLK_SRC ADC_DIGI_CLK_SRC_DEFAULT
84#define HF_ESP32_ADC_CONTINUOUS_CLK_SRC ADC_DIGI_CLK_SRC_DEFAULT
85#define HF_ESP32_ADC_ULP_MODE ADC_ULP_MODE_DISABLE
86
87// ESP32 Classic Configuration
88#elif defined(HF_MCU_ESP32)
89#define HF_ESP32_ADC_MAX_UNITS 2
90#define HF_ESP32_ADC_MAX_CHANNELS 8
91#define HF_ESP32_ADC_MAX_FILTERS 2
92#define HF_ESP32_ADC_MAX_MONITORS 2
93#define HF_ESP32_ADC_MAX_RAW_VALUE 4095
94#define HF_ESP32_ADC_REFERENCE_VOLTAGE_MV 1100
95#define HF_ESP32_ADC_MAX_SAMPLING_FREQ 200000
96#define HF_ESP32_ADC_MIN_SAMPLING_FREQ 10
97#define HF_ESP32_ADC_DEFAULT_SAMPLING_FREQ 1000
98#define HF_ESP32_ADC_DMA_BUFFER_SIZE_MIN 256
99#define HF_ESP32_ADC_DMA_BUFFER_SIZE_MAX 4096
100#define HF_ESP32_ADC_DMA_BUFFER_SIZE_DEFAULT 1024
101
102#define HF_ESP32_ADC_ONESHOT_CLK_SRC ADC_RTC_CLK_SRC_DEFAULT
103#define HF_ESP32_ADC_CONTINUOUS_CLK_SRC ADC_DIGI_CLK_SRC_DEFAULT
104#define HF_ESP32_ADC_ULP_MODE ADC_ULP_MODE_DISABLE
105
106// ESP32-S2 Configuration
107#elif defined(HF_MCU_ESP32S2)
108#define HF_ESP32_ADC_MAX_UNITS 1
109#define HF_ESP32_ADC_MAX_CHANNELS 10
110#define HF_ESP32_ADC_MAX_FILTERS 2
111#define HF_ESP32_ADC_MAX_MONITORS 2
112#define HF_ESP32_ADC_MAX_RAW_VALUE 4095
113#define HF_ESP32_ADC_REFERENCE_VOLTAGE_MV 1100
114#define HF_ESP32_ADC_MAX_SAMPLING_FREQ 200000
115#define HF_ESP32_ADC_MIN_SAMPLING_FREQ 10
116#define HF_ESP32_ADC_DEFAULT_SAMPLING_FREQ 1000
117#define HF_ESP32_ADC_DMA_BUFFER_SIZE_MIN 256
118#define HF_ESP32_ADC_DMA_BUFFER_SIZE_MAX 4096
119#define HF_ESP32_ADC_DMA_BUFFER_SIZE_DEFAULT 1024
120
121#define HF_ESP32_ADC_ONESHOT_CLK_SRC ADC_RTC_CLK_SRC_DEFAULT
122#define HF_ESP32_ADC_CONTINUOUS_CLK_SRC ADC_DIGI_CLK_SRC_DEFAULT
123#define HF_ESP32_ADC_ULP_MODE ADC_ULP_MODE_DISABLE
124
125// ESP32-S3 Configuration
126#elif defined(HF_MCU_ESP32S3)
127#define HF_ESP32_ADC_MAX_UNITS 2
128#define HF_ESP32_ADC_MAX_CHANNELS 10
129#define HF_ESP32_ADC_MAX_FILTERS 2
130#define HF_ESP32_ADC_MAX_MONITORS 2
131#define HF_ESP32_ADC_MAX_RAW_VALUE 4095
132#define HF_ESP32_ADC_REFERENCE_VOLTAGE_MV 1100
133#define HF_ESP32_ADC_MAX_SAMPLING_FREQ 200000
134#define HF_ESP32_ADC_MIN_SAMPLING_FREQ 10
135#define HF_ESP32_ADC_DEFAULT_SAMPLING_FREQ 1000
136#define HF_ESP32_ADC_DMA_BUFFER_SIZE_MIN 256
137#define HF_ESP32_ADC_DMA_BUFFER_SIZE_MAX 4096
138#define HF_ESP32_ADC_DMA_BUFFER_SIZE_DEFAULT 1024
139
140#define HF_ESP32_ADC_ONESHOT_CLK_SRC ADC_RTC_CLK_SRC_DEFAULT
141#define HF_ESP32_ADC_CONTINUOUS_CLK_SRC ADC_DIGI_CLK_SRC_DEFAULT
142#define HF_ESP32_ADC_ULP_MODE ADC_ULP_MODE_DISABLE
143
144// ESP32-C3 Configuration
145#elif defined(HF_MCU_ESP32C3)
146#define HF_ESP32_ADC_MAX_UNITS 1
147#define HF_ESP32_ADC_MAX_CHANNELS 6
148#define HF_ESP32_ADC_MAX_FILTERS 2
149#define HF_ESP32_ADC_MAX_MONITORS 2
150#define HF_ESP32_ADC_MAX_RAW_VALUE 4095
151#define HF_ESP32_ADC_REFERENCE_VOLTAGE_MV 1100
152#define HF_ESP32_ADC_MAX_SAMPLING_FREQ 100000
153#define HF_ESP32_ADC_MIN_SAMPLING_FREQ 10
154#define HF_ESP32_ADC_DEFAULT_SAMPLING_FREQ 1000
155#define HF_ESP32_ADC_DMA_BUFFER_SIZE_MIN 256
156#define HF_ESP32_ADC_DMA_BUFFER_SIZE_MAX 4096
157#define HF_ESP32_ADC_DMA_BUFFER_SIZE_DEFAULT 1024
158
159#define HF_ESP32_ADC_ONESHOT_CLK_SRC ADC_RTC_CLK_SRC_DEFAULT
160#define HF_ESP32_ADC_CONTINUOUS_CLK_SRC ADC_DIGI_CLK_SRC_DEFAULT
161#define HF_ESP32_ADC_ULP_MODE ADC_ULP_MODE_DISABLE
162
163// ESP32-C2 Configuration
164#elif defined(HF_MCU_ESP32C2)
165#define HF_ESP32_ADC_MAX_UNITS 1
166#define HF_ESP32_ADC_MAX_CHANNELS 4
167#define HF_ESP32_ADC_MAX_FILTERS 2
168#define HF_ESP32_ADC_MAX_MONITORS 2
169#define HF_ESP32_ADC_MAX_RAW_VALUE 4095
170#define HF_ESP32_ADC_REFERENCE_VOLTAGE_MV 1100
171#define HF_ESP32_ADC_MAX_SAMPLING_FREQ 100000
172#define HF_ESP32_ADC_MIN_SAMPLING_FREQ 10
173#define HF_ESP32_ADC_DEFAULT_SAMPLING_FREQ 1000
174#define HF_ESP32_ADC_DMA_BUFFER_SIZE_MIN 256
175#define HF_ESP32_ADC_DMA_BUFFER_SIZE_MAX 4096
176#define HF_ESP32_ADC_DMA_BUFFER_SIZE_DEFAULT 1024
177
178#define HF_ESP32_ADC_ONESHOT_CLK_SRC ADC_RTC_CLK_SRC_DEFAULT
179#define HF_ESP32_ADC_CONTINUOUS_CLK_SRC ADC_DIGI_CLK_SRC_DEFAULT
180#define HF_ESP32_ADC_ULP_MODE ADC_ULP_MODE_DISABLE
181
182// ESP32-H2 Configuration
183#elif defined(HF_MCU_ESP32H2)
184#define HF_ESP32_ADC_MAX_UNITS 1
185#define HF_ESP32_ADC_MAX_CHANNELS 6
186#define HF_ESP32_ADC_MAX_FILTERS 2
187#define HF_ESP32_ADC_MAX_MONITORS 2
188#define HF_ESP32_ADC_MAX_RAW_VALUE 4095
189#define HF_ESP32_ADC_REFERENCE_VOLTAGE_MV 1100
190#define HF_ESP32_ADC_MAX_SAMPLING_FREQ 100000
191#define HF_ESP32_ADC_MIN_SAMPLING_FREQ 10
192#define HF_ESP32_ADC_DEFAULT_SAMPLING_FREQ 1000
193#define HF_ESP32_ADC_DMA_BUFFER_SIZE_MIN 256
194#define HF_ESP32_ADC_DMA_BUFFER_SIZE_MAX 4096
195#define HF_ESP32_ADC_DMA_BUFFER_SIZE_DEFAULT 1024
196
197#define HF_ESP32_ADC_ONESHOT_CLK_SRC ADC_RTC_CLK_SRC_DEFAULT
198#define HF_ESP32_ADC_CONTINUOUS_CLK_SRC ADC_DIGI_CLK_SRC_DEFAULT
199#define HF_ESP32_ADC_ULP_MODE ADC_ULP_MODE_DISABLE
200
201// Default fallback (should not be reached)
202#else
203#error "Unsupported ESP32 variant! Please add support for this ESP32 variant in EspAdc.h"
204#endif
205
259class EspAdc : public BaseAdc {
260public:
261 //==============================================//
262 // CONSTRUCTION AND INITIALIZATION
263 //==============================================//
264
269 explicit EspAdc(const hf_adc_unit_config_t& config) noexcept;
270
274 ~EspAdc() noexcept override;
275
276 // Disable copy and move operations
277 // Copy operations are disabled because EspAdc manages hardware resources
278 EspAdc(const EspAdc&) = delete;
279 EspAdc& operator=(const EspAdc&) = delete;
280
281 // Move operations are disabled because EspAdc manages ESP-IDF handles,
282 // mutexes, and callback state that are tightly coupled to hardware
283 EspAdc(EspAdc&& other) = delete;
284 EspAdc& operator=(EspAdc&& other) = delete;
285
286 //==============================================//
287 // HARDWARE LIMITS (VARIANT-SPECIFIC)
288 //==============================================//
289
290 // ESP32 ADC Hardware Limits (configured per variant)
291 static constexpr hf_u8_t HF_ADC_MAX_UNITS =
292 HF_ESP32_ADC_MAX_UNITS;
293 static constexpr hf_u8_t HF_ADC_MAX_CHANNELS =
294 HF_ESP32_ADC_MAX_CHANNELS;
295 static constexpr hf_u8_t HF_ADC_MAX_FILTERS =
296 HF_ESP32_ADC_MAX_FILTERS;
297 static constexpr hf_u8_t HF_ADC_MAX_MONITORS =
298 HF_ESP32_ADC_MAX_MONITORS;
299 static constexpr hf_u16_t HF_ADC_MAX_RAW_VALUE_12BIT =
300 HF_ESP32_ADC_MAX_RAW_VALUE;
301 static constexpr hf_u32_t HF_ADC_REFERENCE_VOLTAGE_MV =
302 HF_ESP32_ADC_REFERENCE_VOLTAGE_MV;
303 static constexpr hf_u32_t HF_ADC_MAX_SAMPLING_FREQ =
304 HF_ESP32_ADC_MAX_SAMPLING_FREQ;
305 static constexpr hf_u32_t HF_ADC_MIN_SAMPLING_FREQ =
306 HF_ESP32_ADC_MIN_SAMPLING_FREQ;
307 static constexpr hf_u32_t HF_ADC_DEFAULT_SAMPLING_FREQ =
308 HF_ESP32_ADC_DEFAULT_SAMPLING_FREQ;
309 static constexpr size_t HF_ADC_DMA_BUFFER_SIZE_MIN =
310 HF_ESP32_ADC_DMA_BUFFER_SIZE_MIN;
311 static constexpr size_t HF_ADC_DMA_BUFFER_SIZE_MAX =
312 HF_ESP32_ADC_DMA_BUFFER_SIZE_MAX;
313 static constexpr size_t HF_ADC_DMA_BUFFER_SIZE_DEFAULT =
314 HF_ESP32_ADC_DMA_BUFFER_SIZE_DEFAULT;
315
316 static constexpr adc_oneshot_clk_src_t HF_ADC_ONESHOT_CLK_SRC =
317 HF_ESP32_ADC_ONESHOT_CLK_SRC;
318 static constexpr adc_continuous_clk_src_t HF_ADC_CONTINUOUS_CLK_SRC =
319 HF_ESP32_ADC_CONTINUOUS_CLK_SRC;
320 static constexpr adc_ulp_mode_t HF_ADC_ULP_MODE =
321 HF_ESP32_ADC_ULP_MODE;
322
323 //==============================================//
324 // BASE CLASS IMPLEMENTATION (REQUIRED)
325 //==============================================//
326
331 hf_bool_t Initialize() noexcept override;
332
337 hf_bool_t Deinitialize() noexcept override;
338
343 [[nodiscard]] hf_u8_t GetMaxChannels() const noexcept override;
344
350 [[nodiscard]] hf_bool_t IsChannelAvailable(hf_channel_id_t channel_id) const noexcept override;
351
360 hf_adc_err_t ReadChannelV(hf_channel_id_t channel_id, float& channel_reading_v,
361 hf_u8_t numOfSamplesToAvg = 1,
362 hf_time_t timeBetweenSamples = 0) noexcept override;
363
372 hf_adc_err_t ReadChannelCount(hf_channel_id_t channel_id, hf_u32_t& channel_reading_count,
373 hf_u8_t numOfSamplesToAvg = 1,
374 hf_time_t timeBetweenSamples = 0) noexcept override;
375
385 hf_adc_err_t ReadChannel(hf_channel_id_t channel_id, hf_u32_t& channel_reading_count,
386 float& channel_reading_v, hf_u8_t numOfSamplesToAvg = 1,
387 hf_time_t timeBetweenSamples = 0) noexcept override;
388
397 hf_adc_err_t ReadMultipleChannels(const hf_channel_id_t* channel_ids, hf_u8_t num_channels,
398 hf_u32_t* readings, float* voltages) noexcept override;
399
400 //==============================================//
401 // MODE AND CONFIGURATION OPERATIONS
402 //==============================================//
403
409 hf_adc_err_t SetMode(hf_adc_mode_t mode) noexcept;
410
415 [[nodiscard]] hf_adc_mode_t GetMode() const noexcept;
416
424 hf_adc_err_t ConfigureChannel(
425 hf_channel_id_t channel_id, hf_adc_atten_t attenuation,
427
434 hf_adc_err_t SetChannelEnabled(hf_channel_id_t channel_id, hf_bool_t enabled) noexcept;
435
441 hf_adc_err_t EnableChannel(hf_channel_id_t channel_id) noexcept;
442
448 hf_adc_err_t DisableChannel(hf_channel_id_t channel_id) noexcept;
449
456 hf_adc_err_t ReadSingleRaw(hf_channel_id_t channel_id, hf_u32_t& raw_value) noexcept;
457
464 hf_adc_err_t ReadSingleVoltage(hf_channel_id_t channel_id, hf_u32_t& voltage_mv) noexcept;
465
473 hf_adc_err_t ReadMultipleRaw(const hf_channel_id_t* channel_ids, hf_u8_t num_channels,
474 hf_u32_t* raw_values) noexcept;
475
483 hf_adc_err_t ReadMultipleVoltage(const hf_channel_id_t* channel_ids, hf_u8_t num_channels,
484 hf_u32_t* voltage_values) noexcept;
485
493 hf_adc_err_t ReadAveraged(hf_channel_id_t channel_id, hf_u16_t num_samples,
494 hf_u32_t& averaged_value) noexcept;
495
501 [[nodiscard]] hf_bool_t IsChannelEnabled(hf_channel_id_t channel_id) const noexcept;
502
503 //==============================================//
504 // CONTINUOUS MODE OPERATIONS
505 //==============================================//
506
512 hf_adc_err_t ConfigureContinuous(const hf_adc_continuous_config_t& config) noexcept;
513
520 hf_adc_err_t SetContinuousCallback(hf_adc_continuous_callback_t callback,
521 void* user_data = nullptr) noexcept;
522
527 hf_adc_err_t StartContinuous() noexcept;
528
533 hf_adc_err_t StopContinuous() noexcept;
534
539 [[nodiscard]] hf_bool_t IsContinuousRunning() const noexcept;
540
549 hf_adc_err_t ReadContinuousData(hf_u8_t* buffer, hf_u32_t buffer_size, hf_u32_t& bytes_read,
550 hf_time_t timeout_ms) noexcept;
551
552 //==============================================//
553 // CALIBRATION OPERATIONS
554 //==============================================//
555
562 hf_adc_err_t InitializeCalibration(
563 hf_adc_atten_t attenuation,
565
571 [[nodiscard]] hf_bool_t IsCalibrationAvailable(hf_adc_atten_t attenuation) const noexcept;
572
580 hf_adc_err_t RawToVoltage(hf_u32_t raw_count, hf_adc_atten_t attenuation,
581 hf_u32_t& voltage_mv) noexcept;
582
583 //==============================================//
584 // FILTER OPERATIONS
585 //==============================================//
586
592 hf_adc_err_t ConfigureFilter(const hf_adc_filter_config_t& filter_config) noexcept;
593
600 hf_adc_err_t SetFilterEnabled(hf_u8_t filter_id, hf_bool_t enabled) noexcept;
601
602 //==============================================//
603 // MONITOR OPERATIONS
604 //==============================================//
605
611 hf_adc_err_t ConfigureMonitor(const hf_adc_monitor_config_t& monitor_config) noexcept;
612
620 hf_adc_err_t SetMonitorCallback(hf_u8_t monitor_id, hf_adc_monitor_callback_t callback,
621 void* user_data = nullptr) noexcept;
622
629 hf_adc_err_t SetMonitorEnabled(hf_u8_t monitor_id, hf_bool_t enabled) noexcept;
630
631 //==============================================//
632 // DIAGNOSTICS AND STATISTICS
633 //==============================================//
634
640 hf_adc_err_t GetStatistics(hf_adc_statistics_t& statistics) noexcept override;
641
647 hf_adc_err_t GetDiagnostics(hf_adc_diagnostics_t& diagnostics) noexcept override;
648
652 hf_adc_err_t ResetStatistics() noexcept override;
653
658 [[nodiscard]] hf_adc_err_t GetLastError() const noexcept;
659
664 [[nodiscard]] const hf_adc_unit_config_t& GetUnitConfig() const noexcept;
665
666private:
667 //==============================================//
668 // PRIVATE IMPLEMENTATION
669 //==============================================//
670
671 // Forward declarations and internal structures
672 struct MonitorContext {
673 uint8_t monitor_id;
674 hf_channel_id_t channel_id;
675 uint32_t high_threshold;
676 uint32_t low_threshold;
678 void* user_data;
679 EspAdc* adc_instance;
680 };
681
682 // Internal helper methods
683 hf_adc_err_t InitializeOneshot() noexcept;
684 hf_adc_err_t InitializeContinuous() noexcept;
685 hf_adc_err_t DeinitializeOneshot() noexcept;
686 hf_adc_err_t DeinitializeContinuous() noexcept;
687 hf_adc_err_t ReadOneshotRaw(hf_channel_id_t channel_id, hf_u32_t& raw_value) noexcept;
688 hf_adc_err_t ValidateChannelId(hf_channel_id_t channel_id) const noexcept;
689 hf_adc_err_t ValidateConfiguration() const noexcept;
690 hf_adc_err_t UpdateStatistics(hf_adc_err_t result, uint64_t start_time_us) noexcept;
691 uint64_t GetCurrentTimeUs() const noexcept;
692 void UpdateDiagnostics(hf_adc_err_t error) noexcept;
693
694 // Static callback functions for ESP-IDF
695 static hf_bool_t IRAM_ATTR ContinuousCallback(adc_continuous_handle_t handle,
696 const adc_continuous_evt_data_t* edata,
697 void* user_data) noexcept;
698 static hf_bool_t IRAM_ATTR HighThresholdCallback(adc_monitor_handle_t monitor_handle,
699 const adc_monitor_evt_data_t* event_data,
700 void* user_data) noexcept;
701 static hf_bool_t IRAM_ATTR LowThresholdCallback(adc_monitor_handle_t monitor_handle,
702 const adc_monitor_evt_data_t* event_data,
703 void* user_data) noexcept;
704
705 //==============================================//
706 // MEMBER VARIABLES
707 //==============================================//
708
709 // Configuration and state
710 hf_adc_unit_config_t config_;
711 std::atomic<hf_bool_t> continuous_running_;
712 std::atomic<hf_adc_err_t> last_error_;
713
714 // Thread safety
715 mutable PlatformMutex config_mutex_;
716 mutable PlatformMutex stats_mutex_;
717
718 // ESP-IDF handles
719 adc_oneshot_unit_handle_t oneshot_handle_;
720 adc_continuous_handle_t continuous_handle_;
721 std::array<adc_cali_handle_t, 4>
722 calibration_handles_;
723 std::array<adc_iir_filter_handle_t, HF_ADC_MAX_FILTERS> filter_handles_;
724 std::array<adc_monitor_handle_t, HF_ADC_MAX_MONITORS> monitor_handles_;
725
726 // Callback data
727 hf_adc_continuous_callback_t continuous_callback_;
728 void* continuous_user_data_;
729 std::array<hf_adc_monitor_callback_t, HF_ADC_MAX_MONITORS>
730 monitor_callbacks_;
731 std::array<void*, HF_ADC_MAX_MONITORS> monitor_user_data_;
732 std::array<MonitorContext, HF_ADC_MAX_MONITORS> monitor_contexts_;
733
734 // Statistics and diagnostics
735 mutable hf_adc_statistics_t statistics_;
736 mutable hf_adc_diagnostics_t diagnostics_;
737};
738
739#endif // HF_MCU_FAMILY_ESP32
Abstract base class for ADC implementations in the HardFOC system.
hf_adc_err_t
Definition BaseAdc.h:115
Consolidated MCU-specific type definitions for hardware abstraction (hf_* types).
bool(*)(const hf_adc_continuous_data_t *data, void *user_data) hf_adc_continuous_callback_t
ADC continuous mode data callback function.
Definition EspTypes_ADC.h:218
hf_adc_mode_t
ADC operating modes supported by ESP32.
Definition EspTypes_ADC.h:41
hf_adc_bitwidth_t
ADC resolution/bit width settings for ESP32 Values must match ESP-IDF adc_bitwidth_t enum.
Definition EspTypes_ADC.h:62
@ WIDTH_DEFAULT
Default width (12-bit for ESP32)
hf_adc_atten_t
ADC attenuation levels for ESP32 These control the input voltage range that can be measured Values mu...
Definition EspTypes_ADC.h:51
void(*)(const hf_adc_monitor_event_t *event, void *user_data) hf_adc_monitor_callback_t
ADC threshold monitor callback function.
Definition EspTypes_ADC.h:234
static constexpr uint32_t HF_ADC_DEFAULT_SAMPLING_FREQ
Definition EspTypes_Base.h:40
static constexpr size_t HF_ADC_DMA_BUFFER_SIZE_DEFAULT
Definition EspTypes_Base.h:41
uint32_t hf_u32_t
Platform-agnostic 32-bit unsigned integer type.
Definition HardwareTypes.h:52
hf_u32_t hf_time_t
Platform-agnostic time type in milliseconds.
Definition HardwareTypes.h:173
uint8_t hf_u8_t
Platform-agnostic 8-bit unsigned integer type.
Definition HardwareTypes.h:40
bool hf_bool_t
Platform-agnostic boolean type.
Definition HardwareTypes.h:88
uint16_t hf_u16_t
Platform-agnostic 16-bit unsigned integer type.
Definition HardwareTypes.h:46
hf_u32_t hf_channel_id_t
Platform-agnostic channel identifier type.
Definition HardwareTypes.h:163
Centralized MCU platform selection and configuration header.
Cross-platform RTOS mutex and synchronization primitives.
Base class for ADCs.
Definition BaseAdc.h:196
Definition PlatformMutex.h:78
ADC continuous mode configuration structure.
Definition EspTypes_ADC.h:110
ADC diagnostic information.
Definition BaseAdc.h:165
ADC filter configuration structure.
Definition EspTypes_ADC.h:124
ADC monitor configuration structure.
Definition EspTypes_ADC.h:136
ADC operation statistics.
Definition BaseAdc.h:145
ADC unit configuration structure.
Definition EspTypes_ADC.h:161