Skip to content

Commit 8d323a1

Browse files
Quency-Dfifieldt
authored andcommitted
add heltec tracker v2 board.
1 parent a3e6f16 commit 8d323a1

File tree

8 files changed

+208
-5
lines changed

8 files changed

+208
-5
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"build": {
3+
"arduino": {
4+
"ldscript": "esp32s3_out.ld",
5+
"partitions": "default_8MB.csv"
6+
},
7+
"core": "esp32",
8+
"extra_flags": [
9+
"-DARDUINO_USB_CDC_ON_BOOT=1",
10+
"-DARDUINO_USB_MODE=0",
11+
"-DARDUINO_RUNNING_CORE=1",
12+
"-DARDUINO_EVENT_RUNNING_CORE=1"
13+
],
14+
"f_cpu": "240000000L",
15+
"f_flash": "80000000L",
16+
"flash_mode": "qio",
17+
"hwids": [["0x303A", "0x1001"]],
18+
"mcu": "esp32s3",
19+
"variant": "heltec_wireless_tracker_v2"
20+
},
21+
"connectivity": ["wifi", "bluetooth", "lora"],
22+
"debug": {
23+
"openocd_target": "esp32s3.cfg"
24+
},
25+
"frameworks": ["arduino", "espidf"],
26+
"name": "Heltec Wireless Tracker V2",
27+
"upload": {
28+
"flash_size": "8MB",
29+
"maximum_ram_size": 327680,
30+
"maximum_size": 8388608,
31+
"wait_for_upload_port": true,
32+
"require_upload_port": true,
33+
"speed": 921600
34+
},
35+
"url": "https://heltec.org",
36+
"vendor": "Heltec"
37+
}

src/graphics/Screen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver)
453453
#endif
454454

455455
dispdev->displayOn();
456-
#ifdef HELTEC_TRACKER_V1_X
456+
#if defined(HELTEC_TRACKER_V1_X) || defined(HELTEC_WIRELESS_TRACKER_V2)
457457
ui->init();
458458
#endif
459459
#ifdef USE_ST7789

src/mesh/SX126xInterface.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ template <typename T> bool SX126xInterface<T>::init()
5252
pinMode(SX126X_POWER_EN, OUTPUT);
5353
#endif
5454

55-
#ifdef HELTEC_V4
55+
#if defined(HELTEC_V4)||defined(HELTEC_WIRELESS_TRACKER_V2)
5656
pinMode(LORA_PA_POWER, OUTPUT);
5757
digitalWrite(LORA_PA_POWER, HIGH);
5858

@@ -352,7 +352,7 @@ template <typename T> bool SX126xInterface<T>::sleep()
352352
digitalWrite(SX126X_POWER_EN, LOW);
353353
#endif
354354

