idfxx 1.0.0
Modern C++23 components for ESP-IDF
Loading...
Searching...
No Matches

Namespaces

namespace  chrono
 ESP-IDF C++ chrono utilities.
 
namespace  i2c
 I2C master driver classes.
 
namespace  lcd
 LCD driver classes.
 
namespace  log
 
namespace  spi
 SPI driver classes.
 

Classes

struct  dma_allocator
 STL-compatible allocator for DMA-capable memory. More...
 
struct  dram_allocator
 STL-compatible allocator for internal DRAM. More...
 
class  error_category
 Error category for IDFXX and ESP-IDF error codes. More...
 
class  event_base
 Typed event base template. More...
 
class  event_group
 Type-safe inter-task event group for bit-level synchronization. More...
 
class  event_loop
 Base class for event loops. More...
 
struct  event_type
 Combines an event base with a specific event ID. More...
 
class  flags
 Type-safe set of flags from a scoped enum. More...
 
class  gpio
 A GPIO pin. More...
 
class  nvs
 Non-Volatile Storage handle. More...
 
class  queue
 Type-safe inter-task message queue. More...
 
struct  spiram_allocator
 STL-compatible allocator for external PSRAM (SPI RAM). More...
 
class  task
 Task lifecycle management. More...
 
class  timer
 High-resolution timer with microsecond precision. More...
 
class  user_event_loop
 User-created event loop with manual dispatch. More...
 

Concepts

concept  flag_enum
 Concept for enums that have opted into flag operators.
 

Typedefs

template<typename T >
using result = std::expected< T, std::error_code >
 result type wrapping a value or error code.
 
template<typename IdEnum >
using event_callback = std::move_only_function< void(event_base< IdEnum > base, IdEnum id, void *event_data) const >
 Callback type for event listeners.
 

Enumerations

enum class  core_id : unsigned int { core_id::core_0 = 0 }
 Identifies a specific CPU core. More...
 
enum class  errc : esp_err_t {
  fail = -1 ,
  no_mem = 0x101 ,
  invalid_arg = 0x102 ,
  invalid_state = 0x103 ,
  invalid_size = 0x104 ,
  not_found = 0x105 ,
  not_supported = 0x106 ,
  timeout = 0x107 ,
  invalid_response = 0x108 ,
  invalid_crc = 0x109 ,
  invalid_version = 0x10A ,
  invalid_mac = 0x10B ,
  not_finished = 0x10C ,
  not_allowed = 0x10D
}
 IDFXX error codes. More...
 
enum class  memory_type : uint32_t {
  memory_type::internal = MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT ,
  memory_type::spiram = MALLOC_CAP_SPIRAM
}
 Memory region type for heap allocations. More...
 
enum class  wait_mode {
  wait_mode::any ,
  wait_mode::all
}
 Specifies whether to wait for any or all of the requested bits. More...
 
enum class  intr_flag : int {
  none = 0 ,
  level1 = 1u << 1 ,
  level2 = 1u << 2 ,
  level3 = 1u << 3 ,
  level4 = 1u << 4 ,
  level5 = 1u << 5 ,
  level6 = 1u << 6 ,
  nmi = 1u << 7 ,
  shared = 1u << 8 ,
  edge = 1u << 9 ,
  iram = 1u << 10 ,
  intr_disabled = 1u << 11
}
 Interrupt allocation flags. More...
 
enum class  intr_cpu_affinity_t {
  automatic = ESP_INTR_CPU_AFFINITY_AUTO ,
  cpu_0 = ESP_INTR_CPU_AFFINITY_0 ,
  cpu_1 = ESP_INTR_CPU_AFFINITY_1
}
 Interrupt CPU core affinity. More...
 

Functions

std::string to_string (core_id c)
 Returns a string representation of a CPU core identifier.
 
const error_categorydefault_category () noexcept
 Returns a reference to the IDFXX error category singleton.
 
std::error_code make_error_code (errc e) noexcept
 Creates a std::error_code from an idfxx::errc value.
 
