Fix pin mapping & TX switch (it's DIO2)

This commit is contained in:
Wessel Nieboer
2026-02-27 11:30:46 +01:00
parent 5a5568ed56
commit 49d8313501
3 changed files with 22 additions and 39 deletions

View File

@@ -147,14 +147,15 @@ static const uint8_t AREF = PIN_AREF;
#define SX126X_BUSY (9)
#define SX126X_RESET (4)
// SKY66122-11 FEM control pins (active HIGH, active LOW = shutdown <1uA)
// CSD+CPS must be HIGH for TX and RX; CTX selects TX(HIGH) vs RX(LOW)
// CTX also enables the 5V boost converter for the PA during TX
#define P_LORA_PA_CSD (24) // P0.24 -> SKY66122 CSD (pin 11) - FEM enable
#define SX126X_POWER_EN (21) // P0.21 -> SKY66122 CPS (pin 1) - path select
#define P_LORA_PA_EN (31) // P0.31 -> SKY66122 CTX (pin 2) - TX/RX + boost EN
// SKY66122-11 FEM control on the RAK13302 module:
// CSD + CPS are tied together on the PCB, routed to WisBlock IO3 (P0.21).
// Setting IO3 HIGH enables the FEM (LNA for RX, PA path for TX).
// CTX is connected to SX1262 DIO2 — the radio handles TX/RX switching
// in hardware via SetDIO2AsRfSwitchCtrl (microsecond-accurate, no GPIO needed).
// The 5V boost for the PA is enabled by WB_IO2 (P0.34 = PIN_3V3_EN).
#define SX126X_POWER_EN (21) // P0.21 = IO3 -> SKY66122 CSD+CPS (FEM enable)
// DIO2 has a NC 0R footprint (R25) to CTX; not connected by default
// CTX is driven by SX1262 DIO2, not a GPIO
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_DIO3_TCXO_VOLTAGE 1.8