-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add support for LilyGo T-Echo Plus #9149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8b0eb98
Add t-echo plus support
thebentern e0f6ea2
T-Echo plus hw model
thebentern 99e7648
Merge branch 'master' into t-echo-plus
thebentern 36a9adb
Merge branch 'master' into t-echo-plus
thebentern 2ed8287
Cruft
thebentern d713053
Fix
thebentern 0601537
Added InkHUD style touch backlight control
thebentern File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| #pragma once | ||
|
|
||
| #include "configuration.h" | ||
|
|
||
| #ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS | ||
|
|
||
| #include "graphics/niche/Drivers/Backlight/LatchingBacklight.h" | ||
| #include "graphics/niche/Drivers/EInk/GDEY0154D67.h" | ||
| #include "graphics/niche/InkHUD/Applets/User/AllMessage/AllMessageApplet.h" | ||
| #include "graphics/niche/InkHUD/Applets/User/DM/DMApplet.h" | ||
| #include "graphics/niche/InkHUD/Applets/User/Heard/HeardApplet.h" | ||
| #include "graphics/niche/InkHUD/Applets/User/Positions/PositionsApplet.h" | ||
| #include "graphics/niche/InkHUD/Applets/User/RecentsList/RecentsListApplet.h" | ||
| #include "graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.h" | ||
| #include "graphics/niche/InkHUD/InkHUD.h" | ||
| #include "graphics/niche/Inputs/TwoButton.h" | ||
|
|
||
| void setupNicheGraphics() | ||
| { | ||
| using namespace NicheGraphics; | ||
|
|
||
| SPI1.begin(); | ||
|
|
||
| Drivers::EInk *driver = new Drivers::GDEY0154D67; | ||
| driver->begin(&SPI1, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES); | ||
|
|
||
| InkHUD::InkHUD *inkhud = InkHUD::InkHUD::getInstance(); | ||
| inkhud->setDriver(driver); | ||
| inkhud->setDisplayResilience(20, 1.5); | ||
| InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252; | ||
| InkHUD::Applet::fontMedium = FREESANS_9PT_WIN1252; | ||
| InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252; | ||
| inkhud->persistence->settings.userTiles.maxCount = 2; | ||
| inkhud->persistence->settings.rotation = 3; | ||
| inkhud->persistence->settings.optionalFeatures.batteryIcon = true; | ||
| inkhud->persistence->settings.optionalMenuItems.backlight = true; | ||
|
|
||
| Drivers::LatchingBacklight *backlight = Drivers::LatchingBacklight::getInstance(); | ||
| backlight->setPin(PIN_EINK_BL); | ||
|
|
||
| inkhud->addApplet("All Messages", new InkHUD::AllMessageApplet, true, true); | ||
| inkhud->addApplet("DMs", new InkHUD::DMApplet); | ||
| inkhud->addApplet("Channel 0", new InkHUD::ThreadedMessageApplet(0)); | ||
| inkhud->addApplet("Channel 1", new InkHUD::ThreadedMessageApplet(1)); | ||
| inkhud->addApplet("Positions", new InkHUD::PositionsApplet, true); | ||
| inkhud->addApplet("Recents List", new InkHUD::RecentsListApplet); | ||
| inkhud->addApplet("Heard", new InkHUD::HeardApplet, true, false, 0); | ||
|
|
||
| inkhud->begin(); | ||
|
|
||
| Inputs::TwoButton *buttons = Inputs::TwoButton::getInstance(); | ||
|
|
||
| buttons->setWiring(0, Inputs::TwoButton::getUserButtonPin()); | ||
| buttons->setTiming(0, 75, 500); | ||
| buttons->setHandlerShortPress(0, [inkhud]() { inkhud->shortpress(); }); | ||
| buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); }); | ||
|
|
||
| buttons->setWiring(1, PIN_BUTTON_TOUCH); | ||
| buttons->setTiming(1, 50, 5000); | ||
| buttons->setHandlerDown(1, [inkhud, backlight]() { | ||
| backlight->peek(); | ||
| inkhud->persistence->settings.optionalMenuItems.backlight = false; | ||
| }); | ||
| buttons->setHandlerLongPress(1, [backlight]() { backlight->latch(); }); | ||
| buttons->setHandlerShortPress(1, [backlight]() { backlight->off(); }); | ||
|
|
||
| buttons->start(); | ||
| } | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| [env:t-echo-plus] | ||
| extends = nrf52840_base | ||
| board = t-echo | ||
| board_level = pr | ||
| board_check = true | ||
| debug_tool = jlink | ||
|
|
||
| build_flags = ${nrf52840_base.build_flags} | ||
| -DTTGO_T_ECHO_PLUS | ||
| -Ivariants/nrf52840/t-echo-plus | ||
| -DEINK_DISPLAY_MODEL=GxEPD2_154_D67 | ||
| -DEINK_WIDTH=200 | ||
| -DEINK_HEIGHT=200 | ||
| -DUSE_EINK | ||
| -DUSE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk | ||
| -DEINK_LIMIT_FASTREFRESH=20 ; How many consecutive fast-refreshes are permitted | ||
| -DEINK_BACKGROUND_USES_FAST ; (Optional) Use FAST refresh for both BACKGROUND and RESPONSIVE, until a limit is reached. | ||
| -DI2C_NO_RESCAN | ||
|
|
||
| build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/t-echo-plus> | ||
|
|
||
| lib_deps = | ||
| ${nrf52840_base.lib_deps} | ||
| https://github.com/meshtastic/GxEPD2/archive/55f618961db45a23eff0233546430f1e5a80f63a.zip | ||
| lewisxhe/PCF8563_Library@^1.0.1 | ||
| adafruit/Adafruit DRV2605 Library@1.2.4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #include "variant.h" | ||
|
thebentern marked this conversation as resolved.
|
||
| #include "nrf.h" | ||
| #include "wiring_constants.h" | ||
| #include "wiring_digital.h" | ||
|
|
||
| const uint32_t g_ADigitalPinMap[] = { | ||
| // P0 - pins 0 and 1 are hardwired for xtal and should never be enabled | ||
| 0xff, 0xff, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, | ||
|
|
||
| // P1 | ||
| 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}; | ||
|
|
||
| void initVariant() | ||
| { | ||
| // LEDs (if populated) | ||
| pinMode(PIN_LED1, OUTPUT); | ||
| ledOff(PIN_LED1); | ||
|
|
||
| pinMode(PIN_LED2, OUTPUT); | ||
| ledOff(PIN_LED2); | ||
|
|
||
| pinMode(PIN_LED3, OUTPUT); | ||
| ledOff(PIN_LED3); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.