std::error_code make_error_code (esp_err_t e) noexcept
 Creates a std::error_code from a general esp_err_t value.
 
template<typename E >
requires std::is_error_code_enum_v<E>
constexpr std::unexpected< std::error_code > error (E e) noexcept
 Creates an unexpected error from an error code enum.
 
template<typename E >
requires std::is_error_condition_enum_v<E>
constexpr std::unexpected< std::error_code > error (E e) noexcept
 Creates an unexpected error from an error condition enum.
 
std::unexpected< std::error_code > error (esp_err_t e) noexcept
 Creates an unexpected error from an esp_err_t value.
 
std::unexpected< std::error_code > error (std::error_code ec) noexcept
 Creates an unexpected error from a std::error_code.
 
result< void > wrap (esp_err_t e)
 Wraps an esp_err_t into a result<void>.
 
template<typename T >
unwrap (result< T > result)
 Throws a std::system_error if the result is an error.
 
template<>
void unwrap (result< void > result)
 
template<typename T , typename Callback >
requires std::invocable<Callback, std::error_code> && std::same_as<std::invoke_result_t<Callback, std::error_code>, void>
void abort_on_error (result< T > result, Callback &&on_error)
 Aborts the program if the result contains an error.
 
template<typename T >
void abort_on_error (result< T > result)
 Aborts the program if the result contains an error.
 
template<flag_enum E>
 flags (E) -> flags< E >
 Class template argument deduction guide.
 
template<flag_enum E>
constexpr flags< E > operator| (E a, E b) noexcept
 Combines two enum values into a flags object.
 
template<flag_enum E>
constexpr flags< E > operator& (E a, E b) noexcept
 Intersects two enum values into a flags object.
 
template<flag_enum E>
constexpr flags< E > operator^ (E a, E b) noexcept
 Toggles two enum values into a flags object.
 
template<flag_enum E>
constexpr flags< E > operator~ (E a) noexcept
 Computes the bitwise complement of an enum value.
 
template<flag_enum E>
std::string to_string (flags< E > f)
 Returns a hexadecimal string representation of a flags value.
 
template<typename T , typename U >
bool operator== (const dram_allocator< T > &, const dram_allocator< U > &)
 Equality comparison for dram_allocator.
 
template<typename T , typename U >
bool operator!= (const dram_allocator< T > &, const dram_allocator< U > &)
 Inequality comparison for dram_allocator.
 
template<typename T , typename U >
bool operator== (const spiram_allocator< T > &, const spiram_allocator< U > &)
 Equality comparison for spiram_allocator.
 
template<typename T , typename U >
bool operator!= (const spiram_allocator< T > &, const spiram_allocator< U > &)
 Inequality comparison for spiram_allocator.
 
template<typename T , typename U >
bool operator== (const dma_allocator< T > &, const dma_allocator< U > &)
 Equality comparison for dma_allocator.
 
template<typename T , typename U >
bool operator!= (const dma_allocator< T > &, const dma_allocator< U > &)
 Inequality comparison for dma_allocator.
 
template<typename Rep , typename Period >
void delay (const std::chrono::duration< Rep, Period > &duration)
 Delay for the specified duration.
 
template<typename Clock , typename Duration >
void delay_until (const std::chrono::time_point< Clock, Duration > &target)
 Delays until the specified time point.
 
void yield () noexcept
 Yields execution to other ready tasks of equal priority.
 
void yield_from_isr (bool higher_priority_task_woken=true) noexcept
 Requests a context switch from ISR context.
 
template<typename IdEnum >
 event_type (event_base< IdEnum >, IdEnum) -> event_type< IdEnum >
 
result< void > try_configure_gpios (const gpio::config &cfg, std::vector< gpio > gpios)
 Configures multiple GPIOs with the same settings.
 
template<typename... Gpios>
result< void > try_configure_gpios (const gpio::config &cfg, Gpios &&... gpios)
 Configures multiple GPIOs with the same settings.
 
