2025-09-23 19:39:11 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <MeshCore.h>
|
|
|
|
|
#include <Arduino.h>
|
2025-12-12 19:01:15 +07:00
|
|
|
#include <helpers/NRF52Board.h>
|
2025-09-23 19:39:11 +02:00
|
|
|
|
2026-04-10 14:25:51 +10:00
|
|
|
// ============================================================
|
|
|
|
|
// T-Echo Lite battery pins — hardcoded from LilyGo t_echo_lite_config.h
|
|
|
|
|
// NOT using any defines from variant.h for battery measurement
|
|
|
|
|
// ============================================================
|
|
|
|
|
#define PIN_VBAT_READ _PINNUM(0, 2) // BATTERY_ADC_DATA
|
|
|
|
|
#define PIN_VBAT_MEAS_EN _PINNUM(0, 31) // BATTERY_MEASUREMENT_CONTROL
|
2025-09-23 19:39:11 +02:00
|
|
|
|
2025-12-20 10:44:13 +01:00
|
|
|
class TechoBoard : public NRF52BoardDCDC {
|
2025-09-23 19:39:11 +02:00
|
|
|
public:
|
2025-12-20 10:44:13 +01:00
|
|
|
TechoBoard() : NRF52Board("TECHO_OTA") {}
|
2025-09-23 19:39:11 +02:00
|
|
|
void begin();
|
|
|
|
|
uint16_t getBattMilliVolts() override;
|
|
|
|
|
|
|
|
|
|
const char* getManufacturerName() const override {
|
2026-04-10 14:25:51 +10:00
|
|
|
return "LilyGo T-Echo Lite";
|
2025-09-23 19:39:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void powerOff() override {
|
2026-04-10 14:25:51 +10:00
|
|
|
digitalWrite(PIN_VBAT_MEAS_EN, LOW);
|
2025-09-23 19:39:11 +02:00
|
|
|
#ifdef LED_RED
|
|
|
|
|
digitalWrite(LED_RED, LOW);
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef LED_GREEN
|
|
|
|
|
digitalWrite(LED_GREEN, LOW);
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef LED_BLUE
|
|
|
|
|
digitalWrite(LED_BLUE, LOW);
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef DISP_BACKLIGHT
|
|
|
|
|
digitalWrite(DISP_BACKLIGHT, LOW);
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef PIN_PWR_EN
|
|
|
|
|
digitalWrite(PIN_PWR_EN, LOW);
|
|
|
|
|
#endif
|
|
|
|
|
sd_power_system_off();
|
|
|
|
|
}
|
2026-04-10 14:25:51 +10:00
|
|
|
};
|