@@ -20,13 +20,29 @@ void RAK3401Board::begin() {
2020
2121 Wire.begin ();
2222
23+ // PIN_3V3_EN (WB_IO2, P0.34) controls the 3V3_S switched peripheral rail
24+ // AND the 5V boost regulator (U5) on the RAK13302 that powers the SKY66122 PA.
25+ // Must stay HIGH during radio operation — do not toggle for power saving.
2326 pinMode (PIN_3V3_EN , OUTPUT );
2427 digitalWrite (PIN_3V3_EN , HIGH );
2528
26- #ifdef P_LORA_PA_EN
27- // Initialize RAK13302 1W LoRa transceiver module PA control pin
28- pinMode (P_LORA_PA_EN , OUTPUT );
29- digitalWrite (P_LORA_PA_EN , LOW ); // Start with PA disabled
30- delay (10 ); // Allow PA module to initialize
29+ // Enable SKY66122-11 FEM on the RAK13302 module.
30+ // CSD and CPS are tied together on the RAK13302 PCB, routed to IO3 (P0.21).
31+ // HIGH = FEM active (LNA for RX, PA path available for TX).
32+ // TX/RX switching (CTX) is handled by SX1262 DIO2 via SetDIO2AsRfSwitchCtrl.
33+ pinMode (SX126X_POWER_EN , OUTPUT );
34+ digitalWrite (SX126X_POWER_EN , HIGH );
35+ delay (1 ); // SKY66122 turn-on settling time (tON = 3us typ)
36+ }
37+
38+ #ifdef NRF52_POWER_MANAGEMENT
39+ void RAK3401Board::initiateShutdown (uint8_t reason) {
40+ // Disable SKY66122 FEM (CSD+CPS LOW = shutdown, <1 uA)
41+ digitalWrite (SX126X_POWER_EN , LOW );
42+
43+ // Disable 3V3 switched peripherals and 5V boost
44+ digitalWrite (PIN_3V3_EN , LOW );
45+
46+ enterSystemOff (reason);
47+ }
3148#endif
32- }
0 commit comments