void configure_gpios (const gpio::config &cfg, std::vector< gpio > gpios)
 Configures multiple GPIOs with the same settings.
 
template<typename... Gpios>
void configure_gpios (const gpio::config &cfg, Gpios &&... gpios)
 Configures multiple GPIOs with the same settings.
 
std::string to_string (gpio g)
 Returns a string representation of a GPIO pin.
 
constexpr int intr_cpu_affinity_to_core_id (intr_cpu_affinity_t cpu_affinity)
 Convert esp_intr_cpu_affinity_t to CPU core ID.
 
const nvs::error_categorynvs_category () noexcept
 Returns a reference to the NVS error category singleton.
 
std::error_code make_error_code (nvs::errc e) noexcept
 Creates an error code from an idfxx::nvs::errc value.
 
std::unexpected< std::error_code > nvs_error (esp_err_t e) noexcept
 Creates an unexpected error from an ESP-IDF error code, mapping to NVS error codes where possible.
 

Variables

template<typename E >
constexpr bool enable_flags_operators = false
 Opt-in trait for enabling flag operators on an enum.
 
constexpr flags< intr_flagintr_flag_lowmed = intr_flag::level1 | intr_flag::level2 | intr_flag::level3
 Low and medium priority levels (1-3). These can be handled in C / C++.
 
constexpr flags< intr_flagintr_flag_high
 High priority levels (4-6 and NMI). These require assembly handlers.
 
constexpr flags< intr_flagintr_flag_levelmask = intr_flag_lowmed | intr_flag_high
 Mask of all interrupt level flags.
 
GPIO Constants

Predefined GPIO instances for direct use.

Available GPIOs depend on the target chip.

constexpr gpio gpio_nc = gpio_constant<GPIO_NUM_NC>::value
 
constexpr gpio gpio_0 = gpio_constant<0>::value
 
constexpr gpio gpio_1 = gpio_constant<1>::value
 
constexpr gpio gpio_2 = gpio_constant<2>::value
 
constexpr gpio gpio_3 = gpio_constant<3>::value
 
constexpr gpio gpio_4 = gpio_constant<4>::value
 
constexpr gpio gpio_5 = gpio_constant<5>::value
 
constexpr gpio gpio_6 = gpio_constant<6>::value
 
constexpr gpio gpio_7 = gpio_constant<7>::value
 
constexpr gpio gpio_8 = gpio_constant<8>::value
 
constexpr gpio gpio_9 = gpio_constant<9>::value
 
constexpr gpio gpio_10 = gpio_constant<10>::value
 
constexpr gpio gpio_11 = gpio_constant<11>::value
 
constexpr gpio gpio_12 = gpio_constant<12>::value
 
constexpr gpio gpio_13 = gpio_constant<13>::value
 
constexpr gpio gpio_14 = gpio_constant<14>::value
 
constexpr gpio gpio_15 = gpio_constant<15>::value
 
constexpr gpio gpio_16 = gpio_constant<16>::value
 
constexpr gpio gpio_17 = gpio_constant<17>::value
 
constexpr gpio gpio_18 = gpio_constant<18>::value
 
constexpr gpio gpio_19 = gpio_constant<19>::value
 
constexpr gpio gpio_20 = gpio_constant<20>::value
 
constexpr gpio gpio_21 = gpio_constant<21>::value
 
constexpr gpio gpio_22 = gpio_constant<22>::value
 
constexpr gpio gpio_23 = gpio_constant<23>::value
 
constexpr gpio gpio_24 = gpio_constant<24>::value
 
constexpr gpio gpio_25 = gpio_constant<25>::value
 
constexpr gpio gpio_26 = gpio_constant<26>::value
 
constexpr gpio gpio_27 = gpio_constant<27>::value
 
constexpr gpio gpio_28 = gpio_constant<28>::value
 
constexpr gpio gpio_29 = gpio_constant<29>::value
 
constexpr gpio gpio_30 = gpio_constant<30>::value
 
constexpr gpio gpio_31 = gpio_constant<31>::value
 
constexpr gpio gpio_32 = gpio_constant<32>::value
 
