Rak3112 support (#8591)

* Add rak3112 to board variants

* Add rak3112 to architecture definitions

* Disable SDcard support

* Update comments

* Remove duplicate definitions and use expected SPI naming for SDcard module

* SDcard module serial interface chip set definition

* Refactor modular variant into existing environment

* Make requested changes

* Extend 3312 variants

* Remove duplicate architecture definition

* Fix definition naming
This commit is contained in:
Ford Jones
2026-01-01 14:23:24 +13:00
committed by GitHub
parent 25acce2a8d
commit 4f1a56d480
3 changed files with 85 additions and 8 deletions

View File

@@ -17,6 +17,8 @@ static const uint8_t MOSI = 11;
static const uint8_t MISO = 10;
static const uint8_t SCK = 13;
#define SPI_INTERFACES_COUNT 1
#define SPI_MOSI (11)
#define SPI_SCK (13)
#define SPI_MISO (10)
@@ -25,4 +27,51 @@ static const uint8_t SCK = 13;
// LEDs
#define LED_BUILTIN LED_GREEN
#ifdef _VARIANT_RAK3112_
/*
* Serial interfaces
*/
// TXD1 RXD1 on Base Board
#define PIN_SERIAL1_RX (44)
#define PIN_SERIAL1_TX (43)
/*
* Internal SPI to LoRa transceiver
*/
#define LORA_SX126X_SCK 5
#define LORA_SX126X_MISO 3
#define LORA_SX126X_MOSI 6
/*
* Analog pins
*/
#define PIN_A0 (21)
#define PIN_A1 (14)
/*
* Wire Interfaces
*/
#define WIRE_INTERFACES_COUNT 2
#define PIN_WIRE1_SDA (17)
#define PIN_WIRE1_SCL (18)
/*
* GPIO's
*/
#define WB_IO1 21
#define WB_IO2 2
// #define WB_IO2 14
#define WB_IO3 41
#define WB_IO4 42
#define WB_IO5 38
#define WB_IO6 39
// #define WB_SW1 35 NC
#define WB_A0 1
#define WB_A1 2
#define WB_CS 12
#define WB_LED1 46
#define WB_LED2 45
#endif
#endif /* Pins_Arduino_h */

View File

@@ -9,3 +9,16 @@ build_flags =
${esp32s3_base.build_flags}
-D RAK3312
-I variants/esp32s3/rak3312
[env:rak3112]
extends = esp32s3_base
board = wiscore_rak3312
board_level = pr
board_check = true
upload_protocol = esptool
build_flags =
${esp32_base.build_flags}
-D RAK3312
-D _VARIANT_RAK3112_
-I variants/esp32s3/rak3312

View File

@@ -18,11 +18,6 @@
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
#endif
#define SX126X_POWER_EN (4)
#define PIN_POWER_EN PIN_3V3_EN
#define PIN_3V3_EN (14)
#define LED_GREEN 46
#define LED_BLUE 45
@@ -35,10 +30,30 @@
#define LED_STATE_ON 1 // State when LED is litted
#define BATTERY_PIN 1
#define ADC_CHANNEL ADC1_GPIO1_CHANNEL
#ifdef _VARIANT_RAK3112_ // Modular variant (stamp)
#define ADC_MULTIPLIER 2.11
#define BUTTON_NEED_PULLUP
#define HAS_SDCARD
#define SDCARD_USE_SPI1
#define SDCARD_CS SPI_CS
#define I2C_SDA1 PIN_WIRE1_SDA
#define I2C_SCL1 PIN_WIRE1_SCL
#else // Generic 3312 variant (40-pin standard connector)
#define ADC_MULTIPLIER 1.667
#define SX126X_POWER_EN (4)
#define PIN_POWER_EN PIN_3V3_EN
#define PIN_3V3_EN (14)
#define HAS_GPS 1
#define GPS_TX_PIN 43
#define GPS_RX_PIN 44
#define BATTERY_PIN 1
#define ADC_CHANNEL ADC1_GPIO1_CHANNEL
#define ADC_MULTIPLIER 1.667
#endif