Expand description
Semtech SX1261, SX1262, and LLCC68 transceivers.
These radios are run by commands. The host sends an opcode and its parameters in one SPI transaction framed by NSS, and the chip holds its BUSY line high while it is still processing, so the host waits for BUSY to fall before every command. Chapter 11 of the SX1261/2 datasheet (Rev 2.2) lists the commands and chapter 13 details them. This module carries them as data:
command- the opcodes and the bytes each command sends.irq- the interrupt bits of the IRQ register.status- the status byte, the device errors, the receive buffer, and the LoRa packet status, decoded with the datasheet’s formulas.config- the frequency word, timeouts, image calibration, the LoRa modulation and packet parameters aLinkSettingsturns into, the power amplifier settings, and the registers the chapter 15 workarounds touch.
The SX1261 has a low power amplifier for up to +15 dBm, and the SX1262 and the LLCC68
a high power one for up to +22 dBm; the SPI interface cannot tell them apart, so the
caller names the amplifier. With the embedded-hal feature, the Sx126x driver puts
the commands in the order chapter 14 gives for a transmission and a reception, with
the chapter 15 workarounds applied.
Modules§
- command
- The SX126x command set: opcodes and the bytes each command sends.
- config
- The settings an SX126x is configured with, and the values its registers take.
- irq
- The SX126x interrupt bits.
- status
- What an SX126x reports back: its status byte, its errors, and a received packet.
Structs§
- Board
- How a module wires its SX126x: the amplifier, the clock, the antenna switch, and the regulator.
- Radio
Config - What a radio sends and listens with: the carrier, the LoRa link, the power, and the sync word and IQ polarity that keep one network apart from another.
- Sx126x
- A Semtech SX1261, SX1262, or LLCC68 on an SPI bus, with its BUSY and NRESET lines.
Enums§
- Radio
Error - What can go wrong driving an SX126x.
- Reception
- How a reception ended.
Constants§
- BUSY_
LIMIT_ US - The longest BUSY may stay high before the driver gives up, in microseconds, on top of a TCXO’s settling time. The slowest transitions the datasheet gives, a cold start from sleep (Table 8-2) and a full calibration (section 13.1.12), each take 3.5 ms.
- BUSY_
POLL_ US - How often BUSY is sampled while the chip is busy, in microseconds.
- IRQ_
POLL_ US - How often the IRQ register is read while a transmission or a reception runs, in microseconds.
- RESET_
HOLD_ US - How long NRESET is held low, in microseconds. Section 8.1 needs typically 100 us; this is the 20 ms Semtech’s LoRaMac-node reference holds it for.
- RESET_
SETTLE_ US - How long the driver waits after releasing NRESET before it watches BUSY, in microseconds, the 10 ms LoRaMac-node waits.
- SLEEP_
ENTRY_ US - How long the driver leaves the chip alone after SetSleep, in microseconds: twice the “around 500 us” section 13.1.1 cautions it is unresponsive for.
- TIMEOUT_
MARGIN_ US - How much longer than a frame’s airtime the chip’s timeout, and then the driver’s own wait, may run before the frame is given up on, in microseconds.
- WAKE_
SETUP_ NS - The pause between NSS falling and the first clock edge when waking the chip from sleep, in nanoseconds: t10 of Table 8-1, 100 us.