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

ESP32 UART type definitions for hardware abstraction. More...

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

Go to the source code of this file.

Classes

struct  hf_uart_config_t
 ESP32 UART port configuration. More...
 
struct  hf_uart_flow_config_t
 ESP32 UART flow control configuration. More...
 
struct  hf_uart_power_config_t
 ESP32 UART power management configuration. More...
 
struct  hf_uart_pattern_config_t
 ESP32 UART pattern detection configuration. More...
 
struct  hf_uart_rs485_config_t
 ESP32 UART RS485 configuration. More...
 
struct  hf_uart_irda_config_t
 ESP32 UART IrDA configuration. More...
 
struct  hf_uart_wakeup_config_t
 ESP32 UART wakeup configuration. More...
 
struct  hf_uart_event_t
 HardFOC UART event structure. More...
 

Typedefs

using hf_uart_event_callback_t = bool (*)(const hf_uart_event_t* event, void* user_data)
 UART event callback function type.
 
using hf_uart_break_callback_t = bool (*)(uint32_t break_duration, void* user_data)
 UART break detection callback function type.
 

Enumerations

enum class  hf_uart_mode_t : uint8_t { HF_UART_MODE_UART = 0 , HF_UART_MODE_RS485 = 1 , HF_UART_MODE_IRDA = 2 }
 ESP32 UART operating modes. More...
 
enum class  hf_uart_data_bits_t : uint8_t { HF_UART_DATA_5_BITS = 0 , HF_UART_DATA_6_BITS = 1 , HF_UART_DATA_7_BITS = 2 , HF_UART_DATA_8_BITS = 3 }
 ESP32 UART data bits configuration. More...
 
enum class  hf_uart_parity_t : uint8_t { HF_UART_PARITY_DISABLE = 0 , HF_UART_PARITY_EVEN = 1 , HF_UART_PARITY_ODD = 2 }
 ESP32 UART parity configuration. More...
 
enum class  hf_uart_stop_bits_t : uint8_t { HF_UART_STOP_BITS_1 = 1 , HF_UART_STOP_BITS_1_5 = 2 , HF_UART_STOP_BITS_2 = 3 }
 ESP32 UART stop bits configuration. More...
 
enum class  hf_uart_flow_ctrl_t : uint8_t { HF_UART_HW_FLOWCTRL_DISABLE = 0 , HF_UART_HW_FLOWCTRL_RTS = 1 , HF_UART_HW_FLOWCTRL_CTS = 2 , HF_UART_HW_FLOWCTRL_CTS_RTS = 3 }
 ESP32 UART flow control configuration. More...
 
enum class  hf_uart_operating_mode_t : uint8_t { HF_UART_MODE_POLLING = 0 , HF_UART_MODE_INTERRUPT = 1 , HF_UART_MODE_DMA = 2 }
 ESP32 UART operating mode. More...
 
enum class  hf_uart_event_type_t : uint8_t {
  HF_UART_DATA = 0 , HF_UART_FIFO_OVF = 1 , HF_UART_BUFFER_FULL = 2 , HF_UART_BREAK = 3 ,
  HF_UART_PARITY_ERR = 4 , HF_UART_FRAME_ERR = 5 , HF_UART_PATTERN_DET = 6 , HF_UART_EVENT_MAX = 7
}
 HardFOC UART event types (mapped from ESP-IDF events). More...
 

Variables

static constexpr hf_pin_num_t HF_UART_IO_UNUSED = 0xFFFFFFFF
 
static constexpr uint32_t HF_UART_BREAK_MIN_DURATION = 1
 Minimum break duration (ms)
 
static constexpr uint32_t HF_UART_BREAK_MAX_DURATION = 1000
 Maximum break duration (ms)
 
static constexpr uint8_t HF_ESP32_UART_MAX_PORTS = 3
 

Detailed Description

ESP32 UART type definitions for hardware abstraction.

This header defines only the essential UART-specific types used by the EspUart implementation. Clean and minimal approach.

Author
Nebiyu Tadesse
Date
2025

Typedef Documentation

◆ hf_uart_break_callback_t

