* Heltec tracker: new 'periph_power' shared pin (between Display & GPS)

This commit is contained in:
Scott Powell 2025-05-08 15:50:53 +10:00
parent 997261a68e
commit 810fc8b8f0
8 changed files with 86 additions and 27 deletions

View file

@ -19,7 +19,7 @@ build_flags =
-D PIN_TFT_RST=39 ; RES
-D PIN_TFT_CS=38
-D USE_PIN_TFT=1
-D PIN_TFT_VDD_CTL=3 ; Vext is connected to VDD which is also connected to LEDA
-D PIN_VEXT_EN=3 ; Vext is connected to VDD which is also connected to OLED & GPS
-D PIN_TFT_LEDA_CTL=21 ; LEDK (switches on/off via mosfet to create the ground)
-D PIN_GPS_RX=33
-D PIN_GPS_TX=34

View file

@ -1,5 +1,6 @@
#include <Arduino.h>
#include "target.h"
#include <helpers/sensors/MicroNMEALocationProvider.h>
HeltecV3Board board;
@ -78,18 +79,25 @@ mesh::LocalIdentity radio_new_identity() {
}
void HWTSensorManager::start_gps() {
gps_active = true;
// init GPS
Serial1.begin(115200, SERIAL_8N1, PIN_GPS_RX, PIN_GPS_TX);
Serial1.println("$CFGSYS,h35155*68");
if (!gps_active) {
board.periph_power.claim();
gps_active = true;
Serial1.println("$CFGSYS,h35155*68");
}
}
void HWTSensorManager::stop_gps() {
gps_active = false;
Serial1.end();
if (gps_active) {
gps_active = false;
board.periph_power.release();
}
}
bool HWTSensorManager::begin() {
// init GPS port
Serial1.begin(115200, SERIAL_8N1, PIN_GPS_RX, PIN_GPS_TX);
return true;
}
@ -106,10 +114,10 @@ void HWTSensorManager::loop() {
_location->loop();
if (millis() > next_gps_update) {
if (_location->isValid()) {
if (gps_active && _location->isValid()) {
node_lat = ((double)_location->getLatitude())/1000000.;
node_lon = ((double)_location->getLongitude())/1000000.;
//Serial.printf("lat %f lon %f\r\n", _lat, _lon);
MESH_DEBUG_PRINTLN("lat %f lon %f", node_lat, node_lon);
}
next_gps_update = millis() + 1000;
}

View file

@ -12,6 +12,7 @@ build_flags =
-D PIN_BOARD_SDA=17
-D PIN_BOARD_SCL=18
-D PIN_USER_BTN=0
-D PIN_VEXT_EN=36
-D SX126X_DIO2_AS_RF_SWITCH=true
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
-D SX126X_CURRENT_LIMIT=130.0f ; for best TX power!