constexpr gpio gpio_33 = gpio_constant<33>::value
 
constexpr gpio gpio_34 = gpio_constant<34>::value
 
constexpr gpio gpio_35 = gpio_constant<35>::value
 
constexpr gpio gpio_36 = gpio_constant<36>::value
 
constexpr gpio gpio_37 = gpio_constant<37>::value
 
constexpr gpio gpio_38 = gpio_constant<38>::value
 
constexpr gpio gpio_39 = gpio_constant<39>::value
 
constexpr gpio gpio_40 = gpio_constant<40>::value
 
constexpr gpio gpio_41 = gpio_constant<41>::value
 
constexpr gpio gpio_42 = gpio_constant<42>::value
 
constexpr gpio gpio_43 = gpio_constant<43>::value
 
constexpr gpio gpio_44 = gpio_constant<44>::value
 
constexpr gpio gpio_45 = gpio_constant<45>::value
 
constexpr gpio gpio_46 = gpio_constant<46>::value
 
constexpr gpio gpio_47 = gpio_constant<47>::value
 
constexpr gpio gpio_48 = gpio_constant<48>::value
 

Typedef Documentation

◆ result

template<typename T >
using idfxx::result = typedef std::expected<T, std::error_code>

result type wrapping a value or error code.

Template Parameters
TThe success value type.

Definition at line 118 of file error.hpp.

Enumeration Type Documentation

◆ errc

enum class idfxx::errc : esp_err_t
strong

IDFXX error codes.

These error codes are compatible with ESP-IDF error codes and can be used with std::error_code through the IDFXX error category.

Enumerator
fail 

Generic failure.

no_mem 

Out of memory.

invalid_arg 

Invalid argument.

invalid_state 

Invalid state.

invalid_size 

Invalid size.

not_found 

Requested resource not found.

not_supported 

Operation or feature not supported.

timeout 

Operation timed out.

invalid_response 

Received response was invalid.

invalid_crc 

CRC or checksum was invalid.

invalid_version 

Version was invalid.

invalid_mac 

MAC address was invalid.

not_finished 

Operation has not fully completed.

not_allowed 

Operation is not allowed.

Definition at line 43 of file error.hpp.

◆ intr_cpu_affinity_t

enum class idfxx::intr_cpu_affinity_t
strong

Interrupt CPU core affinity.

This type specify the CPU core that the peripheral interrupt is connected to.

Enumerator
automatic 

Install the peripheral interrupt to ANY CPU core, decided by on which CPU the interrupt allocator is running.

cpu_0 

Install the peripheral interrupt to CPU core 0.

cpu_1 

Install the peripheral interrupt to CPU core 1.

Definition at line 23 of file intr_types.hpp.

◆ intr_flag

enum class idfxx::intr_flag : int
strong

Interrupt allocation flags.

Type-safe interrupt allocation flags. These flags control interrupt priority levels, sharing behavior, and handler requirements.

Priority levels 1-3 (lowmed) can use C / C++ handlers. Levels 4-6 and NMI require assembly handlers and must pass NULL as the handler function.

Enumerator
none 

No flags / default.

level1 

Accept Level 1 interrupt (lowest priority)

level2 

Accept Level 2 interrupt.

level3 

Accept Level 3 interrupt.

level4 

Accept Level 4 interrupt.

level5 

Accept Level 5 interrupt.

level6 

Accept Level 6 interrupt.

nmi 

Accept Level 7 / NMI (highest priority)

shared 

Interrupt can be shared between ISRs.

edge 

Edge-triggered interrupt.

iram 

ISR can be called if cache is disabled.

intr_disabled 

Return from ISR with interrupts disabled.

Definition at line 35 of file intr_alloc.hpp.

Function Documentation

◆ abort_on_error() [1/2]

template<typename T >
void idfxx::abort_on_error ( result< T >  result)
inline

Aborts the program if the result contains an error.

Template Parameters
TThe success value type.
Parameters
resultThe result to check.

