Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
esphome::home_io_control::RadioLR1121 Class Reference

LR1121 implementation of RadioDriver. More...

#include <radio_lr1121.h>

Inheritance diagram for esphome::home_io_control::RadioLR1121:
Collaboration diagram for esphome::home_io_control::RadioLR1121:

Public Member Functions

 RadioLR1121 (SpiAccess *spi, InternalGPIOPin *rst_pin, InternalGPIOPin *irq_pin, InternalGPIOPin *busy_pin, uint8_t tx_power, uint8_t tcxo_voltage_yaml_code)
bool init () override
 Initialize the radio hardware. Returns true on success.
void apply_tuning (const TuningConfig &tuning) override
 Apply LR1121 runtime tuning: RX bandwidth, response preamble, post-TX settle delay.
uint16_t hop_dwell_ms (const TuningConfig &tuning) const override
 Per-channel dwell for a rotating listen (LR1121).
bool has_fast_tx_rx_turnaround () const override
 TX→RX turnaround capability (LR1121): slow, same as SX1262.
void set_mode_rx () override
 Switch to continuous receive mode.
void set_mode_standby () override
 Switch to standby mode.
const char * chip_name () const override
 Get a human‑readable chip name.
void dump_debug () override
 Dump LR1121-specific debug info.
Public Member Functions inherited from esphome::home_io_control::SoftPhyDriverBase
 SoftPhyDriverBase (InternalGPIOPin *rst_pin, InternalGPIOPin *busy_pin, uint32_t busy_timeout_ms, uint16_t default_response_preamble, uint16_t default_post_tx_settle_us)
bool send_packet (const uint8_t *data, uint8_t len, const RadioTxConfig &tx_config) override
 Send a packet using the specified carrier frequency and preamble settings.
bool wait_for_packet (RadioRxPacket &packet, uint32_t timeout_ms) override
 Wait (blocking) for a packet with timeout.
bool check_for_packet (RadioRxPacket &packet) override
 Non-blocking check for a received packet.
void change_frequency (uint32_t freq_hz) override
 Change the carrier frequency using fast hop (no standby transition needed).
int16_t read_rssi () override
 Read instantaneous RSSI (in dBm) while in RX mode.
bool is_sync_detected () override
 Check if sync word has been detected (while in RX).
bool is_preamble_detected () override
 Check if preamble has been detected (while in RX).
uint16_t response_preamble () const override
 Preamble for response/continuation frames — shared storage, see the concrete drivers' constructors/tuning defaults for the chip-specific rationale and value.
bool is_failed () const override
 Returns true if the radio failed to initialize or encountered a fatal error.
Public Member Functions inherited from esphome::home_io_control::RadioDriver
 RadioDriver (InternalGPIOPin *rst_pin=nullptr)
virtual ~RadioDriver ()=default
uint32_t get_current_freq () const
 Get the current RF frequency.
const RadioCaptureInfoget_last_capture () const
 Get the most recent radio capture info.
void clear_last_capture ()
 Reset the diagnostic capture buffer.
virtual bool reception_in_progress ()
 True while a frame is arriving on the current channel and retuning would destroy it.
bool is_dio_fired () const
 Set by the ISR when DIO fires.
void clear_dio_fired ()
void mark_dio_fired_from_isr ()

Protected Member Functions

void set_rx_bandwidth_ (LR1121RxBandwidth bandwidth)
 Apply the RX bandwidth selector and rewrite the modulation parameters.
void write_command_ (uint16_t opcode, const uint8_t *params, uint8_t len)
 Write-only command: opcode + params, single NSS cycle.
void read_command_ (uint16_t opcode, const uint8_t *params, uint8_t params_len, uint8_t *out, uint8_t out_len)
 Read-type command: write transaction, wait BUSY, then a second NSS cycle clocks out a Stat1 status byte followed by out_len response bytes.
