idfxx 1.0.0
Modern C++23 components for ESP-IDF
Loading...
Searching...
No Matches
idfxx::radio::sx126x::config Struct Reference

Configuration for an SX126x driver instance. More...

Public Attributes

chip_variant variant = chip_variant::sx1262
 Chip family member.
 
idfxx::gpio cs = gpio::nc()
 SPI chip-select pin (required).
 
idfxx::gpio busy = gpio::nc()
 BUSY input from chip (required).
 
idfxx::gpio dio1 = gpio::nc()
 DIO1 IRQ input from chip (required).
 
idfxx::gpio nreset = gpio::nc()
 Active-low reset to chip; nc() skips the hardware reset.
 
freq::hertz clock_speed {10'000'000}
 SPI clock; chip max is 18 MHz.
 
bool dio2_as_rf_switch = true
 Use DIO2 as the antenna T/R switch.
 
idfxx::gpio rxen = gpio::nc()
 Optional external RF-switch RX-enable pin; nc() if unused.
 
idfxx::gpio txen = gpio::nc()
 Optional external RF-switch TX-enable pin; nc() if unused.
 
std::optional< tcxo_configtcxo = std::nullopt
 Optional TCXO; leave unset for crystal.
 
enum regulator regulator = regulator::ldo
 Voltage regulator selection.
 
bool rx_boost = false
 Use boosted-RX gain (more sensitive, higher current).
 
std::chrono::milliseconds busy_timeout {100}
 Max wait for BUSY to go low.
 
std::optional< flags< sx126x_irq_flag > > dio1_mask = std::nullopt
 IRQ flags latched by the chip and routed to DIO1.
 
bool warm_start = false
 Attach to an already configured chip instead of resetting and reconfiguring it.
 
event_looploop = nullptr
 Event loop to post radio events on; nullptr disables posting.
 
task_priority worker_priority {18}
 Worker task priority.
 
size_t worker_stack_size = 4096
 Worker task stack size in bytes.
 
std::optional< core_idworker_core = std::nullopt
 Worker task core affinity.
 

Detailed Description

Configuration for an SX126x driver instance.

Most fields have sensible defaults. The cs, busy, and dio1 GPIO pins are required and must be set; nreset is strongly recommended (without it the chip is not reset at construction and is assumed to be in its power-on state).

Definition at line 195 of file sx126x.hpp.

Member Data Documentation

◆ busy

idfxx::gpio idfxx::radio::sx126x::config::busy = gpio::nc()

BUSY input from chip (required).

Definition at line 198 of file sx126x.hpp.

◆ busy_timeout

std::chrono::milliseconds idfxx::radio::sx126x::config::busy_timeout {100}

Max wait for BUSY to go low.

Definition at line 208 of file sx126x.hpp.

◆ clock_speed

freq::hertz idfxx::radio::sx126x::config::clock_speed {10'000'000}

SPI clock; chip max is 18 MHz.

Definition at line 201 of file sx126x.hpp.

◆ cs

idfxx::gpio idfxx::radio::sx126x::config::cs = gpio::nc()

SPI chip-select pin (required).

Definition at line 197 of file sx126x.hpp.

◆ dio1

idfxx::gpio idfxx::radio::sx126x::config::dio1 = gpio::nc()

DIO1 IRQ input from chip (required).

Definition at line 199 of file sx126x.hpp.

◆ dio1_mask

std::optional<flags<sx126x_irq_flag> > idfxx::radio::sx126x::config::dio1_mask = std::nullopt

IRQ flags latched by the chip and routed to DIO1.

Leave unset for the driver default (tx_done, rx_done, preamble_detected, crc_err, cad_done, cad_detected). Wake-on-radio designs that sleep the host while the chip listens typically drop preamble_detected so DIO1 only rises once a packet has fully arrived.

Definition at line 214 of file sx126x.hpp.

◆ dio2_as_rf_switch

bool idfxx::radio::sx126x::config::dio2_as_rf_switch = true

Use DIO2 as the antenna T/R switch.

Definition at line 202 of file sx126x.hpp.

◆ loop

event_loop* idfxx::radio::sx126x::config::loop = nullptr

Event loop to post radio events on; nullptr disables posting.

Definition at line 223 of file sx126x.hpp.

◆ nreset

idfxx::gpio idfxx::radio::sx126x::config::nreset = gpio::nc()

Active-low reset to chip; nc() skips the hardware reset.

Definition at line 200 of file sx126x.hpp.

◆ regulator

enum regulator idfxx::radio::sx126x::config::regulator = regulator::ldo

Voltage regulator selection.

Definition at line 206 of file sx126x.hpp.

◆ rx_boost

bool idfxx::radio::sx126x::config::rx_boost = false

Use boosted-RX gain (more sensitive, higher current).

Definition at line 207 of file sx126x.hpp.

◆ rxen

idfxx::gpio idfxx::radio::sx126x::config::rxen = gpio::nc()

Optional external RF-switch RX-enable pin; nc() if unused.

Definition at line 203 of file sx126x.hpp.

◆ tcxo

std::optional<tcxo_config> idfxx::radio::sx126x::config::tcxo = std::nullopt

Optional TCXO; leave unset for crystal.

Definition at line 205 of file sx126x.hpp.

◆ txen

idfxx::gpio idfxx::radio::sx126x::config::txen = gpio::nc()

Optional external RF-switch TX-enable pin; nc() if unused.

Definition at line 204 of file sx126x.hpp.

◆ variant

chip_variant idfxx::radio::sx126x::config::variant = chip_variant::sx1262

Chip family member.

Definition at line 196 of file sx126x.hpp.

◆ warm_start

bool idfxx::radio::sx126x::config::warm_start = false

Attach to an already configured chip instead of resetting and reconfiguring it.

No reset pulse and no configuration command is issued at construction — the chip is assumed to carry the configuration a previous (cold-started) driver instance applied, e.g. across a host deep sleep the chip spent duty-cycle listening. Use try_adopt_pending after construction to recover a packet the chip received while no driver was running.

Definition at line 222 of file sx126x.hpp.

◆ worker_core

std::optional<core_id> idfxx::radio::sx126x::config::worker_core = std::nullopt

Worker task core affinity.

Definition at line 226 of file sx126x.hpp.

◆ worker_priority

task_priority idfxx::radio::sx126x::config::worker_priority {18}

Worker task priority.

Definition at line 224 of file sx126x.hpp.

◆ worker_stack_size

size_t idfxx::radio::sx126x::config::worker_stack_size = 4096

Worker task stack size in bytes.

Definition at line 225 of file sx126x.hpp.


The documentation for this struct was generated from the following file: