HF Interface Wrapper 0.1.0-dev
Embedded C++ hardware abstraction layer
Loading...
Searching...
No Matches
EspTypes_Base.h
Go to the documentation of this file.
1
17#pragma once
18
19#include "../../utils/McuSelect.h" // Central MCU platform selection (includes all ESP-IDF headers)
20#include "HardwareTypes.h"
21#include <atomic>
22#include <cstdint>
23
24//==============================================================================
25// BASIC TYPE DEFINITIONS
26//==============================================================================
27
29using hf_timeout_ms_t = uint32_t;
30
31//==============================================================================
32// ESP32-SPECIFIC CONSTANTS
33//==============================================================================
34
35static constexpr hf_timeout_ms_t HF_TIMEOUT_NEVER = 0xFFFFFFFF;
37static constexpr hf_timeout_ms_t HF_TIMEOUT_DEFAULT = 1000;
38
39// Missing ADC constants
40static constexpr uint32_t HF_ADC_DEFAULT_SAMPLING_FREQ = 1000U;
41static constexpr size_t HF_ADC_DMA_BUFFER_SIZE_DEFAULT = 1024U;
42
43//==============================================================================
44// ESP32 TIMING CONVERSION MACROS
45//==============================================================================
46
52#define HF_TICKS_FROM_MS(ms) (pdMS_TO_TICKS(ms))
53#define HF_MS_FROM_TICKS(ticks) ((ticks) * portTICK_PERIOD_MS)
54#define HF_US_TO_TICKS(us) ((us) / (portTICK_PERIOD_MS * 1000))
55#define HF_TICKS_TO_US(ticks) ((ticks) * portTICK_PERIOD_MS * 1000)
56
57//==============================================================================
58// ESP32 POWER MANAGEMENT AND TIMING TYPES
59//==============================================================================
60
72
82
86using hf_timestamp_us_t = uint64_t;
87using hf_timestamp_ns_t = uint64_t;
88using hf_duration_us_t = uint32_t;
89using hf_duration_ns_t = uint32_t;
hf_u64_t hf_timestamp_us_t
Definition BasePeriodicTimer.h:27
static constexpr hf_timeout_ms_t HF_TIMEOUT_NEVER
Definition EspTypes_Base.h:35
uint64_t hf_timestamp_ns_t
Nanosecond timestamp.
Definition EspTypes_Base.h:87
static constexpr hf_timeout_ms_t HF_TIMEOUT_DEFAULT
Definition EspTypes_Base.h:37
uint32_t hf_duration_ns_t
Duration in nanoseconds.
Definition EspTypes_Base.h:89
static constexpr uint32_t HF_ADC_DEFAULT_SAMPLING_FREQ
Definition EspTypes_Base.h:40
hf_sleep_mode_t
ESP32 sleep mode types.
Definition EspTypes_Base.h:76
@ HF_SLEEP_MODE_HIBERNATION
Hibernation mode (lowest power)
@ HF_SLEEP_MODE_LIGHT
Light sleep mode.
@ HF_SLEEP_MODE_NONE
No sleep mode.
@ HF_SLEEP_MODE_DEEP
Deep sleep mode.
static constexpr hf_timeout_ms_t HF_TIMEOUT_IMMEDIATE
Definition EspTypes_Base.h:36
uint32_t hf_duration_us_t
Duration in microseconds.
Definition EspTypes_Base.h:88
hf_power_domain_t
ESP32 power domain configuration for operations.
Definition EspTypes_Base.h:64
@ HF_POWER_DOMAIN_VDDSDIO
SDIO power domain.
@ HF_POWER_DOMAIN_XTAL
Crystal oscillator domain.
@ HF_POWER_DOMAIN_MODEM
RF/WiFi/BT modem domain.
@ HF_POWER_DOMAIN_TOP
SoC top domain.
@ HF_POWER_DOMAIN_RTC_PERIPH
RTC peripherals power domain.
@ HF_POWER_DOMAIN_CPU
CPU power domain.
static constexpr size_t HF_ADC_DMA_BUFFER_SIZE_DEFAULT
Definition EspTypes_Base.h:41
Platform-agnostic hardware type definitions for the HardFOC system.
hf_time_t hf_timeout_ms_t
Timeout value in milliseconds.
Definition HardwareTypes.h:178
Centralized MCU platform selection and configuration header.