mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-09-14 15:16:40 +00:00
New M5Stack Cardputer ADV variant (ESP32-S3, ST7789 TFT, built-in TCA8418 QWERTY keyboard, PI4IOE5V6408 LoRa-cap IO-expander autodetect), and a KeyShield accessory variant for the existing LilyGO T-Echo Lite (external TCA8418 T9 keypad + AW21009 backlight driver). Both keyboards share one ENV_USE_TCA8418 polling block in UITask.cpp::loop(), coexisting with the unrelated CardKB support (different chip/address/flag). Fixes carried in from the contributed T-Echo Lite code: swapped GPS RX/TX pins, TX-LED hooks, TCXO voltage, missing GxEPD2_122_T61 panel include. Fixed during integration: I2C bus was probed for an RTC before Wire.begin() configured its pins on Cardputer ADV (silent RTC autodetect failure). Added dedicated *_solo_dual release envs for both boards (auto-picked up by the solo-firmware release workflow). Gave the T-Echo Lite KeyShield solo build -Os/-Ofast-unflag like every other nRF52 solo build (was missing, cut flash usage from 90.7% to 61.4%). Ported the shared misc-fixed 6x9 font (full Latin/Greek/Cyrillic, opt-in via OLED_MISC_FIXED_FONT) to ST7789Display for the Cardputer's on-screen keyboard. ST7789Spi isn't Adafruit_GFX-based like the other single-font drivers, and this panel's logical->physical scale is non-integer, so glyphs are re-packed to XBM and blitted through the existing drawXbm(), which already does correct fractional-scale boundary math, rather than duplicating that logic. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
53 lines
1.4 KiB
C++
53 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include <MeshCore.h>
|
|
#include <Arduino.h>
|
|
#include <helpers/NRF52Board.h>
|
|
|
|
// ============================================================
|
|
// 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
|
|
|
|
class TechoBoard : public NRF52BoardDCDC {
|
|
public:
|
|
TechoBoard() : NRF52Board("TECHO_OTA") {}
|
|
void begin();
|
|
uint16_t getBattMilliVolts() override;
|
|
|
|
const char* getManufacturerName() const override {
|
|
return "LilyGo T-Echo Lite";
|
|
}
|
|
|
|
#if defined(P_LORA_TX_LED)
|
|
void onBeforeTransmit() override {
|
|
digitalWrite(P_LORA_TX_LED, LOW); // turn TX LED on
|
|
}
|
|
|
|
void onAfterTransmit() override {
|
|
digitalWrite(P_LORA_TX_LED, HIGH); // turn TX LED off
|
|
}
|
|
#endif
|
|
|
|
void powerOff() override {
|
|
digitalWrite(PIN_VBAT_MEAS_EN, LOW);
|
|
#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();
|
|
}
|
|
}; |