feat: add shared GMSK radio profile helpers

Add a fixed 6-byte 100 kbps GMSK profile matching the health-band telemetry packet, plus FSK packet-status helpers for RSSI and error checks. Expose instantaneous RSSI reads for CCA and image calibration for 430-440 MHz GFSK bring-up.
This commit is contained in:
2026-05-19 12:20:49 +08:00
parent f01aed8a56
commit 41b4aed456
3 changed files with 73 additions and 0 deletions
+17
View File
@@ -569,6 +569,14 @@ expected<packet_status_t, error_code> LLCC68::get_packet_status() {
return ps;
}
expected<uint8_t, error_code> LLCC68::get_rssi_inst_x2_neg() {
uint8_t raw = 0;
auto r = read_stream(RADIOLIB_SX126X_CMD_GET_RSSI_INST,
std::span<uint8_t>{&raw, 1});
APP_RADIO_RETURN_ERR_IGNORE_PROC_ERR(r);
return raw;
}
expected<unit, error_code> LLCC68::reset() {
// Drive RESET low-high with delays per datasheet, then poll standby
if (not device_is_ready(config().reset_gpio.port)) {
@@ -899,6 +907,12 @@ expected<unit, error_code> LLCC68::set_gfsk_whitening_seed(uint16_t seed) {
std::span<const uint8_t>{&lsb, 1});
}
expected<unit, error_code> LLCC68::calibrate_image(uint8_t freq1,
uint8_t freq2) {
const uint8_t data[] = {freq1, freq2};
return write_stream(RADIOLIB_SX126X_CMD_CALIBRATE_IMAGE, data);
}
expected<unit, error_code> LLCC68::fix_inverted_iq(uint8_t iq_config) {
uint8_t iqCfg = 0;
auto r = read_register(RADIOLIB_SX126X_REG_IQ_CONFIG,
@@ -1202,6 +1216,9 @@ LLCC68::hal_gfsk_modem_init(gfsk_parameters_t params) {
APP_RADIO_RETURN_ERR_CTX(set_packet_type_gfsk(),
"gfsk_init::set_packet_type");
APP_RADIO_RETURN_ERR_CTX(calibrate_image(RADIOLIB_SX126X_CAL_IMG_430_MHZ_1,
RADIOLIB_SX126X_CAL_IMG_430_MHZ_2),
"gfsk_init::calibrate_image");
APP_RADIO_RETURN_ERR_CTX(set_gfsk_modulation_params(params.mod_params),
"gfsk_init::set_modulation_params");
APP_RADIO_RETURN_ERR_CTX(