Definition at line 289 of file error.hpp.

◆ abort_on_error() [2/2]

template<typename T , typename Callback >
requires std::invocable<Callback, std::error_code> && std::same_as<std::invoke_result_t<Callback, std::error_code>, void>
void idfxx::abort_on_error ( result< T >  result,
Callback &&  on_error 
)
inline

Aborts the program if the result contains an error.

This overload invokes an optional callback before aborting, allowing for error logging or cleanup. The callback is invoked inline without type erasure, enabling zero-overhead error handling.

Warning
For std::function or std::move_only_function, ensure the callback is not null to avoid std::bad_function_call.
Template Parameters
TThe success value type.
CallbackThe callback type (deduced).
Parameters
resultThe result to check.
on_errorFunction called with the error code before aborting. Must be a valid callable (not null for function wrappers).

Definition at line 267 of file error.hpp.

◆ default_category()

const error_category & idfxx::default_category ( )
noexcept

Returns a reference to the IDFXX error category singleton.

This follows the standard library pattern (like std::generic_category()).

Returns
Reference to the singleton error_category instance.

Referenced by make_error_code().

◆ error() [1/4]

template<typename E >
requires std::is_error_code_enum_v<E>
constexpr std::unexpected< std::error_code > idfxx::error ( e)
constexprnoexcept

Creates an unexpected error from an error code enum.

Convenience helper for returning errors from functions that return idfxx::result<T>. Works with any registered error code enum (idfxx::errc, nvs::errc, etc.) via ADL make_error_code.

Template Parameters
EAn error code enum type registered via std::is_error_code_enum.
Parameters
eThe error code enum value.
Returns
An unexpected value suitable for returning from result-returning functions.
idfxx::result<int> read_sensor() {
if (error_condition) {
}
return 42;
}
constexpr std::unexpected< std::error_code > error(E e) noexcept
Creates an unexpected error from an error code enum.
Definition error.hpp:142
@ invalid_state
Invalid state.
std::expected< T, std::error_code > result
result type wrapping a value or error code.
Definition error.hpp:118

Definition at line 142 of file error.hpp.

Referenced by idfxx::event_group< E >::make(), idfxx::queue< T >::make(), idfxx::gpio::try_get_drive_capability(), idfxx::timer::try_start_once(), idfxx::timer::try_start_once(), idfxx::timer::try_start_once(), idfxx::timer::try_start_once(), idfxx::timer::try_start_periodic(), idfxx::timer::try_start_periodic(), and wrap().

◆ error() [2/4]

template<typename E >
requires std::is_error_condition_enum_v<E>
constexpr std::unexpected< std::error_code > idfxx::error ( e)
constexprnoexcept

Creates an unexpected error from an error condition enum.

Convenience helper for returning errors from functions that return idfxx::result<T>. Works with any registered error condition enum (std::errc, etc.) via ADL make_error_code.

Template Parameters
EAn error condition enum type registered via std::is_error_condition_enum.
Parameters
eThe error condition enum value.
Returns
An unexpected value suitable for returning from result-returning functions.
idfxx::result<void> try_lock() {
if (deadlock_detected) {
return idfxx::error(std::errc::resource_deadlock_would_occur);
}
return {};
}

Definition at line 168 of file error.hpp.

References make_error_code().

◆ error() [3/4]

std::unexpected< std::error_code > idfxx::error ( esp_err_t  e)
inlinenoexcept

Creates an unexpected error from an esp_err_t value.

Convenience helper for returning errors from functions that return idfxx::result<T>. Converts the ESP-IDF error code to a std::error_code using make_error_code.

Parameters
eThe ESP-IDF error code.
Returns
An unexpected value suitable for returning from result-returning functions.

Definition at line 182 of file error.hpp.

References make_error_code().

◆ error() [4/4]

std::unexpected< std::error_code > idfxx::error ( std::error_code  ec)
inlinenoexcept

Creates an unexpected error from a std::error_code.

Convenience helper for propagating errors between result types with different value types.

