radio: one LoRaRadio adapter over per-family ops tables; lr20xx cleanup

- LoRaRadioBase -> LoRaRadio (final); SX126x/SX127x/LR1110/LR2021Radio
  replaced by const LoRaRadioOps tables (radio_ops_<family>.cpp), one
  linked per build; mains construct the radio in one line
- lr20xx: vendored Semtech SDK + HAL moved beside the driver (no app-tree
  sources), DIO1 handler split (CCN 52 -> 10), zc_lora_timing.h adopted,
  dead exports removed, header rewritten, comment diet (image-identical)
- semtech,lr2021 uses the lr1110 property names (irq-gpios, tcxo-voltage,
  rfsw-*), compiled config byte-identical
- correct the stale "LR2021 is not CAD-probed" claim
This commit is contained in:
liquidraver committed 2026-09-23 19:51:08 +02:00
1 parent 0c485b2230
commit 10b36094ae
75 files changed
+1065 -2373

No files matched your search

+7 -7
View File
@@ -7,7 +7,7 @@
#include "observer_creds.h"
#include <mesh/Utils.h>
#include <adapters/radio/LoRaRadioBase.h>
#include <adapters/radio/LoRaRadio.h>
#include <adapters/rng/ZephyrRNG.h> /* generateFirstBootIdentity (hardened keygen) */
#include <helpers/MeshcoreJson.h>
@@ -147,10 +147,10 @@ void ObserverMesh::buildStatusJson(const char *status, char *out, size_t out_siz
uptime_secs,
0u, /* debug_flags */
0u, /* queue_len */
((LoRaRadioBase *)_radio)->getNoiseFloor(),
((LoRaRadio *)_radio)->getNoiseFloor(),
0u, /* tx_air_secs */
0u, /* rx_air_secs */
((LoRaRadioBase *)_radio)->getPacketsRecvErrors(),
((LoRaRadio *)_radio)->getPacketsRecvErrors(),
false, /* repeat: observer never forwards */
};
meshcore_build_status_json(out, out_size, &sj);
@@ -446,7 +446,7 @@ bool ObserverMesh::handleCLI(const char *command, char *reply, int reply_size)
if (f >= 300.0f && f <= 1000.0f) {
_prefs.freq = f;
_store->savePrefs(_prefs);
((LoRaRadioBase *)_radio)->reconfigure();
((LoRaRadio *)_radio)->reconfigure();
snprintf(reply, reply_size, "freq=%.3f MHz", (double)_prefs.freq);
} else {
snprintf(reply, reply_size, "ERR freq must be 300-1000 MHz");
@@ -457,7 +457,7 @@ bool ObserverMesh::handleCLI(const char *command, char *reply, int reply_size)
if (sf >= 7 && sf <= 12) {
_prefs.sf = (uint8_t)sf;
_store->savePrefs(_prefs);
((LoRaRadioBase *)_radio)->reconfigure();
((LoRaRadio *)_radio)->reconfigure();
snprintf(reply, reply_size, "sf=%u", _prefs.sf);
} else {
snprintf(reply, reply_size, "ERR sf must be 7-12");
@@ -481,7 +481,7 @@ bool ObserverMesh::handleCLI(const char *command, char *reply, int reply_size)
if (bw >= ZC_RADIO_BW_MIN_KHZ && bw <= ZC_RADIO_BW_MAX_KHZ) {
_prefs.bw = bw;
_store->savePrefs(_prefs);
((LoRaRadioBase *)_radio)->reconfigure();
((LoRaRadio *)_radio)->reconfigure();
snprintf(reply, reply_size, "bw=%.2f kHz", (double)_prefs.bw);
} else {
snprintf(reply, reply_size, "ERR bw must be 7-500 kHz (or index 0-5)");
@@ -492,7 +492,7 @@ bool ObserverMesh::handleCLI(const char *command, char *reply, int reply_size)
if (cr >= 5 && cr <= 8) {
_prefs.cr = (uint8_t)cr;
_store->savePrefs(_prefs);
((LoRaRadioBase *)_radio)->reconfigure();
((LoRaRadio *)_radio)->reconfigure();
snprintf(reply, reply_size, "cr=%u", _prefs.cr);
} else {
snprintf(reply, reply_size, "ERR cr must be 5-8");