mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-06 01:48:13 +00:00
Merge remote-tracking branch 'upstream/master' into StandaloneAddons
This commit is contained in:
@@ -41,16 +41,15 @@ extern "C" {
|
||||
#define NUM_ANALOG_INPUTS (1)
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
#define PIN_LED1 -1
|
||||
#define PIN_LED2 -1
|
||||
#define PIN_LED3 -1
|
||||
|
||||
// LED
|
||||
#define POWER_LED (32 + 6) // red
|
||||
#define PIN_LED1 (32 + 6) // red
|
||||
#define LED_POWER (32 + 4)
|
||||
#define USER_LED (0 + 13) // green
|
||||
// USB_CHECK
|
||||
#define USB_CHECK (32 + 3)
|
||||
#define EXT_PWR_DETECT (32 + 3)
|
||||
#define ADC_V (0 + 8)
|
||||
|
||||
#define LED_RED PIN_LED3
|
||||
@@ -59,7 +58,7 @@ extern "C" {
|
||||
#define LED_BUILTIN LED_BLUE
|
||||
#define LED_CONN PIN_GREEN
|
||||
#define LED_STATE_ON 0 // State when LED is lit // LED灯亮时的状态
|
||||
#define M1_buzzer (0 + 6)
|
||||
#define PIN_BUZZER (0 + 6)
|
||||
/*
|
||||
* Buttons
|
||||
*/
|
||||
@@ -82,6 +81,7 @@ extern "C" {
|
||||
static const uint8_t A0 = PIN_A0;
|
||||
|
||||
#define ADC_RESOLUTION 14
|
||||
#define BATTERY_SENSE_SAMPLES 30
|
||||
|
||||
#define PIN_NFC1 (9)
|
||||
#define PIN_NFC2 (10)
|
||||
@@ -159,7 +159,7 @@ External serial flash WP25R1635FZUIL0
|
||||
|
||||
#define GPS_THREAD_INTERVAL 50
|
||||
|
||||
#define PIN_GPS_PPS (32 + 1) // GPS开关判断
|
||||
#define PIN_GPS_SWITCH (32 + 1) // GPS开关判断
|
||||
|
||||
#define PIN_SERIAL1_RX GPS_TX_PIN
|
||||
#define PIN_SERIAL1_TX GPS_RX_PIN
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
// Status
|
||||
#define LED_PIN_POWER 1
|
||||
#define BIAS_T_ENABLE LED_PIN_POWER
|
||||
#define BIAS_T_VALUE HIGH
|
||||
#define LED_PIN 1
|
||||
|
||||
#define PIN_BUTTON1 47 // 功能键
|
||||
#define PIN_BUTTON2 4 // 电源键
|
||||
|
||||
#define POWER_CFG
|
||||
#define POWER_CHRG 6
|
||||
#define POWER_FULL 42
|
||||
#define LED_POWER 6
|
||||
#define ADC_V 42
|
||||
// USB_CHECK
|
||||
#define EXT_PWR_DETECT 7
|
||||
|
||||
#define PIN_BUZZER 5
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ board = esp32-s3-devkitc-1
|
||||
board_level = extra
|
||||
upload_protocol = esptool
|
||||
build_flags =
|
||||
${esp32_base.build_flags} -D CROWPANEL_ESP32S3_5_EPAPER -I variants/crowpanel-esp32s3-5-epaper
|
||||
${esp32s3_base.build_flags} -D CROWPANEL_ESP32S3_5_EPAPER -I variants/crowpanel-esp32s3-5-epaper
|
||||
-D PRIVATE_HW
|
||||
-DBOARD_HAS_PSRAM
|
||||
-DGPS_POWER_TOGGLE
|
||||
@@ -39,7 +39,7 @@ board = esp32-s3-devkitc-1
|
||||
board_level = extra
|
||||
upload_protocol = esptool
|
||||
build_flags =
|
||||
${esp32_base.build_flags} -D CROWPANEL_ESP32S3_4_EPAPER -I variants/crowpanel-esp32s3-5-epaper
|
||||
${esp32s3_base.build_flags} -D CROWPANEL_ESP32S3_4_EPAPER -I variants/crowpanel-esp32s3-5-epaper
|
||||
-D PRIVATE_HW
|
||||
-DBOARD_HAS_PSRAM
|
||||
-DGPS_POWER_TOGGLE
|
||||
@@ -67,7 +67,7 @@ board = esp32-s3-devkitc-1
|
||||
board_level = extra
|
||||
upload_protocol = esptool
|
||||
build_flags =
|
||||
${esp32_base.build_flags} -D CROWPANEL_ESP32S3_2_EPAPER -I variants/crowpanel-esp32s3-5-epaper
|
||||
${esp32s3_base.build_flags} -D CROWPANEL_ESP32S3_2_EPAPER -I variants/crowpanel-esp32s3-5-epaper
|
||||
-D PRIVATE_HW
|
||||
-DBOARD_HAS_PSRAM
|
||||
-DGPS_POWER_TOGGLE
|
||||
|
||||
@@ -53,4 +53,5 @@
|
||||
// Internally the TTGO module hooks the SX126x-DIO2 in to control the TX/RX switch
|
||||
// (which is the default for the sx1262interface code)
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#define TCXO_OPTIONAL // make it so that the firmware can try both TCXO and XTAL
|
||||
#endif
|
||||
|
||||
@@ -54,4 +54,5 @@
|
||||
// Internally the TTGO module hooks the SX126x-DIO2 in to control the TX/RX switch
|
||||
// (which is the default for the sx1262interface code)
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#define TCXO_OPTIONAL // make it so that the firmware can try both TCXO and XTAL
|
||||
#endif
|
||||
|
||||
@@ -112,7 +112,7 @@ void setupNicheGraphics()
|
||||
// Setup the capacitive touch button
|
||||
// - short: momentary backlight
|
||||
// - long: latch backlight on
|
||||
buttons->setWiring(TOUCH_BUTTON, PIN_BUTTON_TOUCH, LOW);
|
||||
buttons->setWiring(TOUCH_BUTTON, PIN_BUTTON_TOUCH);
|
||||
buttons->setTiming(TOUCH_BUTTON, 50, 5000); // 5 seconds before latch - limited by T-Echo's capacitive touch IC
|
||||
buttons->setHandlerDown(TOUCH_BUTTON, [backlight]() {
|
||||
backlight->peek();
|
||||
|
||||
@@ -8,4 +8,6 @@ lib_deps =
|
||||
build_flags =
|
||||
${esp32_base.build_flags} -D TBEAM_V10 -I variants/tbeam
|
||||
-DGPS_POWER_TOGGLE ; comment this line to disable double press function on the user button to turn off gps entirely.
|
||||
-DBOARD_HAS_PSRAM
|
||||
-mfix-esp32-psram-cache-issue
|
||||
upload_speed = 921600
|
||||
102
variants/tlora_t3s3_epaper/nicheGraphics.h
Normal file
102
variants/tlora_t3s3_epaper/nicheGraphics.h
Normal file
@@ -0,0 +1,102 @@
|
||||
#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"
|
||||
|
||||
// #include "graphics/niche/InkHUD/Applets/Examples/BasicExample/BasicExampleApplet.h"
|
||||
// #include "graphics/niche/InkHUD/Applets/Examples/NewMsgExample/NewMsgExampleApplet.h"
|
||||
|
||||
// Shared NicheGraphics components
|
||||
// --------------------------------
|
||||
#include "graphics/niche/Drivers/EInk/DEPG0213BNS800.h"
|
||||
#include "graphics/niche/Inputs/TwoButton.h"
|
||||
|
||||
#include "graphics/niche/Fonts/FreeSans6pt7b.h"
|
||||
#include "graphics/niche/Fonts/FreeSans6pt8bCyrillic.h"
|
||||
#include <Fonts/FreeSans9pt7b.h>
|
||||
|
||||
void setupNicheGraphics()
|
||||
{
|
||||
using namespace NicheGraphics;
|
||||
|
||||
// SPI
|
||||
// -----------------------------
|
||||
|
||||
// Display is connected to HSPI
|
||||
SPIClass *hspi = new SPIClass(HSPI);
|
||||
hspi->begin(PIN_EINK_SCLK, -1, PIN_EINK_MOSI, PIN_EINK_CS);
|
||||
|
||||
// E-Ink Driver
|
||||
// -----------------------------
|
||||
|
||||
// Use E-Ink driver
|
||||
Drivers::EInk *driver = new Drivers::DEPG0213BNS800;
|
||||
driver->begin(hspi, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES);
|
||||
|
||||
// InkHUD
|
||||
// ----------------------------
|
||||
|
||||
InkHUD::InkHUD *inkhud = InkHUD::InkHUD::getInstance();
|
||||
|
||||
// Set the driver
|
||||
inkhud->setDriver(driver);
|
||||
|
||||
// Set how many FAST updates per FULL update
|
||||
// Set how unhealthy additional FAST updates beyond this number are
|
||||
inkhud->setDisplayResilience(15, 1.5);
|
||||
|
||||
// Prepare fonts
|
||||
InkHUD::Applet::fontLarge = InkHUD::AppletFont(FreeSans9pt7b);
|
||||
InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt7b);
|
||||
/*
|
||||
// Font localization demo: Cyrillic
|
||||
InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt8bCyrillic);
|
||||
InkHUD::Applet::fontSmall.addSubstitutionsWin1251();
|
||||
*/
|
||||
|
||||
// Customize default settings
|
||||
inkhud->persistence->settings.userTiles.maxCount = 2; // How many tiles can the display handle?
|
||||
inkhud->persistence->settings.rotation = 3; // 270 degrees clockwise
|
||||
inkhud->persistence->settings.userTiles.count = 1; // One tile only by default, keep things simple for new users
|
||||
|
||||
// Pick applets
|
||||
inkhud->addApplet("All Messages", new InkHUD::AllMessageApplet, true, true); // Activated, autoshown
|
||||
inkhud->addApplet("DMs", new InkHUD::DMApplet); // Inactive
|
||||
inkhud->addApplet("Channel 0", new InkHUD::ThreadedMessageApplet(0)); // Inactive
|
||||
inkhud->addApplet("Channel 1", new InkHUD::ThreadedMessageApplet(1)); // Inactive
|
||||
inkhud->addApplet("Positions", new InkHUD::PositionsApplet, true); // Activated
|
||||
inkhud->addApplet("Recents List", new InkHUD::RecentsListApplet); // Inactive
|
||||
inkhud->addApplet("Heard", new InkHUD::HeardApplet, true, false, 0); // Activated, not autoshown, default on tile 0
|
||||
// inkhud->addApplet("Basic", new InkHUD::BasicExampleApplet);
|
||||
// inkhud->addApplet("NewMsg", new InkHUD::NewMsgExampleApplet);
|
||||
|
||||
// Start running InkHUD
|
||||
inkhud->begin();
|
||||
|
||||
// Buttons
|
||||
// --------------------------
|
||||
|
||||
Inputs::TwoButton *buttons = Inputs::TwoButton::getInstance(); // Shared NicheGraphics component
|
||||
|
||||
// Setup the main user button
|
||||
buttons->setWiring(0, Inputs::TwoButton::getUserButtonPin(), true);
|
||||
buttons->setHandlerShortPress(0, []() { InkHUD::InkHUD::getInstance()->shortpress(); });
|
||||
buttons->setHandlerLongPress(0, []() { InkHUD::InkHUD::getInstance()->longpress(); });
|
||||
|
||||
buttons->start();
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -7,6 +7,7 @@ upload_protocol = esptool
|
||||
build_flags =
|
||||
${esp32_base.build_flags} -D TLORA_T3S3_EPAPER -I variants/tlora_t3s3_epaper
|
||||
-DGPS_POWER_TOGGLE
|
||||
-DUSE_EINK
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_213_BN
|
||||
-DEINK_WIDTH=250
|
||||
-DEINK_HEIGHT=122
|
||||
@@ -16,3 +17,21 @@ build_flags =
|
||||
lib_deps =
|
||||
${esp32s3_base.lib_deps}
|
||||
https://github.com/meshtastic/GxEPD2/archive/b202ebfec6a4821e098cf7a625ba0f6f2400292d.zip
|
||||
|
||||
[env:tlora-t3s3-epaper-inkhud]
|
||||
extends = esp32s3_base, inkhud
|
||||
board = tlora-t3s3-v1
|
||||
board_check = true
|
||||
upload_protocol = esptool
|
||||
build_src_filter =
|
||||
${esp32_base.build_src_filter}
|
||||
${inkhud.build_src_filter}
|
||||
build_flags =
|
||||
${esp32s3_base.build_flags}
|
||||
${inkhud.build_flags}
|
||||
-I variants/tlora_t3s3_epaper
|
||||
-D TLORA_T3S3_EPAPER
|
||||
-D MAX_THREADS=40 ; Required if used with WiFi
|
||||
lib_deps =
|
||||
${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX
|
||||
${esp32s3_base.lib_deps}
|
||||
@@ -2,7 +2,6 @@
|
||||
#define SDCARD_USE_SPI1
|
||||
|
||||
// Display (E-Ink)
|
||||
#define USE_EINK
|
||||
#define PIN_EINK_CS 15
|
||||
#define PIN_EINK_BUSY 48
|
||||
#define PIN_EINK_DC 16
|
||||
|
||||
Reference in New Issue
Block a user