Parameters
ecThe error code.
Returns
An unexpected value suitable for returning from result-returning functions.
idfxx::result<int> try_compute() {
idfxx::result<void> r = try_setup();
if (!r) {
return idfxx::error(r.error());
}
return 42;
}

Definition at line 205 of file error.hpp.

◆ flags()

template<flag_enum E>
idfxx::flags ( ) -> flags< E >

Class template argument deduction guide.

Allows flags to be constructed without explicit template arguments:

auto f = flags{my_flags::read}; // deduces flags<my_flags>
Type-safe set of flags from a scoped enum.
Definition flags.hpp:88

◆ intr_cpu_affinity_to_core_id()

constexpr int idfxx::intr_cpu_affinity_to_core_id ( intr_cpu_affinity_t  cpu_affinity)
constexpr

Convert esp_intr_cpu_affinity_t to CPU core ID.

Definition at line 31 of file intr_types.hpp.

◆ make_error_code() [1/3]

std::error_code idfxx::make_error_code ( errc  e)
inlinenoexcept

Creates a std::error_code from an idfxx::errc value.

Definition at line 99 of file error.hpp.

References default_category().

Referenced by error(), and error().

◆ make_error_code() [2/3]

std::error_code idfxx::make_error_code ( esp_err_t  e)
noexcept

Creates a std::error_code from a general esp_err_t value.

Maps common ESP-IDF error codes to corresponding idfxx::errc values, or returns an std::error_code with idfxx::errc::fail for unknown ESP-IDF error codes.

◆ make_error_code() [3/3]

std::error_code idfxx::make_error_code ( nvs::errc  e)
inlinenoexcept

Creates an error code from an idfxx::nvs::errc value.

Definition at line 326 of file nvs.hpp.

References nvs_category().

◆ nvs_category()

const nvs::error_category & idfxx::nvs_category ( )
noexcept

Returns a reference to the NVS error category singleton.

Returns
Reference to the singleton nvs::error_category instance.

Referenced by make_error_code().

◆ nvs_error()

std::unexpected< std::error_code > idfxx::nvs_error ( esp_err_t  e)
noexcept

Creates an unexpected error from an ESP-IDF error code, mapping to NVS error codes where possible.

Converts the ESP-IDF error code to an NVS-specific error code if a mapping exists, otherwise falls back to the default IDFXX error category.

Parameters
eThe ESP-IDF error code.
Returns
An unexpected value suitable for returning from result-returning functions.

◆ operator&()

template<flag_enum E>
constexpr flags< E > idfxx::operator& ( a,
b 
)
constexprnoexcept

Intersects two enum values into a flags object.

Parameters
aFirst flag value.
bSecond flag value.
Returns
A flags object containing the intersection.

Definition at line 328 of file flags.hpp.

◆ operator^()

template<flag_enum E>
constexpr flags< E > idfxx::operator^ ( a,
b 
)
constexprnoexcept

Toggles two enum values into a flags object.

Parameters
aFirst flag value.
bSecond flag value.
Returns
A flags object with toggled bits.

Definition at line 341 of file flags.hpp.

◆ operator|()

template<flag_enum E>
constexpr flags< E > idfxx::operator| ( a,
b 
)
constexprnoexcept

Combines two enum values into a flags object.

Enables natural syntax for combining flag enum values without explicitly constructing flags objects.

Parameters
aFirst flag value.
bSecond flag value.
Returns
A flags object containing both flags.

Definition at line 315 of file flags.hpp.

◆ operator~()

template<flag_enum E>
constexpr flags< E > idfxx::operator~ ( a)
constexprnoexcept

Computes the bitwise complement of an enum value.

Parameters
aThe flag value to complement.
Returns
A flags object with all bits inverted.

Definition at line 353 of file flags.hpp.

◆ to_string()

template<flag_enum E>
std::string idfxx::to_string ( flags< E >  f)
inline

Returns a hexadecimal string representation of a flags value.

Template Parameters
EThe flag enum type (must satisfy flag_enum concept).
Parameters
fThe flags value to convert.
Returns
A string in the form "0x..." representing the underlying value in hexadecimal.

