HF Interface Wrapper 0.1.0-dev
Embedded C++ hardware abstraction layer
Loading...
Searching...
No Matches
EspTypes_PIO.h File Reference

ESP32 PIO/RMT type definitions for hardware abstraction. More...

#include "BasePio.h"
#include "EspTypes_Base.h"
#include "HardwareTypes.h"
#include "McuSelect.h"
Include dependency graph for EspTypes_PIO.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  hf_rmt_transmit_config_t
 ESP32 RMT transmission configuration. More...
 
struct  hf_rmt_receive_config_t
 ESP32 RMT reception configuration. More...
 
struct  hf_rmt_carrier_config_t
 ESP32 RMT carrier configuration for IR protocols. More...
 

Macros

#define HF_RMT_IS_VALID_CHANNEL(ch)   ((ch) < HF_RMT_MAX_CHANNELS)
 RMT validation macros for ESP32 variants.
 
#define HF_RMT_IS_VALID_TX_CHANNEL(ch)   ((ch) >= 0 && (ch) < 2)
 
#define HF_RMT_IS_VALID_RX_CHANNEL(ch)   ((ch) >= 2 && (ch) < 4)
 
#define HF_RMT_IS_VALID_RESOLUTION(res)    ((res) >= HF_RMT_MIN_RESOLUTION_HZ && (res) <= HF_RMT_MAX_RESOLUTION_HZ)
 
#define HF_RMT_IS_VALID_MEM_BLOCK_SIZE(size)    ((size) >= HF_RMT_MIN_MEM_BLOCK_SYMBOLS && (size) <= HF_RMT_MAX_MEM_BLOCK_SYMBOLS)
 
#define HF_RMT_IS_VALID_QUEUE_DEPTH(depth)   ((depth) >= 1 && (depth) <= HF_RMT_MAX_QUEUE_DEPTH)
 
#define HF_RMT_IS_VALID_INTR_PRIORITY(prio)   ((prio) <= HF_RMT_MAX_INTERRUPT_PRIORITY)
 

Enumerations

enum class  hf_rmt_clock_source_t : uint8_t { HF_RMT_CLK_SRC_DEFAULT = 0 , HF_RMT_CLK_SRC_APB = 1 , HF_RMT_CLK_SRC_XTAL = 2 , HF_RMT_CLK_SRC_RC_FAST = 3 }
 ESP32 RMT clock source selection. More...
 
enum class  hf_rmt_channel_direction_t : uint8_t { HF_RMT_CHANNEL_DIRECTION_TX = 0 , HF_RMT_CHANNEL_DIRECTION_RX = 1 }
 ESP32 RMT channel direction. More...
 

Functions

constexpr int8_t HfRmtGetTxChannel (uint8_t index) noexcept
 Get the recommended TX channel for the current ESP32 variant.
 
constexpr int8_t HfRmtGetRxChannel (uint8_t index) noexcept
 Get the recommended RX channel for the current ESP32 variant.
 
constexpr bool HfRmtIsChannelValidForDirection (uint8_t channel_id, hf_pio_direction_t direction) noexcept
 Validate channel for specific direction on current ESP32 variant.
 
constexpr const char * HfRmtGetVariantName () noexcept
 Get ESP32 variant name for debugging.
 

Variables

static constexpr uint8_t HF_RMT_MAX_CHANNELS = 4
 
static constexpr uint8_t HF_RMT_MAX_TX_CHANNELS = 2
 
static constexpr uint8_t HF_RMT_MAX_RX_CHANNELS = 2
 
static constexpr uint8_t HF_RMT_TX_CHANNEL_START = 0
 
static constexpr uint8_t HF_RMT_RX_CHANNEL_START = 2
 
static constexpr size_t HF_RMT_MIN_MEM_BLOCK_SYMBOLS = 48
 
static constexpr size_t HF_RMT_MAX_MEM_BLOCK_SYMBOLS = 1024
 
static constexpr size_t HF_RMT_DEFAULT_MEM_BLOCK_SYMBOLS = 64
 
static constexpr uint32_t HF_RMT_MAX_RESOLUTION_HZ = 80000000
 
static constexpr uint32_t HF_RMT_MIN_RESOLUTION_HZ = 1000
 
static constexpr uint32_t HF_RMT_DEFAULT_RESOLUTION_HZ = 1000000
 
static constexpr uint8_t HF_RMT_MAX_QUEUE_DEPTH = 32
 
static constexpr uint8_t HF_RMT_MAX_INTERRUPT_PRIORITY = 7
 

Detailed Description

ESP32 PIO/RMT type definitions for hardware abstraction.

This header defines only the essential PIO/RMT-specific types used by the EspPio implementation. Clean and minimal approach.

Author
Nebiyu Tadesse
Date
2025

Macro Definition Documentation

◆ HF_RMT_IS_VALID_CHANNEL

#define HF_RMT_IS_VALID_CHANNEL ( ch)    ((ch) < HF_RMT_MAX_CHANNELS)

RMT validation macros for ESP32 variants.

◆ HF_RMT_IS_VALID_INTR_PRIORITY

#define HF_RMT_IS_VALID_INTR_PRIORITY ( prio)    ((prio) <= HF_RMT_MAX_INTERRUPT_PRIORITY)

◆ HF_RMT_IS_VALID_MEM_BLOCK_SIZE

#define HF_RMT_IS_VALID_MEM_BLOCK_SIZE ( size)     ((size) >= HF_RMT_MIN_MEM_BLOCK_SYMBOLS && (size) <= HF_RMT_MAX_MEM_BLOCK_SYMBOLS)

