mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-08 06:02:05 +00:00
Compare commits
87 Commits
d1374ffaae
...
e753601681
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e753601681 | ||
![]() |
46c7d74760 | ||
![]() |
15d2ae17f8 | ||
![]() |
91579c4650 | ||
![]() |
79b710a108 | ||
![]() |
28a29938bc | ||
![]() |
235eb66b0a | ||
![]() |
8d449e5016 | ||
![]() |
aa7469bf66 | ||
![]() |
1e4bf271f8 | ||
![]() |
46f8939a6f | ||
![]() |
00a96f39d1 | ||
![]() |
ce8298c056 | ||
![]() |
10cb204e17 | ||
![]() |
7ee0c2163c | ||
![]() |
0dcc6baffc | ||
![]() |
ca176bc5e8 | ||
![]() |
08301c793f | ||
![]() |
ef0fb49da3 | ||
![]() |
2d5f8a92f6 | ||
![]() |
5ef961dbdb | ||
![]() |
20f3c6f0f5 | ||
![]() |
c37fe24987 | ||
![]() |
7e8845fc15 | ||
![]() |
f6dedcbc02 | ||
![]() |
658a5077da | ||
![]() |
80a750d3c3 | ||
![]() |
873788ea27 | ||
![]() |
c1bd6c4c34 | ||
![]() |
9143540825 | ||
![]() |
22151cfe6f | ||
![]() |
9005703667 | ||
![]() |
95160c436e | ||
![]() |
97c3673eba | ||
![]() |
8346ab4d86 | ||
![]() |
00f623a488 | ||
![]() |
7da03560b3 | ||
![]() |
680ea1c340 | ||
![]() |
addd294d24 | ||
![]() |
77b972c5f8 | ||
![]() |
a72e02b844 | ||
![]() |
aad4cbd3c6 | ||
![]() |
a5ef03bc7e | ||
![]() |
c11e1809db | ||
![]() |
97a1a42940 | ||
![]() |
ffe9728782 | ||
![]() |
3145061cae | ||
![]() |
ffa5476be3 | ||
![]() |
71bc0098e9 | ||
![]() |
6fc13208d4 | ||
![]() |
15c2094bf9 | ||
![]() |
e7e1a20292 | ||
![]() |
f30f5281c1 | ||
![]() |
f5c3e77a60 | ||
![]() |
0f1e528b20 | ||
![]() |
cb14fc3b9d | ||
![]() |
43978af62b | ||
![]() |
e0d6fce99d | ||
![]() |
ab35668d42 | ||
![]() |
2f15fbae63 | ||
![]() |
3d8d6ef31f | ||
![]() |
d55e3bf034 | ||
![]() |
a69c489acf | ||
![]() |
7867cf5590 | ||
![]() |
b10af5b659 | ||
![]() |
60ee8ead63 | ||
![]() |
020e44d856 | ||
![]() |
e0bb76261b | ||
![]() |
acc0cfe773 | ||
![]() |
f5e3acb8c2 | ||
![]() |
ee95455e22 | ||
![]() |
f7f5466dff | ||
![]() |
0418568653 | ||
![]() |
9efdf8bb57 | ||
![]() |
e145e10423 | ||
![]() |
8c2e72703a | ||
![]() |
7f5e988817 | ||
![]() |
7920110444 | ||
![]() |
d454a44086 | ||
![]() |
9de6340af1 | ||
![]() |
cd438a8534 | ||
![]() |
251c006712 | ||
![]() |
f7bc4d82c7 | ||
![]() |
eb48defde1 | ||
![]() |
f55e855887 | ||
![]() |
3743269721 | ||
![]() |
d72e908046 |
@ -9,7 +9,7 @@ plugins:
|
|||||||
lint:
|
lint:
|
||||||
enabled:
|
enabled:
|
||||||
- checkov@3.2.436
|
- checkov@3.2.436
|
||||||
- renovate@40.41.0
|
- renovate@40.42.2
|
||||||
- prettier@3.5.3
|
- prettier@3.5.3
|
||||||
- trufflehog@3.88.35
|
- trufflehog@3.88.35
|
||||||
- yamllint@1.37.1
|
- yamllint@1.37.1
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 24c7a3d287a4bd269ce191827e5dabd8ce8f57a7
|
Subproject commit db60f07ac298b6161ca553b3868b542cceadcac4
|
@ -192,6 +192,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
// Touchscreen
|
// Touchscreen
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
#define FT6336U_ADDR 0x48
|
#define FT6336U_ADDR 0x48
|
||||||
|
#define CST226SE_ADDR 0x1A
|
||||||
|
#define CST226SE_ADDR_ALT 0x5A
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// BIAS-T Generator
|
// BIAS-T Generator
|
||||||
|
@ -72,6 +72,7 @@ class ScanI2C
|
|||||||
LTR390UV,
|
LTR390UV,
|
||||||
TCA8418KB,
|
TCA8418KB,
|
||||||
PCT2075,
|
PCT2075,
|
||||||
|
CST226SE,
|
||||||
} DeviceType;
|
} DeviceType;
|
||||||
|
|
||||||
// typedef uint8_t DeviceAddress;
|
// typedef uint8_t DeviceAddress;
|
||||||
|
@ -435,13 +435,18 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
|
|||||||
SCAN_SIMPLE_CASE(DFROBOT_RAIN_ADDR, DFROBOT_RAIN, "DFRobot Rain Gauge", (uint8_t)addr.address);
|
SCAN_SIMPLE_CASE(DFROBOT_RAIN_ADDR, DFROBOT_RAIN, "DFRobot Rain Gauge", (uint8_t)addr.address);
|
||||||
SCAN_SIMPLE_CASE(LTR390UV_ADDR, LTR390UV, "LTR390UV", (uint8_t)addr.address);
|
SCAN_SIMPLE_CASE(LTR390UV_ADDR, LTR390UV, "LTR390UV", (uint8_t)addr.address);
|
||||||
SCAN_SIMPLE_CASE(PCT2075_ADDR, PCT2075, "PCT2075", (uint8_t)addr.address);
|
SCAN_SIMPLE_CASE(PCT2075_ADDR, PCT2075, "PCT2075", (uint8_t)addr.address);
|
||||||
|
SCAN_SIMPLE_CASE(CST226SE_ADDR, CST226SE, "CST226SE", (uint8_t)addr.address);
|
||||||
#ifdef HAS_TPS65233
|
#ifdef HAS_TPS65233
|
||||||
SCAN_SIMPLE_CASE(TPS65233_ADDR, TPS65233, "TPS65233", (uint8_t)addr.address);
|
SCAN_SIMPLE_CASE(TPS65233_ADDR, TPS65233, "TPS65233", (uint8_t)addr.address);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case MLX90614_ADDR_DEF:
|
case MLX90614_ADDR_DEF:
|
||||||
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0e), 1);
|
// Do we have the MLX90614 or the MPR121KB or the CST226SE
|
||||||
if (registerValue == 0x5a) {
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x06), 1);
|
||||||
|
if (registerValue == 0xAB) {
|
||||||
|
type = CST226SE;
|
||||||
|
logFoundDevice("CST226SE", (uint8_t)addr.address);
|
||||||
|
} else if (getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0e), 1) == 0x5a) {
|
||||||
type = MLX90614;
|
type = MLX90614;
|
||||||
logFoundDevice("MLX90614", (uint8_t)addr.address);
|
logFoundDevice("MLX90614", (uint8_t)addr.address);
|
||||||
} else {
|
} else {
|
||||||
|
@ -39,6 +39,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#include "graphics/ScreenFonts.h"
|
#include "graphics/ScreenFonts.h"
|
||||||
#include "graphics/images.h"
|
#include "graphics/images.h"
|
||||||
#include "input/ScanAndSelect.h"
|
#include "input/ScanAndSelect.h"
|
||||||
|
#include "input/TouchScreenCST226SE.h"
|
||||||
#include "input/TouchScreenImpl1.h"
|
#include "input/TouchScreenImpl1.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "mesh-pb-constants.h"
|
#include "mesh-pb-constants.h"
|
||||||
@ -1104,7 +1105,7 @@ static void drawNodes(OLEDDisplay *display, int16_t x, int16_t y, const NodeStat
|
|||||||
char usersString[20];
|
char usersString[20];
|
||||||
snprintf(usersString, sizeof(usersString), "%d/%d", nodeStatus->getNumOnline(), nodeStatus->getNumTotal());
|
snprintf(usersString, sizeof(usersString), "%d/%d", nodeStatus->getNumOnline(), nodeStatus->getNumTotal());
|
||||||
#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \
|
#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \
|
||||||
defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS)) && \
|
defined(ST7789_CS) || defined(USE_ST7789) || defined(USE_ST7796) || defined(ILI9488_CS) || defined(HX8357_CS)) && \
|
||||||
!defined(DISPLAY_FORCE_SMALL_FONTS)
|
!defined(DISPLAY_FORCE_SMALL_FONTS)
|
||||||
display->drawFastImage(x, y + 3, 8, 8, imgUser);
|
display->drawFastImage(x, y + 3, 8, 8, imgUser);
|
||||||
#else
|
#else
|
||||||
@ -1523,7 +1524,7 @@ static void drawNodeInfo(OLEDDisplay *display, OLEDDisplayUiState *state, int16_
|
|||||||
screen->drawColumns(display, x, y, fields);
|
screen->drawColumns(display, x, y, fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(ESP_PLATFORM) && defined(USE_ST7789)
|
#if defined(ESP_PLATFORM) && (defined(USE_ST7789) || defined(USE_ST7796))
|
||||||
SPIClass SPI1(HSPI);
|
SPIClass SPI1(HSPI);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1541,6 +1542,13 @@ Screen::Screen(ScanI2C::DeviceAddress address, meshtastic_Config_DisplayConfig_O
|
|||||||
#else
|
#else
|
||||||
dispdev = new ST7789Spi(&SPI1, ST7789_RESET, ST7789_RS, ST7789_NSS, GEOMETRY_RAWMODE, TFT_WIDTH, TFT_HEIGHT);
|
dispdev = new ST7789Spi(&SPI1, ST7789_RESET, ST7789_RS, ST7789_NSS, GEOMETRY_RAWMODE, TFT_WIDTH, TFT_HEIGHT);
|
||||||
#endif
|
#endif
|
||||||
|
#elif defined(USE_ST7796)
|
||||||
|
#ifdef ESP_PLATFORM
|
||||||
|
dispdev = new ST7796Spi(&SPI1, ST7796_RESET, ST7796_RS, ST7796_NSS, GEOMETRY_RAWMODE, TFT_WIDTH, TFT_HEIGHT, ST7796_SDA,
|
||||||
|
ST7796_MISO, ST7796_SCK, TFT_SPI_FREQUENCY);
|
||||||
|
#else
|
||||||
|
dispdev = new ST7796Spi(&SPI1, ST7796_RESET, ST7796_RS, ST7796_NSS, GEOMETRY_RAWMODE, TFT_WIDTH, TFT_HEIGHT);
|
||||||
|
#endif
|
||||||
#elif defined(USE_SSD1306)
|
#elif defined(USE_SSD1306)
|
||||||
dispdev = new SSD1306Wire(address.address, -1, -1, geometry,
|
dispdev = new SSD1306Wire(address.address, -1, -1, geometry,
|
||||||
(address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE);
|
(address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE);
|
||||||
@ -1641,6 +1649,15 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver)
|
|||||||
pinMode(VTFT_LEDA, OUTPUT);
|
pinMode(VTFT_LEDA, OUTPUT);
|
||||||
digitalWrite(VTFT_LEDA, TFT_BACKLIGHT_ON);
|
digitalWrite(VTFT_LEDA, TFT_BACKLIGHT_ON);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifdef USE_ST7796
|
||||||
|
ui->init();
|
||||||
|
#ifdef ESP_PLATFORM
|
||||||
|
analogWrite(VTFT_LEDA, BRIGHTNESS_DEFAULT);
|
||||||
|
#else
|
||||||
|
pinMode(VTFT_LEDA, OUTPUT);
|
||||||
|
digitalWrite(VTFT_LEDA, TFT_BACKLIGHT_ON);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
enabled = true;
|
enabled = true;
|
||||||
setInterval(0); // Draw ASAP
|
setInterval(0); // Draw ASAP
|
||||||
@ -1675,6 +1692,21 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver)
|
|||||||
nrf_gpio_cfg_default(ST7789_NSS);
|
nrf_gpio_cfg_default(ST7789_NSS);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef USE_ST7796
|
||||||
|
SPI1.end();
|
||||||
|
#if defined(ARCH_ESP32)
|
||||||
|
pinMode(VTFT_LEDA, OUTPUT);
|
||||||
|
digitalWrite(VTFT_LEDA, LOW);
|
||||||
|
pinMode(ST7796_RESET, ANALOG);
|
||||||
|
pinMode(ST7796_RS, ANALOG);
|
||||||
|
pinMode(ST7796_NSS, ANALOG);
|
||||||
|
#else
|
||||||
|
nrf_gpio_cfg_default(VTFT_LEDA);
|
||||||
|
nrf_gpio_cfg_default(ST7796_RESET);
|
||||||
|
nrf_gpio_cfg_default(ST7796_RS);
|
||||||
|
nrf_gpio_cfg_default(ST7796_NSS);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef T_WATCH_S3
|
#ifdef T_WATCH_S3
|
||||||
PMU->disablePowerOutput(XPOWERS_ALDO2);
|
PMU->disablePowerOutput(XPOWERS_ALDO2);
|
||||||
@ -1704,6 +1736,10 @@ void Screen::setup()
|
|||||||
// Heltec T114 and T190: honor a custom text color, if defined in variant.h
|
// Heltec T114 and T190: honor a custom text color, if defined in variant.h
|
||||||
static_cast<ST7789Spi *>(dispdev)->setRGB(TFT_MESH);
|
static_cast<ST7789Spi *>(dispdev)->setRGB(TFT_MESH);
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(USE_ST7796) && defined(TFT_MESH)
|
||||||
|
// Custom text color, if defined in variant.h
|
||||||
|
static_cast<ST7796Spi *>(dispdev)->setRGB(TFT_MESH);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Initialising the UI will init the display too.
|
// Initialising the UI will init the display too.
|
||||||
ui->init();
|
ui->init();
|
||||||
@ -1764,6 +1800,8 @@ void Screen::setup()
|
|||||||
static_cast<TFTDisplay *>(dispdev)->flipScreenVertically();
|
static_cast<TFTDisplay *>(dispdev)->flipScreenVertically();
|
||||||
#elif defined(USE_ST7789)
|
#elif defined(USE_ST7789)
|
||||||
static_cast<ST7789Spi *>(dispdev)->flipScreenVertically();
|
static_cast<ST7789Spi *>(dispdev)->flipScreenVertically();
|
||||||
|
#elif defined(USE_ST7796)
|
||||||
|
static_cast<ST7796Spi *>(dispdev)->mirrorScreen();
|
||||||
#else
|
#else
|
||||||
dispdev->flipScreenVertically();
|
dispdev->flipScreenVertically();
|
||||||
#endif
|
#endif
|
||||||
@ -1795,10 +1833,13 @@ void Screen::setup()
|
|||||||
new TouchScreenImpl1(dispdev->getWidth(), dispdev->getHeight(), static_cast<TFTDisplay *>(dispdev)->getTouch);
|
new TouchScreenImpl1(dispdev->getWidth(), dispdev->getHeight(), static_cast<TFTDisplay *>(dispdev)->getTouch);
|
||||||
touchScreenImpl1->init();
|
touchScreenImpl1->init();
|
||||||
}
|
}
|
||||||
#elif HAS_TOUCHSCREEN
|
#elif HAS_TOUCHSCREEN && !HAS_CST226SE
|
||||||
touchScreenImpl1 =
|
touchScreenImpl1 =
|
||||||
new TouchScreenImpl1(dispdev->getWidth(), dispdev->getHeight(), static_cast<TFTDisplay *>(dispdev)->getTouch);
|
new TouchScreenImpl1(dispdev->getWidth(), dispdev->getHeight(), static_cast<TFTDisplay *>(dispdev)->getTouch);
|
||||||
touchScreenImpl1->init();
|
touchScreenImpl1->init();
|
||||||
|
#elif HAS_TOUCHSCREEN && HAS_CST226SE
|
||||||
|
touchScreenCST226SE = new TouchScreenCST226SE(TFT_HEIGHT, TFT_WIDTH);
|
||||||
|
touchScreenCST226SE->init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Subscribe to status updates
|
// Subscribe to status updates
|
||||||
@ -2501,7 +2542,8 @@ void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
|
|||||||
if (!Throttle::isWithinTimespanMs(storeForwardModule->lastHeartbeat,
|
if (!Throttle::isWithinTimespanMs(storeForwardModule->lastHeartbeat,
|
||||||
(storeForwardModule->heartbeatInterval * 1200))) { // no heartbeat, overlap a bit
|
(storeForwardModule->heartbeatInterval * 1200))) { // no heartbeat, overlap a bit
|
||||||
#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \
|
#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \
|
||||||
defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || defined(ILI9488_CS) || ARCH_PORTDUINO) && \
|
defined(ST7789_CS) || defined(USE_ST7789) || defined(USE_ST7796) || defined(HX8357_CS) || defined(ILI9488_CS) || \
|
||||||
|
ARCH_PORTDUINO) && \
|
||||||
!defined(DISPLAY_FORCE_SMALL_FONTS)
|
!defined(DISPLAY_FORCE_SMALL_FONTS)
|
||||||
display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 12, 8,
|
display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 12, 8,
|
||||||
imgQuestionL1);
|
imgQuestionL1);
|
||||||
@ -2513,7 +2555,7 @@ void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
|
|||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \
|
#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \
|
||||||
defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS)) && \
|
defined(ST7789_CS) || defined(USE_ST7789) || defined(USE_ST7796) || defined(HX8357_CS) || defined(ILI9488_CS)) && \
|
||||||
!defined(DISPLAY_FORCE_SMALL_FONTS)
|
!defined(DISPLAY_FORCE_SMALL_FONTS)
|
||||||
display->drawFastImage(x + SCREEN_WIDTH - 18 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 16, 8,
|
display->drawFastImage(x + SCREEN_WIDTH - 18 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 16, 8,
|
||||||
imgSFL1);
|
imgSFL1);
|
||||||
@ -2528,7 +2570,8 @@ void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
|
|||||||
} else {
|
} else {
|
||||||
// TODO: Raspberry Pi supports more than just the one screen size
|
// TODO: Raspberry Pi supports more than just the one screen size
|
||||||
#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \
|
#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \
|
||||||
defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || defined(ILI9488_CS) || ARCH_PORTDUINO) && \
|
defined(ST7789_CS) || defined(USE_ST7789) || defined(USE_ST7796) || defined(HX8357_CS) || defined(ILI9488_CS) || \
|
||||||
|
ARCH_PORTDUINO) && \
|
||||||
!defined(DISPLAY_FORCE_SMALL_FONTS)
|
!defined(DISPLAY_FORCE_SMALL_FONTS)
|
||||||
display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 12, 8,
|
display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 12, 8,
|
||||||
imgInfoL1);
|
imgInfoL1);
|
||||||
|
@ -47,6 +47,8 @@ class Screen
|
|||||||
#include <SSD1306Wire.h>
|
#include <SSD1306Wire.h>
|
||||||
#elif defined(USE_ST7789)
|
#elif defined(USE_ST7789)
|
||||||
#include <ST7789Spi.h>
|
#include <ST7789Spi.h>
|
||||||
|
#elif defined(USE_ST7796)
|
||||||
|
#include <ST7796Spi.h>
|
||||||
#else
|
#else
|
||||||
// the SH1106/SSD1306 variant is auto-detected
|
// the SH1106/SSD1306 variant is auto-detected
|
||||||
#include <AutoOLEDWire.h>
|
#include <AutoOLEDWire.h>
|
||||||
|
@ -65,7 +65,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \
|
#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \
|
||||||
defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || defined(ILI9488_CS)) && \
|
defined(ST7789_CS) || defined(USE_ST7789) || defined(USE_ST7796) || defined(HX8357_CS) || defined(ILI9488_CS)) && \
|
||||||
!defined(DISPLAY_FORCE_SMALL_FONTS)
|
!defined(DISPLAY_FORCE_SMALL_FONTS)
|
||||||
// The screen is bigger so use bigger fonts
|
// The screen is bigger so use bigger fonts
|
||||||
#define FONT_SMALL FONT_MEDIUM_LOCAL // Height: 19
|
#define FONT_SMALL FONT_MEDIUM_LOCAL // Height: 19
|
||||||
|
@ -21,7 +21,8 @@ const uint8_t bluetoothConnectedIcon[36] PROGMEM = {0xfe, 0x01, 0xff, 0x03, 0x03
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \
|
#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \
|
||||||
defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || defined(ILI9488_CS) || ARCH_PORTDUINO) && \
|
defined(ST7789_CS) || defined(USE_ST7789) || defined(USE_ST7796) || defined(HX8357_CS) || defined(ILI9488_CS) || \
|
||||||
|
ARCH_PORTDUINO) && \
|
||||||
!defined(DISPLAY_FORCE_SMALL_FONTS)
|
!defined(DISPLAY_FORCE_SMALL_FONTS)
|
||||||
const uint8_t imgQuestionL1[] PROGMEM = {0xff, 0x01, 0x01, 0x32, 0x7b, 0x49, 0x49, 0x6f, 0x26, 0x01, 0x01, 0xff};
|
const uint8_t imgQuestionL1[] PROGMEM = {0xff, 0x01, 0x01, 0x32, 0x7b, 0x49, 0x49, 0x6f, 0x26, 0x01, 0x01, 0xff};
|
||||||
const uint8_t imgQuestionL2[] PROGMEM = {0x0f, 0x08, 0x08, 0x08, 0x06, 0x0f, 0x0f, 0x06, 0x08, 0x08, 0x08, 0x0f};
|
const uint8_t imgQuestionL2[] PROGMEM = {0x0f, 0x08, 0x08, 0x08, 0x06, 0x0f, 0x0f, 0x06, 0x08, 0x08, 0x08, 0x0f};
|
||||||
|
104
src/input/TouchScreenCST226SE.cpp
Normal file
104
src/input/TouchScreenCST226SE.cpp
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
#include "TouchScreenCST226SE.h"
|
||||||
|
#include "variant.h"
|
||||||
|
|
||||||
|
#ifdef HAS_CST226SE
|
||||||
|
|
||||||
|
#ifndef TOUCH_IRQ
|
||||||
|
#define TOUCH_IRQ -1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "PowerFSM.h"
|
||||||
|
#include "Wire.h"
|
||||||
|
#include "configuration.h"
|
||||||
|
#include "modules/ExternalNotificationModule.h"
|
||||||
|
|
||||||
|
volatile bool isPressed = false;
|
||||||
|
|
||||||
|
TouchScreenCST226SE *touchScreenCST226SE;
|
||||||
|
|
||||||
|
TouchScreenCST226SE::TouchScreenCST226SE(uint16_t width, uint16_t height) : TouchScreenBase("CST226", width, height) {}
|
||||||
|
|
||||||
|
void TouchScreenCST226SE::init()
|
||||||
|
{
|
||||||
|
touch.setPins(-1, TOUCH_IRQ);
|
||||||
|
touch.setTouchDrvModel(TouchDrv_CST226);
|
||||||
|
for (uint8_t addr : PossibleAddresses) {
|
||||||
|
if (touch.begin(Wire, addr, I2C_SDA, I2C_SCL)) {
|
||||||
|
i2cAddress = addr;
|
||||||
|
if (TOUCH_IRQ != -1) {
|
||||||
|
pinMode(TOUCH_IRQ, INPUT_PULLUP);
|
||||||
|
attachInterrupt(
|
||||||
|
TOUCH_IRQ, []() { isPressed = true; }, FALLING);
|
||||||
|
}
|
||||||
|
LOG_DEBUG("CST226SE init OK at address 0x%02X", addr);
|
||||||
|
inputBroker->registerSource(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LOG_ERROR("CST226SE init failed at all known addresses");
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TouchScreenCST226SE::getTouch(int16_t &x, int16_t &y)
|
||||||
|
{
|
||||||
|
int16_t x_array[1], y_array[1];
|
||||||
|
uint8_t touched = touch.getPoint(x_array, y_array, 1);
|
||||||
|
if (touched > 0) {
|
||||||
|
y = x_array[0];
|
||||||
|
x = (TFT_WIDTH - y_array[0]);
|
||||||
|
// Check bounds
|
||||||
|
if (x < 0 || x >= TFT_WIDTH || y < 0 || y >= TFT_HEIGHT) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true; // Valid touch detected
|
||||||
|
}
|
||||||
|
return false; // No valid touch data
|
||||||
|
}
|
||||||
|
|
||||||
|
void TouchScreenCST226SE::onEvent(const TouchEvent &event)
|
||||||
|
{
|
||||||
|
InputEvent e;
|
||||||
|
e.source = event.source;
|
||||||
|
|
||||||
|
e.touchX = event.x;
|
||||||
|
e.touchY = event.y;
|
||||||
|
|
||||||
|
switch (event.touchEvent) {
|
||||||
|
case TOUCH_ACTION_LEFT: {
|
||||||
|
e.inputEvent = static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case TOUCH_ACTION_RIGHT: {
|
||||||
|
e.inputEvent = static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_LEFT);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case TOUCH_ACTION_UP: {
|
||||||
|
e.inputEvent = static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_UP);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case TOUCH_ACTION_DOWN: {
|
||||||
|
e.inputEvent = static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_DOWN);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case TOUCH_ACTION_DOUBLE_TAP: {
|
||||||
|
e.inputEvent = static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case TOUCH_ACTION_LONG_PRESS: {
|
||||||
|
e.inputEvent = static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_CANCEL);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case TOUCH_ACTION_TAP: {
|
||||||
|
if (moduleConfig.external_notification.enabled && (externalNotificationModule->nagCycleCutoff != UINT32_MAX)) {
|
||||||
|
externalNotificationModule->stopNow();
|
||||||
|
} else {
|
||||||
|
powerFSM.trigger(EVENT_INPUT);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this->notifyObservers(&e);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
30
src/input/TouchScreenCST226SE.h
Normal file
30
src/input/TouchScreenCST226SE.h
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "variant.h"
|
||||||
|
|
||||||
|
#ifdef HAS_CST226SE
|
||||||
|
|
||||||
|
#include "modules/CannedMessageModule.h"
|
||||||
|
|
||||||
|
#include "TouchDrvCSTXXX.hpp"
|
||||||
|
#include "TouchScreenBase.h"
|
||||||
|
|
||||||
|
class TouchScreenCST226SE : public TouchScreenBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
TouchScreenCST226SE(uint16_t width, uint16_t height);
|
||||||
|
void init(void);
|
||||||
|
virtual bool getTouch(int16_t &x, int16_t &y);
|
||||||
|
virtual void onEvent(const TouchEvent &event);
|
||||||
|
|
||||||
|
private:
|
||||||
|
static TouchScreenCST226SE *instance;
|
||||||
|
TouchDrvCSTXXX touch;
|
||||||
|
uint8_t i2cAddress = 0;
|
||||||
|
static constexpr uint8_t PossibleAddresses[2] = {CST226SE_ADDR, CST226SE_ADDR_ALT};
|
||||||
|
};
|
||||||
|
|
||||||
|
// For global reference in other code
|
||||||
|
extern TouchScreenCST226SE *touchScreenCST226SE;
|
||||||
|
|
||||||
|
#endif
|
@ -337,12 +337,12 @@ void setup()
|
|||||||
|
|
||||||
#ifdef LED_POWER
|
#ifdef LED_POWER
|
||||||
pinMode(LED_POWER, OUTPUT);
|
pinMode(LED_POWER, OUTPUT);
|
||||||
digitalWrite(LED_POWER, HIGH);
|
digitalWrite(LED_POWER, LED_STATE_ON);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USER_LED
|
#ifdef USER_LED
|
||||||
pinMode(USER_LED, OUTPUT);
|
pinMode(USER_LED, OUTPUT);
|
||||||
digitalWrite(USER_LED, LOW);
|
digitalWrite(USER_LED, HIGH ^ LED_STATE_ON);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(T_DECK)
|
#if defined(T_DECK)
|
||||||
@ -942,7 +942,7 @@ void setup()
|
|||||||
// Don't call screen setup until after nodedb is setup (because we need
|
// Don't call screen setup until after nodedb is setup (because we need
|
||||||
// the current region name)
|
// the current region name)
|
||||||
#if defined(ST7701_CS) || defined(ST7735_CS) || defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || \
|
#if defined(ST7701_CS) || defined(ST7735_CS) || defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || \
|
||||||
defined(ST7789_CS) || defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS)
|
defined(ST7789_CS) || defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(USE_ST7796)
|
||||||
screen->setup();
|
screen->setup();
|
||||||
#elif defined(ARCH_PORTDUINO)
|
#elif defined(ARCH_PORTDUINO)
|
||||||
if (screen_found.port != ScanI2C::I2CPort::NO_I2C || settingsMap[displayPanel]) {
|
if (screen_found.port != ScanI2C::I2CPort::NO_I2C || settingsMap[displayPanel]) {
|
||||||
|
@ -600,7 +600,7 @@ void NodeDB::installDefaultConfig(bool preserveKey = false)
|
|||||||
config.bluetooth.fixed_pin = defaultBLEPin;
|
config.bluetooth.fixed_pin = defaultBLEPin;
|
||||||
|
|
||||||
#if defined(ST7735_CS) || defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7789_CS) || \
|
#if defined(ST7735_CS) || defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7789_CS) || \
|
||||||
defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS)
|
defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(USE_ST7796)
|
||||||
bool hasScreen = true;
|
bool hasScreen = true;
|
||||||
#ifdef HELTEC_MESH_NODE_T114
|
#ifdef HELTEC_MESH_NODE_T114
|
||||||
uint32_t st7789_id = get_st7789_id(ST7789_NSS, ST7789_SCK, ST7789_SDA, ST7789_RS, ST7789_RESET);
|
uint32_t st7789_id = get_st7789_id(ST7789_NSS, ST7789_SCK, ST7789_SDA, ST7789_RS, ST7789_RESET);
|
||||||
|
@ -65,6 +65,8 @@ PB_BIND(meshtastic_Config_SessionkeyConfig, meshtastic_Config_SessionkeyConfig,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,6 +88,23 @@ typedef enum _meshtastic_Config_DeviceConfig_RebroadcastMode {
|
|||||||
meshtastic_Config_DeviceConfig_RebroadcastMode_CORE_PORTNUMS_ONLY = 5
|
meshtastic_Config_DeviceConfig_RebroadcastMode_CORE_PORTNUMS_ONLY = 5
|
||||||
} meshtastic_Config_DeviceConfig_RebroadcastMode;
|
} meshtastic_Config_DeviceConfig_RebroadcastMode;
|
||||||
|
|
||||||
|
/* Defines buzzer behavior for audio feedback */
|
||||||
|
typedef enum _meshtastic_Config_DeviceConfig_BuzzerMode {
|
||||||
|
/* Default behavior.
|
||||||
|
Buzzer is enabled for all audio feedback including button presses and alerts. */
|
||||||
|
meshtastic_Config_DeviceConfig_BuzzerMode_ALL_ENABLED = 0,
|
||||||
|
/* Disabled.
|
||||||
|
All buzzer audio feedback is disabled. */
|
||||||
|
meshtastic_Config_DeviceConfig_BuzzerMode_DISABLED = 1,
|
||||||
|
/* Notifications Only.
|
||||||
|
Buzzer is enabled only for notifications and alerts, but not for button presses.
|
||||||
|
External notification config determines the specifics of the notification behavior. */
|
||||||
|
meshtastic_Config_DeviceConfig_BuzzerMode_NOTIFICATIONS_ONLY = 2,
|
||||||
|
/* Non-notification system buzzer tones only.
|
||||||
|
Buzzer is enabled only for non-notification tones such as button presses, startup, shutdown, but not for alerts. */
|
||||||
|
meshtastic_Config_DeviceConfig_BuzzerMode_SYSTEM_ONLY = 3
|
||||||
|
} meshtastic_Config_DeviceConfig_BuzzerMode;
|
||||||
|
|
||||||
/* Bit field of boolean configuration options, indicating which optional
|
/* Bit field of boolean configuration options, indicating which optional
|
||||||
fields to include when assembling POSITION messages.
|
fields to include when assembling POSITION messages.
|
||||||
Longitude, latitude, altitude, speed, heading, and DOP
|
Longitude, latitude, altitude, speed, heading, and DOP
|
||||||
@ -335,6 +352,9 @@ typedef struct _meshtastic_Config_DeviceConfig {
|
|||||||
char tzdef[65];
|
char tzdef[65];
|
||||||
/* If true, disable the default blinking LED (LED_PIN) behavior on the device */
|
/* If true, disable the default blinking LED (LED_PIN) behavior on the device */
|
||||||
bool led_heartbeat_disabled;
|
bool led_heartbeat_disabled;
|
||||||
|
/* Controls buzzer behavior for audio feedback
|
||||||
|
Defaults to ENABLED */
|
||||||
|
meshtastic_Config_DeviceConfig_BuzzerMode buzzer_mode;
|
||||||
} meshtastic_Config_DeviceConfig;
|
} meshtastic_Config_DeviceConfig;
|
||||||
|
|
||||||
/* Position Config */
|
/* Position Config */
|
||||||
@ -618,6 +638,10 @@ extern "C" {
|
|||||||
#define _meshtastic_Config_DeviceConfig_RebroadcastMode_MAX meshtastic_Config_DeviceConfig_RebroadcastMode_CORE_PORTNUMS_ONLY
|
#define _meshtastic_Config_DeviceConfig_RebroadcastMode_MAX meshtastic_Config_DeviceConfig_RebroadcastMode_CORE_PORTNUMS_ONLY
|
||||||
#define _meshtastic_Config_DeviceConfig_RebroadcastMode_ARRAYSIZE ((meshtastic_Config_DeviceConfig_RebroadcastMode)(meshtastic_Config_DeviceConfig_RebroadcastMode_CORE_PORTNUMS_ONLY+1))
|
#define _meshtastic_Config_DeviceConfig_RebroadcastMode_ARRAYSIZE ((meshtastic_Config_DeviceConfig_RebroadcastMode)(meshtastic_Config_DeviceConfig_RebroadcastMode_CORE_PORTNUMS_ONLY+1))
|
||||||
|
|
||||||
|
#define _meshtastic_Config_DeviceConfig_BuzzerMode_MIN meshtastic_Config_DeviceConfig_BuzzerMode_ALL_ENABLED
|
||||||
|
#define _meshtastic_Config_DeviceConfig_BuzzerMode_MAX meshtastic_Config_DeviceConfig_BuzzerMode_SYSTEM_ONLY
|
||||||
|
#define _meshtastic_Config_DeviceConfig_BuzzerMode_ARRAYSIZE ((meshtastic_Config_DeviceConfig_BuzzerMode)(meshtastic_Config_DeviceConfig_BuzzerMode_SYSTEM_ONLY+1))
|
||||||
|
|
||||||
#define _meshtastic_Config_PositionConfig_PositionFlags_MIN meshtastic_Config_PositionConfig_PositionFlags_UNSET
|
#define _meshtastic_Config_PositionConfig_PositionFlags_MIN meshtastic_Config_PositionConfig_PositionFlags_UNSET
|
||||||
#define _meshtastic_Config_PositionConfig_PositionFlags_MAX meshtastic_Config_PositionConfig_PositionFlags_SPEED
|
#define _meshtastic_Config_PositionConfig_PositionFlags_MAX meshtastic_Config_PositionConfig_PositionFlags_SPEED
|
||||||
#define _meshtastic_Config_PositionConfig_PositionFlags_ARRAYSIZE ((meshtastic_Config_PositionConfig_PositionFlags)(meshtastic_Config_PositionConfig_PositionFlags_SPEED+1))
|
#define _meshtastic_Config_PositionConfig_PositionFlags_ARRAYSIZE ((meshtastic_Config_PositionConfig_PositionFlags)(meshtastic_Config_PositionConfig_PositionFlags_SPEED+1))
|
||||||
@ -669,6 +693,7 @@ extern "C" {
|
|||||||
|
|
||||||
#define meshtastic_Config_DeviceConfig_role_ENUMTYPE meshtastic_Config_DeviceConfig_Role
|
#define meshtastic_Config_DeviceConfig_role_ENUMTYPE meshtastic_Config_DeviceConfig_Role
|
||||||
#define meshtastic_Config_DeviceConfig_rebroadcast_mode_ENUMTYPE meshtastic_Config_DeviceConfig_RebroadcastMode
|
#define meshtastic_Config_DeviceConfig_rebroadcast_mode_ENUMTYPE meshtastic_Config_DeviceConfig_RebroadcastMode
|
||||||
|
#define meshtastic_Config_DeviceConfig_buzzer_mode_ENUMTYPE meshtastic_Config_DeviceConfig_BuzzerMode
|
||||||
|
|
||||||
#define meshtastic_Config_PositionConfig_gps_mode_ENUMTYPE meshtastic_Config_PositionConfig_GpsMode
|
#define meshtastic_Config_PositionConfig_gps_mode_ENUMTYPE meshtastic_Config_PositionConfig_GpsMode
|
||||||
|
|
||||||
@ -692,7 +717,7 @@ extern "C" {
|
|||||||
|
|
||||||
/* Initializer values for message structs */
|
/* Initializer values for message structs */
|
||||||
#define meshtastic_Config_init_default {0, {meshtastic_Config_DeviceConfig_init_default}}
|
#define meshtastic_Config_init_default {0, {meshtastic_Config_DeviceConfig_init_default}}
|
||||||
#define meshtastic_Config_DeviceConfig_init_default {_meshtastic_Config_DeviceConfig_Role_MIN, 0, 0, 0, _meshtastic_Config_DeviceConfig_RebroadcastMode_MIN, 0, 0, 0, 0, "", 0}
|
#define meshtastic_Config_DeviceConfig_init_default {_meshtastic_Config_DeviceConfig_Role_MIN, 0, 0, 0, _meshtastic_Config_DeviceConfig_RebroadcastMode_MIN, 0, 0, 0, 0, "", 0, _meshtastic_Config_DeviceConfig_BuzzerMode_MIN}
|
||||||
#define meshtastic_Config_PositionConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _meshtastic_Config_PositionConfig_GpsMode_MIN}
|
#define meshtastic_Config_PositionConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _meshtastic_Config_PositionConfig_GpsMode_MIN}
|
||||||
#define meshtastic_Config_PowerConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0}
|
#define meshtastic_Config_PowerConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||||
#define meshtastic_Config_NetworkConfig_init_default {0, "", "", "", 0, _meshtastic_Config_NetworkConfig_AddressMode_MIN, false, meshtastic_Config_NetworkConfig_IpV4Config_init_default, "", 0, 0}
|
#define meshtastic_Config_NetworkConfig_init_default {0, "", "", "", 0, _meshtastic_Config_NetworkConfig_AddressMode_MIN, false, meshtastic_Config_NetworkConfig_IpV4Config_init_default, "", 0, 0}
|
||||||
@ -703,7 +728,7 @@ extern "C" {
|
|||||||
#define meshtastic_Config_SecurityConfig_init_default {{0, {0}}, {0, {0}}, 0, {{0, {0}}, {0, {0}}, {0, {0}}}, 0, 0, 0, 0}
|
#define meshtastic_Config_SecurityConfig_init_default {{0, {0}}, {0, {0}}, 0, {{0, {0}}, {0, {0}}, {0, {0}}}, 0, 0, 0, 0}
|
||||||
#define meshtastic_Config_SessionkeyConfig_init_default {0}
|
#define meshtastic_Config_SessionkeyConfig_init_default {0}
|
||||||
#define meshtastic_Config_init_zero {0, {meshtastic_Config_DeviceConfig_init_zero}}
|
#define meshtastic_Config_init_zero {0, {meshtastic_Config_DeviceConfig_init_zero}}
|
||||||
#define meshtastic_Config_DeviceConfig_init_zero {_meshtastic_Config_DeviceConfig_Role_MIN, 0, 0, 0, _meshtastic_Config_DeviceConfig_RebroadcastMode_MIN, 0, 0, 0, 0, "", 0}
|
#define meshtastic_Config_DeviceConfig_init_zero {_meshtastic_Config_DeviceConfig_Role_MIN, 0, 0, 0, _meshtastic_Config_DeviceConfig_RebroadcastMode_MIN, 0, 0, 0, 0, "", 0, _meshtastic_Config_DeviceConfig_BuzzerMode_MIN}
|
||||||
#define meshtastic_Config_PositionConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _meshtastic_Config_PositionConfig_GpsMode_MIN}
|
#define meshtastic_Config_PositionConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _meshtastic_Config_PositionConfig_GpsMode_MIN}
|
||||||
#define meshtastic_Config_PowerConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0}
|
#define meshtastic_Config_PowerConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||||
#define meshtastic_Config_NetworkConfig_init_zero {0, "", "", "", 0, _meshtastic_Config_NetworkConfig_AddressMode_MIN, false, meshtastic_Config_NetworkConfig_IpV4Config_init_zero, "", 0, 0}
|
#define meshtastic_Config_NetworkConfig_init_zero {0, "", "", "", 0, _meshtastic_Config_NetworkConfig_AddressMode_MIN, false, meshtastic_Config_NetworkConfig_IpV4Config_init_zero, "", 0, 0}
|
||||||
@ -726,6 +751,7 @@ extern "C" {
|
|||||||
#define meshtastic_Config_DeviceConfig_disable_triple_click_tag 10
|
#define meshtastic_Config_DeviceConfig_disable_triple_click_tag 10
|
||||||
#define meshtastic_Config_DeviceConfig_tzdef_tag 11
|
#define meshtastic_Config_DeviceConfig_tzdef_tag 11
|
||||||
#define meshtastic_Config_DeviceConfig_led_heartbeat_disabled_tag 12
|
#define meshtastic_Config_DeviceConfig_led_heartbeat_disabled_tag 12
|
||||||
|
#define meshtastic_Config_DeviceConfig_buzzer_mode_tag 13
|
||||||
#define meshtastic_Config_PositionConfig_position_broadcast_secs_tag 1
|
#define meshtastic_Config_PositionConfig_position_broadcast_secs_tag 1
|
||||||
#define meshtastic_Config_PositionConfig_position_broadcast_smart_enabled_tag 2
|
#define meshtastic_Config_PositionConfig_position_broadcast_smart_enabled_tag 2
|
||||||
#define meshtastic_Config_PositionConfig_fixed_position_tag 3
|
#define meshtastic_Config_PositionConfig_fixed_position_tag 3
|
||||||
@ -849,7 +875,8 @@ X(a, STATIC, SINGULAR, BOOL, double_tap_as_button_press, 8) \
|
|||||||
X(a, STATIC, SINGULAR, BOOL, is_managed, 9) \
|
X(a, STATIC, SINGULAR, BOOL, is_managed, 9) \
|
||||||
X(a, STATIC, SINGULAR, BOOL, disable_triple_click, 10) \
|
X(a, STATIC, SINGULAR, BOOL, disable_triple_click, 10) \
|
||||||
X(a, STATIC, SINGULAR, STRING, tzdef, 11) \
|
X(a, STATIC, SINGULAR, STRING, tzdef, 11) \
|
||||||
X(a, STATIC, SINGULAR, BOOL, led_heartbeat_disabled, 12)
|
X(a, STATIC, SINGULAR, BOOL, led_heartbeat_disabled, 12) \
|
||||||
|
X(a, STATIC, SINGULAR, UENUM, buzzer_mode, 13)
|
||||||
#define meshtastic_Config_DeviceConfig_CALLBACK NULL
|
#define meshtastic_Config_DeviceConfig_CALLBACK NULL
|
||||||
#define meshtastic_Config_DeviceConfig_DEFAULT NULL
|
#define meshtastic_Config_DeviceConfig_DEFAULT NULL
|
||||||
|
|
||||||
@ -995,7 +1022,7 @@ extern const pb_msgdesc_t meshtastic_Config_SessionkeyConfig_msg;
|
|||||||
/* Maximum encoded size of messages (where known) */
|
/* Maximum encoded size of messages (where known) */
|
||||||
#define MESHTASTIC_MESHTASTIC_CONFIG_PB_H_MAX_SIZE meshtastic_Config_size
|
#define MESHTASTIC_MESHTASTIC_CONFIG_PB_H_MAX_SIZE meshtastic_Config_size
|
||||||
#define meshtastic_Config_BluetoothConfig_size 10
|
#define meshtastic_Config_BluetoothConfig_size 10
|
||||||
#define meshtastic_Config_DeviceConfig_size 98
|
#define meshtastic_Config_DeviceConfig_size 100
|
||||||
#define meshtastic_Config_DisplayConfig_size 32
|
#define meshtastic_Config_DisplayConfig_size 32
|
||||||
#define meshtastic_Config_LoRaConfig_size 85
|
#define meshtastic_Config_LoRaConfig_size 85
|
||||||
#define meshtastic_Config_NetworkConfig_IpV4Config_size 20
|
#define meshtastic_Config_NetworkConfig_IpV4Config_size 20
|
||||||
|
@ -55,6 +55,8 @@ typedef enum _meshtastic_Language {
|
|||||||
meshtastic_Language_SLOVENIAN = 15,
|
meshtastic_Language_SLOVENIAN = 15,
|
||||||
/* Ukrainian */
|
/* Ukrainian */
|
||||||
meshtastic_Language_UKRAINIAN = 16,
|
meshtastic_Language_UKRAINIAN = 16,
|
||||||
|
/* Bulgarian */
|
||||||
|
meshtastic_Language_BULGARIAN = 17,
|
||||||
/* Simplified Chinese (experimental) */
|
/* Simplified Chinese (experimental) */
|
||||||
meshtastic_Language_SIMPLIFIED_CHINESE = 30,
|
meshtastic_Language_SIMPLIFIED_CHINESE = 30,
|
||||||
/* Traditional Chinese (experimental) */
|
/* Traditional Chinese (experimental) */
|
||||||
|
@ -360,7 +360,7 @@ extern const pb_msgdesc_t meshtastic_BackupPreferences_msg;
|
|||||||
/* Maximum encoded size of messages (where known) */
|
/* Maximum encoded size of messages (where known) */
|
||||||
/* meshtastic_NodeDatabase_size depends on runtime parameters */
|
/* meshtastic_NodeDatabase_size depends on runtime parameters */
|
||||||
#define MESHTASTIC_MESHTASTIC_DEVICEONLY_PB_H_MAX_SIZE meshtastic_BackupPreferences_size
|
#define MESHTASTIC_MESHTASTIC_DEVICEONLY_PB_H_MAX_SIZE meshtastic_BackupPreferences_size
|
||||||
#define meshtastic_BackupPreferences_size 2269
|
#define meshtastic_BackupPreferences_size 2271
|
||||||
#define meshtastic_ChannelFile_size 718
|
#define meshtastic_ChannelFile_size 718
|
||||||
#define meshtastic_DeviceState_size 1722
|
#define meshtastic_DeviceState_size 1722
|
||||||
#define meshtastic_NodeInfoLite_size 196
|
#define meshtastic_NodeInfoLite_size 196
|
||||||
|
@ -187,7 +187,7 @@ extern const pb_msgdesc_t meshtastic_LocalModuleConfig_msg;
|
|||||||
|
|
||||||
/* Maximum encoded size of messages (where known) */
|
/* Maximum encoded size of messages (where known) */
|
||||||
#define MESHTASTIC_MESHTASTIC_LOCALONLY_PB_H_MAX_SIZE meshtastic_LocalConfig_size
|
#define MESHTASTIC_MESHTASTIC_LOCALONLY_PB_H_MAX_SIZE meshtastic_LocalConfig_size
|
||||||
#define meshtastic_LocalConfig_size 745
|
#define meshtastic_LocalConfig_size 747
|
||||||
#define meshtastic_LocalModuleConfig_size 669
|
#define meshtastic_LocalModuleConfig_size 669
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -258,6 +258,12 @@ typedef enum _meshtastic_HardwareModel {
|
|||||||
meshtastic_HardwareModel_SEEED_WIO_TRACKER_L1_EINK = 100,
|
meshtastic_HardwareModel_SEEED_WIO_TRACKER_L1_EINK = 100,
|
||||||
/* Reserved ID for future and past use */
|
/* Reserved ID for future and past use */
|
||||||
meshtastic_HardwareModel_QWANTZ_TINY_ARMS = 101,
|
meshtastic_HardwareModel_QWANTZ_TINY_ARMS = 101,
|
||||||
|
/* *
|
||||||
|
Lilygo T-Deck Pro */
|
||||||
|
meshtastic_HardwareModel_T_DECK_PRO = 102,
|
||||||
|
/* *
|
||||||
|
Lilygo TLora Pager */
|
||||||
|
meshtastic_HardwareModel_T_LORA_PAGER = 103,
|
||||||
/* ------------------------------------------------------------------------------------------------------------------------------------------
|
/* ------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits.
|
Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits.
|
||||||
------------------------------------------------------------------------------------------------------------------------------------------ */
|
------------------------------------------------------------------------------------------------------------------------------------------ */
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
#define GPS_POWER_TOGGLE // Moved definition from platformio.ini to here
|
#define GPS_POWER_TOGGLE // Moved definition from platformio.ini to here
|
||||||
|
|
||||||
#define BUTTON_PIN 39 // The middle button GPIO on the T-Beam
|
#define BUTTON_PIN 39 // The middle button GPIO on the T-Beam
|
||||||
|
// Note: On the ESP32 base version, gpio34-39 are input-only, and do not have internal pull-ups.
|
||||||
|
// If 39 is not being used for a button, it is suggested to remove the #define.
|
||||||
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||||
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
|
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
|
||||||
#define ADC_MULTIPLIER 1.85 // (R1 = 470k, R2 = 680k)
|
#define ADC_MULTIPLIER 1.85 // (R1 = 470k, R2 = 680k)
|
||||||
|
@ -3,11 +3,23 @@
|
|||||||
extends = esp32_base
|
extends = esp32_base
|
||||||
board = ttgo-t-beam
|
board = ttgo-t-beam
|
||||||
board_check = true
|
board_check = true
|
||||||
lib_deps =
|
lib_deps = ${esp32_base.lib_deps}
|
||||||
${esp32_base.lib_deps}
|
build_flags = ${esp32_base.build_flags}
|
||||||
build_flags =
|
-D TBEAM_V10
|
||||||
${esp32_base.build_flags} -D TBEAM_V10 -I variants/tbeam
|
-I variants/tbeam
|
||||||
-DGPS_POWER_TOGGLE ; comment this line to disable double press function on the user button to turn off gps entirely.
|
-D GPS_POWER_TOGGLE ; comment this line to disable double press function on the user button to turn off gps entirely.
|
||||||
-DBOARD_HAS_PSRAM
|
-D BOARD_HAS_PSRAM
|
||||||
-mfix-esp32-psram-cache-issue
|
-mfix-esp32-psram-cache-issue
|
||||||
upload_speed = 921600
|
upload_speed = 921600
|
||||||
|
|
||||||
|
[env:tbeam-displayshield]
|
||||||
|
extends = env:tbeam
|
||||||
|
|
||||||
|
build_flags =
|
||||||
|
${env:tbeam.build_flags}
|
||||||
|
-D USE_ST7796
|
||||||
|
|
||||||
|
lib_deps =
|
||||||
|
${env:tbeam.lib_deps}
|
||||||
|
https://github.com/meshtastic/st7796/archive/refs/tags/1.0.5.zip ; display addon
|
||||||
|
lewisxhe/SensorLib@0.3.1 ; touchscreen addon
|
||||||
|
@ -42,4 +42,32 @@
|
|||||||
#define GPS_UBLOX
|
#define GPS_UBLOX
|
||||||
#define GPS_RX_PIN 34
|
#define GPS_RX_PIN 34
|
||||||
#define GPS_TX_PIN 12
|
#define GPS_TX_PIN 12
|
||||||
// #define GPS_DEBUG
|
// #define GPS_DEBUG
|
||||||
|
|
||||||
|
// Used when the display shield is chosen
|
||||||
|
#ifdef USE_ST7796
|
||||||
|
|
||||||
|
#undef EXT_NOTIFY_OUT
|
||||||
|
#undef LED_STATE_ON
|
||||||
|
#undef LED_PIN
|
||||||
|
|
||||||
|
#define HAS_CST226SE 1
|
||||||
|
#define HAS_TOUCHSCREEN 1
|
||||||
|
// #define TOUCH_IRQ 35 // broken in this version of the lib 0.3.1
|
||||||
|
#define CANNED_MESSAGE_MODULE_ENABLE 1
|
||||||
|
#define USE_VIRTUAL_KEYBOARD 1
|
||||||
|
|
||||||
|
#define ST7796_NSS 25
|
||||||
|
#define ST7796_RS 13 // DC
|
||||||
|
#define ST7796_SDA 14 // MOSI
|
||||||
|
#define ST7796_SCK 15
|
||||||
|
#define ST7796_RESET 2
|
||||||
|
#define ST7796_MISO -1
|
||||||
|
#define ST7796_BUSY -1
|
||||||
|
#define VTFT_LEDA 4
|
||||||
|
#define TFT_SPI_FREQUENCY 60000000
|
||||||
|
#define TFT_HEIGHT 222
|
||||||
|
#define TFT_WIDTH 480
|
||||||
|
#define BRIGHTNESS_DEFAULT 100 // Medium Low Brightness
|
||||||
|
#define SCREEN_TRANSITION_FRAMERATE 5 // fps
|
||||||
|
#endif
|
Loading…
Reference in New Issue
Block a user