* 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

@ -1,6 +1,7 @@
#pragma once
#include <Arduino.h>
#include <helpers/RefCountedDigitalPin.h>
// LoRa radio module pins for Heltec V3
// Also for Heltec Wireless Tracker
@ -20,7 +21,6 @@
#define PIN_ADC_CTRL_ACTIVE LOW
#define PIN_ADC_CTRL_INACTIVE HIGH
//#define PIN_LED_BUILTIN 35
#define PIN_VEXT_EN 36
#include "ESP32Board.h"
@ -31,6 +31,10 @@ private:
bool adc_active_state;
public:
RefCountedDigitalPin periph_power;
HeltecV3Board() : periph_power(PIN_VEXT_EN) { }
void begin() {
ESP32Board::begin();
@ -41,8 +45,7 @@ public:
pinMode(PIN_ADC_CTRL, OUTPUT);
digitalWrite(PIN_ADC_CTRL, !adc_active_state); // Initially inactive
pinMode(PIN_VEXT_EN, OUTPUT);
digitalWrite(PIN_VEXT_EN, LOW); // for V3.2 boards
periph_power.begin();
esp_reset_reason_t reason = esp_reset_reason();
if (reason == ESP_RST_DEEPSLEEP) {