Files
MeshCore/variants/heltec_v4_r8/LoRaFEMControl.h
agessaman 720f0f1528 kiss_modem: reach FEM gain through the board's radio.fem CLI commands
Boards own their FEM control through handleCommand() ("get/set
radio.fem.rxgain|txgain"). Use that instead of a parallel set of FEM
virtuals on MainBoard, so any board that implements the commands works
in KISS with no extra code.

- Remove the six FEM virtuals from MainBoard and the board overrides.
- KissModem talks to the board in one adapter. A gain counts as
  controllable only if "get" replies exactly "> on" or "> off". "set"
  is checked by reading the state back, never by its reply wording.
- SetFemState always replies with the read-back state once the
  requested bits pass the capability check.
- Guard the boards' prefs writes against a NULL store. KISS attaches
  no prefs, so "set radio.fem.*" would dereference NULL.
- Wio Tracker L1 1W TX gain is exposed again, matching its CLI.
2026-09-23 17:31:20 -07:00

26 lines
603 B
C++

#pragma once
typedef enum {
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) { return true; }
void setLnaCanControl(bool can_control) { }
bool isLNAEnabled(void) const { return lna_enabled; }
LoRaFEMType getFEMType(void) const { return KCT8103L_PA; }
private:
bool lna_enabled = false;
};