pamoja_radios/sx127x.rs
1//! Semtech SX1276, SX1277, SX1278, and SX1279 transceivers, and the modules built on them
2//! such as the RFM95W.
3//!
4//! These radios are run through registers. The host writes the carrier, the modem, and the
5//! amplifier settings into them, fills the data buffer through RegFifo, and sets the
6//! operating mode in RegOpMode to transmit or receive, and RegIrqFlags reports how it went.
7//! The SX1276/77/78/79 datasheet (Rev 7) describes the registers, and this module carries
8//! them as data:
9//!
10//! - [`register`] - the register addresses, the SPI address byte, and the operating modes.
11//! - [`irq`] - the LoRa interrupt flags.
12//! - [`status`] - the signal levels of a received packet and the modem's live state.
13//! - [`config`] - the frequency word, the LoRa modem settings a
14//! [`LinkSettings`](pamoja_lora::LinkSettings) turns into, the amplifier and current limit
15//! settings, the sync word, the IQ polarity, and the register values of the errata.
16//!
17//! The four chips share their registers and differ in the bands they cover, and the SPI
18//! interface cannot see which amplifier output a module wires to its antenna, so the caller
19//! names it. With the `embedded-hal` feature, the [`Sx127x`] driver resets the chip,
20//! calibrates its receiver at the carrier, and follows the datasheet's transmit and receive
21//! sequences.
22
23pub mod config;
24pub mod irq;
25pub mod register;
26pub mod status;
27
28#[cfg(feature = "embedded-hal")]
29mod driver;
30
31#[cfg(feature = "embedded-hal")]
32pub use driver::{
33 Board, RadioConfig, RadioError, Reception, Sx127x, CALIBRATION_LIMIT_US, CALIBRATION_POLL_US,
34 IRQ_POLL_US, RESET_HOLD_US, RESET_SETTLE_US, TIMEOUT_MARGIN_US,
35};