Definition at line 365 of file flags.hpp.

References idfxx::flags< E >::value().

◆ unwrap() [1/2]

template<typename T >
T idfxx::unwrap ( result< T >  result)
inline

Throws a std::system_error if the result is an error.

Template Parameters
TThe success value type.
Parameters
resultThe result to check.
Returns
The success value.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled in menuconfig.
Exceptions
std::system_errorif the result is an error.

Definition at line 237 of file error.hpp.

Referenced by idfxx::nvs::commit(), configure_gpios(), configure_gpios(), idfxx::event_loop::create_system(), idfxx::nvs::flash::deinit(), idfxx::nvs::flash::deinit(), idfxx::event_loop::destroy_system(), idfxx::task::detach(), idfxx::lcd::panel::display_on(), idfxx::nvs::flash::erase(), idfxx::nvs::erase(), idfxx::nvs::flash::erase(), idfxx::nvs::erase_all(), idfxx::nvs::get_blob(), idfxx::gpio::get_drive_capability(), idfxx::nvs::get_string(), idfxx::nvs::get_value(), idfxx::gpio::hold_disable(), idfxx::gpio::hold_enable(), idfxx::nvs::flash::init(), idfxx::nvs::flash::init(), idfxx::nvs::flash::init(), idfxx::nvs::flash::init(), idfxx::nvs::flash::init(), idfxx::nvs::flash::init(), idfxx::gpio::input_enable(), idfxx::gpio::intr_disable(), idfxx::gpio::intr_enable(), idfxx::gpio::isr_handler_add(), idfxx::gpio::isr_handler_add(), idfxx::gpio::isr_handler_remove(), idfxx::gpio::isr_handler_remove_all(), idfxx::task::join(), idfxx::task::join(), idfxx::task::join_until(), idfxx::task::kill(), idfxx::event_loop::listener_add(), idfxx::event_loop::listener_add(), idfxx::event_loop::listener_add(), idfxx::event_loop::listener_remove(), idfxx::lcd::panel::mirror(), idfxx::task::notify(), idfxx::queue< T >::peek(), idfxx::queue< T >::peek(), idfxx::queue< T >::peek_until(), idfxx::event_loop::post(), idfxx::event_loop::post(), idfxx::event_loop::post(), idfxx::event_loop::post(), idfxx::i2c::master_bus::probe(), idfxx::gpio::pulldown_disable(), idfxx::gpio::pulldown_enable(), idfxx::gpio::pullup_disable(), idfxx::gpio::pullup_enable(), idfxx::i2c::master_device::read_register(), idfxx::i2c::master_device::read_register(), idfxx::i2c::master_device::read_register(), idfxx::i2c::master_device::read_register(), idfxx::i2c::master_device::read_register(), idfxx::i2c::master_device::read_register(), idfxx::i2c::master_device::read_register(), idfxx::i2c::master_device::read_register(), idfxx::i2c::master_device::read_register(), idfxx::i2c::master_device::read_register(), idfxx::queue< T >::receive(), idfxx::queue< T >::receive(), idfxx::i2c::master_device::receive(), idfxx::i2c::master_device::receive(), idfxx::i2c::master_device::receive(), idfxx::i2c::master_device::receive(), idfxx::i2c::master_device::receive(), idfxx::i2c::master_device::receive(), idfxx::queue< T >::receive_until(), idfxx::timer::restart(), idfxx::task::resume(), idfxx::user_event_loop::run(), idfxx::queue< T >::send(), idfxx::queue< T >::send(), idfxx::queue< T >::send_to_front(), idfxx::queue< T >::send_to_front(), idfxx::queue< T >::send_to_front_until(), idfxx::queue< T >::send_until(), idfxx::nvs::set_blob(), idfxx::nvs::set_blob(), idfxx::gpio::set_direction(), idfxx::gpio::set_drive_capability(), idfxx::gpio::set_intr_type(), idfxx::task::set_priority(), idfxx::gpio::set_pull_mode(), idfxx::nvs::set_string(), idfxx::nvs::set_value(), idfxx::gpio::sleep_sel_disable(), idfxx::gpio::sleep_sel_enable(), idfxx::gpio::sleep_set_direction(), idfxx::gpio::sleep_set_pull_mode(), idfxx::task::spawn(), idfxx::task::spawn(), idfxx::timer::start_once(), idfxx::timer::start_once(), idfxx::timer::start_once(), idfxx::timer::start_once(), idfxx::timer::start_once(), idfxx::timer::start_once(), idfxx::timer::start_periodic(), idfxx::timer::start_periodic(), idfxx::timer::start_periodic(), idfxx::timer::stop(), idfxx::task::suspend(), idfxx::lcd::panel::swap_xy(), idfxx::event_group< E >::sync(), idfxx::event_group< E >::sync(), idfxx::event_group< E >::sync_until(), idfxx::i2c::master_device::transmit(), idfxx::i2c::master_device::transmit(), idfxx::i2c::master_device::transmit(), idfxx::i2c::master_device::transmit(), idfxx::event_group< E >::wait(), idfxx::event_group< E >::wait(), idfxx::event_group< E >::wait_until(), idfxx::gpio::wakeup_disable(), idfxx::gpio::wakeup_enable(), idfxx::i2c::master_device::write_register(), idfxx::i2c::master_device::write_register(), idfxx::i2c::master_device::write_register(), idfxx::i2c::master_device::write_register(), idfxx::i2c::master_device::write_register(), idfxx::i2c::master_device::write_register(), idfxx::i2c::master_device::write_register(), idfxx::i2c::master_device::write_register(), idfxx::i2c::master_device::write_registers(), idfxx::i2c::master_device::write_registers(), idfxx::i2c::master_device::write_registers(), and idfxx::i2c::master_device::write_registers().

