稳定版代码

Signed-off-by: 吴文峰 <kevin@lmve.net>
This commit is contained in:
2026-03-06 19:52:05 +08:00
parent 79d721d417
commit 26d5971aba
1533 changed files with 256309 additions and 0 deletions
@@ -0,0 +1,18 @@
[env:betafpv_2400_tx_micro]
extends = esp32_base
board = esp32doit-devkit-v1
board_level = extra
build_flags =
${esp32_base.build_flags}
-D BETAFPV_2400_TX
-D VTABLES_IN_FLASH=1
-D CONFIG_DISABLE_HAL_LOCKS=1
-O2
-I variants/esp32/betafpv_2400_tx_micro
board_build.f_cpu = 240000000L
upload_protocol = esptool
;upload_port = /dev/ttyUSB0
upload_speed = 460800
lib_deps =
${esp32_base.lib_deps}
adafruit/Adafruit NeoPixel @ ^1.12.0
@@ -0,0 +1,37 @@
// https://betafpv.com/products/elrs-micro-tx-module
// 0.96" OLED
#define I2C_SDA 22
#define I2C_SCL 32
// NO GPS
#undef GPS_RX_PIN
#undef GPS_TX_PIN
#define LORA_SCK 18
#define LORA_MISO 19
#define LORA_MOSI 23
#define LORA_CS 5
#define RF95_FAN_EN 17
// #define LED_PIN 16 // This is a LED_WS2812 not a standard LED
#define HAS_NEOPIXEL // Enable the use of neopixels
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
#define NEOPIXEL_DATA 16 // gpio pin used to send data to the neopixels
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use
#define BUTTON_PIN 25
#define BUTTON_NEED_PULLUP
#undef EXT_NOTIFY_OUT
// SX128X 2.4 Ghz LoRa module
#define USE_SX1280
#define LORA_RESET 14
#define SX128X_CS 5
#define SX128X_DIO1 4
#define SX128X_BUSY 21
#define SX128X_TXEN 26
#define SX128X_RXEN 27
#define SX128X_RESET LORA_RESET
#define SX128X_MAX_POWER 3
@@ -0,0 +1,17 @@
[env:betafpv_900_tx_nano]
extends = esp32_base
board = esp32doit-devkit-v1
board_level = extra
build_flags =
${esp32_base.build_flags}
-D BETAFPV_900_TX_NANO
-D VTABLES_IN_FLASH=1
-D CONFIG_DISABLE_HAL_LOCKS=1
-O2
-I variants/esp32/betafpv_900_tx_nano
board_build.f_cpu = 240000000L
upload_protocol = esptool
;upload_port = /dev/ttyUSB0
upload_speed = 460800
lib_deps =
${esp32_base.lib_deps}
@@ -0,0 +1,28 @@
// https://betafpv.com/products/elrs-nano-tx-module
// no screen
#define HAS_SCREEN 0
// NO GPS
#undef GPS_RX_PIN
#undef GPS_TX_PIN
#define USE_RF95
#define LORA_SCK 18
#define LORA_MISO 19
#define LORA_MOSI 23
#define LORA_CS 5
#define LORA_DIO0 4
#define LORA_RESET 14
#define LORA_DIO1 2
#define LORA_DIO2
#define LORA_DIO3
#define LED_PIN 16 // green - blue is at 17
#define BUTTON_PIN 25
#define BUTTON_NEED_PULLUP
#undef EXT_NOTIFY_OUT
@@ -0,0 +1,12 @@
; CircuitMess Chatter 2 based on ESP32-WROOM-32 (38 pins) devkit & DeeamLNK DL-LLCC68 or Heltec HT RA62 SX1262/SX1268 module
[env:chatter2]
extends = esp32_base
board = esp32doit-devkit-v1
build_flags =
${esp32_base.build_flags}
-D CHATTER_2
-I variants/esp32/chatter2
lib_deps =
${esp32_base.lib_deps}
lovyan03/LovyanGFX@^1.2.0
@@ -0,0 +1,124 @@
//////////////////////////////////////////////////////////////////////////////////
// //
// Have custom connections or functionality? Configure them in this section //
// //
//////////////////////////////////////////////////////////////////////////////////
// Debugging
// #define GPS_DEBUG
// Lora
#define USE_LLCC68 // Original Chatter2 with LLCC68 module
#define USE_SX1262 // Added for when Lora module is swapped for HT-RA62
#define SX126X_CS 14 // module's NSS pin
#define LORA_SCK 16 // module's SCK pin
#define LORA_MOSI 5 // module's MOSI pin
#define LORA_MISO 17 // module's MISO pin
#define SX126X_RESET RADIOLIB_NC // module's NRST pin
#define SX126X_BUSY 4 // module's BUSY pin works for both LLCC68 and RA-62 with cut & jumper
#define SX126X_DIO1 18 // module's DIO1 pin
#define SX126X_DIO2_AS_RF_SWITCH // module's DIO2 pin
#define SX126X_DIO3_TCXO_VOLTAGE 1.8 // module's DIO pin
#define SX126X_TXEN RADIOLIB_NC
#define SX126X_RXEN RADIOLIB_NC
// Status
// #define LED_PIN 1
// External notification
// FIXME: Check if EXT_NOTIFY_OUT actualy has any effect and removes the need for setting the external notication pin in the
// app/preferences
// #define EXT_NOTIFY_OUT 2 // The GPIO pin that acts as the external notification output (here we connect an LED to it)
// Buzzer
#define PIN_BUZZER 19
// Buttons
// #define BUTTON_PIN 36 // Use the WAKE button as the user button
// I2C
// #define I2C_SCL 27
// #define I2C_SDA 26
#define SX126X_MAX_POWER 22 // SX126xInterface.cpp defaults to 22 if not defined, but here we define it for good practice
// Display
#define HAS_SCREEN 1 // Assume no screen present by default to prevent crash...
// ST7735S TFT LCD
#define ST7735S 1 // there are different (sub-)versions of ST7735
#define ST7735_CS -1
#define ST7735_RS 33 // DC
#define ST7735_SDA 26 // MOSI
#define ST7735_SCK 27
#define ST7735_RESET 15
#define ST7735_MISO -1
#define ST7735_BUSY -1
#define TFT_BL 32
#define ST7735_SPI_HOST HSPI_HOST // SPI2_HOST for S3, auto may work too
#define SPI_FREQUENCY 40000000
#define SPI_READ_FREQUENCY 16000000
#define TFT_HEIGHT 160
#define TFT_WIDTH 128
#define TFT_OFFSET_X 0
#define TFT_OFFSET_Y 0
#define TFT_INVERT false
#define SCREEN_ROTATE
#define SCREEN_TRANSITION_FRAMERATE 5 // fps
#define DISPLAY_FORCE_SMALL_FONTS
#define TFT_BACKLIGHT_ON LOW
// Battery
#define BATTERY_PIN 34 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
#define ADC_CHANNEL ADC1_GPIO34_CHANNEL
#define ADC_ATTENUATION \
ADC_ATTEN_DB_2_5 // 2_5-> 100mv-1250mv, 11-> 150mv-3100mv for ESP32
// ESP32-S2/C3/S3 are different
// lower dB for lower voltage rnage
#define ADC_MULTIPLIER 5.0 // VBATT---10k--pin34---2.5K---GND
// Chatter2 uses 3 AAA cells
#define CELL_TYPE_ALKALINE
#define NUM_CELLS 3
#undef EXT_PWR_DETECT
// GPS
// FIXME: unsure what to define HAS_GPS as if GPS isn't always present
#define HAS_GPS 1 // Don't need to set this to 0 to prevent a crash as it doesn't crash if GPS not found, will probe by default
// #define PIN_GPS_EN 15
// #define GPS_EN_ACTIVE 1
#undef GPS_TX_PIN
#undef GPS_RX_PIN
#define GPS_TX_PIN 13
#define GPS_RX_PIN 2
// keyboard
#define INPUTBROKER_SERIAL_TYPE 1
#define KB_LOAD 21 // load values from the switch and store in shift register
#define KB_CLK 22 // clock pin for serial data out
#define KB_DATA 23 // data pin
#define CANNED_MESSAGE_MODULE_ENABLE 1
/////////////////////////////////////////////////////////////////////////////////
// //
// You should have no need to modify the code below, nor in pins_arduino.h //
// //
/////////////////////////////////////////////////////////////////////////////////
#define LORA_CS SX126X_CS // FIXME: for some reason both are used in /src
// Many of the below values would only be used if USE_RF95 was defined, but it's not as we aren't actually using an RF95, just
// that the 4 pins above are named like it If they aren't used they don't need to be defined and doing so cause confusion to those
// adapting this file LORA_RESET value is never used in src (as we are not using RF95), so no need to define LORA_DIO0 is not used
// in src (as we are not using RF95) as SX1262 does not have it per SX1262 datasheet, so no need to define
// FIXME: confirm that the linked lines below are actually only called when using the SX126x or SX128x and no other modules
// then use SX126X_DIO1 and SX128X_DIO1 respectively for that purpose, removing the need for RF95-style LORA_* definitions when
// the RF95 isn't used
#define LORA_DIO1 \
SX126X_DIO1 // The old name is used in
// https://github.com/meshtastic/firmware/blob/7eff5e7bcb2084499b723c5e3846c15ee089e36d/src/sleep.cpp#L298, so
// must also define the old name
// LORA_DIO2 value is never used in src (as we are not using RF95), so no need to define, and if DIO2_AS_RF_SWITCH is set then it
// cannot serve any extra function even if requested to LORA_DIO3 value is never used in src (as we are not using RF95), so no
// need to define, and DIO3_AS_TCXO_AT_1V8 is set so it cannot serve any extra function even if requested to (from 13.3.2.1
// DioxMask in SX1262 datasheet: Note that if DIO2 or DIO3 are used to control the RF Switch or the TCXO, the IRQ will not be
// generated even if it is mapped to the pins.)
@@ -0,0 +1,12 @@
; 9M2IBR APRS LoRa Tracker: ESP32-WROOM-32 + EBYTE E22-400M30S
; https://shopee.com.my/product/1095224/21692283917
[env:9m2ibr_aprs_lora_tracker]
extends = esp32_base
board = esp32doit-devkit-v1
board_level = extra
build_flags =
${esp32_base.build_flags}
-D PRIVATE_HW
-D EBYTE_E22
-D EBYTE_E22_900M30S ; Assume Tx power curve is identical to 900M30S as there is no documentation
-I variants/esp32/diy/9m2ibr_aprs_lora_tracker
@@ -0,0 +1,74 @@
/*
9M2IBR APRS LoRa Tracker: ESP32-WROOM-32 + EBYTE E22-400M30S
https://shopee.com.my/product/1095224/21692283917
Originally developed for LoRa_APRS_iGate and GPIO is similar to
https://github.com/richonguzman/LoRa_APRS_iGate/blob/main/variants/ESP32_DIY_1W_LoRa_Mesh_V1_2/board_pinout.h
*/
// OLED (may be different controllers depending on screen size)
#define I2C_SDA 21
#define I2C_SCL 22
#define HAS_SCREEN 1 // Generates randomized BLE pin
// GNSS: Ai-Thinker GP-02 BDS/GNSS module
#define GPS_RX_PIN 16
#define GPS_TX_PIN 17
// Button
#define BUTTON_PIN 15 // Right side button - if not available, set device.button_gpio to 0 from Meshtastic client
// LEDs
#define LED_PIN 13 // Tx LED
#define USER_LED 2 // Rx LED
// Buzzer
#define PIN_BUZZER 33
// Battery sense
#define BATTERY_PIN 35
#define ADC_MULTIPLIER 2.01 // 100k + 100k, and add 1% tolerance
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
#define BATTERY_SENSE_RESOLUTION_BITS ADC_RESOLUTION
// SPI
#define LORA_SCK 18
#define LORA_MISO 19
#define LORA_MOSI 23
// LoRa
#define LORA_CS 5
#define LORA_DIO0 26 // a No connect on the SX1262/SX1268 module
#define LORA_RESET 27 // RST for SX1276, and for SX1262/SX1268
#define LORA_DIO1 12 // IRQ for SX1262/SX1268
#define LORA_DIO2 RADIOLIB_NC // BUSY for SX1262/SX1268
#define LORA_DIO3 // NC, but used as TCXO supply by E22 module
#define LORA_RXEN 32 // RF switch RX (and E22 LNA) control by ESP32 GPIO
#define LORA_TXEN 25 // RF switch TX (and E22 PA) control by ESP32 GPIO
// RX/TX for RFM95/SX127x
#define RF95_RXEN LORA_RXEN
#define RF95_TXEN LORA_TXEN
// #define RF95_TCXO <GPIO#>
// common pinouts for SX126X modules
#define SX126X_CS 5
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_DIO2
#define SX126X_RESET LORA_RESET
#define SX126X_RXEN LORA_RXEN
#define SX126X_TXEN LORA_TXEN
// Support alternative modules if soldered in place of E22
#define USE_RF95 // RFM95/SX127x
#define USE_SX1262
#define USE_SX1268
#define USE_LLCC68
// E22 TCXO support
#ifdef EBYTE_E22
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
#define TCXO_OPTIONAL // make it so that the firmware can try both TCXO and XTAL
#endif
@@ -0,0 +1,11 @@
; Port to Disaster Radio's ESP32-v3 Dev Board
[env:meshtastic-dr-dev]
extends = esp32_base
board = esp32doit-devkit-v1
board_upload.maximum_size = 4194304
board_upload.maximum_ram_size = 532480
build_flags =
${esp32_base.build_flags}
-D DR_DEV
-D EBYTE_E22
-I variants/esp32/diy/dr-dev
@@ -0,0 +1,76 @@
// Initialize i2c bus on sd_dat and esp_led pins, respectively. We need a bus to not hang on boot
#define HAS_SCREEN 0
#define I2C_SDA 4
#define I2C_SCL 5
#define BATTERY_PIN 34
#define ADC_CHANNEL ADC1_GPIO34_CHANNEL
// GPS
#undef GPS_RX_PIN
#define GPS_RX_PIN NOT_A_PIN
#define HAS_GPS 0
#define BUTTON_PIN 13 // The middle button GPIO on the T-Beam
#define BUTTON_NEED_PULLUP
#define EXT_NOTIFY_OUT 12 // Overridden default pin to use for Ext Notify Module (#975).
#define LORA_DIO0 NOT_A_PIN // a No connect on the SX1262/SX1268 module
#define LORA_RESET NOT_A_PIN // RST for SX1276, and for SX1262/SX1268
#define LORA_DIO3 NOT_A_PIN // Not connected on PCB, but internally on the SX1262/SX1268, if DIO3 is high the TXCO is enabled
// In transmitting, set TXEN as high communication levelRXEN pin is low level;
// In receiving, set RXEN as high communication level, TXEN is lowlevel;
// Before powering off, set TXEN、RXEN as low level.
#undef LORA_SCK
#define LORA_SCK 18
#undef LORA_MISO
#define LORA_MISO 19
#undef LORA_MOSI
#define LORA_MOSI 23
// PINS FOR THE 900M22S
#define LORA_DIO1 26 // IRQ for SX1262/SX1268
#define LORA_DIO2 22 // BUSY for SX1262/SX1268
// NOT_A_PIN is treated as RADIOLIB_NC due to how they are defined, best to use RADIOLIB_NC directly
#define LORA_TXEN RADIOLIB_NC // Input - RF switch TX control, connecting external MCU IO or DIO2, valid in high level
// E22_TXEN_CONNECTED_TO_DIO2 wasn't defined, so RXEN wasn't controlled. Commented it out to maintain behavior, but shouldn't be.
// Need to comment out defining SX126X_RXEN as LORA_RXEN too
// #define LORA_RXEN 17 // Input - RF switch RX control, connecting external MCU IO, valid in high level
#undef LORA_CS
#define LORA_CS 16
#define SX126X_BUSY 22
#define SX126X_CS 16
// PINS FOR THE 900M30S
/*
#define LORA_DIO1 27 // IRQ for SX1262/SX1268
#define LORA_DIO2 35 // BUSY for SX1262/SX1268
#define LORA_TXEN NOT_A_PIN // Input - RF switch TX control, connecting external MCU IO or DIO2, valid in high level
#define LORA_RXEN 21 // Input - RF switch RX control, connecting external MCU IO, valid in high level
#undef LORA_CS
#define LORA_CS 33
#define SX126X_BUSY 35
#define SX126X_CS 33
*/
// RX/TX for RFM95/SX127x
// #define RF95_RXEN LORA_RXEN
#define RF95_TXEN LORA_TXEN
// #define RF95_TCXO <GPIO#>
// common pinouts for SX126X modules
#define SX126X_DIO1 LORA_DIO1
#define SX126X_RESET LORA_RESET
// #define SX126X_RXEN LORA_RXEN
#define SX126X_TXEN LORA_TXEN
// supported modules list
// #define USE_RF95 // RFM95/SX127x
#define USE_SX1262
// #define USE_SX1268
// #define USE_LLCC68
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
@@ -0,0 +1,8 @@
; Hydra - Meshtastic DIY v1 hardware with some specific changes
[env:hydra]
extends = esp32_base
board = esp32doit-devkit-v1
build_flags =
${esp32_base.build_flags}
-D DIY_V1
-I variants/esp32/diy/hydra
@@ -0,0 +1,46 @@
// For OLED LCD
#define I2C_SDA 21
#define I2C_SCL 22
// For GPS, 'undef's not needed
#define GPS_TX_PIN 15
#define GPS_RX_PIN 12
#define PIN_GPS_EN 4
#define BUTTON_PIN 39 // The middle button GPIO on the T-Beam
// Note: On the ESP32 base version, gpio34-39 are input-only, and do not have internal pull-ups.
// If 39 is not being used for a button, it is suggested to remove the #define.
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
#define ADC_MULTIPLIER 1.85 // (R1 = 470k, R2 = 680k)
#define EXT_PWR_DETECT 4 // Pin to detect connected external power source for LILYGO® TTGO T-Energy T18 and other DIY boards
#define EXT_NOTIFY_OUT 12 // Overridden default pin to use for Ext Notify Module (#975).
#define LED_PIN 2 // add status LED (compatible with core-pcb and DIY targets)
// Radio
#define USE_SX1262 // E22-900M30S uses SX1262
#define USE_SX1268 // E22-400M30S uses SX1268
#define SX126X_MAX_POWER \
22 // Outputting 22dBm from SX1262 results in ~30dBm E22-900M30S output (module only uses last stage of the YP2233W PA)
#define SX126X_DIO3_TCXO_VOLTAGE 1.8 // E22 series TCXO reference voltage is 1.8V
#define SX126X_CS 18 // EBYTE module's NSS pin
#define SX126X_SCK 5 // EBYTE module's SCK pin
#define SX126X_MOSI 27 // EBYTE module's MOSI pin
#define SX126X_MISO 19 // EBYTE module's MISO pin
#define SX126X_RESET 23 // EBYTE module's NRST pin
#define SX126X_BUSY 32 // EBYTE module's BUSY pin
#define SX126X_DIO1 33 // EBYTE module's DIO1 pin
#define SX126X_TXEN 13 // Schematic connects EBYTE module's TXEN pin to MCU
#define SX126X_RXEN 14 // Schematic connects EBYTE module's RXEN pin to MCU
#define LORA_CS SX126X_CS // Compatibility with variant file configuration structure
#define LORA_SCK SX126X_SCK // Compatibility with variant file configuration structure
#define LORA_MOSI SX126X_MOSI // Compatibility with variant file configuration structure
#define LORA_MISO SX126X_MISO // Compatibility with variant file configuration structure
#define LORA_DIO1 SX126X_DIO1 // Compatibility with variant file configuration structure
#define LORA_TXEN SX126X_TXEN // Compatibility with variant file configuration structure
#define LORA_RXEN SX126X_RXEN // Compatibility with variant file configuration structure
#define LORA_RESET SX126X_RESET // Compatibility with variant file configuration structure
#define LORA_DIO2 SX126X_BUSY // Compatibility with variant file configuration structure
@@ -0,0 +1,10 @@
; Meshtastic DIY v1 by Nano VHF Schematic based on ESP32-WROOM-32 (38 pins) devkit & EBYTE E22 SX1262/SX1268 module
[env:meshtastic-diy-v1]
extends = esp32_base
board = esp32doit-devkit-v1
board_check = true
build_flags =
${esp32_base.build_flags}
-D DIY_V1
-D EBYTE_E22
-I variants/esp32/diy/v1
@@ -0,0 +1,57 @@
// For OLED LCD
#define I2C_SDA 21
#define I2C_SCL 22
// GPS
#undef GPS_RX_PIN
#undef GPS_TX_PIN
#define GPS_RX_PIN 12
#define GPS_TX_PIN 15
#define GPS_UBLOX
#define BUTTON_PIN 39 // The middle button GPIO on the T-Beam
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
#define ADC_MULTIPLIER 1.85 // (R1 = 470k, R2 = 680k)
#define EXT_PWR_DETECT 4 // Pin to detect connected external power source for LILYGO® TTGO T-Energy T18 and other DIY boards
#define EXT_NOTIFY_OUT 12 // Overridden default pin to use for Ext Notify Module (#975).
#define LED_PIN 2 // add status LED (compatible with core-pcb and DIY targets)
#define LORA_DIO0 26 // a No connect on the SX1262/SX1268 module
#define LORA_RESET 23 // RST for SX1276, and for SX1262/SX1268
#define LORA_DIO1 33 // IRQ for SX1262/SX1268
#define LORA_DIO2 32 // BUSY for SX1262/SX1268
#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262/SX1268, if DIO3 is high the TXCO is enabled
#define LORA_SCK 5
#define LORA_MISO 19
#define LORA_MOSI 27
#define LORA_CS 18
// supported modules list
#define USE_RF95 // RFM95/SX127x
#define USE_SX1262
#define USE_SX1268
#define USE_LLCC68
// common pinouts for SX126X modules
#define SX126X_CS 18 // NSS for SX126X
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_DIO2
#define SX126X_RESET LORA_RESET
#define SX126X_RXEN RADIOLIB_NC // Defining the RXEN ruins RFSwitching for the E22 900M30S in RadioLib
#define SX126X_TXEN 13
// RX/TX for RFM95/SX127x
#define RF95_RXEN 14
#define RF95_TXEN 13
// Set lora.tx_power to 13 for Hydra or other E22 900M30S target due to PA
#define SX126X_MAX_POWER 22
#ifdef EBYTE_E22
// Internally the TTGO module hooks the SX126x-DIO2 in to control the TX/RX switch
// (which is the default for the sx1262interface code)
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
#define TCXO_OPTIONAL // make it so that the firmware can try both TCXO and XTAL
#endif
@@ -0,0 +1,10 @@
; Meshtastic DIY v1.1 new schematic based on ESP32-WROOM-32 & SX1262/SX1268 modules
[env:meshtastic-diy-v1_1]
extends = esp32_base
board = esp32doit-devkit-v1
board_level = extra
build_flags =
${esp32_base.build_flags}
-D DIY_V1
-D EBYTE_E22
-I variants/esp32/diy/v1_1
@@ -0,0 +1,58 @@
// For OLED LCD
#define I2C_SDA 21
#define I2C_SCL 22
// GPS
#undef GPS_RX_PIN
#define GPS_RX_PIN 15
#define BUTTON_PIN 2 // The middle button GPIO on the T-Beam
#define BUTTON_NEED_PULLUP
#define EXT_NOTIFY_OUT 12 // Overridden default pin to use for Ext Notify Module (#975).
#define LORA_DIO0 26 // a No connect on the SX1262/SX1268 module
#define LORA_RESET 27 // RST for SX1276, and for SX1262/SX1268
#define LORA_DIO1 33 // IRQ for SX1262/SX1268
#define LORA_DIO2 32 // BUSY for SX1262/SX1268
#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262/SX1268, if DIO3 is high the TXCO is enabled
// In transmitting, set TXEN as high communication levelRXEN pin is low level;
// In receiving, set RXEN as high communication level, TXEN is lowlevel;
// Before powering off, set TXEN、RXEN as low level.
#define LORA_RXEN 14 // Input - RF switch RX control, connecting external MCU IO, valid in high level
#define LORA_TXEN 13 // Input - RF switch TX control, connecting external MCU IO or DIO2, valid in high level
#undef LORA_SCK
#define LORA_SCK 18
#undef LORA_MISO
#define LORA_MISO 19
#undef LORA_MOSI
#define LORA_MOSI 23
#undef LORA_CS
#define LORA_CS 5
// RX/TX for RFM95/SX127x
#define RF95_RXEN LORA_RXEN
#define RF95_TXEN LORA_TXEN
// #define RF95_TCXO <GPIO#>
// common pinouts for SX126X modules
#define SX126X_CS 5
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_DIO2
#define SX126X_RESET LORA_RESET
#define SX126X_RXEN LORA_RXEN
#define SX126X_TXEN LORA_TXEN
// supported modules list
#define USE_RF95 // RFM95/SX127x
#define USE_SX1262
#define USE_SX1268
#define USE_LLCC68
#ifdef EBYTE_E22
// Internally the TTGO module hooks the SX126x-DIO2 in to control the TX/RX switch
// (which is the default for the sx1262interface code)
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
#define TCXO_OPTIONAL // make it so that the firmware can try both TCXO and XTAL
#endif
@@ -0,0 +1,12 @@
[env:hackerboxes-esp32-io]
extends = esp32_base
board = esp32dev
board_level = extra
build_flags =
${esp32_base.build_flags}
-D PRIVATE_HW
-I variants/esp32/hackerboxes_esp32_io
monitor_speed = 115200
upload_protocol = esptool
;upload_port = /dev/ttyUSB0
upload_speed = 921600
@@ -0,0 +1,30 @@
#define BUTTON_PIN 0
// HACKBOX LoRa IO Kit
// Uses a ESP-32-WROOM and a RA-01SH (SX1262) LoRa Board
#define LED_PIN 2 // LED
#define LED_STATE_ON 1 // State when LED is lit
#define HAS_SCREEN 0
#define HAS_GPS 0
#undef GPS_RX_PIN
#undef GPS_TX_PIN
#define USE_SX1262
#define LORA_SCK 18
#define LORA_MISO 19
#define LORA_MOSI 23
#define LORA_CS 5
#define LORA_DIO0 RADIOLIB_NC
#define LORA_RESET 27
#define LORA_DIO1 33
#define LORA_DIO2 RADIOLIB_NC
#define LORA_BUSY 32
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_CS LORA_CS
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_BUSY
#define SX126X_RESET LORA_RESET
#define SX126X_MAX_POWER 22 // Max power of the RA-01SH is 22db
@@ -0,0 +1,9 @@
[env:heltec-v1]
;build_type = debug ; to make it possible to step through our jtag debugger
extends = esp32_base
board_level = extra
board = heltec_wifi_lora_32
build_flags =
${esp32_base.build_flags}
-D HELTEC_V1
-I variants/esp32/heltec_v1
@@ -0,0 +1,31 @@
// the default ESP32 Pin of 15 is the Oled SCL, set to 36 and 37 and works fine.
// Tested on Neo6m module.
#undef GPS_RX_PIN
#undef GPS_TX_PIN
#define GPS_RX_PIN 36
#define GPS_TX_PIN 33
#ifndef USE_JTAG // gpio15 is TDO for JTAG, so no I2C on this board while doing jtag
#define I2C_SDA 4 // I2C pins for this board
#define I2C_SCL 15
#endif
#define RESET_OLED 16 // If defined, this pin will be used to reset the display controller
#define LED_PIN 25 // If defined we will blink this LED
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
#define USE_RF95
#define LORA_DIO0 26 // a No connect on the SX1262 module
#ifndef USE_JTAG
#define LORA_RESET 14
#endif
#define LORA_DIO1 RADIOLIB_NC
#define LORA_DIO2 32 // Not really used
// ratio of voltage divider = 3.20 (R1=100k, R2=220k)
#define ADC_MULTIPLIER 3.2
#define BATTERY_PIN 13 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
#define ADC_CHANNEL ADC2_GPIO13_CHANNEL
#define BAT_MEASURE_ADC_UNIT 2
@@ -0,0 +1,9 @@
[env:heltec-v2_1]
board_level = extra
;build_type = debug ; to make it possible to step through our jtag debugger
extends = esp32_base
board = heltec_wifi_lora_32_V2
build_flags =
${esp32_base.build_flags}
-D HELTEC_V2_1
-I variants/esp32/heltec_v2.1
@@ -0,0 +1,37 @@
// Pin planning should refer to this document
// https://resource.heltec.cn/download/WiFi_LoRa_32/WIFI_LoRa_32_V2.pdf
// the default ESP32 Pin of 15 is the Oled SCL, 37 is battery pin.
// Tested on Neo6m module.
#undef GPS_RX_PIN
#undef GPS_TX_PIN
#define GPS_RX_PIN 36
#define GPS_TX_PIN 33
#define PIN_GPS_EN 37 // GPS power enable pin
#ifndef USE_JTAG // gpio15 is TDO for JTAG, so no I2C on this board while doing jtag
#define I2C_SDA 4 // I2C pins for this board
#define I2C_SCL 15
#endif
#define RESET_OLED 16 // If defined, this pin will be used to reset the display controller
#define VEXT_ENABLE 21 // active low, powers the oled display and the lora antenna boost
#define LED_PIN 25 // If defined we will blink this LED
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
#define USE_RF95
#define LORA_DIO0 26 // a No connect on the SX1262 module
#ifndef USE_JTAG
#define LORA_RESET 14
#endif
#define LORA_DIO1 35 // https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-3/18436
#define LORA_DIO2 34 // Not really used
#define ADC_MULTIPLIER 3.2 // 220k + 100k (320k/100k=3.2)
// #define ADC_WIDTH ADC_WIDTH_BIT_10
#define BATTERY_PIN 37 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
#define ADC_CHANNEL ADC1_GPIO37_CHANNEL
#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
@@ -0,0 +1,9 @@
[env:heltec-v2_0]
;build_type = debug ; to make it possible to step through our jtag debugger
board_level = extra
extends = esp32_base
board = heltec_wifi_lora_32_V2
build_flags =
${esp32_base.build_flags}
-D HELTEC_V2_0
-I variants/esp32/heltec_v2
@@ -0,0 +1,31 @@
// the default ESP32 Pin of 15 is the Oled SCL, set to 36 and 37 and works fine.
// Tested on Neo6m module.
#undef GPS_RX_PIN
#undef GPS_TX_PIN
#define GPS_RX_PIN 36
#define GPS_TX_PIN 33
#ifndef USE_JTAG // gpio15 is TDO for JTAG, so no I2C on this board while doing jtag
#define I2C_SDA 4 // I2C pins for this board
#define I2C_SCL 15
#endif
#define RESET_OLED 16 // If defined, this pin will be used to reset the display controller
#define VEXT_ENABLE 21 // active low, powers the oled display and the lora antenna boost
#define LED_PIN 25 // If defined we will blink this LED
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
#define USE_RF95
#define LORA_DIO0 26 // a No connect on the SX1262 module
#ifndef USE_JTAG
#define LORA_RESET 14
#endif
#define LORA_DIO1 35 // https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-3/18436
#define LORA_DIO2 34 // Not really used
// ratio of voltage divider = 3.20 (R12=100k, R10=220k)
#define ADC_MULTIPLIER 3.2
#define BATTERY_PIN 13 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
#define ADC_CHANNEL ADC2_GPIO13_CHANNEL
#define BAT_MEASURE_ADC_UNIT 2
@@ -0,0 +1,24 @@
[env:heltec-wireless-bridge]
;build_type = debug ; to make it possible to step through our jtag debugger
extends = esp32_base
board_level = extra
board = heltec_wifi_lora_32
build_flags =
${esp32_base.build_flags}
-I variants/esp32/heltec_wireless_bridge
-D HELTEC_WIRELESS_BRIDGE
-D BOARD_HAS_PSRAM
-D RADIOLIB_EXCLUDE_LR11X0=1
-D RADIOLIB_EXCLUDE_SX128X=1
-D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1
-D MESHTASTIC_EXCLUDE_DETECTIONSENSOR=1
-D MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1
-D MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR_EXTERNAL=1
-D MESHTASTIC_EXCLUDE_EXTERNALNOTIFICATION=1
-D MESHTASTIC_EXCLUDE_GPS=1
-D MESHTASTIC_EXCLUDE_I2C=1
-D MESHTASTIC_EXCLUDE_INPUTBROKER=1
-D MESHTASTIC_EXCLUDE_POWER_FSM=1
-D MESHTASTIC_EXCLUDE_SERIAL=1
-D MESHTASTIC_EXCLUDE_SCREEN=1
-D MESHTASTIC_EXCLUDE_WAYPOINT=1
@@ -0,0 +1,41 @@
// updated variant 20250420 berlincount, tested with HTIT-TB
//
// connections in HTIT-WB
// per https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf
// md5: a0e6ae10ff76611aa61433366b2e4f5c esp32_datasheet_en.pdf
// per https://resource.heltec.cn/download/Wireless_Bridge/Schematic_Diagram_HTIT-WB_V0.2.pdf
// md5: d5c1b0219ece347dd8cee866d7d3ab0a Schematic_Diagram_HTIT-WB_V0.2.pdf
#define NO_EXT_GPIO 1
#define NO_GPS 1
#define HAS_GPS 0 // GPS is not equipped
#undef GPS_RX_PIN
#undef GPS_TX_PIN
// Green / Lora = PIN 22 / GPIO2, Yellow / Wifi = PIN 23 / GPIO0, Blue / BLE = PIN 25 / GPIO16
#define LED_PIN 22
#define WIFI_LED 23
#define BLE_LED 25
// ESP32-D0WDQ6 direct pins SX1276
#define USE_RF95
#define LORA_DIO0 26
#define LORA_DIO1 35
#define LORA_DIO2 34
#define LORA_SCK 05
#define LORA_MISO 19
#define LORA_MOSI 27
#define LORA_CS 18
// several things are not possible with JTAG enabled
#ifndef USE_JTAG
#define LORA_RESET 14 // LoRa Reset shares a pin with MTMS
#define I2C_SDA 4 // SD_DATA1 going to W25Q64, but
#define I2C_SCL 15 // SD_CMD shared a pin with MTD0
#endif
// user button is present on device, but currently untested & unconfigured - couldn't figure out how it's connected
// battery support is present within device, but currently untested & unconfigured - couldn't find reliable information yet
@@ -0,0 +1,8 @@
[env:heltec-wsl-v2_1]
extends = esp32_base
board = heltec_wireless_stick_lite
board_level = extra
build_flags =
${esp32_base.build_flags}
-D PRIVATE_HW
-I variants/esp32/heltec_wsl_v2.1
@@ -0,0 +1,29 @@
#define I2C_SCL SCL
#define I2C_SDA SDA
#define LED_PIN LED
// active low, powers the Battery reader, but no lora antenna boost (?)
// #define VEXT_ENABLE Vext
// #define VEXT_ON_VALUE LOW
#define BUTTON_PIN 0
#define ADC_CTRL 21
#define ADC_CTRL_ENABLED LOW
#define BATTERY_PIN 37 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
#define ADC_CHANNEL ADC1_CHANNEL_1
// ratio of voltage divider = 3.20 (R1=100k, R2=220k)
#define ADC_MULTIPLIER 3.2
#define USE_RF95 // RFM95/SX127x
#define LORA_DIO0 26
#define LORA_RESET 14
#define LORA_DIO1 35
#define LORA_DIO2 34
#define LORA_SCK 5
#define LORA_MISO 19
#define LORA_MOSI 27
#define LORA_CS 18
@@ -0,0 +1,47 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
static const uint8_t TX = 1;
static const uint8_t RX = 3;
static const uint8_t TXD2 = 17;
static const uint8_t RXD2 = 16;
static const uint8_t SDA = 21;
static const uint8_t SCL = 22;
static const uint8_t SS = 5;
static const uint8_t MOSI = 23;
static const uint8_t MISO = 19;
static const uint8_t SCK = 18;
static const uint8_t G23 = 23;
static const uint8_t G19 = 19;
static const uint8_t G18 = 18;
static const uint8_t G3 = 3;
static const uint8_t G16 = 16;
static const uint8_t G21 = 21;
static const uint8_t G2 = 2;
static const uint8_t G12 = 12;
static const uint8_t G15 = 15;
static const uint8_t G35 = 35;
static const uint8_t G36 = 36;
static const uint8_t G25 = 25;
static const uint8_t G26 = 26;
static const uint8_t G1 = 1;
static const uint8_t G17 = 17;
static const uint8_t G22 = 22;
static const uint8_t G5 = 5;
static const uint8_t G13 = 13;
static const uint8_t G0 = 0;
static const uint8_t G34 = 34;
static const uint8_t DAC1 = 25;
static const uint8_t DAC2 = 26;
static const uint8_t ADC1 = 35;
static const uint8_t ADC2 = 36;
#endif /* Pins_Arduino_h */
@@ -0,0 +1,29 @@
[env:m5stack-core]
extends = esp32_base
board = m5stack-core-esp32
monitor_filters = esp32_exception_decoder
build_src_filter =
${esp32_base.build_src_filter}
build_flags =
${esp32_base.build_flags}
-I variants/esp32/m5stack_core
-DILI9341_DRIVER
-DM5STACK
-DUSER_SETUP_LOADED
-DTFT_SDA_READ
-DTFT_DRIVER=0x9341
-DTFT_MISO=19
-DTFT_MOSI=23
-DTFT_SCLK=18
-DTFT_CS=14
-DTFT_DC=27
-DTFT_RST=33
-DTFT_BL=32
-DSPI_FREQUENCY=40000000
-DSPI_READ_FREQUENCY=16000000
-DDISABLE_ALL_LIBRARY_WARNINGS
lib_ignore =
m5stack-core
lib_deps =
${esp32_base.lib_deps}
lovyan03/LovyanGFX@^1.2.0
@@ -0,0 +1,46 @@
// #define BUTTON_NEED_PULLUP // if set we need to turn on the internal CPU pullup during sleep
#define I2C_SDA 21
#define I2C_SCL 22
// #define BUTTON_PIN 39 // 38, 37
// #define BUTTON_PIN 0
#define BUTTON_NEED_PULLUP
// #define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Plugin.
#define BUTTON_PIN 38
#define PIN_BUZZER 25
#undef LORA_SCK
#undef LORA_MISO
#undef LORA_MOSI
#undef LORA_CS
#define LORA_SCK 18
#define LORA_MISO 19
#define LORA_MOSI 23
#define LORA_CS 5
#define USE_RF95
#define LORA_DIO0 36 // a No connect on the SX1262 module
#define LORA_RESET 26
#define LORA_DIO1 RADIOLIB_NC // Not really used
#define LORA_DIO2 RADIOLIB_NC // Not really used
// This board has different GPS pins than all other boards
#undef GPS_RX_PIN
#undef GPS_TX_PIN
#define GPS_RX_PIN 16
#define GPS_TX_PIN 17
#define TFT_HEIGHT 240
#define TFT_WIDTH 320
#define TFT_OFFSET_X 0
#define TFT_OFFSET_Y 0
#define TFT_BUSY -1
// LCD screens are slow, so slowdown the wipe so it looks better
#define SCREEN_TRANSITION_FRAMERATE 1 // fps
#define ILI9341_SPI_HOST VSPI_HOST // VSPI_HOST or HSPI_HOST
@@ -0,0 +1,49 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#define TX2 -1
#define RX2 -1
static const uint8_t TX = 1;
static const uint8_t RX = 3;
static const uint8_t SDA = 32;
static const uint8_t SCL = 33;
static const uint8_t SS = 9;
static const uint8_t MOSI = 23;
static const uint8_t MISO = 34;
static const uint8_t SCK = 18;
static const uint8_t G26 = 26;
static const uint8_t G36 = 36;
static const uint8_t G25 = 25;
static const uint8_t G32 = 32;
static const uint8_t G33 = 33;
static const uint8_t G21 = 21;
static const uint8_t G22 = 22;
static const uint8_t G13 = 13;
static const uint8_t G14 = 14;
static const uint8_t G12 = 12;
static const uint8_t G19 = 19;
static const uint8_t G5 = 5;
static const uint8_t G10 = 10;
static const uint8_t G2 = 2;
static const uint8_t G37 = 37;
static const uint8_t G38 = 38;
static const uint8_t G39 = 39;
static const uint8_t DAC1 = 25;
static const uint8_t DAC2 = 26;
static const uint8_t ADC1 = 35;
static const uint8_t ADC2 = 36;
#endif /* Pins_Arduino_h */
@@ -0,0 +1,28 @@
[env:m5stack-coreink]
extends = esp32_base
board = m5stack-coreink
board_check = true
build_src_filter =
${esp32_base.build_src_filter}
build_flags =
${esp32_base.build_flags}
-I variants/esp32/m5stack_coreink
;-D RADIOLIB_VERBOSE
-Ofast
-D__MCUXPRESSO
-DEINK_DISPLAY_MODEL=GxEPD2_154_M09
-DEINK_WIDTH=200
-DEINK_HEIGHT=200
-DUSER_SETUP_LOADED
-DM5_COREINK
-DM5STACK
lib_deps =
${esp32_base.lib_deps}
zinggjm/GxEPD2@^1.6.2
lewisxhe/PCF8563_Library@^1.0.1
lib_ignore =
m5stack-coreink
monitor_filters = esp32_exception_decoder
board_build.f_cpu = 240000000L
upload_protocol = esptool
upload_port = /dev/ttyACM0
@@ -0,0 +1,109 @@
// Primary I2C Bus includes PCF8563 RTC Module
#define I2C_SDA 21
#define I2C_SCL 22
#define HAS_GPS 1
#undef GPS_RX_PIN
#undef GPS_TX_PIN
// Use Secondary I2C Bus as GPS Serial
#define GPS_RX_PIN 33
// #define GPS_TX_PIN 32 (now used by SX1262 BUSY as GPS works with just RX)
// Green LED
#define LED_STATE_ON 1 // State when LED is lit
#define LED_PIN 10
#include "pcf8563.h"
// PCF8563 RTC Module
#define PCF8563_RTC 0x51
#define HAS_RTC 1
// Wheel
// Down 37
// Push 38
// Up 39
// Top Physical Button 5
#define BUTTON_NEED_PULLUP
#define BUTTON_PIN 5
// BUZZER
#define PIN_BUZZER 2
#undef LORA_SCK
#undef LORA_MISO
#undef LORA_MOSI
#undef LORA_CS
#define USE_RF95
// #define USE_SX1262
// #define USE_SX1280
#ifdef USE_RF95
#define LORA_SCK 18
#define LORA_MISO 34
#define LORA_MOSI 23
#define LORA_CS 14
#define LORA_DIO0 25
#define LORA_RESET 26
#define LORA_DIO1 RADIOLIB_NC
#define LORA_DIO2 RADIOLIB_NC
#endif
// https://www.waveshare.com/core1262-868m.htm
#ifdef USE_SX1262
#define LORA_SCK 18
#define LORA_MISO 34
#define LORA_MOSI 23
#define LORA_CS 14
#define LORA_RESET 26
#define LORA_DIO1 25
#define LORA_DIO2 32 // 33 // (13 not working) //BUSY pin on SX1262
#define SX126X_CS LORA_CS
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_DIO2
#define SX126X_RESET LORA_RESET
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
#endif
#ifdef USE_SX1280
#define LORA_SCK 18
#define LORA_MISO 34
#define LORA_MOSI 23
#define LORA_CS 14
#define LORA_RESET 26
#define LORA_DIO1 25
#define LORA_DIO2 13
#define SX128X_CS LORA_CS
#define SX128X_DIO1 LORA_DIO1
#define SX128X_BUSY LORA_DIO2
#define SX128X_RESET LORA_RESET
#define SX128X_MAX_POWER 13 // 10
#endif
#define USE_EINK
// https://docs.m5stack.com/en/core/coreink
// https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/schematic/Core/coreink/coreink_sch.pdf
#define PIN_EINK_EN -1 // N/C
#define PIN_EINK_CS 9 // EPD_CS
#define PIN_EINK_BUSY 4 // EPD_BUSY
#define PIN_EINK_DC 15 // EPD_D/C
#define PIN_EINK_RES -1 // Connected but not needed
#define PIN_EINK_SCLK 18 // EPD_SCLK
#define PIN_EINK_MOSI 23 // EPD_MOSI
#define BATTERY_PIN 35
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
// https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/schematic/Core/m5paper/M5_PAPER_SCH.pdf
// https://github.com/m5stack/M5Core-Ink/blob/master/examples/Basics/FactoryTest/FactoryTest.ino#L58
// VBAT
// |
// R83 (3K)
// +
// R86 (11K)
// |
// GND
// https://github.com/m5stack/M5Core-Ink/blob/master/examples/Basics/FactoryTest/FactoryTest.ino#L58
#define ADC_MULTIPLIER 5
// https://embeddedexplorer.com/esp32-adc-esp-idf-tutorial/
@@ -0,0 +1,10 @@
; The 1.0 release of the nano-g1-explorer board
[env:nano-g1-explorer]
extends = esp32_base
board = ttgo-t-beam
lib_deps =
${esp32_base.lib_deps}
build_flags =
${esp32_base.build_flags}
-D NANO_G1_EXPLORER
-I variants/esp32/nano-g1-explorer
@@ -0,0 +1,40 @@
// #define BUTTON_NEED_PULLUP // if set we need to turn on the internal CPU pullup during sleep
#define I2C_SDA 21
#define I2C_SCL 22
#define BUTTON_PIN 36 // The user button (information button) GPIO on the Nano G1 explorer
#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
// common pinout for their SX1262 vs RF95 modules - both can be enabled and we will probe at runtime for RF95 and if
// not found then probe for SX1262
#define USE_RF95
#define USE_SX1262
#define GPS_RX_PIN 34
#define GPS_TX_PIN 12
#define LORA_DIO0 26 // a No connect on the SX1262 module
#define LORA_RESET 23
#define LORA_DIO1 33 // SX1262 IRQ
#define LORA_DIO2 32 // SX1262 BUSY
#define LORA_DIO3 // Not connected on PCB
#ifdef USE_SX1262
#define SX126X_CS LORA_CS // FIXME - we really should define LORA_CS instead
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_DIO2
#define SX126X_RESET LORA_RESET
// Not really an E22
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
// Internally the module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface
// code)
#endif
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
#define BATTERY_SENSE_SAMPLES 15 // Set the number of samples, It has an effect of increasing sensitivity.
#define ADC_MULTIPLIER 2
#define USE_SH1107_128_64
@@ -0,0 +1,10 @@
; The 1.0 release of the nano-g1 board
[env:nano-g1]
extends = esp32_base
board = ttgo-t-beam
lib_deps =
${esp32_base.lib_deps}
build_flags =
${esp32_base.build_flags}
-D NANO_G1
-I variants/esp32/nano-g1
@@ -0,0 +1,36 @@
// #define BUTTON_NEED_PULLUP // if set we need to turn on the internal CPU pullup during sleep
#define I2C_SDA 21
#define I2C_SCL 22
#define BUTTON_PIN 36 // The middle button GPIO on the Nano G1
#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
// common pinout for their SX1262 vs RF95 modules - both can be enabled and we will probe at runtime for RF95 and if
// not found then probe for SX1262
#define USE_RF95
#define USE_SX1262
#define GPS_RX_PIN 34
#define GPS_TX_PIN 12
#define LORA_DIO0 26 // a No connect on the SX1262 module
#define LORA_RESET 23
#define LORA_DIO1 33 // SX1262 IRQ
#define LORA_DIO2 32 // SX1262 BUSY
#define LORA_DIO3 // Not connected on PCB
#ifdef USE_SX1262
#define SX126X_CS LORA_CS // FIXME - we really should define LORA_CS instead
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_DIO2
#define SX126X_RESET LORA_RESET
// Not really an E22
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
// Internally the module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface
// code)
#endif
// different screen
#define USE_SH1106
@@ -0,0 +1,16 @@
[env:radiomaster_900_bandit]
extends = esp32_base
board = esp32doit-devkit-v1
build_flags =
${esp32_base.build_flags}
-DRADIOMASTER_900_BANDIT
-DVTABLES_IN_FLASH=1
-DCONFIG_DISABLE_HAL_LOCKS=1
-DHAS_STK8XXX=1
-O2
-I variants/esp32/radiomaster_900_bandit
board_build.f_cpu = 240000000L
upload_protocol = esptool
lib_deps =
${esp32_base.lib_deps}
https://github.com/gjelsoe/STK8xxx-Accelerometer/archive/v0.1.1.zip
@@ -0,0 +1,126 @@
/*
Initial settings and work by https://github.com/gjelsoe
Unit provided by Radio Master RC
https://radiomasterrc.com/products/bandit-expresslrs-rf-module with 1.29" OLED display CH1115 driver
*/
/*
On this model then screen is NOT upside down, don't flip it for the user.
*/
#undef DISPLAY_FLIP_SCREEN
/*
I2C SDA and SCL.
0x18 - STK8XXX Accelerometer
0x3C - SH1115 Display Driver
*/
#define I2C_SDA 14
#define I2C_SCL 12
/*
I2C STK8XXX Accelerometer Interrupt PIN to ESP32 Pin 6 - SENSOR_CAPP (GPIO37)
*/
#define STK8XXX_INT 37
/*
No GPS - but free pins are available.
*/
#define HAS_GPS 0
#undef GPS_RX_PIN
#undef GPS_TX_PIN
/*
Pin connections from ESP32-D0WDQ6 to SX1276.
*/
#define LORA_DIO0 22
#define LORA_DIO1 21
#define LORA_SCK 18
#define LORA_MISO 19
#define LORA_MOSI 23
#define LORA_CS 4
#define LORA_RESET 5
#define LORA_TXEN 33
/*
This unit has a FAN built-in.
FAN is active at 250mW on it's ExpressLRS Firmware.
This FAN has TACHO signal on Pin 27 for use with PWM.
*/
#define RF95_FAN_EN 2
/*
LED PIN setup and it has a NeoPixel LED.
It's possible to setup colors for Button 1 and 2,
look at BUTTON1_COLOR, BUTTON1_COLOR_INDEX, BUTTON2_COLOR and BUTTON2_COLOR_INDEX
this is done here for now.
*/
#define HAS_NEOPIXEL // Enable the use of neopixels
#define NEOPIXEL_COUNT 6 // How many neopixels are connected
#define NEOPIXEL_DATA 15 // GPIO pin used to send data to the neopixels
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // Type of neopixels in use
#define ENABLE_AMBIENTLIGHTING // Turn on Ambient Lighting
// #define BUTTON1_COLOR 0xFF0000 // Background light for Button 1 in HEX RGB Color (RadioMaster Bandit only).
// #define BUTTON1_COLOR_INDEX 0 // NeoPixel Index ID for Button 1
// #define BUTTON2_COLOR 0x0000FF // Background light for Button 2 in HEX RGB Color (RadioMaster Bandit only).
// #define BUTTON2_COLOR_INDEX 1 // NeoPixel Index ID for Button 2
/*
It has 1 x five-way and 2 x normal buttons.
Button GPIO RGB Index
---------------------------
Five-way 39 -
Button 1 34 0
Button 2 35 1
Five way button when using ADC.
2.632V, 2.177V, 1.598V, 1.055V, 0V
ADC Values:
{ UP, DOWN, LEFT, RIGHT, ENTER, IDLE }
3227, 0 ,1961, 2668, 1290, 4095
Five way button when using ADC.
https://github.com/ExpressLRS/targets/blob/f3215b5ec891108db1a13523e4163950cfcadaac/TX/Radiomaster%20Bandit.json#L41
*/
#define INPUTBROKER_EXPRESSLRSFIVEWAY_TYPE
#define PIN_JOYSTICK 39
#define JOYSTICK_ADC_VALS /*UP*/ 3227, /*DOWN*/ 0, /*LEFT*/ 1961, /*RIGHT*/ 2668, /*OK*/ 1290, /*IDLE*/ 4095
/*
Normal Button Pin setup.
*/
#define BUTTON_PIN 34
#define BUTTON_NEED_PULLUP
/*
No External notification.
*/
#undef EXT_NOTIFY_OUT
/*
Remapping PIN Names.
Note, that this unit uses RFO
*/
#define USE_RF95
#define USE_RF95_RFO
#define RF95_CS LORA_CS
#define RF95_DIO1 LORA_DIO1
#define RF95_TXEN LORA_TXEN
#define RF95_RESET LORA_RESET
#define RF95_MAX_POWER 10
/*
This module has Skyworks SKY66122 controlled by dacWrite
power ranging from 100mW to 1000mW.
Mapping of PA_LEVEL to Power output: GPIO26/dacWrite
168 -> 100mW
155 -> 250mW
142 -> 500mW
110 -> 1000mW
*/
#define RF95_PA_EN 26
#define RF95_PA_DAC_EN
#define RF95_PA_LEVEL 110
@@ -0,0 +1,19 @@
;
; This uses the same code and settings as the Radio Master Bandit Nano (https://www.radiomasterrc.com/products/bandit-nano-expresslrs-rf-module)
;
; Link to the unit : https://www.radiomasterrc.com/products/bandit-micro-expresslrs-rf-module
;
[env:radiomaster_900_bandit_micro]
extends = esp32_base
board = esp32doit-devkit-v1
build_flags =
${esp32_base.build_flags}
-DRADIOMASTER_900_BANDIT_NANO
-DVTABLES_IN_FLASH=1
-DCONFIG_DISABLE_HAL_LOCKS=1
-O2
-I variants/esp32/radiomaster_900_bandit_nano
board_build.f_cpu = 240000000L
upload_protocol = esptool
lib_deps =
${esp32_base.lib_deps}
@@ -0,0 +1,14 @@
[env:radiomaster_900_bandit_nano]
extends = esp32_base
board = esp32doit-devkit-v1
build_flags =
${esp32_base.build_flags}
-DRADIOMASTER_900_BANDIT_NANO
-DVTABLES_IN_FLASH=1
-DCONFIG_DISABLE_HAL_LOCKS=1
-O2
-I variants/esp32/radiomaster_900_bandit_nano
board_build.f_cpu = 240000000L
upload_protocol = esptool
lib_deps =
${esp32_base.lib_deps}
@@ -0,0 +1,81 @@
/*
Initial settings and work by https://github.com/uberhalit and re-work by https://github.com/gjelsoe
Unit provided by Radio Master RC
https://radiomasterrc.com/products/bandit-nano-expresslrs-rf-module with 0.96" OLED display
*/
/*
I2C SDA and SCL.
*/
#define I2C_SDA 14
#define I2C_SCL 12
/*
No GPS - but free solder pads are available inside the case.
*/
#undef GPS_RX_PIN
#undef GPS_TX_PIN
/*
Pin connections from ESP32-D0WDQ6 to SX1276.
*/
#define LORA_DIO0 22
#define LORA_DIO1 21
#define LORA_SCK 18
#define LORA_MISO 19
#define LORA_MOSI 23
#define LORA_CS 4
#define LORA_RESET 5
#define LORA_TXEN 33
/*
This unit has a FAN built-in.
FAN is active at 250mW on it's ExpressLRS Firmware.
*/
#define RF95_FAN_EN 2
/*
LED PIN setup.
*/
#define LED_PIN 15
/*
Five way button when using ADC.
https://github.com/ExpressLRS/targets/blob/f3215b5ec891108db1a13523e4163950cfcadaac/TX/Radiomaster%20Bandit.json#L41
*/
#define INPUTBROKER_EXPRESSLRSFIVEWAY_TYPE
#define PIN_JOYSTICK 39
#define JOYSTICK_ADC_VALS /*UP*/ 3227, /*DOWN*/ 0, /*LEFT*/ 1961, /*RIGHT*/ 2668, /*OK*/ 1290, /*IDLE*/ 4095
#define DISPLAY_FLIP_SCREEN
/*
No External notification.
*/
#undef EXT_NOTIFY_OUT
/*
Remapping PIN Names.
Note, that this unit uses RFO
*/
#define USE_RF95
#define USE_RF95_RFO
#define RF95_CS LORA_CS
#define RF95_DIO1 LORA_DIO1
#define RF95_TXEN LORA_TXEN
#define RF95_RESET LORA_RESET
#define RF95_MAX_POWER 12
/*
This module has Skyworks SKY66122 controlled by dacWrite
power rangeing from 100mW to 1000mW.
Mapping of PA_LEVEL to Power output: GPIO26/dacWrite
168 -> 100mW -> 2.11v
148 -> 250mW -> 1.87v
128 -> 500mW -> 1.63v
90 -> 1000mW -> 1.16v
*/
#define RF95_PA_EN 26
#define RF95_PA_DAC_EN
#define RF95_PA_LEVEL 90
@@ -0,0 +1,38 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#define LED_GREEN 12
#define LED_BLUE 2
#define LED_BUILTIN LED_GREEN
static const uint8_t TX = 1;
static const uint8_t RX = 3;
#define TX1 21
#define RX1 19
#define WB_IO1 14
#define WB_IO2 27
#define WB_IO3 26
#define WB_IO4 23
#define WB_IO5 13
#define WB_IO6 22
#define WB_SW1 34
#define WB_A0 36
#define WB_A1 39
#define WB_CS 32
#define WB_LED1 12
#define WB_LED2 2
static const uint8_t SDA = 4;
static const uint8_t SCL = 5;
static const uint8_t SS = 32;
static const uint8_t MOSI = 25;
static const uint8_t MISO = 35;
static const uint8_t SCK = 33;
#endif /* Pins_Arduino_h */
@@ -0,0 +1,10 @@
[env:rak11200]
extends = esp32_base
board = wiscore_rak11200
board_level = pr
board_check = true
build_flags =
${esp32_base.build_flags}
-D RAK_11200
-I variants/esp32/rak11200
upload_speed = 115200
@@ -0,0 +1,81 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#define LED_GREEN 12
#define LED_BLUE 2
#define LED_BUILTIN LED_GREEN
static const uint8_t TX = 1;
static const uint8_t RX = 3;
#define TX1 21
#define RX1 19
#define WB_IO1 14
#define WB_IO2 27
#define WB_IO3 26
#define WB_IO4 23
#define WB_IO5 13
#define WB_IO6 22
#define WB_SW1 34
#define WB_A0 36
#define WB_A1 39
#define WB_CS 32
#define WB_LED1 12
#define WB_LED2 2
static const uint8_t SDA = 4;
static const uint8_t SCL = 5;
static const uint8_t SS = 32;
static const uint8_t MOSI = 25;
static const uint8_t MISO = 35;
static const uint8_t SCK = 33;
#endif /* Pins_Arduino_h */
/* -------- Meshtastic pins -------- */
#define I2C_SDA SDA
#define I2C_SCL SCL
#undef GPS_RX_PIN
#define GPS_RX_PIN (RX1)
#undef GPS_TX_PIN
#define GPS_TX_PIN (TX1)
#define LED_PIN LED_BLUE
#define PIN_VBAT WB_A0
#define BATTERY_PIN PIN_VBAT
#define ADC_CHANNEL ADC1_GPIO36_CHANNEL
// https://docs.rakwireless.com/Product-Categories/WisBlock/RAK13300/
#define LORA_DIO0 RADIOLIB_NC // a No connect on the SX1262/SX1268 module
#define LORA_RESET WB_IO4 // RST for SX1276, and for SX1262/SX1268
#define LORA_DIO1 WB_IO6 // IRQ for SX1262/SX1268
#define LORA_DIO2 WB_IO5 // BUSY for SX1262/SX1268
#define LORA_DIO3 \
RADIOLIB_NC // Not connected on PCB, but internally on the TTGO SX1262/SX1268, if DIO3 is high the TXCO is enabled
#undef LORA_SCK
#define LORA_SCK SCK
#undef LORA_MISO
#define LORA_MISO MISO
#undef LORA_MOSI
#define LORA_MOSI MOSI
#undef LORA_CS
#define LORA_CS SS
#define USE_SX1262
#define SX126X_ANT_SW WB_IO3
#define SX126X_CS SS // NSS for SX126X
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_DIO2
#define SX126X_RESET LORA_RESET
#define SX126X_POWER_EN WB_IO2
// DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
@@ -0,0 +1,10 @@
; The 1.0 release of the nano-g1 board
[env:station-g1]
extends = esp32_base
board = ttgo-t-beam
lib_deps =
${esp32_base.lib_deps}
build_flags =
${esp32_base.build_flags}
-D STATION_G1
-I variants/esp32/station-g1
@@ -0,0 +1,46 @@
// #define BUTTON_NEED_PULLUP // if set we need to turn on the internal CPU pullup during sleep
#define I2C_SDA 21
#define I2C_SCL 22
#define I2C_SDA1 14 // Second i2c channel on external IO connector
#define I2C_SCL1 15 // Second i2c channel on external IO connector
#define BUTTON_PIN 36 // The middle button GPIO on the Nano G1
#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
// common pinout for their SX1262 vs RF95 modules - both can be enabled and we will probe at runtime for RF95 and if
// not found then probe for SX1262
#define USE_RF95
#define USE_SX1262
#define LORA_DIO0 26 // a No connect on the SX1262 module
#define LORA_RESET 23
#define LORA_DIO1 33 // SX1262 IRQ
#define LORA_DIO2 32 // SX1262 BUSY
#define LORA_DIO3 // Not connected on PCB
#ifdef USE_SX1262
#define SX126X_CS LORA_CS // FIXME - we really should define LORA_CS instead
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_DIO2
#define SX126X_RESET LORA_RESET
#define SX126X_DIO2_AS_RF_SWITCH // Internally the module hooks the SX1262-DIO2 in to control the TX/RX switch
#define SX126X_MAX_POWER \
16 // Ensure the PA does not exceed the saturation output power. More
// Info:https://uniteng.com/wiki/doku.php?id=meshtastic:station#rf_design_-_lora_station_edition_g1
#endif
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
#define BATTERY_SENSE_SAMPLES 30 // Set the number of samples, It has an effect of increasing sensitivity.
#define ADC_MULTIPLIER 6.45
#define CELL_TYPE_LION // same curve for liion/lipo
#define NUM_CELLS 3
// different screen
#define USE_SH1106
// Station may not have GPS installed, but it has a labeled GPS pinout
#define GPS_RX_PIN 34
#define GPS_TX_PIN 12
@@ -0,0 +1,15 @@
; The 1.0 release of the TBEAM board
[env:tbeam]
extends = esp32_base
board = ttgo-t-beam
board_level = pr
board_check = true
lib_deps =
${esp32_base.lib_deps}
build_flags =
${esp32_base.build_flags}
-D TBEAM_V10
-I variants/esp32/tbeam
-DBOARD_HAS_PSRAM
-mfix-esp32-psram-cache-issue
upload_speed = 921600
@@ -0,0 +1,45 @@
// #define BUTTON_NEED_PULLUP // if set we need to turn on the internal CPU pullup during sleep
#define I2C_SDA 21
#define I2C_SCL 22
#define BUTTON_PIN 38 // The middle button GPIO on the T-Beam
#define BUTTON_ACTIVE_LOW true
#define BUTTON_ACTIVE_PULLUP true
#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
#define LED_STATE_ON 0 // State when LED is lit
#define LED_PIN 4 // Newer tbeams (1.1) have an extra led on GPIO4
// TTGO uses a common pinout for their SX1262 vs RF95 modules - both can be enabled and we will probe at runtime for RF95 and if
// not found then probe for SX1262
#define USE_RF95 // RFM95/SX127x
#define USE_SX1262
#define USE_SX1268
#define LORA_DIO0 26 // a No connect on the SX1262 module
#define LORA_RESET 23
#define LORA_DIO1 33 // SX1262 IRQ
#define LORA_DIO2 32 // SX1262 BUSY
#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262, if DIO3 is high the TXCO is enabled
#ifdef USE_SX1262
#define SX126X_CS LORA_CS // FIXME - we really should define LORA_CS instead
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_DIO2
#define SX126X_RESET LORA_RESET
// Not really an E22 but TTGO seems to be trying to clone that
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
// Internally the TTGO module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface
// code)
#endif
// Leave undefined to disable our PMU IRQ handler. DO NOT ENABLE THIS because the pmuirq can cause sperious interrupts
// and waking from light sleep
// #define PMU_IRQ 35
#define HAS_AXP192
#define GPS_UBLOX
#define GPS_RX_PIN 34
#define GPS_TX_PIN 12
// #define GPS_DEBUG
@@ -0,0 +1,9 @@
; The original TBEAM board without the AXP power chip and a few other changes
[env:tbeam0_7]
board_level = extra
extends = esp32_base
board = ttgo-t-beam
build_flags =
${esp32_base.build_flags}
-D TBEAM_V07
-I variants/esp32/tbeam_v07
@@ -0,0 +1,22 @@
// #define BUTTON_NEED_PULLUP // if set we need to turn on the internal CPU pullup during sleep
#define I2C_SDA 21
#define I2C_SCL 22
#define BUTTON_PIN 39
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
#define USE_RF95
#define LORA_DIO0 26 // a No connect on the SX1262 module
#define LORA_RESET 23
#define LORA_DIO1 33
#define LORA_DIO2 32 // Not really used
// This board has different GPS pins than all other boards
#undef GPS_RX_PIN
#undef GPS_TX_PIN
#define GPS_RX_PIN 12
#define GPS_TX_PIN 15
#define GPS_UBLOX
@@ -0,0 +1,9 @@
[env:tlora-v1]
board_level = extra
extends = esp32_base
board = ttgo-lora32-v1
build_flags =
${esp32_base.build_flags}
-D TLORA_V1
-I variants/esp32/tlora_v1
upload_speed = 115200
@@ -0,0 +1,17 @@
#define I2C_SDA 4 // I2C pins for this board
#define I2C_SCL 15
#define RESET_OLED 16 // If defined, this pin will be used to reset the display controller
#define VEXT_ENABLE 21 // active low, powers the oled display and the lora antenna boost
#define VEXT_ON_VALUE LOW
#define LED_PIN 2 // If defined we will blink this LED
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
#define BUTTON_NEED_PULLUP
#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
#define USE_RF95
#define LORA_DIO0 26 // a No connect on the SX1262 module
#define LORA_RESET 14
#define LORA_DIO1 33 // Must be manually wired: https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-3/18436
#define LORA_DIO2 32 // Not really used
@@ -0,0 +1,7 @@
[env:tlora_v1_3]
board_level = extra
extends = esp32_base
board = ttgo-lora32-v1
build_flags =
${esp32_base.build_flags} -D TLORA_V1_3 -I variants/esp32/tlora_v1_3
upload_speed = 115200
@@ -0,0 +1,18 @@
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
#define I2C_SDA 21 // I2C pins for this board
#define I2C_SCL 22
#define RESET_OLED 16 // If defined, this pin will be used to reset the display controller
#define VEXT_ENABLE 21 // active low, powers the oled display and the lora antenna boost
#define LED_PIN 25 // If defined we will blink this LED
#define BUTTON_PIN 36
#define BUTTON_NEED_PULLUP
#define USE_RF95
#define LORA_DIO0 26 // a No connect on the SX1262 module
#define LORA_RESET 14
#define LORA_DIO1 33 // Prob. must be manually wired: https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-3/18436
#define LORA_DIO2 32 // Not really used
@@ -0,0 +1,8 @@
[env:tlora-v2]
board_level = extra
extends = esp32_base
board = ttgo-lora32-v1
build_flags =
${esp32_base.build_flags}
-D TLORA_V2
-I variants/esp32/tlora_v2
@@ -0,0 +1,18 @@
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
#define I2C_SDA 21 // I2C pins for this board
#define I2C_SCL 22
#define VEXT_ENABLE 21 // active low, powers the oled display and the lora antenna boost
#define LED_PIN 25 // If defined we will blink this LED
#define BUTTON_PIN \
0 // If defined, this will be used for user button presses, if your board doesn't have a physical switch, you can wire one
// between this pin and ground
#define BUTTON_NEED_PULLUP
#define USE_RF95
#define LORA_DIO0 26 // a No connect on the SX1262 module
#define LORA_RESET 14
#define LORA_DIO1 33 // Must be manually wired: https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-3/18436
#define LORA_DIO2 32 // Not really used
@@ -0,0 +1,16 @@
[env:tlora-v2-1-1_6]
extends = esp32_base
board = ttgo-lora32-v21
board_check = true
build_flags =
${esp32_base.build_flags} -D TLORA_V2_1_16 -I variants/esp32/tlora_v2_1_16
upload_speed = 115200
[env:sugarcube]
extends = env:tlora-v2-1-1_6
board_level = extra
build_flags =
${env:tlora-v2-1-1_6.build_flags}
-DBUTTON_PIN=0
-DPIN_BUZZER=25
-DLED_PIN=-1
@@ -0,0 +1,29 @@
#define BATTERY_PIN 35
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
#define BATTERY_SENSE_SAMPLES 30
// ratio of voltage divider = 2.0 (R42=100k, R43=100k)
#define ADC_MULTIPLIER 2
#define I2C_SDA 21 // I2C pins for this board
#define I2C_SCL 22
#if defined(LED_PIN) && LED_PIN == -1
#undef LED_PIN
#else
#define LED_PIN 25 // If defined we will blink this LED
#endif
#define USE_RF95
#define LORA_DIO0 26 // a No connect on the SX1262 module
#define LORA_RESET 23
// In the T3 V1.6.1 TXCO version, GPIO 33 is connected to Radios
// internal temperature-compensated crystal oscillator enable
#ifdef LORA_TCXO_GPIO
#define LORA_DIO1 RADIOLIB_NC // no-connect on sx127x module
#else
#define LORA_DIO1 33 // https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-3/18436
#endif
#define LORA_DIO2 32 // Not really used
@@ -0,0 +1,10 @@
[env:tlora-v2-1-1_6-tcxo]
extends = esp32_base
board_level = extra
board = ttgo-lora32-v21
build_flags =
${esp32_base.build_flags}
-D TLORA_V2_1_16
-I variants/esp32/tlora_v2_1_16
-D LORA_TCXO_GPIO=33
upload_speed = 115200
@@ -0,0 +1,9 @@
[env:tlora-v2-1-1_8]
extends = esp32_base
board_level = extra
board = ttgo-lora32-v21
build_flags =
${esp32_base.build_flags}
-D TLORA_V2_1_18
-I variants/esp32/tlora_v2_1_18
@@ -0,0 +1,20 @@
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
// ratio of voltage divider = 2.0 (R42=100k, R43=100k)
#define ADC_MULTIPLIER 2.11 // 2.0 + 10% for correction of display undervoltage.
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
#define I2C_SDA 21 // I2C pins for this board
#define I2C_SCL 22
#define LED_PIN 25 // If defined we will blink this LED
#define BUTTON_PIN 12 // If defined, this will be used for user button presses,
#define BUTTON_NEED_PULLUP
#define USE_SX1280
#define LORA_RESET 23
#define SX128X_CS 18
#define SX128X_DIO1 26
#define SX128X_BUSY 32
#define SX128X_RESET LORA_RESET
@@ -0,0 +1,9 @@
[env:tlora-v3-3-0-tcxo]
extends = esp32_base
board = ttgo-lora32-v21
build_flags =
${esp32_base.build_flags}
-D TLORA_V2_1_16
-I variants/esp32/tlora_v2_1_16
-D LORA_TCXO_GPIO=12
-D BUTTON_PIN=0
@@ -0,0 +1,9 @@
[env:trackerd]
extends = esp32_base
board_level = extra
board = pico32
board_build.f_flash = 80000000L
build_flags =
${esp32_base.build_flags} -D PRIVATE_HW -I variants/esp32/trackerd -D BSFILE=\"boards/dragino_lbt2.h\"
;board_build.partitions = no_ota.csv
@@ -0,0 +1,53 @@
// Initialize i2c bus on sd_dat and esp_led pins, respectively. We need a bus to not hang on boot
#define HAS_SCREEN 0
#define I2C_SDA 21
#define I2C_SCL 22
#undef GPS_RX_PIN
#undef GPS_TX_PIN
#define GPS_RX_PIN 9
#define GPS_TX_PIN 10
#define LED_PIN 13 // 13 red, 2 blue, 15 red
// #define HAS_BUTTON 0
#define BUTTON_PIN 0
#define BUTTON_NEED_PULLUP
#define USE_RF95
#define LORA_DIO0 26 // a No connect on the SX1262 module
#define LORA_RESET 23
#define LORA_DIO1 33
#define LORA_DIO2 32 // Not really used
#undef BAT_MEASURE_ADC_UNIT
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
#define ADC_MULTIPLIER 1.34 // tracked resistance divider is 100k+470k, so it can not fillfull well on esp32 adc
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
#define ADC_ATTENUATION ADC_ATTEN_DB_12 // lower dB for high resistance voltage divider
#undef GPS_RX_PIN
#undef GPS_TX_PIN
#undef PIN_GPS_PPS
#define PIN_GPS_EN 12
#define GPS_EN_ACTIVE 1
#define GPS_TX_PIN 10
#define GPS_RX_PIN 9
#define PIN_GPS_RESET 25
// #define PIN_GPS_REINIT 25
#define GPS_RESET_MODE 1
#define GPS_L76K
#undef PIN_LED1
#undef PIN_LED2
#undef PIN_LED3
#define PIN_LED1 13
#define PIN_LED2 15
#define PIN_LED3 2
#define ledOff(pin) pinMode(pin, INPUT)
@@ -0,0 +1,44 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
static const uint8_t TX = 1;
static const uint8_t RX = 3;
static const uint8_t SDA = 21;
static const uint8_t SCL = 22;
static const uint8_t SS = 5;
static const uint8_t MOSI = 23;
static const uint8_t MISO = 19;
static const uint8_t SCK = 18;
static const uint8_t G23 = 23;
static const uint8_t G19 = 19;
static const uint8_t G18 = 18;
static const uint8_t G3 = 3;
static const uint8_t G16 = 16;
static const uint8_t G21 = 21;
static const uint8_t G2 = 2;
static const uint8_t G12 = 12;
static const uint8_t G15 = 15;
static const uint8_t G35 = 35;
static const uint8_t G36 = 36;
static const uint8_t G25 = 25;
static const uint8_t G26 = 26;
static const uint8_t G1 = 1;
static const uint8_t G17 = 17;
static const uint8_t G22 = 22;
static const uint8_t G5 = 5;
static const uint8_t G13 = 13;
static const uint8_t G0 = 0;
static const uint8_t G34 = 34;
static const uint8_t DAC1 = 25;
static const uint8_t DAC2 = 26;
static const uint8_t ADC1 = 35;
static const uint8_t ADC2 = 36;
#endif /* Pins_Arduino_h */
@@ -0,0 +1,15 @@
[env:wiphone]
extends = esp32_base
board = wiphone
board_level = extra
monitor_filters = esp32_exception_decoder
board_build.partitions = default_16MB.csv
build_flags =
${esp32_base.build_flags}
-D WIPHONE
-I variants/esp32/wiphone
lib_deps =
${esp32_base.lib_deps}
lovyan03/LovyanGFX@^1.2.0
sparkfun/SX1509 IO Expander@^3.0.5
pololu/APA102@^3.0.0
@@ -0,0 +1,62 @@
#define I2C_SDA 15
#define I2C_SCL 25
#define GPIO_EXTENDER 1509
#define EXTENDER_FLAG 0x40
#define EXTENDER_PIN(x) (x + EXTENDER_FLAG)
#undef RF95_SCK
#undef RF95_MISO
#undef RF95_MOSI
#undef RF95_NSS
#define RF95_SCK 14
#define RF95_MISO 12
#define RF95_MOSI 13
#define RF95_NSS 27
#define USE_RF95
#define LORA_DIO0 38
#define LORA_RESET RADIOLIB_NC
#define LORA_DIO1 RADIOLIB_NC
#define LORA_DIO2 RADIOLIB_NC
// This board has no GPS or Screen for now
#undef GPS_RX_PIN
#undef GPS_TX_PIN
#define NO_GPS 1
#define HAS_GPS 0
#define NO_SCREEN
#define HAS_SCREEN 0
// Default SPI1 will be mapped to the display
#define ST7789_SDA 23
#define ST7789_SCK 18
#define ST7789_CS 5
#define ST7789_RS 26
// I don't have a 'wiphone' but this I think should not be defined this way (don't set TFT_BL if we don't have a hw way to control
// it)
// #define ST7789_BL -1 // EXTENDER_PIN(9)
#define ST7789_RESET -1
#define ST7789_MISO 19
#define ST7789_BUSY -1
#define ST7789_SPI_HOST SPI3_HOST
// I don't have a 'wiphone' but this I think should not be defined this way (don't set TFT_BL if we don't have a hw way to control
// it)
// #define TFT_BL -1 // EXTENDER_PIN(9)
#define SPI_FREQUENCY 40000000
#define SPI_READ_FREQUENCY 16000000
#define TFT_HEIGHT 240
#define TFT_WIDTH 320
#define TFT_OFFSET_X 0
#define TFT_OFFSET_Y 0
#define TFT_OFFSET_ROTATION 0
#define SCREEN_ROTATE
#define SCREEN_TRANSITION_FRAMERATE 5
#define I2S_MCLK_GPIO0
#define I2S_BCK_PIN 4 // rev1.3 - 4 (wp05)
#define I2S_WS_PIN 33
#define I2S_MOSI_PIN 21
#define I2S_MISO_PIN 34
@@ -0,0 +1,8 @@
[env:ai-c3]
extends = esp32c3_base
board = esp32-c3-devkitm-1
board_level = extra
build_flags =
${esp32c3_base.build_flags}
-D PRIVATE_HW
-I variants/esp32c3/ai-c3
@@ -0,0 +1,32 @@
#define SDA 0
#define SCL 1
#define I2C_SDA SDA
#define I2C_SCL SCL
#define BUTTON_PIN 9 // BOOT button
#define LED_PIN 30 // RGB LED
#define USE_RF95
#define LORA_SCK 4
#define LORA_MISO 5
#define LORA_MOSI 6
#define LORA_CS 7
#define LORA_DIO0 10
#define LORA_DIO1 3
#define LORA_RESET 2
// WaveShare Core1262-868M
// https://www.waveshare.com/wiki/Core1262-868M
#define USE_SX1262
#define SX126X_CS LORA_CS
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY 10
#define SX126X_RESET LORA_RESET
#define SX126X_DIO2_AS_RF_SWITCH // use DIO2 as RF switch
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
#define HAS_GPS 0
#undef GPS_RX_PIN
#undef GPS_TX_PIN
@@ -0,0 +1,24 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
static const uint8_t TX = 21;
static const uint8_t RX = 20;
static const uint8_t SDA = 1;
static const uint8_t SCL = 0;
static const uint8_t SS = 8;
static const uint8_t MOSI = 7;
static const uint8_t MISO = 6;
static const uint8_t SCK = 10;
static const uint8_t A0 = 0;
static const uint8_t A1 = 1;
static const uint8_t A2 = 2;
static const uint8_t A3 = 3;
static const uint8_t A4 = 4;
static const uint8_t A5 = 5;
#endif /* Pins_Arduino_h */
@@ -0,0 +1,12 @@
; ESP32 C3 Super Mini Development Board
; https://www.espboards.dev/esp32/esp32-c3-super-mini/
[env:esp32c3_super_mini]
extends = esp32c3_base
board = esp32-c3-devkitm-1
build_flags =
${esp32_base.build_flags}
-D PRIVATE_HW
-I variants/esp32c3/diy/esp32c3_super_mini
-D ARDUINO_USB_MODE=1
-D ARDUINO_USB_CDC_ON_BOOT=1
board_level = extra
@@ -0,0 +1,61 @@
#ifndef _VARIANT_ESP32C3_SUPER_MINI_
#define _VARIANT_ESP32C3_SUPER_MINI_
/*----------------------------------------------------------------------------
* Headers
*----------------------------------------------------------------------------*/
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
// I2C (Wire) & OLED
#define WIRE_INTERFACES_COUNT (1)
#define I2C_SDA (1)
#define I2C_SCL (0)
#define USE_SSD1306
// GPS
#undef GPS_RX_PIN
#undef GPS_TX_PIN
#define GPS_RX_PIN (20)
#define GPS_TX_PIN (21)
// Button
#define BUTTON_PIN (9) // BOOT button
// LoRa
#define USE_LLCC68
#define USE_SX1262
// #define USE_RF95
#define USE_SX1268
#define LORA_DIO0 RADIOLIB_NC
#define LORA_RESET (5)
#define LORA_DIO1 (3)
#define LORA_RXEN (2)
#define LORA_BUSY (4)
#define LORA_SCK (10)
#define LORA_MISO (6)
#define LORA_MOSI (7)
#define LORA_CS (8)
#define SX126X_CS LORA_CS
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_BUSY
#define SX126X_RESET LORA_RESET
#define SX126X_RXEN LORA_RXEN
#define SX126X_DIO3_TCXO_VOLTAGE (1.8)
#define TCXO_OPTIONAL // make it so that the firmware can try both TCXO and XTAL
#ifdef __cplusplus
}
#endif
/*----------------------------------------------------------------------------
* Arduino objects - C++ only
*----------------------------------------------------------------------------*/
#endif
@@ -0,0 +1,14 @@
[env:hackerboxes-esp32c3-oled]
extends = esp32c3_base
board = esp32-c3-devkitm-1
board_level = extra
build_flags =
${esp32_base.build_flags}
-D PRIVATE_HW
-D ARDUINO_USB_MODE=1
-D ARDUINO_USB_CDC_ON_BOOT=1
-I variants/esp32c3/hackerboxes_esp32c3_oled
monitor_speed = 115200
upload_protocol = esptool
;upload_port = /dev/ttyUSB0
upload_speed = 921600
@@ -0,0 +1,36 @@
#define BUTTON_PIN 9
// Hackerboxes LoRa ESP32-C3 OLED Kit
// Uses a ESP32-C3 OLED Board and a RA-01SH (SX1262) LoRa Board
#define LED_PIN 8 // LED
#define LED_STATE_ON 1 // State when LED is lit
#define HAS_SCREEN 0
#define HAS_GPS 0
#undef GPS_RX_PIN
#undef GPS_TX_PIN
// #define USE_SSD1306_72_40
// #define I2C_SDA 5 // I2C pins for this board
// #define I2C_SCL 6 //
// #define TFT_WIDTH 72
// #define TFT_HEIGHT 40
#define USE_SX1262
#define LORA_SCK 4
#define LORA_MISO 7
#define LORA_MOSI 3
#define LORA_CS 1
#define LORA_DIO0 RADIOLIB_NC
#define LORA_RESET 0
#define LORA_DIO1 20
#define LORA_DIO2 RADIOLIB_NC
#define LORA_BUSY 10
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_CS LORA_CS
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_BUSY
#define SX126X_RESET LORA_RESET
#define SX126X_MAX_POWER 22 // Max power of the RA-01SH is 22db
@@ -0,0 +1,24 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
static const uint8_t TX = 21;
static const uint8_t RX = 20;
static const uint8_t SDA = 1;
static const uint8_t SCL = 0;
static const uint8_t SS = 8;
static const uint8_t MOSI = 7;
static const uint8_t MISO = 6;
static const uint8_t SCK = 10;
static const uint8_t A0 = 0;
static const uint8_t A1 = 1;
static const uint8_t A2 = 2;
static const uint8_t A3 = 3;
static const uint8_t A4 = 4;
static const uint8_t A5 = 5;
#endif /* Pins_Arduino_h */
@@ -0,0 +1,12 @@
[env:heltec-ht62-esp32c3-sx1262]
extends = esp32c3_base
board = esp32-c3-devkitm-1
board_level = pr
build_flags =
${esp32_base.build_flags}
-D HELTEC_HT62
-I variants/esp32c3/heltec_esp32c3
monitor_speed = 115200
upload_protocol = esptool
;upload_port = /dev/ttyUSB0
upload_speed = 921600
@@ -0,0 +1,29 @@
#define BUTTON_PIN 9
// LED pin on HT-DEV-ESP_V2 and HT-DEV-ESP_V3
// https://resource.heltec.cn/download/HT-CT62/HT-CT62_Reference_Design.pdf
// https://resource.heltec.cn/download/HT-DEV-ESP/HT-DEV-ESP_V3_Sch.pdf
#define LED_PIN 2 // LED
#define LED_STATE_ON 1 // State when LED is lit
#define HAS_SCREEN 0
#define HAS_GPS 0
#undef GPS_RX_PIN
#undef GPS_TX_PIN
#define USE_SX1262
#define LORA_SCK 10
#define LORA_MISO 6
#define LORA_MOSI 7
#define LORA_CS 8
#define LORA_DIO0 RADIOLIB_NC
#define LORA_RESET 5
#define LORA_DIO1 3
#define LORA_DIO2 RADIOLIB_NC
#define LORA_BUSY 4
#define SX126X_CS LORA_CS
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_BUSY
#define SX126X_RESET LORA_RESET
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
@@ -0,0 +1,25 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#include <variant.h>
static const uint8_t TX = UART_TX;
static const uint8_t RX = UART_RX;
static const uint8_t SDA = I2C_SDA;
static const uint8_t SCL = I2C_SCL;
static const uint8_t SS = 8;
static const uint8_t MOSI = 7;
static const uint8_t MISO = 6;
static const uint8_t SCK = 10;
static const uint8_t A0 = 0;
static const uint8_t A1 = 1;
static const uint8_t A2 = 2;
static const uint8_t A3 = 3;
static const uint8_t A4 = 4;
static const uint8_t A5 = 5;
#endif /* Pins_Arduino_h */
@@ -0,0 +1,9 @@
[env:heltec-hru-3601]
extends = esp32c3_base
board = adafruit_qtpy_esp32c3
build_flags =
${esp32_base.build_flags}
-D HELTEC_HRU_3601
-I variants/esp32c3/heltec_hru_3601
lib_deps = ${esp32c3_base.lib_deps}
adafruit/Adafruit NeoPixel @ ^1.12.0
@@ -0,0 +1,40 @@
#define BUTTON_PIN 9
#define HAS_SCREEN 0
#define HAS_GPS 0
#undef GPS_RX_PIN
#undef GPS_TX_PIN
#define USE_SX1262
#define LORA_SCK 10
#define LORA_MISO 6
#define LORA_MOSI 7
#define LORA_CS 8
#define LORA_DIO0 RADIOLIB_NC
#define LORA_RESET 5
#define LORA_DIO1 3
#define LORA_DIO2 RADIOLIB_NC
#define LORA_BUSY 4
#define SX126X_CS LORA_CS
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_BUSY
#define SX126X_RESET LORA_RESET
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
// Vext_Ctrl pin controls 3.3V LDO (U2) which provides power to I2C peripheral
#define PIN_POWER_EN 1
// Board has I2C connected to UART0 pins, and no other hardware serial port
#define UART_TX -1
#define UART_RX -1
// Board has I2C connected to U0RXD and U0TXD
#define I2C_SDA 21
#define I2C_SCL 20
// Board has RGB LED on GPIO2
#define HAS_NEOPIXEL // Enable the use of neopixels
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
#define NEOPIXEL_DATA 2 // gpio pin used to send data to the neopixels
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use
@@ -0,0 +1,24 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
static const uint8_t TX = -1; // 21;
static const uint8_t RX = -1; // 20;
static const uint8_t SDA = 1;
static const uint8_t SCL = 0;
static const uint8_t SS = 7;
static const uint8_t MOSI = 6;
static const uint8_t MISO = 5;
static const uint8_t SCK = 4;
static const uint8_t A0 = 0;
static const uint8_t A1 = 1;
static const uint8_t A2 = 2;
static const uint8_t A3 = 3;
static const uint8_t A4 = 4;
static const uint8_t A5 = 5;
#endif /* Pins_Arduino_h */
@@ -0,0 +1,12 @@
[env:m5stack-stamp-c3]
extends = esp32c3_base
board = esp32-c3-devkitm-1
board_level = extra
build_flags =
${esp32_base.build_flags}
-D PRIVATE_HW
-I variants/esp32c3/m5stack-stamp-c3
monitor_speed = 115200
upload_protocol = esptool
;upload_port = /dev/ttyACM2
upload_speed = 921600
@@ -0,0 +1,73 @@
#define I2C_SDA 1
#define I2C_SCL 0
#define BUTTON_PIN 3 // M5Stack STAMP C3 built in button
#define BUTTON_NEED_PULLUP
// #define HAS_SCREEN 0
#define HAS_GPS 0
#undef GPS_RX_PIN
#undef GPS_TX_PIN
#undef LORA_SCK
#undef LORA_MISO
#undef LORA_MOSI
#undef LORA_CS
// Adafruit RFM95W OK
// https://www.adafruit.com/product/3072
#define USE_RF95
#define LORA_SCK 4
#define LORA_MISO 5
#define LORA_MOSI 6
#define LORA_CS 7
#define LORA_DIO0 10
#define LORA_RESET 8
#define LORA_DIO1 RADIOLIB_NC
#define LORA_DIO2 RADIOLIB_NC
// WaveShare Core1262-868M OK
// https://www.waveshare.com/wiki/Core1262-868M
// #define USE_SX1262
// #define LORA_SCK 4
// #define LORA_MISO 5
// #define LORA_MOSI 6
// #define LORA_CS 7
// #define LORA_DIO0 RADIOLIB_NC
// #define LORA_RESET 8
// #define LORA_DIO1 10
// #define LORA_DIO2 RADIOLIB_NC
// #define LORA_BUSY 18
// #define SX126X_CS LORA_CS
// #define SX126X_DIO1 LORA_DIO1
// #define SX126X_BUSY LORA_BUSY
// #define SX126X_RESET LORA_RESET
// #define SX126X_DIO2_AS_RF_SWITCH
// #define SX126X_DIO3_TCXO_VOLTAGE 1.8
// SX128X 2.4 Ghz LoRa module Not OK - RadioLib issue ? still to confirm
// #define USE_SX1280
// #define LORA_SCK 4
// #define LORA_MISO 5
// #define LORA_MOSI 6
// #define LORA_CS 7
// #define LORA_DIO0 -1
// #define LORA_DIO1 10
// #define LORA_DIO2 21
// #define LORA_RESET 8
// #define LORA_BUSY 1
// #define SX128X_CS LORA_CS
// #define SX128X_DIO1 LORA_DIO1
// #define SX128X_BUSY LORA_BUSY
// #define SX128X_RESET LORA_RESET
// #define SX128X_MAX_POWER 10
// Not yet tested
// #define USE_EINK
// #define PIN_EINK_EN -1 // N/C
// #define PIN_EINK_CS 9 // EPD_CS
// #define PIN_EINK_BUSY 18 // EPD_BUSY
// #define PIN_EINK_DC 19 // EPD_D/C
// #define PIN_EINK_RES -1 // Connected but not needed
// #define PIN_EINK_SCLK 4 // EPD_SCLK
// #define PIN_EINK_MOSI 6 // EPD_MOSI
@@ -0,0 +1,28 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#define USB_VID 0x2886
#define USB_PID 0x0048
static const uint8_t TX = 16;
static const uint8_t RX = 17;
static const uint8_t SDA = 10;
static const uint8_t SCL = 8;
// Default SPI will be mapped to Radio
static const uint8_t MISO = 22;
static const uint8_t SCK = 20;
static const uint8_t MOSI = 21;
static const uint8_t SS = 6;
// #define SPI_MOSI (11)
// #define SPI_SCK (14)
// #define SPI_MISO (2)
// #define SPI_CS (13)
// #define SDCARD_CS SPI_CS
#endif /* Pins_Arduino_h */
@@ -0,0 +1,35 @@
[env:m5stack-unitc6l]
extends = esp32c6_base
board = esp32-c6-devkitc-1
;OpenOCD flash method
;upload_protocol = esp-builtin
;Normal method
upload_protocol = esptool
;upload_port = /dev/ttyACM2
build_unflags =
-D HAS_BLUETOOTH
-D MESHTASTIC_EXCLUDE_BLUETOOTH
-D HAS_WIFI
lib_deps =
${esp32c6_base.lib_deps}
adafruit/Adafruit NeoPixel@^1.12.3
h2zero/NimBLE-Arduino@^2.3.6
build_flags =
${esp32c6_base.build_flags}
-D M5STACK_UNITC6L
-I variants/esp32c6/m5stack_unitc6l
-DMESHTASTIC_EXCLUDE_PAXCOUNTER=1
-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_MODE=1
-D HAS_BLUETOOTH=1
-D MESHTASTIC_EXCLUDE_WEBSERVER
-D MESHTASTIC_EXCLUDE_MQTT
-DCONFIG_BT_NIMBLE_EXT_ADV=1
-DCONFIG_BT_NIMBLE_MAX_EXT_ADV_INSTANCES=2
-D NIMBLE_TWO
monitor_speed=115200
lib_ignore =
NonBlockingRTTTL
libpax
build_src_filter =
${esp32c6_base.build_src_filter} +<../variants/esp32c6/m5stack_unitc6l>
@@ -0,0 +1,74 @@
#include "driver/gpio.h"
#include <Arduino.h>
#include <Wire.h>
// I2C device addr
#define PI4IO_M_ADDR 0x43
// PI4IO registers
#define PI4IO_REG_CHIP_RESET 0x01
#define PI4IO_REG_IO_DIR 0x03
#define PI4IO_REG_OUT_SET 0x05
#define PI4IO_REG_OUT_H_IM 0x07
#define PI4IO_REG_IN_DEF_STA 0x09
#define PI4IO_REG_PULL_EN 0x0B
#define PI4IO_REG_PULL_SEL 0x0D
#define PI4IO_REG_IN_STA 0x0F
#define PI4IO_REG_INT_MASK 0x11
#define PI4IO_REG_IRQ_STA 0x13
// PI4IO
#define setbit(x, y) x |= (0x01 << y)
#define clrbit(x, y) x &= ~(0x01 << y)
#define reversebit(x, y) x ^= (0x01 << y)
#define getbit(x, y) ((x) >> (y)&0x01)
void i2c_read_byte(uint8_t addr, uint8_t reg, uint8_t *value)
{
Wire.beginTransmission(addr);
Wire.write(reg);
Wire.endTransmission();
Wire.requestFrom(addr, 1);
*value = Wire.read();
}
/*******************************************************************/
void i2c_write_byte(uint8_t addr, uint8_t reg, uint8_t value)
{
Wire.beginTransmission(addr);
Wire.write(reg);
Wire.write(value);
Wire.endTransmission();
}
/*******************************************************************/
void c6l_init()
{
// P7 LoRa Reset
// P6 RF Switch
// P5 LNA Enable
printf("pi4io_init\n");
uint8_t in_data;
i2c_write_byte(PI4IO_M_ADDR, PI4IO_REG_CHIP_RESET, 0xFF);
vTaskDelay(10 / portTICK_PERIOD_MS);
i2c_read_byte(PI4IO_M_ADDR, PI4IO_REG_CHIP_RESET, &in_data);
vTaskDelay(10 / portTICK_PERIOD_MS);
i2c_write_byte(PI4IO_M_ADDR, PI4IO_REG_IO_DIR, 0b11000000); // 0: input 1: output
vTaskDelay(10 / portTICK_PERIOD_MS);
i2c_write_byte(PI4IO_M_ADDR, PI4IO_REG_OUT_H_IM, 0b00111100); // 使用到的引脚关闭High-Impedance
vTaskDelay(10 / portTICK_PERIOD_MS);
i2c_write_byte(PI4IO_M_ADDR, PI4IO_REG_PULL_SEL, 0b11000011); // pull up/down select, 0 down, 1 up
vTaskDelay(10 / portTICK_PERIOD_MS);
i2c_write_byte(PI4IO_M_ADDR, PI4IO_REG_PULL_EN, 0b11000011); // pull up/down enable, 0 disable, 1 enable
vTaskDelay(10 / portTICK_PERIOD_MS);
i2c_write_byte(PI4IO_M_ADDR, PI4IO_REG_IN_DEF_STA, 0b00000011); // P0 P1 默认高电平, 按键按下触发中断
vTaskDelay(10 / portTICK_PERIOD_MS);
i2c_write_byte(PI4IO_M_ADDR, PI4IO_REG_INT_MASK, 0b11111100); // P0 P1 中断使能 0 enable, 1 disable
vTaskDelay(10 / portTICK_PERIOD_MS);
i2c_write_byte(PI4IO_M_ADDR, PI4IO_REG_OUT_SET, 0b10000000); // 默认输出为0
vTaskDelay(10 / portTICK_PERIOD_MS);
i2c_read_byte(PI4IO_M_ADDR, PI4IO_REG_IRQ_STA, &in_data); // 读取IRQ_STA清除标志
i2c_read_byte(PI4IO_M_ADDR, PI4IO_REG_OUT_SET, &in_data);
setbit(in_data, 6); // HIGH
i2c_write_byte(PI4IO_M_ADDR, PI4IO_REG_OUT_SET, in_data);
}
@@ -0,0 +1,52 @@
void c6l_init();
#define HAS_GPS 1
#define GPS_RX_PIN 4
#define GPS_TX_PIN 5
#define I2C_SDA 10
#define I2C_SCL 8
#define PIN_BUZZER 11
#define HAS_NEOPIXEL // Enable the use of neopixels
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
#define NEOPIXEL_DATA 2 // gpio pin used to send data to the neopixels
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use
#define ENABLE_AMBIENTLIGHTING // Turn on Ambient Lighting
// #define BUTTON_PIN 9
#define BUTTON_EXTENDER
#undef LORA_SCK
#undef LORA_MISO
#undef LORA_MOSI
#undef LORA_CS
// WaveShare Core1262-868M OK
// https://www.waveshare.com/wiki/Core1262-868M
#define USE_SX1262
#define LORA_MISO 22
#define LORA_SCK 20
#define LORA_MOSI 21
#define LORA_CS 23
#define LORA_RESET RADIOLIB_NC
#define LORA_DIO1 7
#define LORA_BUSY 19
#define SX126X_CS LORA_CS
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_BUSY
#define SX126X_RESET LORA_RESET
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_DIO3_TCXO_VOLTAGE 3.0
#define USE_SPISSD1306
#ifdef USE_SPISSD1306
#define SSD1306_NSS 6 // CS
#define SSD1306_RS 18 // DC
#define SSD1306_RESET 15
// #define OLED_DG 1
#endif
#define SCREEN_TRANSITION_FRAMERATE 10
#define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness
@@ -0,0 +1,10 @@
[env:tlora-c6]
extends = esp32c6_base
board = esp32-c6-devkitm-1
board_level = pr
build_flags =
${esp32c6_base.build_flags}
-D TLORA_C6
-I variants/esp32c6/tlora_c6
-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_MODE=1
@@ -0,0 +1,21 @@
#define I2C_SDA 8 // I2C pins for this board
#define I2C_SCL 9
#define LED_PIN 7 // If defined we will blink this LED
#define LED_STATE_ON 0 // State when LED is lit
#define USE_SX1262
#define LORA_SCK 6
#define LORA_MISO 1
#define LORA_MOSI 0
#define LORA_CS 18
#define LORA_RESET 21
#define SX126X_CS LORA_CS
#define SX126X_DIO1 23
#define SX126X_DIO2 20
#define SX126X_BUSY 22
#define SX126X_RESET LORA_RESET
#define SX126X_RXEN 15
#define SX126X_TXEN 14
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
@@ -0,0 +1,8 @@
[env:nugget-s2-lora]
extends = esp32s2_base
board = lolin_s2_mini
board_level = extra
build_flags =
${esp32s2_base.build_flags}
-D PRIVATE_HW
-I variants/esp32s2/nugget_s2_lora
@@ -0,0 +1,23 @@
#define I2C_SDA 34 // I2C pins for this board
#define I2C_SCL 36
#define LED_PIN 15 // If defined we will blink this LED
#define HAS_NEOPIXEL // Enable the use of neopixels
#define NEOPIXEL_COUNT 3 // How many neopixels are connected
#define NEOPIXEL_DATA 12 // gpio pin used to send data to the neopixels
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
#define BUTTON_NEED_PULLUP
#define USE_RF95
#define LORA_SCK 6
#define LORA_MISO 8
#define LORA_MOSI 10
#define LORA_CS 13
#define LORA_DIO0 16
#define LORA_RESET 5
#define LORA_DIO1 RADIOLIB_NC
#define LORA_DIO2 RADIOLIB_NC
@@ -0,0 +1,28 @@
// Need this file for ESP32-S3
// No need to modify this file, changes to pins imported from variant.h
// Most is similar to https://github.com/espressif/arduino-esp32/blob/master/variants/esp32s3/pins_arduino.h
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#include <variant.h>
#define USB_VID 0x303a
#define USB_PID 0x1001
// Serial
static const uint8_t TX = UART_TX;
static const uint8_t RX = UART_RX;
// Default SPI will be mapped to Radio
static const uint8_t SS = LORA_CS;
static const uint8_t SCK = LORA_SCK;
static const uint8_t MOSI = LORA_MOSI;
static const uint8_t MISO = LORA_MISO;
// The default Wire will be mapped to PMU and RTC
static const uint8_t SCL = I2C_SCL;
static const uint8_t SDA = I2C_SDA;
#endif /* Pins_Arduino_h */
@@ -0,0 +1,7 @@
[env:CDEBYTE_EoRa-S3]
extends = esp32s3_base
board = CDEBYTE_EoRa-S3
build_flags =
${esp32s3_base.build_flags}
-D CDEBYTE_EORA_S3
-I variants/esp32s3/CDEBYTE_EoRa-S3
@@ -0,0 +1,63 @@
// LED - status indication
#define LED_PIN 37
// Button - user interface
#define BUTTON_PIN 0 // This is the BOOT button, and it has its own pull-up resistor
// SD card - TODO: test, currently untested, copied from T3S3 variant
#define HAS_SDCARD
#define SDCARD_USE_SPI1
// TODO: rename this to make this SD-card specific
#define SPI_CS 13
#define SPI_SCK 14
#define SPI_MOSI 11
#define SPI_MISO 2
// FIXME: there are two other SPI pins that are not defined here
// Compatibility
#define SDCARD_CS SPI_CS
// Battery voltage monitoring - TODO: test, currently untested, copied from T3S3 variant
#define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
#define ADC_CHANNEL ADC1_GPIO1_CHANNEL
#define ADC_MULTIPLIER \
2.11 // ratio of voltage divider = 2.0 (R10=1M, R13=1M), plus some undervoltage correction - TODO: this was carried over from
// the T3S3, test to see if the undervoltage correction is needed.
// Display - OLED connected via I2C by the default hardware configuration
#define HAS_SCREEN 1
#define USE_SSD1306
#define I2C_SCL 17
#define I2C_SDA 18
// UART - The 1mm JST SH connector closest to the USB-C port
#define UART_TX 43
#define UART_RX 44
// Peripheral I2C - The 1mm JST SH connector furthest from the USB-C port which follows Adafruit connection standard. There are no
// pull-up resistors on these lines, the downstream device needs to include them. TODO: test, currently untested
#define I2C_SCL1 21
#define I2C_SDA1 10
// Radio
#define USE_SX1262 // CDEBYTE EoRa-S3-900TB <- CDEBYTE E22-900MM22S <- Semtech SX1262
#define USE_SX1268 // CDEBYTE EoRa-S3-400TB <- CDEBYTE E22-400MM22S <- Semtech SX1268
#define SX126X_CS 7
#define LORA_SCK 5
#define LORA_MOSI 6
#define LORA_MISO 3
#define SX126X_RESET 8
#define SX126X_BUSY 34
#define SX126X_DIO1 33
#define SX126X_DIO2_AS_RF_SWITCH // All switching is performed with DIO2, it is automatically inverted using circuitry.
// CDEBYTE EoRa-S3 uses an XTAL, thus we do not need DIO3 as TCXO voltage reference. Don't define SX126X_DIO3_TCXO_VOLTAGE for
// simplicity rather than defining it as 0.
#define SX126X_MAX_POWER \
22 // E22-900MM22S and E22-400MM22S have a raw SX1262 or SX1268 respsectively, they are rated to output up and including 22
// dBm out of their SX126x IC.
// Compatibility with old variant.h file structure - FIXME: this should be done in the respective radio interface modules to clean
// up all variants.
#define LORA_CS SX126X_CS
#define LORA_DIO1 SX126X_DIO1
@@ -0,0 +1,28 @@
// Need this file for ESP32-S3
// No need to modify this file, changes to pins imported from variant.h
// Most is similar to https://github.com/espressif/arduino-esp32/blob/master/variants/esp32s3/pins_arduino.h
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#include <variant.h>
#define USB_VID 0x303a
#define USB_PID 0x1001
// Serial
static const uint8_t TX = UART_TX;
static const uint8_t RX = UART_RX;
// Default SPI will be mapped to Radio
static const uint8_t SS = LORA_CS;
static const uint8_t SCK = LORA_SCK;
static const uint8_t MOSI = LORA_MOSI;
static const uint8_t MISO = LORA_MISO;
// The default Wire will be mapped to PMU and RTC
static const uint8_t SCL = I2C_SCL;
static const uint8_t SDA = I2C_SDA;
#endif /* Pins_Arduino_h */
@@ -0,0 +1,9 @@
[env:EBYTE_ESP32-S3]
extends = esp32s3_base
; board assumes the lowest spec WROOM module: 4 MB (Quad SPI) Flash, No PSRAM
board = ESP32-S3-WROOM-1-N4
board_level = extra
build_flags =
${esp32s3_base.build_flags}
-D EBYTE_ESP32_S3
-I variants/esp32s3/EBYTE_ESP32-S3
@@ -0,0 +1,193 @@
// Supporting information: https://github.com/S5NC/EBYTE_ESP32-S3/
// Originally developed for E22-900M30S with ESP32-S3-WROOM-1-N4
// NOTE: Uses ESP32-S3-WROOM-1-N4.json in boards folder (via platformio.ini board field), assumes 4 MB (quad SPI) flash, no PSRAM
// FIXME: implement SX12 module type autodetection and have setup for each case (add E32 support)
// E32 has same pinout except having extra pins. I assume that the GND on it is connected internally to other GNDs so it is not a
// problem to NC the extra GND pins.
// For each EBYTE module pin in this section, provide the pin number of the ESP32-S3 you connected it to
// The ESP32-S3 is great because YOU CAN USE PRACTICALLY ANY PINS for the connections, but avoid some pins (such as on the WROOM
// modules the following): strapping pins (except 0 as a user button input as it already has a pulldown resistor in typical
// application schematic) (0, 3, 45, 46), USB-reserved (19, 20), and pins which aren't present on the WROOM-2 module for
// compatiblity as it uses octal SPI, or are likely connected internally in either WROOM version (26-37), and avoid pins whose
// voltages are set by the SPI voltage (47, 48), and pins that don't exist (22-25) You can ALSO set the SPI pins (SX126X_CS,
// SX126X_SCK, SX126X_MISO, SX126X_MOSI) to any pin with the ESP32-S3 due to \ GPIO Matrix / IO MUX / RTC IO MUX \, and also the
// serial pins, but this isn't recommended for Serial0 as the WROOM modules have a 499 Ohm resistor on U0TXD (to reduce harmonics
// but also acting as a sort of protection)
// We have many free pins on the ESP32-S3-WROOM-X-Y module, perhaps it is best to use one of its pins to control TXEN, and use
// DIO2 as an extra interrupt, but right now Meshtastic does not benefit from having another interrupt pin available.
// Adding two 0-ohm links on your PCB design so that you can choose between the two modes for controlling the E22's TXEN would
// enable future software to make the most of an extra available interrupt pin
// Possible improvement: can add extremely low resistance MOSFET to physically toggle power to E22 module when in full sleep (not
// waiting for interrupt)?
// PA stands for Power Amplifier, used when transmitting to increase output power
// LNA stands for Low Noise Amplifier, used when \ listening for / receiving \ data to increase sensitivity
//////////////////////////////////////////////////////////////////////////////////
// //
// Have custom connections or functionality? Configure them in this section //
// //
//////////////////////////////////////////////////////////////////////////////////
#define SX126X_CS 14 // EBYTE module's NSS pin // FIXME: rename to SX126X_SS
#define LORA_SCK 21 // EBYTE module's SCK pin
#define LORA_MOSI 38 // EBYTE module's MOSI pin
#define LORA_MISO 39 // EBYTE module's MISO pin
#define SX126X_RESET 40 // EBYTE module's NRST pin
#define SX126X_BUSY 41 // EBYTE module's BUSY pin
#define SX126X_DIO1 42 // EBYTE module's DIO1 pin
// We don't define a pin for SX126X_DIO2 as Meshtastic doesn't use it as an interrupt output, so it is never connected to an MCU
// pin! Also E22 module datasheets say not to connect it to an MCU pin.
// We don't define a pin for SX126X_DIO3 as Meshtastic doesn't use it as an interrupt output, so it is never connected to an MCU
// pin! Also E22 module datasheets say to use it as the TCXO's reference voltage.
// E32 module (which uses SX1276) may not have ability to set TCXO voltage using a DIO pin.
// The radio module needs to be told whether to enable RX mode or TX mode. Each radio module takes different actions based on
// these values, but generally the path from the antenna to SX1262 is changed from signal output to signal input. Also, if there
// are LNAs (Low-Noise Amplifiers) or PAs (Power Amplifiers) in the output or input paths, their power is also controlled by
// these pins. You should never have both TXEN and RXEN set high, this can cause problems for some radio modules, and is
// commonly referred to as 'undefined behaviour' in datasheets. For the SX1262, you shouldn't connect DIO2 to the MCU. DIO2 is
// an output only, and can be controlled via SPI instructions, the use for this is to save an MCU pin by using the DIO2 pin to
// control the RF switching mode.
// Choose ONLY ONE option from below, comment in/out the '/*'s and '*/'s
// SX126X_TXEN is the E22's [SX1262's] TXEN pin, SX126X_RXEN is the E22's [SX1262's] RXEN pin
// Option 1: E22's TXEN pin connected to E22's DIO2 pin, E22's RXEN pin connected to NEGATED output of E22's DIO2 pin (more
// expensive option hardware-wise, is the 'most proper' way, removes need for routing one/two traces from MCU to RF switching
// pins), however you can't have E22 in low-power 'sleep' mode (TXEN and RXEN both low cannot be achieved this this option).
/*
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_TXEN RADIOLIB_NC
#define SX126X_RXEN RADIOLIB_NC
*/
// Option 2: E22's TXEN pin connected to E22's DIO2 pin, E22's RXEN pin connected to MCU pin (cheaper option hardware-wise,
// removes need for routing another trace from MCU to an RF switching pin).
// /*
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_TXEN RADIOLIB_NC
#define SX126X_RXEN 10
// */
// Option 3: E22's TXEN pin connected to MCU pin, E22's RXEN pin connected to MCU pin (cheaper option hardware-wise, allows for
// ramping up PA before transmission (add/expand on feature yourself in RadioLib) if PA takes a while to stabilise)
// Don't define DIO2_AS_RF_SWITCH because we only use DIO2 or an MCU pin mutually exclusively to connect to E22's TXEN (to prevent
// a short if they are both connected at the same time (suboptimal PCB design) and there's a slight non-neglibible delay and/or
// voltage difference between DIO2 and TXEN). Can use DIO2 as an IRQ (but not in Meshtastic at the moment).
/*
#define SX126X_TXEN 9
#define SX126X_RXEN 10
*/
// (NOT RECOMMENDED, if need to ramp up PA before transmission, better to use option 3)
// Option 4: E22's TXEN pin connected to MCU pin, E22's RXEN pin connected to NEGATED output of E22's DIO2 pin (more expensive
// option hardware-wise, allows for ramping up PA before transmission (add/expand on feature yourself in RadioLib) if PA takes
// a while to stabilise, removes need for routing another trace from MCU to an RF switching pin, however may mean if in
// RadioLib you don't tell DIO2 to go high to indicate transmission (so the negated output goes to RXEN to turn the LNA off)
// then you may end up enabling E22's TXEN and RXEN pins at the same time whilst you ramp up the PA which is not ideal,
// changing DIO2's switching advance in RadioLib may not even be possible, may be baked into the SX126x).
/*
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_TXEN 9
#define SX126X_RXEN RADIOLIB_NC
*/
// Status
#define LED_PIN 1
#define LED_STATE_ON 1 // State when LED is lit
// External notification
// FIXME: Check if EXT_NOTIFY_OUT actualy has any effect and removes the need for setting the external notication pin in the
// app/preferences
#define EXT_NOTIFY_OUT 2 // The GPIO pin that acts as the external notification output (here we connect an LED to it)
// Buzzer
#define PIN_BUZZER 11
// Buttons
#define BUTTON_PIN 0 // Use the BOOT button as the user button
// I2C
#define I2C_SCL 18
#define I2C_SDA 8
// UART
#define UART_TX 43
#define UART_RX 44
// Power
// Outputting 22dBm from SX1262 results in ~30dBm E22-900M30S output (module only uses last stage of the YP2233W PA)
// Respect local regulations! If your E22-900M30S outputs the advertised 30 dBm and you use a 6 dBi antenna, you are at the
// equivalent of 36 EIRP (Effective Isotropic Radiated Power), which in this case is the limit for non-HAM users in the US (4W
// EIRP, at SPECIFIC frequencies).
// In the EU (and UK), as of now, you are allowed 27 dBm ERP which is 29.15 EIRP.
// https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:32022D0180
// https://www.legislation.gov.uk/uksi/1999/930/schedule/6/made
// To respect the 29.15 dBm EIRP (at SPECIFIC frequencies, others are lower) EU limit with a 2.5 dBi gain antenna, consulting
// https://github.com/S5NC/EBYTE_ESP32-S3/blob/main/power%20testing.txt, assuming 0.1 dBm insertion loss, output 20 dBm from the
// E22-900M30S's SX1262. It is worth noting that if you are in this situation and don't have a HAM license, you may be better off
// with a lower gain antenna, and output the difference as a higher total power input into the antenna, as your EIRP would be the
// same, but you would get a wider angle of coverage. Also take insertion loss and possibly VSWR into account
// (https://www.everythingrf.com/tech-resources/vswr). Please check regulations yourself and check airtime, usage (for example
// whether you are airborne), frequency, and power laws.
#define SX126X_MAX_POWER 22 // SX126xInterface.cpp defaults to 22 if not defined, but here we define it for good practice
// Display
// FIXME: change behavior in src to default to not having screen if is undefined
// FIXME: remove 0/1 option for HAS_SCREEN in src, change to being defined or not
// FIXME: check if it actually causes a crash when not specifiying that a display isn't present
#define HAS_SCREEN 0 // Assume no screen present by default to prevent crash...
// GPS
// FIXME: unsure what to define HAS_GPS as if GPS isn't always present
#define HAS_GPS 1 // Don't need to set this to 0 to prevent a crash as it doesn't crash if GPS not found, will probe by default
#define PIN_GPS_EN 15
#define GPS_EN_ACTIVE 1
#define GPS_TX_PIN 16
#define GPS_RX_PIN 17
/////////////////////////////////////////////////////////////////////////////////
// //
// You should have no need to modify the code below, nor in pins_arduino.h //
// //
/////////////////////////////////////////////////////////////////////////////////
#define USE_SX1262 // E22-900M30S, E22-900M22S, and E22-900MM22S (not E220!) use SX1262
#define USE_SX1268 // E22-400M30S, E22-400M33S, E22-400M22S, and E22-400MM22S use SX1268
// The below isn't needed as we directly define SX126X_TXEN and SX126X_RXEN instead of using proxies E22_TXEN and E22_RXEN
/*
// FALLBACK: If somehow E22_TXEN isn't defined or clearly isn't a valid pin number, set it to RADIOLIB_NC to avoid SX126X_TXEN
being defined but having no value #if (!defined(E22_TXEN) || !(0 <= E22_TXEN && E22_TXEN <= 48)) #define E22_TXEN RADIOLIB_NC
#endif
// FALLBACK: If somehow E22_RXEN isn't defined or clearly isn't a valid pin number, set it to RADIOLIB_NC to avoid SX126X_RXEN
being defined but having no value #if (!defined(E22_RXEN) || !(0 <= E22_RXEN && E22_RXEN <= 48)) #define E22_RXEN RADIOLIB_NC
#endif
#define SX126X_TXEN E22_TXEN
#define SX126X_RXEN E22_RXEN
*/
// E22 series TCXO voltage is 1.8V per https://www.ebyte.com/en/pdf-down.aspx?id=781 (source
// https://github.com/jgromes/RadioLib/issues/12#issuecomment-520695575), so set it as such
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
#define LORA_CS SX126X_CS // FIXME: for some reason both are used in /src
// Many of the below values would only be used if USE_RF95 was defined, but it's not as we aren't actually using an RF95, just
// that the 4 pins above are named like it If they aren't used they don't need to be defined and doing so cause confusion to those
// adapting this file LORA_RESET value is never used in src (as we are not using RF95), so no need to define LORA_DIO0 is not used
// in src (as we are not using RF95) as SX1262 does not have it per SX1262 datasheet, so no need to define
// FIXME: confirm that the linked lines below are actually only called when using the SX126x or SX128x and no other modules
// then use SX126X_DIO1 and SX128X_DIO1 respectively for that purpose, removing the need for RF95-style LORA_* definitions when
// the RF95 isn't used
#define LORA_DIO1 \
SX126X_DIO1 // The old name is used in
// https://github.com/meshtastic/firmware/blob/7eff5e7bcb2084499b723c5e3846c15ee089e36d/src/sleep.cpp#L298, so
// must also define the old name
// LORA_DIO2 value is never used in src (as we are not using RF95), so no need to define, and if DIO2_AS_RF_SWITCH is set then it
// cannot serve any extra function even if requested to LORA_DIO3 value is never used in src (as we are not using RF95), so no
// need to define, and DIO3_AS_TCXO_AT_1V8 is set so it cannot serve any extra function even if requested to (from 13.3.2.1
// DioxMask in SX1262 datasheet: Note that if DIO2 or DIO3 are used to control the RF Switch or the TCXO, the IRQ will not be
// generated even if it is mapped to the pins.)
@@ -0,0 +1,28 @@
// Need this file for ESP32-S3
// No need to modify this file, changes to pins imported from variant.h
// Most is similar to https://github.com/espressif/arduino-esp32/blob/master/variants/esp32s3/pins_arduino.h
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#include <variant.h>
#define USB_VID 0x303a
#define USB_PID 0x1001
// Serial
static const uint8_t TX = UART_TX;
static const uint8_t RX = UART_RX;
// Default SPI will be mapped to Radio
static const uint8_t SS = LORA_CS;
static const uint8_t SCK = LORA_SCK;
static const uint8_t MOSI = LORA_MOSI;
static const uint8_t MISO = LORA_MISO;
// The default Wire will be mapped to PMU and RTC
static const uint8_t SCL = I2C_SCL;
static const uint8_t SDA = I2C_SDA;
#endif /* Pins_Arduino_h */

Some files were not shown because too many files have changed in this diff Show More