Transparent LoRa-over-USB dongle firmware supporting Heltec V3 (ESP32-S3) and RAK 4631 (nRF52840) boards. Actor-model architecture with typed channels between USB, radio, and display tasks. - Protocol: Command/Response enums with COBS+postcard framing design - Board abstraction: auto-discovered via build.rs Jinja2 codegen - Radio task: SX1262 state machine (Idle → Receiving ↔ Transmitting) - Display task: optional SSD1306 dashboard via StatusWatch - RAK 4631: fully wired SPI/USB/I2C peripherals, clippy-clean - Heltec V3: structure in place, awaits espup Xtensa toolchain
26 lines
805 B
Rust
26 lines
805 B
Rust
use crate::channel::{RadioState, RadioStatus};
|
|
|
|
/// Render the status dashboard to a framebuffer.
|
|
///
|
|
/// Pure logic — no hardware dependency. Takes a status snapshot and produces
|
|
/// draw calls that the display task flushes to the screen.
|
|
pub fn dashboard(status: &RadioStatus) {
|
|
// TODO: use embedded-graphics to render:
|
|
// Line 1: board name + radio state
|
|
// Line 2: freq / BW / SF
|
|
// Line 3: TX power / coding rate
|
|
// Line 4: RX count / TX count
|
|
// Line 5: last RSSI / SNR
|
|
let _ = status;
|
|
}
|
|
|
|
/// Format radio state as a short display string.
|
|
#[allow(dead_code)]
|
|
pub fn state_label(state: RadioState) -> &'static str {
|
|
match state {
|
|
RadioState::Idle => "IDLE",
|
|
RadioState::Receiving => "RX",
|
|
RadioState::Transmitting => "TX",
|
|
}
|
|
}
|