Files
heltec-repeater/firmware/main/board.h
T

52 lines
2.0 KiB
C

// Heltec WiFi LoRa 32 V4.3 (HTIT-WB32LAF) board definition.
//
// Sources:
// - Heltec wiki "WiFi LoRa 32 V4" product page (USE_KCT8103L_PA for V4.3)
// - Heltec schematic HTIT-WB32LAF_V4.3.pdf
// - RNode_Firmware 1.86 / RTNode-HeltecV4 Boards.h + sx126x.cpp
// (experimentally proven working configuration for this exact board)
//
// See docs/HARDWARE.md for the full evidence trail.
#pragma once
// SX1262 SPI + control
#define BOARD_LORA_NSS 8
#define BOARD_LORA_SCK 9
#define BOARD_LORA_MOSI 10
#define BOARD_LORA_MISO 11
#define BOARD_LORA_RESET 12
#define BOARD_LORA_BUSY 13
#define BOARD_LORA_DIO1 14
// KCT8103L RF front-end (V4.3)
// PWR_EN : FEM supply enable, drive HIGH
// CSD : chip enable, drive HIGH (has internal pull-up on KCT8103L,
// which is how RNode 1.86 auto-detects V4.3 vs V4.2/GC1109)
// CTX : path select, LOW = RX/LNA, HIGH = TX/PA
// CPS : wired to SX1262 DIO2 (DIO2-as-RF-switch must be enabled)
#define BOARD_FEM_PWR_EN 7
#define BOARD_FEM_CSD 2
#define BOARD_FEM_CTX 5
// SX1262 TCXO: DIO3-controlled, 1.8 V (RNode 1.86 value for this board)
#define BOARD_TCXO_VOLTAGE_CODE 0x02 // MODE_TCXO_1_8V
#define BOARD_TCXO_DELAY_STEPS 0xFF // x 15.625 us ~= 4 ms
// Status LED (white, per RNode 1.86 pin_led_rx/tx for this board)
#define BOARD_LED 35
// Overcurrent protection value from RNode 1.86 ("OCP_TUNED 0x28")
#define BOARD_SX1262_OCP 0x28
// SSD1306 OLED (128x64, I2C 0x3C) + PRG button.
// Pins verified against RTNode-HeltecV4 Display.h / Boards.h for this exact
// board revision (docs/FUTURE_UI.md). Vext is an ACTIVE-LOW external rail
// that powers the display; set once at boot, never toggled mid-TX.
#define BOARD_OLED_SDA 17
#define BOARD_OLED_SCL 18
#define BOARD_OLED_RST 21
#define BOARD_VEXT 36
// GPIO0 is the BOOT strap pin: input only, sampled well after boot,
// debounced. No boot-time gestures (docs/FUTURE_UI.md constraint 3).
#define BOARD_BTN_PRG 0