◆ unwrap() [2/2]

template<>
void idfxx::unwrap ( result< void >  result)
inline

Definition at line 243 of file error.hpp.

◆ wrap()

result< void > idfxx::wrap ( esp_err_t  e)
inline

Wraps an esp_err_t into a result<void>.

Parameters
eThe esp_err_t value to wrap.
Returns
A result representing success or failure.

Definition at line 216 of file error.hpp.

References error().

Referenced by idfxx::gpio::try_get_drive_capability(), idfxx::event_loop::try_post(), idfxx::event_loop::try_post(), idfxx::timer::try_restart(), idfxx::user_event_loop::try_run(), idfxx::timer::try_start_once(), idfxx::timer::try_start_once(), idfxx::timer::try_start_periodic(), and idfxx::timer::try_stop().

Variable Documentation

◆ enable_flags_operators

template<typename E >
constexpr bool idfxx::enable_flags_operators = false
inlineconstexpr

Opt-in trait for enabling flag operators on an enum.

Specialize this to true for enum types that should support bitwise operators and work with flags<E>.

Template Parameters
EThe enum type.
See also
flag_enum

Definition at line 56 of file flags.hpp.

◆ intr_flag_high

constexpr flags<intr_flag> idfxx::intr_flag_high
inlineconstexpr
Initial value:
=
intr_flag::level4 | intr_flag::level5 | intr_flag::level6 | intr_flag::nmi

High priority levels (4-6 and NMI). These require assembly handlers.

Definition at line 61 of file intr_alloc.hpp.

◆ intr_flag_levelmask

constexpr flags<intr_flag> idfxx::intr_flag_levelmask = intr_flag_lowmed | intr_flag_high
inlineconstexpr

Mask of all interrupt level flags.

Definition at line 65 of file intr_alloc.hpp.

◆ intr_flag_lowmed

constexpr flags<intr_flag> idfxx::intr_flag_lowmed = intr_flag::level1 | intr_flag::level2 | intr_flag::level3
inlineconstexpr

Low and medium priority levels (1-3). These can be handled in C / C++.

Definition at line 58 of file intr_alloc.hpp.