mirror of
https://github.com/meshtastic/firmware.git
synced 2025-10-27 23:12:39 +00:00
add heltec tracker v2 board.
This commit is contained in:
parent
a3e6f16378
commit
8d323a1cf1
37
boards/heltec_wireless_tracker_v2.json
Normal file
37
boards/heltec_wireless_tracker_v2.json
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"ldscript": "esp32s3_out.ld",
|
||||||
|
"partitions": "default_8MB.csv"
|
||||||
|
},
|
||||||
|
"core": "esp32",
|
||||||
|
"extra_flags": [
|
||||||
|
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
||||||
|
"-DARDUINO_USB_MODE=0",
|
||||||
|
"-DARDUINO_RUNNING_CORE=1",
|
||||||
|
"-DARDUINO_EVENT_RUNNING_CORE=1"
|
||||||
|
],
|
||||||
|
"f_cpu": "240000000L",
|
||||||
|
"f_flash": "80000000L",
|
||||||
|
"flash_mode": "qio",
|
||||||
|
"hwids": [["0x303A", "0x1001"]],
|
||||||
|
"mcu": "esp32s3",
|
||||||
|
"variant": "heltec_wireless_tracker_v2"
|
||||||
|
},
|
||||||
|
"connectivity": ["wifi", "bluetooth", "lora"],
|
||||||
|
"debug": {
|
||||||
|
"openocd_target": "esp32s3.cfg"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino", "espidf"],
|
||||||
|
"name": "Heltec Wireless Tracker V2",
|
||||||
|
"upload": {
|
||||||
|
"flash_size": "8MB",
|
||||||
|
"maximum_ram_size": 327680,
|
||||||
|
"maximum_size": 8388608,
|
||||||
|
"wait_for_upload_port": true,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"speed": 921600
|
||||||
|
},
|
||||||
|
"url": "https://heltec.org",
|
||||||
|
"vendor": "Heltec"
|
||||||
|
}
|
||||||
@ -453,7 +453,7 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
dispdev->displayOn();
|
dispdev->displayOn();
|
||||||
#ifdef HELTEC_TRACKER_V1_X
|
#if defined(HELTEC_TRACKER_V1_X) || defined(HELTEC_WIRELESS_TRACKER_V2)
|
||||||
ui->init();
|
ui->init();
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_ST7789
|
#ifdef USE_ST7789
|
||||||
|
|||||||
@ -52,7 +52,7 @@ template <typename T> bool SX126xInterface<T>::init()
|
|||||||
pinMode(SX126X_POWER_EN, OUTPUT);
|
pinMode(SX126X_POWER_EN, OUTPUT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HELTEC_V4
|
#if defined(HELTEC_V4)||defined(HELTEC_WIRELESS_TRACKER_V2)
|
||||||
pinMode(LORA_PA_POWER, OUTPUT);
|
pinMode(LORA_PA_POWER, OUTPUT);
|
||||||
digitalWrite(LORA_PA_POWER, HIGH);
|
digitalWrite(LORA_PA_POWER, HIGH);
|
||||||
|
|
||||||
@ -352,7 +352,7 @@ template <typename T> bool SX126xInterface<T>::sleep()
|
|||||||
digitalWrite(SX126X_POWER_EN, LOW);
|
digitalWrite(SX126X_POWER_EN, LOW);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HELTEC_V4
|
#if defined(HELTEC_V4)||defined(HELTEC_WIRELESS_TRACKER_V2)
|
||||||
/*
|
/*
|
||||||
* Do not switch the power on and off frequently.
|
* Do not switch the power on and off frequently.
|
||||||
* After turning off LORA_PA_EN, the power consumption has dropped to the uA level.
|
* After turning off LORA_PA_EN, the power consumption has dropped to the uA level.
|
||||||
@ -367,7 +367,7 @@ template <typename T> bool SX126xInterface<T>::sleep()
|
|||||||
/** Some boards require GPIO control of tx vs rx paths */
|
/** Some boards require GPIO control of tx vs rx paths */
|
||||||
template <typename T> void SX126xInterface<T>::setTransmitEnable(bool txon)
|
template <typename T> void SX126xInterface<T>::setTransmitEnable(bool txon)
|
||||||
{
|
{
|
||||||
#ifdef HELTEC_V4
|
#if defined(HELTEC_V4)||defined(HELTEC_WIRELESS_TRACKER_V2)
|
||||||
digitalWrite(LORA_PA_POWER, HIGH);
|
digitalWrite(LORA_PA_POWER, HIGH);
|
||||||
digitalWrite(LORA_PA_EN, HIGH);
|
digitalWrite(LORA_PA_EN, HIGH);
|
||||||
digitalWrite(LORA_PA_TX_EN, txon ? 1 : 0);
|
digitalWrite(LORA_PA_TX_EN, txon ? 1 : 0);
|
||||||
|
|||||||
@ -201,6 +201,8 @@
|
|||||||
#define HW_VENDOR meshtastic_HardwareModel_HELTEC_V4
|
#define HW_VENDOR meshtastic_HardwareModel_HELTEC_V4
|
||||||
#elif defined(M5STACK_UNITC6L)
|
#elif defined(M5STACK_UNITC6L)
|
||||||
#define HW_VENDOR meshtastic_HardwareModel_M5STACK_C6L
|
#define HW_VENDOR meshtastic_HardwareModel_M5STACK_C6L
|
||||||
|
#elif defined(HELTEC_WIRELESS_TRACKER_V2)
|
||||||
|
#define HW_VENDOR meshtastic_HardwareModel_HELTEC_WIRELESS_TRACKER_V2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|||||||
@ -554,7 +554,7 @@ void enableLoraInterrupt()
|
|||||||
gpio_pullup_en((gpio_num_t)LORA_CS);
|
gpio_pullup_en((gpio_num_t)LORA_CS);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HELTEC_V4
|
#if defined(HELTEC_V4)||defined(HELTEC_WIRELESS_TRACKER_V2)
|
||||||
gpio_pullup_en((gpio_num_t)LORA_PA_POWER);
|
gpio_pullup_en((gpio_num_t)LORA_PA_POWER);
|
||||||
gpio_pullup_en((gpio_num_t)LORA_PA_EN);
|
gpio_pullup_en((gpio_num_t)LORA_PA_EN);
|
||||||
gpio_pulldown_en((gpio_num_t)LORA_PA_TX_EN);
|
gpio_pulldown_en((gpio_num_t)LORA_PA_TX_EN);
|
||||||
|
|||||||
71
variants/esp32s3/heltec_wireless_tracker_v2/pins_arduino.h
Normal file
71
variants/esp32s3/heltec_wireless_tracker_v2/pins_arduino.h
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
#ifndef Pins_Arduino_h
|
||||||
|
#define Pins_Arduino_h
|
||||||
|
|
||||||
|
#include "soc/soc_caps.h"
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#define DISPLAY_HEIGHT 80
|
||||||
|
#define DISPLAY_WIDTH 160
|
||||||
|
|
||||||
|
#define USB_VID 0x303a
|
||||||
|
#define USB_PID 0x1001
|
||||||
|
|
||||||
|
static const uint8_t LED_BUILTIN = 18;
|
||||||
|
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||||
|
#define LED_BUILTIN LED_BUILTIN
|
||||||
|
|
||||||
|
static const uint8_t TX = 43;
|
||||||
|
static const uint8_t RX = 44;
|
||||||
|
|
||||||
|
static const uint8_t SDA = 5;
|
||||||
|
static const uint8_t SCL = 6;
|
||||||
|
|
||||||
|
static const uint8_t SS = 8;
|
||||||
|
static const uint8_t MOSI = 10;
|
||||||
|
static const uint8_t MISO = 11;
|
||||||
|
static const uint8_t SCK = 9;
|
||||||
|
|
||||||
|
static const uint8_t A0 = 1;
|
||||||
|
static const uint8_t A1 = 2;
|
||||||
|
static const uint8_t A2 = 3;
|
||||||
|
static const uint8_t A3 = 4;
|
||||||
|
static const uint8_t A4 = 5;
|
||||||
|
static const uint8_t A5 = 6;
|
||||||
|
static const uint8_t A6 = 7;
|
||||||
|
static const uint8_t A7 = 8;
|
||||||
|
static const uint8_t A8 = 9;
|
||||||
|
static const uint8_t A9 = 10;
|
||||||
|
static const uint8_t A10 = 11;
|
||||||
|
static const uint8_t A11 = 12;
|
||||||
|
static const uint8_t A12 = 13;
|
||||||
|
static const uint8_t A13 = 14;
|
||||||
|
static const uint8_t A14 = 15;
|
||||||
|
static const uint8_t A15 = 16;
|
||||||
|
static const uint8_t A16 = 17;
|
||||||
|
static const uint8_t A17 = 18;
|
||||||
|
static const uint8_t A18 = 19;
|
||||||
|
static const uint8_t A19 = 20;
|
||||||
|
|
||||||
|
static const uint8_t T1 = 1;
|
||||||
|
static const uint8_t T2 = 2;
|
||||||
|
static const uint8_t T3 = 3;
|
||||||
|
static const uint8_t T4 = 4;
|
||||||
|
static const uint8_t T5 = 5;
|
||||||
|
static const uint8_t T6 = 6;
|
||||||
|
static const uint8_t T7 = 7;
|
||||||
|
static const uint8_t T8 = 8;
|
||||||
|
static const uint8_t T9 = 9;
|
||||||
|
static const uint8_t T10 = 10;
|
||||||
|
static const uint8_t T11 = 11;
|
||||||
|
static const uint8_t T12 = 12;
|
||||||
|
static const uint8_t T13 = 13;
|
||||||
|
static const uint8_t T14 = 14;
|
||||||
|
|
||||||
|
static const uint8_t Vext = 3;
|
||||||
|
static const uint8_t LED = 18;
|
||||||
|
|
||||||
|
static const uint8_t RST_LoRa = 12;
|
||||||
|
static const uint8_t BUSY_LoRa = 13;
|
||||||
|
static const uint8_t DIO0 = 14;
|
||||||
|
|
||||||
|
#endif /* Pins_Arduino_h */
|
||||||
15
variants/esp32s3/heltec_wireless_tracker_v2/platformio.ini
Normal file
15
variants/esp32s3/heltec_wireless_tracker_v2/platformio.ini
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
[env:heltec-wireless-tracker-v2]
|
||||||
|
extends = esp32s3_base
|
||||||
|
board = heltec_wireless_tracker_v2
|
||||||
|
board_build.partitions = default_8MB.csv
|
||||||
|
upload_protocol = esptool
|
||||||
|
|
||||||
|
build_flags =
|
||||||
|
${esp32s3_base.build_flags}
|
||||||
|
-I variants/esp32s3/heltec_wireless_tracker_v2
|
||||||
|
-D HELTEC_WIRELESS_TRACKER_V2
|
||||||
|
-D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||||
|
-D SX126X_MAX_POWER=11 ;The latter limit is the largest, and will be updated after the V4 update.
|
||||||
|
lib_deps =
|
||||||
|
${esp32s3_base.lib_deps}
|
||||||
|
lovyan03/LovyanGFX@^1.2.0
|
||||||
78
variants/esp32s3/heltec_wireless_tracker_v2/variant.h
Normal file
78
variants/esp32s3/heltec_wireless_tracker_v2/variant.h
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
#define LED_PIN 18
|
||||||
|
|
||||||
|
#define _VARIANT_HELTEC_WIRELESS_TRACKER
|
||||||
|
|
||||||
|
// I2C
|
||||||
|
#define I2C_SDA SDA
|
||||||
|
#define I2C_SCL SCL
|
||||||
|
|
||||||
|
// ST7735S TFT LCD
|
||||||
|
#define ST7735S 1 // there are different (sub-)versions of ST7735
|
||||||
|
#define ST7735_CS 38
|
||||||
|
#define ST7735_RS 40 // DC
|
||||||
|
#define ST7735_SDA 42 // MOSI
|
||||||
|
#define ST7735_SCK 41
|
||||||
|
#define ST7735_RESET 39
|
||||||
|
#define ST7735_MISO -1
|
||||||
|
#define ST7735_BUSY -1
|
||||||
|
#define TFT_BL 21
|
||||||
|
#define ST7735_SPI_HOST SPI3_HOST
|
||||||
|
#define SPI_FREQUENCY 40000000
|
||||||
|
#define SPI_READ_FREQUENCY 16000000
|
||||||
|
#define SCREEN_ROTATE
|
||||||
|
#define TFT_HEIGHT DISPLAY_WIDTH
|
||||||
|
#define TFT_WIDTH DISPLAY_HEIGHT
|
||||||
|
#define TFT_OFFSET_X 24
|
||||||
|
#define TFT_OFFSET_Y 0
|
||||||
|
#define TFT_INVERT false
|
||||||
|
#define SCREEN_TRANSITION_FRAMERATE 3 // fps
|
||||||
|
#define DISPLAY_FORCE_SMALL_FONTS
|
||||||
|
|
||||||
|
|
||||||
|
#define VEXT_ENABLE 3 // active HIGH - powers the GPS, GPS LNA and OLED
|
||||||
|
#define VEXT_ON_VALUE HIGH
|
||||||
|
#define BUTTON_PIN 0
|
||||||
|
|
||||||
|
#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_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider
|
||||||
|
#define ADC_MULTIPLIER 4.9 * 1.045
|
||||||
|
#define ADC_CTRL 2 // active HIGH, powers the voltage divider.
|
||||||
|
#define ADC_USE_PULLUP // Use internal pullup/pulldown instead of actively driving the output
|
||||||
|
|
||||||
|
#undef GPS_RX_PIN
|
||||||
|
#undef GPS_TX_PIN
|
||||||
|
#define GPS_RX_PIN 33
|
||||||
|
#define GPS_TX_PIN 34
|
||||||
|
#define PIN_GPS_RESET 35
|
||||||
|
#define PIN_GPS_PPS 36
|
||||||
|
// #define PIN_GPS_EN 3 // Uncomment to power off the GPS with triple-click on Tracker v2, though we'll also lose the
|
||||||
|
// display.
|
||||||
|
|
||||||
|
#define GPS_RESET_MODE LOW
|
||||||
|
#define GPS_UC6580
|
||||||
|
#define GPS_BAUDRATE 115200
|
||||||
|
|
||||||
|
#define USE_SX1262
|
||||||
|
#define LORA_DIO0 -1 // a No connect on the SX1262 module
|
||||||
|
#define LORA_RESET 12
|
||||||
|
#define LORA_DIO1 14 // SX1262 IRQ
|
||||||
|
#define LORA_DIO2 13 // SX1262 BUSY
|
||||||
|
#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262, if DIO3 is high the TXCO is enabled
|
||||||
|
|
||||||
|
#define LORA_SCK 9
|
||||||
|
#define LORA_MISO 11
|
||||||
|
#define LORA_MOSI 10
|
||||||
|
#define LORA_CS 8
|
||||||
|
|
||||||
|
#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
|
||||||
|
|
||||||
|
#define LORA_PA_POWER 7 // power en
|
||||||
|
#define LORA_PA_EN 4
|
||||||
|
#define LORA_PA_TX_EN 46 // enable tx
|
||||||
Loading…
Reference in New Issue
Block a user