◆ HF_RMT_IS_VALID_QUEUE_DEPTH

#define HF_RMT_IS_VALID_QUEUE_DEPTH ( depth)    ((depth) >= 1 && (depth) <= HF_RMT_MAX_QUEUE_DEPTH)

◆ HF_RMT_IS_VALID_RESOLUTION

#define HF_RMT_IS_VALID_RESOLUTION ( res)     ((res) >= HF_RMT_MIN_RESOLUTION_HZ && (res) <= HF_RMT_MAX_RESOLUTION_HZ)

◆ HF_RMT_IS_VALID_RX_CHANNEL

#define HF_RMT_IS_VALID_RX_CHANNEL ( ch)    ((ch) >= 2 && (ch) < 4)

◆ HF_RMT_IS_VALID_TX_CHANNEL

#define HF_RMT_IS_VALID_TX_CHANNEL ( ch)    ((ch) >= 0 && (ch) < 2)

Enumeration Type Documentation

◆ hf_rmt_channel_direction_t

enum class hf_rmt_channel_direction_t : uint8_t
strong

ESP32 RMT channel direction.

Enumerator
HF_RMT_CHANNEL_DIRECTION_TX 

Transmit direction.

HF_RMT_CHANNEL_DIRECTION_RX 

Receive direction.

◆ hf_rmt_clock_source_t

enum class hf_rmt_clock_source_t : uint8_t
strong

ESP32 RMT clock source selection.

Enumerator
HF_RMT_CLK_SRC_DEFAULT 

Default clock source (APB)

HF_RMT_CLK_SRC_APB 

APB clock (80MHz)

HF_RMT_CLK_SRC_XTAL 

Crystal clock (40MHz)

HF_RMT_CLK_SRC_RC_FAST 

RC fast clock (~8MHz)

Function Documentation

◆ HfRmtGetRxChannel()

constexpr int8_t HfRmtGetRxChannel ( uint8_t index)
inlineconstexprnoexcept

Get the recommended RX channel for the current ESP32 variant.

Parameters
indexChannel index (0-based within available RX channels)
Returns
Actual channel number, or -1 if invalid

◆ HfRmtGetTxChannel()

constexpr int8_t HfRmtGetTxChannel ( uint8_t index)
inlineconstexprnoexcept

Get the recommended TX channel for the current ESP32 variant.

Parameters
indexChannel index (0-based within available TX channels)
Returns
Actual channel number, or -1 if invalid

◆ HfRmtGetVariantName()

constexpr const char * HfRmtGetVariantName ( )
inlineconstexprnoexcept

Get ESP32 variant name for debugging.

Returns
String describing the current ESP32 variant

◆ HfRmtIsChannelValidForDirection()

constexpr bool HfRmtIsChannelValidForDirection ( uint8_t channel_id,
hf_pio_direction_t direction )
inlineconstexprnoexcept

Validate channel for specific direction on current ESP32 variant.

Parameters
channel_idChannel number to validate
directionDirection (TX or RX)
Returns
true if channel is valid for the direction, false otherwise

Variable Documentation

◆ HF_RMT_DEFAULT_MEM_BLOCK_SYMBOLS

constexpr size_t HF_RMT_DEFAULT_MEM_BLOCK_SYMBOLS = 64
staticconstexpr

◆ HF_RMT_DEFAULT_RESOLUTION_HZ

constexpr uint32_t HF_RMT_DEFAULT_RESOLUTION_HZ = 1000000
staticconstexpr

◆ HF_RMT_MAX_CHANNELS

constexpr uint8_t HF_RMT_MAX_CHANNELS = 4
staticconstexpr

◆ HF_RMT_MAX_INTERRUPT_PRIORITY

constexpr uint8_t HF_RMT_MAX_INTERRUPT_PRIORITY = 7
staticconstexpr

◆ HF_RMT_MAX_MEM_BLOCK_SYMBOLS

constexpr size_t HF_RMT_MAX_MEM_BLOCK_SYMBOLS = 1024
staticconstexpr

◆ HF_RMT_MAX_QUEUE_DEPTH

constexpr uint8_t HF_RMT_MAX_QUEUE_DEPTH = 32
staticconstexpr

◆ HF_RMT_MAX_RESOLUTION_HZ

constexpr uint32_t HF_RMT_MAX_RESOLUTION_HZ = 80000000
staticconstexpr

◆ HF_RMT_MAX_RX_CHANNELS

constexpr uint8_t HF_RMT_MAX_RX_CHANNELS = 2
staticconstexpr

◆ HF_RMT_MAX_TX_CHANNELS

constexpr uint8_t HF_RMT_MAX_TX_CHANNELS = 2
staticconstexpr

◆ HF_RMT_MIN_MEM_BLOCK_SYMBOLS

constexpr size_t HF_RMT_MIN_MEM_BLOCK_SYMBOLS = 48
staticconstexpr

◆ HF_RMT_MIN_RESOLUTION_HZ

constexpr uint32_t HF_RMT_MIN_RESOLUTION_HZ = 1000
staticconstexpr

◆ HF_RMT_RX_CHANNEL_START

constexpr uint8_t HF_RMT_RX_CHANNEL_START = 2
staticconstexpr

◆ HF_RMT_TX_CHANNEL_START

constexpr uint8_t HF_RMT_TX_CHANNEL_START = 0
staticconstexpr