feat: per-board TX power range, TX_POWER_MAX sentinel (-128)

- Each board exports TX_POWER_RANGE constant (min, max dBm)
- RadioConfig::validate() uses the board's range, not hardcoded limits
- TX_POWER_MAX sentinel (-128 on the wire) means "use board's maximum"
  — resolved to the actual max before storing config
- GetConfig returns the resolved actual power, not the sentinel
- Default configs in examples use TX_POWER_MAX
- Protocol docs updated
This commit is contained in:
swaits committed 2026-03-29 20:42:58 -06:00
1 parent 0b4eb04591
commit ebe9197d04
8 files changed
+46 -14

No files matched your search

+3
View File
@@ -25,6 +25,9 @@ pub type UsbDriver = esp_hal::otg_fs::asynch::Driver<'static>;
pub type DisplayI2c = I2c<'static, esp_hal::Async>;
/// TX power range for this board's radio (SX1262).
pub const TX_POWER_RANGE: (i8, i8) = (-9, 22);
// ── Peripheral bundles ───────────────────────────────────────────────
pub struct RadioParts {
+3
View File
@@ -25,6 +25,9 @@ pub type UsbDriver = esp_hal::otg_fs::asynch::Driver<'static>;
pub type DisplayI2c = I2c<'static, esp_hal::Async>;
/// TX power range for this board's radio (SX1262).
pub const TX_POWER_RANGE: (i8, i8) = (-9, 22);
// ── Peripheral bundles ───────────────────────────────────────────────
pub struct RadioParts {
+3
View File
@@ -33,6 +33,9 @@ pub type UsbDriver = Driver<'static, USBD, &'static embassy_nrf::usb::vbus_detec
/// I2C bus for an optional SSD1306 OLED.
pub type DisplayI2c = Twim<'static, embassy_nrf::peripherals::TWISPI0>;
/// TX power range for this board's radio (SX1262).
pub const TX_POWER_RANGE: (i8, i8) = (-9, 22);
// ── Peripheral bundles ───────────────────────────────────────────────
pub struct RadioParts {