Файли
Valentin V. Bartenev 1817248d97 Add LoRa FEM RX-path LNA control via CLI; restore enabled default
Ported from meshcore-dev/MeshCore#2140 (Quency-D <hj_zzns@163.com>).

The upstream v1.16.0 merge changed the Heltec FEM LNA to disabled by
default (upstream commit 696aae6e).  This patch restores the enabled
default for repeater via the new "radio.fem.rxgain" preference
(defaulted to 1), while also making the setting user-configurable
and persisted across reboots.
2026-06-07 15:36:19 +03:00

31 рядки
787 B
C++

#pragma once
#include <stdint.h>
typedef enum {
GC1109_PA,
KCT8103L_PA,
OTHER_FEM_TYPES
} LoRaFEMType;
class LoRaFEMControl
{
public:
LoRaFEMControl(){ }
virtual ~LoRaFEMControl(){ }
void init(void);
void setSleepModeEnable(void);
void setTxModeEnable(void);
void setRxModeEnable(void);
void setRxModeEnableWhenMCUSleep(void);
void setLNAEnable(bool enabled);
bool isLnaCanControl(void) const { return lna_can_control; }
void setLnaCanControl(bool can_control) { lna_can_control = can_control; }
bool isLNAEnabled(void) const { return lna_enabled; }
LoRaFEMType getFEMType(void) const { return fem_type; }
private:
LoRaFEMType fem_type=OTHER_FEM_TYPES;
bool lna_enabled=false;
bool lna_can_control=false;
};