mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-28 23:50:06 +00:00

Some checks are pending
CI / setup (check) (push) Waiting to run
CI / setup (esp32) (push) Waiting to run
CI / setup (esp32c3) (push) Waiting to run
CI / setup (esp32c6) (push) Waiting to run
CI / setup (esp32s3) (push) Waiting to run
CI / setup (nrf52840) (push) Waiting to run
CI / setup (rp2040) (push) Waiting to run
CI / setup (rp2350) (push) Waiting to run
CI / setup (stm32) (push) Waiting to run
CI / version (push) Waiting to run
CI / check (push) Blocked by required conditions
CI / build-esp32 (push) Blocked by required conditions
CI / build-esp32s3 (push) Blocked by required conditions
CI / build-esp32c3 (push) Blocked by required conditions
CI / build-esp32c6 (push) Blocked by required conditions
CI / build-nrf52840 (push) Blocked by required conditions
CI / build-rp2040 (push) Blocked by required conditions
CI / build-rp2350 (push) Blocked by required conditions
CI / build-stm32 (push) Blocked by required conditions
CI / build-debian-src (push) Waiting to run
CI / package-pio-deps-native-tft (push) Waiting to run
CI / test-native (push) Waiting to run
CI / docker-deb-amd64 (push) Waiting to run
CI / docker-deb-amd64-tft (push) Waiting to run
CI / docker-alp-amd64 (push) Waiting to run
CI / docker-alp-amd64-tft (push) Waiting to run
CI / docker-deb-arm64 (push) Waiting to run
CI / docker-deb-armv7 (push) Waiting to run
CI / gather-artifacts (esp32) (push) Blocked by required conditions
CI / gather-artifacts (esp32c3) (push) Blocked by required conditions
CI / gather-artifacts (esp32c6) (push) Blocked by required conditions
CI / gather-artifacts (esp32s3) (push) Blocked by required conditions
CI / gather-artifacts (nrf52840) (push) Blocked by required conditions
CI / gather-artifacts (rp2040) (push) Blocked by required conditions
CI / gather-artifacts (rp2350) (push) Blocked by required conditions
CI / gather-artifacts (stm32) (push) Blocked by required conditions
CI / release-artifacts (push) Blocked by required conditions
CI / release-firmware (esp32) (push) Blocked by required conditions
CI / release-firmware (esp32c3) (push) Blocked by required conditions
CI / release-firmware (esp32c6) (push) Blocked by required conditions
CI / release-firmware (esp32s3) (push) Blocked by required conditions
CI / release-firmware (nrf52840) (push) Blocked by required conditions
CI / release-firmware (rp2040) (push) Blocked by required conditions
CI / release-firmware (rp2350) (push) Blocked by required conditions
CI / release-firmware (stm32) (push) Blocked by required conditions
CI / publish-firmware (push) Blocked by required conditions
* Add BaseUI support for L1 EInk * Fix Eink offset * Add joystick * Updates * Adjust Seeed Wio Tracker L1 E-Ink variant (#7326) * Rename variant Needs the -inkhud suffix to work correctly with the web flasher * Display driver for ZJY122250_0213BAAMFGN * Remove dead code from nicheGraphics.h Remnants of T-Echo's nicheGraphics.h file, which was used as a template. * Use ZJY122250_0213BAAMFGN driver Improves display health. We don't need as many full refreshes now. * Tidying * board_check = true --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com> * Consolidation * Add hack for existing InkHUD button functionality --------- Co-authored-by: todd-herbert <herbert.todd@gmail.com>
90 lines
3.3 KiB
C++
90 lines
3.3 KiB
C++
#pragma once
|
|
|
|
#include "configuration.h"
|
|
|
|
#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS
|
|
|
|
// InkHUD-specific components
|
|
// ---------------------------
|
|
#include "graphics/niche/InkHUD/InkHUD.h"
|
|
|
|
// Applets
|
|
#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"
|
|
|
|
// Shared NicheGraphics components
|
|
// --------------------------------
|
|
#include "graphics/niche/Drivers/EInk/ZJY122250_0213BAAMFGN.h"
|
|
#include "graphics/niche/Inputs/TwoButton.h"
|
|
|
|
void setupNicheGraphics()
|
|
{
|
|
using namespace NicheGraphics;
|
|
|
|
// SPI
|
|
// -----------------------------
|
|
|
|
// For NRF52 platforms, SPI pins are defined in variant.h
|
|
SPI1.begin();
|
|
|
|
// E-Ink Driver
|
|
// -----------------------------
|
|
|
|
Drivers::EInk *driver = new Drivers::ZJY122250_0213BAAMFGN;
|
|
driver->begin(&SPI1, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES);
|
|
|
|
// InkHUD
|
|
// ----------------------------
|
|
|
|
InkHUD::InkHUD *inkhud = InkHUD::InkHUD::getInstance();
|
|
|
|
// Set the E-Ink driver
|
|
inkhud->setDriver(driver);
|
|
|
|
// Set how many FAST updates per FULL update
|
|
inkhud->setDisplayResilience(15);
|
|
|
|
// Select fonts
|
|
InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252;
|
|
InkHUD::Applet::fontMedium = FREESANS_9PT_WIN1252;
|
|
InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252;
|
|
|
|
// Customize default settings
|
|
inkhud->persistence->settings.rotation = 1; // 90 degrees clockwise
|
|
inkhud->persistence->settings.optionalFeatures.batteryIcon = true; // Device definitely has a battery
|
|
inkhud->persistence->settings.userTiles.count = 1; // One tile only by default, keep things simple for new users
|
|
inkhud->persistence->settings.userTiles.maxCount = 2; // Two applets side-by-side
|
|
|
|
// Pick applets
|
|
// Note: order of applets determines priority of "auto-show" feature
|
|
inkhud->addApplet("All Messages", new InkHUD::AllMessageApplet, true, true); // Activated, autoshown
|
|
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); // Activated
|
|
inkhud->addApplet("Recents List", new InkHUD::RecentsListApplet); // -
|
|
inkhud->addApplet("Heard", new InkHUD::HeardApplet, true, false, 0); // Activated, no autoshow, default on tile 0
|
|
|
|
// Start running InkHUD
|
|
inkhud->begin();
|
|
|
|
// Buttons
|
|
// --------------------------
|
|
|
|
Inputs::TwoButton *buttons = Inputs::TwoButton::getInstance(); // Shared NicheGraphics component
|
|
|
|
// #0: Main User Button
|
|
buttons->setWiring(0, Inputs::TwoButton::getUserButtonPin());
|
|
buttons->setTiming(0, 75, 500);
|
|
buttons->setHandlerShortPress(0, [inkhud]() { inkhud->shortpress(); });
|
|
buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); });
|
|
|
|
// Begin handling button events
|
|
buttons->start();
|
|
}
|
|
|
|
#endif |