355-
#ifdef HELTEC_V4
355+
#if defined(HELTEC_V4)||defined(HELTEC_WIRELESS_TRACKER_V2)
356356
/*
357357
* Do not switch the power on and off frequently.
358358
* 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()
367367
/** Some boards require GPIO control of tx vs rx paths */
368368
template <typename T> void SX126xInterface<T>::setTransmitEnable(bool txon)
369369
{
370-
#ifdef HELTEC_V4
370+
#if defined(HELTEC_V4)||defined(HELTEC_WIRELESS_TRACKER_V2)
371371
digitalWrite(LORA_PA_POWER, HIGH);
372372
digitalWrite(LORA_PA_EN, HIGH);
373373
digitalWrite(LORA_PA_TX_EN, txon ? 1 : 0);

src/platform/esp32/architecture.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@
201201
#define HW_VENDOR meshtastic_HardwareModel_HELTEC_V4
202202
#elif defined(M5STACK_UNITC6L)
203203
#define HW_VENDOR meshtastic_HardwareModel_M5STACK_C6L
204+
#elif defined(HELTEC_WIRELESS_TRACKER_V2)
205+
#define HW_VENDOR meshtastic_HardwareModel_HELTEC_WIRELESS_TRACKER_V2
204206
#endif
205207

206208
// -----------------------------------------------------------------------------

src/sleep.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ void enableLoraInterrupt()
554554
gpio_pullup_en((gpio_num_t)LORA_CS);
555555
#endif
556556

557-
#ifdef HELTEC_V4
557+
#if defined(HELTEC_V4)||defined(HELTEC_WIRELESS_TRACKER_V2)
558558
gpio_pullup_en((gpio_num_t)LORA_PA_POWER);
559559
gpio_pullup_en((gpio_num_t)LORA_PA_EN);
560560
gpio_pulldown_en((gpio_num_t)LORA_PA_TX_EN);
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#ifndef Pins_Arduino_h
2+
#define Pins_Arduino_h
3+
4+
#include "soc/soc_caps.h"
5+
#include <stdint.h>
6+
7+
#define DISPLAY_HEIGHT 80
8+
#define DISPLAY_WIDTH 160
9+
10+
#define USB_VID 0x303a
11+
#define USB_PID 0x1001
12+
13+
static const uint8_t LED_BUILTIN = 18;
14+
#define BUILTIN_LED LED_BUILTIN // backward compatibility
15+
#define LED_BUILTIN LED_BUILTIN
16+
17+
static const uint8_t TX = 43;
18+
static const uint8_t RX = 44;
19+
20+
static const uint8_t SDA = 5;
21+
static const uint8_t SCL = 6;
22+
23+
static const uint8_t SS = 8;
24+
static const uint8_t MOSI = 10;
25+
static const uint8_t MISO = 11;
26+
static const uint8_t SCK = 9;
27+
28+
static const uint8_t A0 = 1;
29+
static const uint8_t A1 = 2;
30+
static const uint8_t A2 = 3;
31+
static const uint8_t A3 = 4;
32+
static const uint8_t A4 = 5;
33+
static const uint8_t A5 = 6;
34+
static const uint8_t A6 = 7;
35+
static const uint8_t A7 = 8;
36+
static const uint8_t A8 = 9;
37+
static const uint8_t A9 = 10;
38+
static const uint8_t A10 = 11;
39+
static const uint8_t A11 = 12;
40+
static const uint8_t A12 = 13;
41+
static const uint8_t A13 = 14;
42+
static const uint8_t A14 = 15;
43+
static const uint8_t A15 = 16;
44+
static const uint8_t A16 = 17;
45+
static const uint8_t A17 = 18;
46+
static const uint8_t A18 = 19;
47+
static const uint8_t A19 = 20;
48+
49+
static const uint8_t T1 = 1;
50+
static const uint8_t T2 = 2;
51+
static const uint8_t T3 = 3;
52+
static const uint8_t T4 = 4;
53+
static const uint8_t T5 = 5;
54+
static const uint8_t T6 = 6;
55+
static const uint8_t T7 = 7;
56+
static const uint8_t T8 = 8;
57+
static const uint8_t T9 = 9;
58+
static const uint8_t T10 = 10;
59+
static const uint8_t T11 = 11;
60+
static const uint8_t T12 = 12;
61+
static const uint8_t T13 = 13;
62+
static const uint8_t T14 = 14;
63+
64+
static const uint8_t Vext = 3;
65+
static const uint8_t LED = 18;
66+
67+
static const uint8_t RST_LoRa = 12;
68+
static const uint8_t BUSY_LoRa = 13;
69+
static const uint8_t DIO0 = 14;
70+
71+
#endif /* Pins_Arduino_h */
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[env:heltec-wireless-tracker-v2]
2+
extends = esp32s3_base
3+
board = heltec_wireless_tracker_v2
4+
board_build.partitions = default_8MB.csv
5+
upload_protocol = esptool
6+
7+
build_flags =
8+
${esp32s3_base.build_flags}
9+
-I variants/esp32s3/heltec_wireless_tracker_v2
10+
-D HELTEC_WIRELESS_TRACKER_V2
11+
-D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
12+
-D SX126X_MAX_POWER=11 ;The latter limit is the largest, and will be updated after the V4 update.
13+
lib_deps =
14+
${esp32s3_base.lib_deps}
15+
lovyan03/LovyanGFX@^1.2.0
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#define LED_PIN 18
2+
3+
#define _VARIANT_HELTEC_WIRELESS_TRACKER
4+
5+
// I2C
6+
#define I2C_SDA SDA
7+
#define I2C_SCL SCL
8+
9+
// ST7735S TFT LCD
10+
#define ST7735S 1 // there are different (sub-)versions of ST7735
11+
#define ST7735_CS 38
12+
#define ST7735_RS 40 // DC
13+
#define ST7735_SDA 42 // MOSI
14+
#define ST7735_SCK 41
15+
#define ST7735_RESET 39
16+
#define ST7735_MISO -1
17+
#define ST7735_BUSY -1
18+
#define TFT_BL 21
19+
#define ST7735_SPI_HOST SPI3_HOST
20+
#define SPI_FREQUENCY 40000000
21+
#define SPI_READ_FREQUENCY 16000000
22+
#define SCREEN_ROTATE
23+
#define TFT_HEIGHT DISPLAY_WIDTH
24+
#define TFT_WIDTH DISPLAY_HEIGHT
25+
#define TFT_OFFSET_X 24
26+
#define TFT_OFFSET_Y 0
27+
#define TFT_INVERT false
28+
#define SCREEN_TRANSITION_FRAMERATE 3 // fps
29+
#define DISPLAY_FORCE_SMALL_FONTS
30+
31+
32+
#define VEXT_ENABLE 3 // active HIGH - powers the GPS, GPS LNA and OLED
33+
#define VEXT_ON_VALUE HIGH
34+
#define BUTTON_PIN 0
35+
36+
#define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
37+
#define ADC_CHANNEL ADC1_GPIO1_CHANNEL
38+
#define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider
39+
#define ADC_MULTIPLIER 4.9 * 1.045
40+
#define ADC_CTRL 2 // active HIGH, powers the voltage divider.
41+
#define ADC_USE_PULLUP // Use internal pullup/pulldown instead of actively driving the output
42+
43+
#undef GPS_RX_PIN
44+
#undef GPS_TX_PIN
45+
#define GPS_RX_PIN 33
46+
#define GPS_TX_PIN 34
47+
#define PIN_GPS_RESET 35
48+
#define PIN_GPS_PPS 36
49+
// #define PIN_GPS_EN 3 // Uncomment to power off the GPS with triple-click on Tracker v2, though we'll also lose the
50+
// display.
51+
52+
#define GPS_RESET_MODE LOW
53+
#define GPS_UC6580
54+
#define GPS_BAUDRATE 115200
55+
56+
#define USE_SX1262
57+
#define LORA_DIO0 -1 // a No connect on the SX1262 module
58+
#define LORA_RESET 12
59+
#define LORA_DIO1 14 // SX1262 IRQ
60+
#define LORA_DIO2 13 // SX1262 BUSY
61+
#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262, if DIO3 is high the TXCO is enabled
62+
63+
#define LORA_SCK 9
64+
#define LORA_MISO 11
65+
#define LORA_MOSI 10
66+
#define LORA_CS 8
67+
68+
#define SX126X_CS LORA_CS
69+
#define SX126X_DIO1 LORA_DIO1
70+
#define SX126X_BUSY LORA_DIO2
71+
#define SX126X_RESET LORA_RESET
72+
73+
#define SX126X_DIO2_AS_RF_SWITCH
74+
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
75+
76+
#define LORA_PA_POWER 7 // power en
77+
#define LORA_PA_EN 4
78+
#define LORA_PA_TX_EN 46 // enable tx

0 commit comments

Comments
 (0)