TechoBoard.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #include <MeshCore.h>
  3. #include <Arduino.h>
  4. #include <helpers/NRF52Board.h>
  5. // ============================================================
  6. // T-Echo Lite battery pins — hardcoded from LilyGo t_echo_lite_config.h
  7. // NOT using any defines from variant.h for battery measurement
  8. // ============================================================
  9. #define PIN_VBAT_READ _PINNUM(0, 2) // BATTERY_ADC_DATA
  10. #define PIN_VBAT_MEAS_EN _PINNUM(0, 31) // BATTERY_MEASUREMENT_CONTROL
  11. class TechoBoard : public NRF52BoardDCDC {
  12. public:
  13. TechoBoard() : NRF52Board("TECHO_OTA") {}
  14. void begin();
  15. uint16_t getBattMilliVolts() override;
  16. const char* getManufacturerName() const override {
  17. return "LilyGo T-Echo Lite";
  18. }
  19. void powerOff() override {
  20. digitalWrite(PIN_VBAT_MEAS_EN, LOW);
  21. #ifdef LED_RED
  22. digitalWrite(LED_RED, LOW);
  23. #endif
  24. #ifdef LED_GREEN
  25. digitalWrite(LED_GREEN, LOW);
  26. #endif
  27. #ifdef LED_BLUE
  28. digitalWrite(LED_BLUE, LOW);
  29. #endif
  30. #ifdef DISP_BACKLIGHT
  31. digitalWrite(DISP_BACKLIGHT, LOW);
  32. #endif
  33. #ifdef PIN_PWR_EN
  34. digitalWrite(PIN_PWR_EN, LOW);
  35. #endif
  36. sd_power_system_off();
  37. }
  38. };