using hf_uart_break_callback_t = bool (*)(uint32_t break_duration, void* user_data)

UART break detection callback function type.

Parameters
break_durationBreak duration in milliseconds
user_dataUser data pointer
Returns
true to yield to higher priority task, false otherwise

◆ hf_uart_event_callback_t

using hf_uart_event_callback_t = bool (*)(const hf_uart_event_t* event, void* user_data)

UART event callback function type.

Parameters
eventPointer to HardFOC UART event
user_dataUser data pointer
Returns
true to yield to higher priority task, false otherwise

Enumeration Type Documentation

◆ hf_uart_data_bits_t

enum class hf_uart_data_bits_t : uint8_t
strong

ESP32 UART data bits configuration.

Enumerator
HF_UART_DATA_5_BITS 

5 data bits

HF_UART_DATA_6_BITS 

6 data bits

HF_UART_DATA_7_BITS 

7 data bits

HF_UART_DATA_8_BITS 

8 data bits

◆ hf_uart_event_type_t

enum class hf_uart_event_type_t : uint8_t
strong

HardFOC UART event types (mapped from ESP-IDF events).

Enumerator
HF_UART_DATA 

Data received.

HF_UART_FIFO_OVF 

FIFO overflow.

HF_UART_BUFFER_FULL 

Buffer full.

HF_UART_BREAK 

Break detected.

HF_UART_PARITY_ERR 

Parity error.

HF_UART_FRAME_ERR 

Frame error.

HF_UART_PATTERN_DET 

Pattern detected.

HF_UART_EVENT_MAX 

Maximum event type.

◆ hf_uart_flow_ctrl_t

enum class hf_uart_flow_ctrl_t : uint8_t
strong

ESP32 UART flow control configuration.

Enumerator
HF_UART_HW_FLOWCTRL_DISABLE 

No flow control.

HF_UART_HW_FLOWCTRL_RTS 

RTS flow control.

HF_UART_HW_FLOWCTRL_CTS 

CTS flow control.

HF_UART_HW_FLOWCTRL_CTS_RTS 

CTS and RTS flow control.

◆ hf_uart_mode_t

enum class hf_uart_mode_t : uint8_t
strong

ESP32 UART operating modes.

Enumerator
HF_UART_MODE_UART 

Standard UART mode.

HF_UART_MODE_RS485 

RS485 mode.

HF_UART_MODE_IRDA 

IrDA mode.

◆ hf_uart_operating_mode_t

enum class hf_uart_operating_mode_t : uint8_t
strong

ESP32 UART operating mode.

Enumerator
HF_UART_MODE_POLLING 

Polling mode.

HF_UART_MODE_INTERRUPT 

Interrupt mode.

HF_UART_MODE_DMA 

DMA mode.

◆ hf_uart_parity_t

enum class hf_uart_parity_t : uint8_t
strong

ESP32 UART parity configuration.

Enumerator
HF_UART_PARITY_DISABLE 

No parity.

HF_UART_PARITY_EVEN 

Even parity.

HF_UART_PARITY_ODD 

Odd parity.

◆ hf_uart_stop_bits_t

enum class hf_uart_stop_bits_t : uint8_t
strong

ESP32 UART stop bits configuration.

Enumerator
HF_UART_STOP_BITS_1 

1 stop bit

HF_UART_STOP_BITS_1_5 

1.5 stop bits

HF_UART_STOP_BITS_2 

2 stop bits

Variable Documentation

◆ HF_ESP32_UART_MAX_PORTS

constexpr uint8_t HF_ESP32_UART_MAX_PORTS = 3
staticconstexpr

◆ HF_UART_BREAK_MAX_DURATION

constexpr uint32_t HF_UART_BREAK_MAX_DURATION = 1000
staticconstexpr

Maximum break duration (ms)

◆ HF_UART_BREAK_MIN_DURATION

constexpr uint32_t HF_UART_BREAK_MIN_DURATION = 1
staticconstexpr

Minimum break duration (ms)

◆ HF_UART_IO_UNUSED

constexpr hf_pin_num_t HF_UART_IO_UNUSED = 0xFFFFFFFF
staticconstexpr