void write_buffer_ (const uint8_t *data, uint8_t len)
 Write into the LR1121 TX buffer (always from the chip's internal write pointer, which resets to the buffer base for a fresh WriteBuffer sequence — unlike SX1262 there is no separate offset parameter here).
void read_buffer_ (uint8_t offset, uint8_t len, uint8_t *data)
 Read from the LR1121 RX buffer at a given offset (as reported by GetRxBufferStatus).
void log_command_status_ (uint16_t opcode) const
 Log a warning if the most recently observed Stat1 command-status byte indicates the chip rejected the previous command (a FAIL or PERR command-status code in Stat1).
void write_reg_mem_mask32_ (uint32_t addr, uint32_t mask, uint32_t value)
 WriteRegMemMask32: read-modify-write a 32-bit register through mask/value.
void apply_high_acp_workaround_ ()
 Apply the Semtech high-ACP TX-quality erratum workaround.
void apply_gfsk_workaround_ ()
 Apply the GFSK modulation workaround register trio.
void calibrate_image_ ()
 Issue a banded image calibration for the 868MHz operating range.
void configure_radio_ ()
 Full radio initialization (called from init()).
void set_frequency_register (uint32_t freq_hz) override
 Set RF frequency via the chip's own frequency register/opcode encoding, and update current_freq_.
void set_packet_params_ (uint16_t preamble_len, uint8_t payload_len, uint8_t packet_type, uint8_t crc_type)
 Configure GFSK packet parameters (preamble, payload length, CRC).
void write_modulation_params_ ()
 Apply the runtime bandwidth setting to the LR1121 modulation parameters.
void set_rx_packet_params () override
 Configure RX-specific packet parameters (preamble detector length, fixed probe length).
void set_tx_packet_params (uint16_t preamble_len, uint8_t payload_len) override
 Configure TX packet parameters for one outgoing UART-encoded frame.
void clear_irq_status (uint32_t irq_mask) override
 Clear IRQ status bits.
uint16_t get_errors_ ()
 Read device error flags (for diagnostics only — see dump_debug()).
void clear_errors_ ()
 Clear device error flags.
void fill_capture_info (bool blocking_wait, uint32_t irq_status, uint8_t rx_offset, uint8_t reported_len, const uint8_t *raw, uint8_t raw_len, const uint8_t *frame, uint8_t frame_len) override
 Populate the RadioCaptureInfo from chip-specific telemetry (RSSI opcode, packet-status byte, and IRQ-word-width narrowing all differ per chip).
uint32_t read_irq_status_raw () override
 Read the raw IRQ status word from the radio.
uint32_t sync_word_valid_bit () const override
uint32_t rx_done_bit () const override
uint32_t tx_done_bit () const override
uint32_t preamble_detected_bit () const override
uint32_t activity_irq_mask () const override
 IRQ bits that count as "activity" for the internal poll_until_activity_() helper and check_for_packet.
int16_t early_rx_read_offset () const override
 Data-buffer offset an in-flight reception is being written to, or a negative value when this chip must not be read before RX_DONE.
uint8_t read_rssi_raw_byte () override
 Read the single raw RSSI byte (chip-specific opcode); formula is shared, see read_rssi.
void write_tx_buffer (const uint8_t *data, uint8_t len) override
 Write the UART-encoded TX payload into the chip's TX buffer.
void get_rx_buffer_status (uint8_t &reported_len, uint8_t &rx_offset) override
 Read the chip-reported RX length and buffer offset (raw, before any clamping).
void read_rx_buffer (uint8_t offset, uint8_t *data, uint8_t len) override
 Read len bytes from the RX buffer starting at offset.
void start_tx () override
 Issue the SetTx opcode with the fixed TX timeout — identical 3-byte payload on both chips, differing only in opcode/transport, so this stays a thin chip-specific wrapper.
void before_tx_arm () override
 Hook run immediately before every SetTx.
void invalidate_stale_rx_content_after_tx () override
 Hook run from rearm_rx_after_tx_, after a transmission and before re-entering RX.
Protected Member Functions inherited from esphome::home_io_control::SoftPhyDriverBase
void set_response_preamble_ (uint16_t preamble)
 Set the preamble length used for response/continuation frames within an exchange.
void set_post_tx_settle_us_ (uint16_t delay_us)
 Set the delay between TX completion and re-entering RX.
void wait_busy_ ()
 Wait until busy_pin_ reads low, feeding the watchdog while polling.
virtual bool read_rx_packet (RadioRxPacket &packet, bool blocking_wait, uint32_t irq_status)
 Read a received packet from the buffer and return the raw bytes reported by the chip.
void reset_rx_state_ (bool force_standby=true)
 Reset RX state machine and buffer. Optionally force standby first.
void rearm_rx_after_tx_ ()
 Minimal path back into RX immediately after a transmission — see the definition for why this is deliberately not reset_rx_state_.
virtual uint32_t idle_rx_completion_budget_ms () const
 Blocking budget for the idle-path length-driven receive, in milliseconds (issue #81).
virtual void configure_buffer_base ()
 Hook run as part of reset_rx_state_, before re-entering RX.
Protected Member Functions inherited from esphome::home_io_control::RadioDriver
void prepare_blocking_receive_ (RadioRxPacket &packet)
 Common preamble for blocking receive: clear diagnostics and output packet.
void prepare_nonblocking_receive_ (RadioRxPacket &packet)
 Common preamble for non‑blocking receive: clear diagnostics, output packet, and DIO latch.
void note_reception_in_progress_ ()
 Record that a frame is arriving right now.
void clear_reception_in_progress_ ()
 Drop the holdoff: the reception ended, was delivered, or was torn down deliberately.
void reset_hardware_ ()
 Shared hardware reset sequence for chips with an active-low RST pin.
void populate_capture_base_ (bool blocking_wait, uint32_t freq_hz, int16_t rssi_dbm, const uint8_t *raw, uint8_t raw_len, const uint8_t *frame, uint8_t frame_len)
 Populate the common fields of RadioCaptureInfo from raw telemetry.

Static Protected Member Functions

static void gpio_intr (RadioLR1121 *arg)
 IRQ pin (DIO9) ISR — sets dio_fired flag. Runs in interrupt context.
Static Protected Member Functions inherited from esphome::home_io_control::SoftPhyDriverBase
static void build_gfsk_packet_params (const SoftPhyPacketParams &p, uint8_t out[GFSK_PACKET_PARAMS_LEN])
 Fill the nine-byte GFSK SetPacketParams payload shared by both chips.

Additional Inherited Members

Protected Attributes inherited from esphome::home_io_control::SoftPhyDriverBase
bool failed_ {false}
 Set on a BUSY timeout or a chip-identity check failing; see is_failed.
InternalGPIOPin * busy_pin_
 BUSY line, read directly by both concrete drivers' own dump_debug() in addition to wait_busy_, so this stays protected rather than folding entirely into the private wait-loop state below.
Protected Attributes inherited from esphome::home_io_control::RadioDriver
uint32_t current_freq_ {FREQ_CH2}
RadioCaptureInfo last_capture_ {}
InternalGPIOPin * rst_pin_ {nullptr}
bool rx_hold_armed_ {false}
 Idle-hop holdoff latch — see reception_in_progress().
uint32_t rx_hold_since_us_ {0}
 micros() timestamp the holdoff was last (re-)armed at.
volatile bool dio_fired_ {false}
Static Protected Attributes inherited from esphome::home_io_control::SoftPhyDriverBase
static constexpr uint8_t GFSK_PACKET_PARAMS_LEN = 9
 Byte count of the GFSK SetPacketParams payload — identical on both software-PHY chips.

Detailed Description

LR1121 implementation of RadioDriver.

Manages the LR1121 via 16-bit-opcode, two-transaction SPI using the SpiAccess interface. Configures the chip in GFSK mode with software CRC-CCITT to match the IO-Homecontrol protocol (the LR1121, like the SX1262, lacks the SX1276's IoHomeOn mode). The IRQ-driven RX/TX orchestration is inherited from SoftPhyDriverBase; this class supplies the SPI transport and every LR1121-specific register/opcode encoding underneath it. See the file header for the driver's relationship to RadioSX1262.

Definition at line 250 of file radio_lr1121.h.

Constructor & Destructor Documentation

◆ RadioLR1121()

esphome::home_io_control::RadioLR1121::RadioLR1121 ( SpiAccess * spi,
InternalGPIOPin * rst_pin,
InternalGPIOPin * irq_pin,
InternalGPIOPin * busy_pin,
uint8_t tx_power,
uint8_t tcxo_voltage_yaml_code )
inline

Definition at line 252 of file radio_lr1121.h.

Here is the call graph for this function:

Member Function Documentation

◆ activity_irq_mask()

uint32_t esphome::home_io_control::RadioLR1121::activity_irq_mask ( ) const
inlinenodiscardoverrideprotectedvirtual

IRQ bits that count as "activity" for the internal poll_until_activity_() helper and check_for_packet.

Default is "any bit" — safe only for a driver whose SetDioIrqParams-equivalent mask never includes PreambleDetected in the first place, so a preamble-only reading can never reach this check. Neither current driver qualifies: both SX1262 and LR1121 unmask PreambleDetected (each for its own reason) and override this to exclude it — a preamble-only reading means a frame may still be arriving, and treating it as terminal activity would tear down RX mid-reception.

Excludes PREAMBLE_DETECTED, unlike the base's "any bit" default — see LR1121_IRQ_ACTIVITY_MASK's doc comment for why this chip needs the distinction.

Reimplemented from esphome::home_io_control::SoftPhyDriverBase.

Definition at line 386 of file radio_lr1121.h.

◆ apply_gfsk_workaround_()

void esphome::home_io_control::RadioLR1121::apply_gfsk_workaround_ ( )
protected

Apply the GFSK modulation workaround register trio.

Called at the end of write_modulation_params_() so it re-applies on every bandwidth retune too.

Definition at line 89 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ apply_high_acp_workaround_()

void esphome::home_io_control::RadioLR1121::apply_high_acp_workaround_ ( )
protected

Apply the Semtech high-ACP TX-quality erratum workaround.

Must run before every SetRx/SetTx — called from set_mode_rx() and before_tx_arm rather than once at init, mirroring Semtech's own call sites.

Definition at line 84 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ apply_tuning()

void esphome::home_io_control::RadioLR1121::apply_tuning ( const TuningConfig & tuning)
inlineoverridevirtual

Apply LR1121 runtime tuning: RX bandwidth, response preamble, post-TX settle delay.

Reimplemented from esphome::home_io_control::RadioDriver.

Definition at line 264 of file radio_lr1121.h.

Here is the call graph for this function:

◆ before_tx_arm()

void esphome::home_io_control::RadioLR1121::before_tx_arm ( )
inlineoverrideprotectedvirtual

Hook run immediately before every SetTx.

No-op by default; LR1121 overrides this to apply its high-ACP TX-quality workaround, which Semtech's own reference applies unconditionally before every SetRx/SetTx.

High-ACP workaround — Semtech applies this unconditionally before every SetTx, same as before every SetRx (see set_mode_rx()).

Reimplemented from esphome::home_io_control::SoftPhyDriverBase.

Definition at line 420 of file radio_lr1121.h.

Here is the call graph for this function:

◆ calibrate_image_()

void esphome::home_io_control::RadioLR1121::calibrate_image_ ( )
protected

Issue a banded image calibration for the 868MHz operating range.

Definition at line 98 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ chip_name()

const char * esphome::home_io_control::RadioLR1121::chip_name ( ) const
inlinenodiscardoverridevirtual

Get a human‑readable chip name.

Returns
Short lowercase identifier (e.g. "sx1276").

Implements esphome::home_io_control::RadioDriver.

Definition at line 288 of file radio_lr1121.h.

◆ clear_errors_()

void esphome::home_io_control::RadioLR1121::clear_errors_ ( )
protected

Clear device error flags.

Called both during init (after TCXO configuration, before calibration) and at the end of configure_radio_() to discard init-time noise.

Definition at line 182 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ clear_irq_status()

void esphome::home_io_control::RadioLR1121::clear_irq_status ( uint32_t irq_mask)
overrideprotectedvirtual

Clear IRQ status bits.

Parameters
irq_maskBitmask of IRQs to clear (each driver narrows to its own IRQ word width).

Implements esphome::home_io_control::SoftPhyDriverBase.

Definition at line 184 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ configure_radio_()

void esphome::home_io_control::RadioLR1121::configure_radio_ ( )
protected

Full radio initialization (called from init()).

Definition at line 286 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ dump_debug()

void esphome::home_io_control::RadioLR1121::dump_debug ( )
overridevirtual

Dump LR1121-specific debug info.

Reimplemented from esphome::home_io_control::RadioDriver.

Definition at line 265 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ early_rx_read_offset()

int16_t esphome::home_io_control::RadioLR1121::early_rx_read_offset ( ) const
inlinenodiscardoverrideprotectedvirtual

Data-buffer offset an in-flight reception is being written to, or a negative value when this chip must not be read before RX_DONE.

Neither chip's RX_DONE marks the end of the frame: with no hardware framing, RX runs in fixed-length mode at SOFT_PHY_RX_PROBE_PACKET_LEN, so RX_DONE arrives a fixed ~10 ms after the sync word no matter how short the frame actually was. That delay lands squarely on the protocol's tightest turnaround — the hub's reply to a device's challenge — so a driver that can read its buffer while reception is still running opts in here and the shared flow finishes on the frame's own air time instead (see try_early_completion_).

Default is -1: wait for RX_DONE exactly as before. SX1262 overrides it with the RX base address it programs in configure_buffer_base(), which is where a single in-flight packet always starts. LR1121 also opts in, at the base of its one shared TX/RX buffer — see RadioLR1121::early_rx_read_offset for why a wrong guess there is safe only in combination with invalidate_stale_rx_content_after_tx.

Opted in (issue #81). The LR1121's ReadBuffer8 is the same non-destructive, offset-addressed read the SX1262's is, so the length-driven receive ports unchanged; only the offset differs, and this chip's has to be reasoned about rather than programmed (see LR1121_RX_BUFFER_BASE).

Not yet confirmed against a real LR1121, and deliberately shipped that way: a wrong offset here is safe, but not merely because try_early_completion_() gates on CRC-CCITT. On this chip's single shared TX/RX buffer, the bytes sitting at a wrong offset right after a transmission would otherwise be the hub's own last-sent frame — genuinely CRC-valid, not noise, so the CRC gate alone would not catch it. What actually makes a wrong guess harmless is invalidate_stale_rx_content_after_tx overwriting that content after every TX, so a wrong offset degrades to reading real garbage instead — which the CRC gate (or the stage-1 length peek) then correctly rejects, falling through to the RX_DONE path exactly as it does today. Either way it cannot cost a frame, only the latency saving. RadioCaptureInfo::rx_offset (logged in SoftPhyDriverBase::read_rx_packet under IOHOME_FRAME_LOG) carries the chip's own post-RX_DONE answer if the assumption ever needs checking on hardware.

Reimplemented from esphome::home_io_control::SoftPhyDriverBase.

Definition at line 405 of file radio_lr1121.h.

◆ fill_capture_info()

void esphome::home_io_control::RadioLR1121::fill_capture_info ( bool blocking_wait,
uint32_t irq_status,
uint8_t rx_offset,
uint8_t reported_len,
const uint8_t * raw,
uint8_t raw_len,
const uint8_t * frame,
uint8_t frame_len )
overrideprotectedvirtual

Populate the RadioCaptureInfo from chip-specific telemetry (RSSI opcode, packet-status byte, and IRQ-word-width narrowing all differ per chip).

Note: RadioCaptureInfo::irq_status is uint16_t; the 32-bit IRQ word is mapped down by taking bits [2..10] and shifting right by 2.

Implements esphome::home_io_control::SoftPhyDriverBase.

Definition at line 194 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ get_errors_()

uint16_t esphome::home_io_control::RadioLR1121::get_errors_ ( )
protected

Read device error flags (for diagnostics only — see dump_debug()).

Returns
Error bitmask (2-byte response, cross-checked against RadioLib).

Definition at line 176 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ get_rx_buffer_status()

void esphome::home_io_control::RadioLR1121::get_rx_buffer_status ( uint8_t & reported_len,
uint8_t & rx_offset )
overrideprotectedvirtual

Read the chip-reported RX length and buffer offset (raw, before any clamping).

Implements esphome::home_io_control::SoftPhyDriverBase.

Definition at line 224 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ gpio_intr()

void IRAM_ATTR esphome::home_io_control::RadioLR1121::gpio_intr ( RadioLR1121 * arg)
staticprotected

IRQ pin (DIO9) ISR — sets dio_fired flag. Runs in interrupt context.

Definition at line 241 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ has_fast_tx_rx_turnaround()

bool esphome::home_io_control::RadioLR1121::has_fast_tx_rx_turnaround ( ) const
inlinenodiscardoverridevirtual

TX→RX turnaround capability (LR1121): slow, same as SX1262.

See RadioSX1262::has_fast_tx_rx_turnaround for the rationale — the LR1121 needs the same standby/settle cycle between TX and RX.

Implements esphome::home_io_control::RadioDriver.

Definition at line 283 of file radio_lr1121.h.

◆ hop_dwell_ms()

uint16_t esphome::home_io_control::RadioLR1121::hop_dwell_ms ( const TuningConfig & tuning) const
inlinenodiscardoverridevirtual

Per-channel dwell for a rotating listen (LR1121).

See LR1121_DISCOVERY_HOP_SLICE_MS for why this is measured independently rather than inherited from SX1262, and SX1262_DISCOVERY_HOP_SLICE_MS for the shared short-dwell reasoning. Governs discovery and the broadcast roll-call alike (see RadioDriver::hop_dwell_ms). The value comes from the user-facing lr1121_discovery_hop_slice_ms tuning field.

Implements esphome::home_io_control::RadioDriver.

Definition at line 276 of file radio_lr1121.h.

◆ init()

bool esphome::home_io_control::RadioLR1121::init ( )
overridevirtual

Initialize the radio hardware. Returns true on success.

Implements esphome::home_io_control::RadioDriver.

Definition at line 245 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ invalidate_stale_rx_content_after_tx()

void esphome::home_io_control::RadioLR1121::invalidate_stale_rx_content_after_tx ( )
inlineoverrideprotectedvirtual

Hook run from rearm_rx_after_tx_, after a transmission and before re-entering RX.

No-op by default.

SX1262 has a real address split written once at init (configure_buffer_base): TX always builds at its own base, RX always lands at a different one, so nothing a transmission wrote can ever appear where a length-driven receive (early_rx_read_offset) later reads from. LR1121 has no such split — one shared 256-byte buffer for both directions, and WriteBuffer always starts from the buffer base (see write_buffer_'s doc comment) — so after every LR1121 transmission, the offset a length-driven receive will read from holds a real, CRC-valid, UART-encoded copy of the hub's own last-sent frame. That is not noise: if early_rx_read_offset()'s offset guess ever turns out to be wrong, reading that residue back would pass every stage of try_early_completion_() and hand back the hub's own transmission as a phantom received packet — worse than doing nothing, since check_for_packet() would then tear down and re-arm RX (issue #81's force_standby path) over whatever real reception was actually in progress. RadioLR1121 overrides this to overwrite that offset with a few non-frame-shaped bytes after every TX, so a wrong offset guess degrades back to reading genuine garbage — which correctly fails the length-driven receive's stage 1 or stage 3 — instead of a valid-looking phantom frame.

Overwrites the header-peek window at LR1121_RX_BUFFER_BASE with non-frame-shaped bytes (all-zero: a run of zero bits can never satisfy decode_uart_probe's stop-bit check, so soft_phy_peek_frame_length() fails deterministically on it, not merely with high probability). write_buffer_() always starts from the chip's own buffer base — the same address early_rx_read_offset() reads from — so this needs no separate offset parameter. Sized to exactly the bytes try_early_completion_()'s stage 1 reads, so it stays a single short SPI write rather than clearing the whole probe window.

Reimplemented from esphome::home_io_control::SoftPhyDriverBase.

Definition at line 430 of file radio_lr1121.h.

Here is the call graph for this function:

◆ log_command_status_()

void esphome::home_io_control::RadioLR1121::log_command_status_ ( uint16_t opcode) const
protected

Log a warning if the most recently observed Stat1 command-status byte indicates the chip rejected the previous command (a FAIL or PERR command-status code in Stat1).

Definition at line 60 of file radio_lr1121.cpp.

◆ preamble_detected_bit()

uint32_t esphome::home_io_control::RadioLR1121::preamble_detected_bit ( ) const
inlinenodiscardoverrideprotectedvirtual

Implements esphome::home_io_control::SoftPhyDriverBase.

Definition at line 381 of file radio_lr1121.h.

◆ read_buffer_()

void esphome::home_io_control::RadioLR1121::read_buffer_ ( uint8_t offset,
uint8_t len,
uint8_t * data )
protected

Read from the LR1121 RX buffer at a given offset (as reported by GetRxBufferStatus).

Definition at line 107 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ read_command_()

void esphome::home_io_control::RadioLR1121::read_command_ ( uint16_t opcode,
const uint8_t * params,
uint8_t params_len,
uint8_t * out,
uint8_t out_len )
protected

Read-type command: write transaction, wait BUSY, then a second NSS cycle clocks out a Stat1 status byte followed by out_len response bytes.

Parameters
opcodeLR1121 16-bit opcode.
paramsPointer to request parameter buffer (may be nullptr).
params_lenRequest parameter length.
outOutput buffer for the response bytes (excludes Stat1).
out_lenNumber of response bytes to read.

Definition at line 44 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ read_irq_status_raw()

uint32_t esphome::home_io_control::RadioLR1121::read_irq_status_raw ( )
overrideprotectedvirtual

Read the raw IRQ status word from the radio.

Virtual to allow test doubles (both concrete drivers' tests override this).

Reads the raw 32-bit IRQ status word from the radio (via GetStatus).

Implements esphome::home_io_control::SoftPhyDriverBase.

Definition at line 112 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ read_rssi_raw_byte()

uint8_t esphome::home_io_control::RadioLR1121::read_rssi_raw_byte ( )
overrideprotectedvirtual

Read the single raw RSSI byte (chip-specific opcode); formula is shared, see read_rssi.

Implements esphome::home_io_control::SoftPhyDriverBase.

Definition at line 218 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ read_rx_buffer()

void esphome::home_io_control::RadioLR1121::read_rx_buffer ( uint8_t offset,
uint8_t * data,
uint8_t len )
inlineoverrideprotectedvirtual

Read len bytes from the RX buffer starting at offset.

Implements esphome::home_io_control::SoftPhyDriverBase.

Definition at line 413 of file radio_lr1121.h.

Here is the call graph for this function:

◆ rx_done_bit()

uint32_t esphome::home_io_control::RadioLR1121::rx_done_bit ( ) const
inlinenodiscardoverrideprotectedvirtual

Implements esphome::home_io_control::SoftPhyDriverBase.

Definition at line 377 of file radio_lr1121.h.

◆ set_frequency_register()

void esphome::home_io_control::RadioLR1121::set_frequency_register ( uint32_t freq_hz)
overrideprotectedvirtual

Set RF frequency via the chip's own frequency register/opcode encoding, and update current_freq_.

Called from both change_frequency and the shared send_packet().

Plain Hz, 32-bit — no PLL-step conversion needed on this chip.

Implements esphome::home_io_control::SoftPhyDriverBase.

Definition at line 429 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ set_mode_rx()

void esphome::home_io_control::RadioLR1121::set_mode_rx ( )
overridevirtual

Switch to continuous receive mode.

Implements esphome::home_io_control::RadioDriver.

Definition at line 419 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ set_mode_standby()

void esphome::home_io_control::RadioLR1121::set_mode_standby ( )
overridevirtual

Switch to standby mode.

Implements esphome::home_io_control::RadioDriver.

Definition at line 414 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ set_packet_params_()

void esphome::home_io_control::RadioLR1121::set_packet_params_ ( uint16_t preamble_len,
uint8_t payload_len,
uint8_t packet_type,
uint8_t crc_type )
protected

Configure GFSK packet parameters (preamble, payload length, CRC).

Definition at line 126 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ set_rx_bandwidth_()

void esphome::home_io_control::RadioLR1121::set_rx_bandwidth_ ( LR1121RxBandwidth bandwidth)
protected

Apply the RX bandwidth selector and rewrite the modulation parameters.

Definition at line 440 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ set_rx_packet_params()

void esphome::home_io_control::RadioLR1121::set_rx_packet_params ( )
overrideprotectedvirtual

Configure RX-specific packet parameters (preamble detector length, fixed probe length).

Implements esphome::home_io_control::SoftPhyDriverBase.

Definition at line 142 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ set_tx_packet_params()

void esphome::home_io_control::RadioLR1121::set_tx_packet_params ( uint16_t preamble_len,
uint8_t payload_len )
inlineoverrideprotectedvirtual

Configure TX packet parameters for one outgoing UART-encoded frame.

Parameters
preamble_lenPreamble length in symbols, from the caller's RadioTxConfig.
payload_lenUART-encoded payload length in bytes.

Implements esphome::home_io_control::SoftPhyDriverBase.

Definition at line 349 of file radio_lr1121.h.

Here is the call graph for this function:

◆ start_tx()

void esphome::home_io_control::RadioLR1121::start_tx ( )
overrideprotectedvirtual

Issue the SetTx opcode with the fixed TX timeout — identical 3-byte payload on both chips, differing only in opcode/transport, so this stays a thin chip-specific wrapper.

Implements esphome::home_io_control::SoftPhyDriverBase.

Definition at line 232 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ sync_word_valid_bit()

uint32_t esphome::home_io_control::RadioLR1121::sync_word_valid_bit ( ) const
inlinenodiscardoverrideprotectedvirtual

Implements esphome::home_io_control::SoftPhyDriverBase.

Definition at line 375 of file radio_lr1121.h.

◆ tx_done_bit()

uint32_t esphome::home_io_control::RadioLR1121::tx_done_bit ( ) const
inlinenodiscardoverrideprotectedvirtual

Implements esphome::home_io_control::SoftPhyDriverBase.

Definition at line 379 of file radio_lr1121.h.

◆ write_buffer_()

void esphome::home_io_control::RadioLR1121::write_buffer_ ( const uint8_t * data,
uint8_t len )
protected

Write into the LR1121 TX buffer (always from the chip's internal write pointer, which resets to the buffer base for a fresh WriteBuffer sequence — unlike SX1262 there is no separate offset parameter here).

Definition at line 103 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ write_command_()

void esphome::home_io_control::RadioLR1121::write_command_ ( uint16_t opcode,
const uint8_t * params,
uint8_t len )
protected

Write-only command: opcode + params, single NSS cycle.

Parameters
opcodeLR1121 16-bit opcode.
paramsPointer to parameter buffer (may be nullptr).
lenParameter length.

Definition at line 31 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ write_modulation_params_()

void esphome::home_io_control::RadioLR1121::write_modulation_params_ ( )
protected

Apply the runtime bandwidth setting to the LR1121 modulation parameters.

Definition at line 150 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ write_reg_mem_mask32_()

void esphome::home_io_control::RadioLR1121::write_reg_mem_mask32_ ( uint32_t addr,
uint32_t mask,
uint32_t value )
protected

WriteRegMemMask32: read-modify-write a 32-bit register through mask/value.

Used by the vendor errata workarounds below; opcode 0x010C.

Definition at line 75 of file radio_lr1121.cpp.

Here is the call graph for this function:

◆ write_tx_buffer()

void esphome::home_io_control::RadioLR1121::write_tx_buffer ( const uint8_t * data,
uint8_t len )
inlineoverrideprotectedvirtual

Write the UART-encoded TX payload into the chip's TX buffer.

Implements esphome::home_io_control::SoftPhyDriverBase.

Definition at line 409 of file radio_lr1121.h.

Here is the call graph for this function:

The documentation for this class was generated from the following files: