Merge branch 'master' into t-deck-pro

This commit is contained in:
mverch67
2025-06-22 10:49:55 +02:00
217 changed files with 11999 additions and 5141 deletions

View File

@@ -22,6 +22,9 @@
#include "graphics/niche/Drivers/EInk/GDEY0154D67.h"
#include "graphics/niche/Inputs/TwoButton.h"
// Button feedback
#include "buzz.h"
void setupNicheGraphics()
{
using namespace NicheGraphics;
@@ -98,8 +101,14 @@ void setupNicheGraphics()
buttons->setWiring(1, PIN_BUTTON1);
buttons->setTiming(1, 50, 500); // 500ms before latch
buttons->setHandlerDown(1, [backlight]() { backlight->peek(); });
buttons->setHandlerLongPress(1, [backlight]() { backlight->latch(); });
buttons->setHandlerShortPress(1, [backlight]() { backlight->off(); });
buttons->setHandlerLongPress(1, [backlight]() {
backlight->latch();
playBeep();
});
buttons->setHandlerShortPress(1, [backlight]() {
backlight->off();
playBoop();
});
// Begin handling button events
buttons->start();

View File

@@ -63,6 +63,9 @@ extern "C" {
* Buttons
*/
#define PIN_BUTTON2 (32 + 10)
#define ALT_BUTTON_PIN PIN_BUTTON2
#define ALT_BUTTON_ACTIVE_LOW true
#define ALT_BUTTON_ACTIVE_PULLUP true
#define PIN_BUTTON1 (32 + 7)
// #define PIN_BUTTON1 (0 + 11)

View File

@@ -3,6 +3,9 @@
#define PIN_BUTTON1 47 // 功能键
#define PIN_BUTTON2 4 // 电源键
#define ALT_BUTTON_PIN PIN_BUTTON2
#define ALT_BUTTON_ACTIVE_LOW false
#define ALT_BUTTON_ACTIVE_PULLUP false
#define LED_POWER 6
#define ADC_V 42
@@ -60,4 +63,3 @@
#define HAS_GPS 0
#define BUTTON_PIN PIN_BUTTON1
#define BUTTON_PIN_ALT PIN_BUTTON2

View File

@@ -0,0 +1,62 @@
# Simplifies DIY InkHUD builds, with presets for several common E-Ink displays
# - build using custom task in Platformio's "Project Tasks" panel
# - build with `pio run -e <variant> -t build_weact_154` (or similar)
# Silence trunk's objections to the import statements
# trunk-ignore-all(ruff/F821)
# trunk-ignore-all(flake8/F821)
from SCons.Script import COMMAND_LINE_TARGETS
Import("env")
Import("projenv")
# Custom targets
# These wrappers just run the normal build task under a different target name
# We intercept the build later on, based on the target name
env.AddTarget(
name="build_weact_154",
dependencies=["buildprog"],
actions=None,
title='Build (WeAct 1.54")',
)
env.AddTarget(
name="build_weact_213",
dependencies=["buildprog"],
actions=None,
title='Build (WeAct 2.13")',
)
env.AddTarget(
name="build_weact_290",
dependencies=["buildprog"],
actions=None,
title='Build (WeAct 2.9")',
)
env.AddTarget(
name="build_weact_420",
dependencies=["buildprog"],
actions=None,
title='Build (WeAct 4.2")',
)
# Check whether a build was started via one of our custom targets above
if "build_weact_154" in COMMAND_LINE_TARGETS:
print('Building for WeAct 1.54" Display')
projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DRIVER", "ZJY200200_0154DAAMFGN"))
projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DISPLAYRESILIENCE", "15"))
elif "build_weact_213" in COMMAND_LINE_TARGETS:
print('Building for WeAct 2.13" Display')
projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DRIVER", "HINK_E0213A289"))
projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DISPLAYRESILIENCE", "10"))
elif "build_weact_290" in COMMAND_LINE_TARGETS:
print('Building for WeAct 2.9" Display')
projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DRIVER", "ZJY128296_029EAAMFGN"))
projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DISPLAYRESILIENCE", "15"))
elif "build_weact_420" in COMMAND_LINE_TARGETS:
print('Building for WeAct 4.2" Display')
projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DRIVER", "HINK_E042A87"))
projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DISPLAYRESILIENCE", "15"))

View File

@@ -0,0 +1,94 @@
#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/HINK_E0213A289.h" // WeAct 2.13"
#include "graphics/niche/Drivers/EInk/HINK_E042A87.h" // WeAct 4.2"
#include "graphics/niche/Drivers/EInk/ZJY128296_029EAAMFGN.h" // WeAct 2.9"
#include "graphics/niche/Drivers/EInk/ZJY200200_0154DAAMFGN.h" // WeACt 1.54"
#include "graphics/niche/Inputs/TwoButton.h"
#if !defined(INKHUD_BUILDCONF_DRIVER) || !defined(INKHUD_BUILDCONF_DISPLAYRESILIENCE)
#error If not using a DIY preset, display model and resilience must be set manually
#endif
void setupNicheGraphics()
{
using namespace NicheGraphics;
// SPI
// -----------------------------
SPI.begin();
// Driver
// -----------------------------
// Use E-Ink driver
Drivers::EInk *driver = new Drivers::INKHUD_BUILDCONF_DRIVER;
driver->begin(&SPI, 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.
inkhud->setDisplayResilience(INKHUD_BUILDCONF_DISPLAYRESILIENCE); // Suggest roughly ten
// Prepare fonts
InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1252;
InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252;
// Init settings, and customize defaults
// Values ignored individually if found saved to flash
inkhud->persistence->settings.rotation = (driver->height > driver->width ? 1 : 0); // Rotate 90deg to landscape, if needed
inkhud->persistence->settings.userTiles.maxCount = 4;
inkhud->persistence->settings.optionalFeatures.batteryIcon = true;
// Pick applets
// Note: order of applets determines priority of "auto-show" feature
inkhud->addApplet("All Messages", new InkHUD::AllMessageApplet);
inkhud->addApplet("DMs", new InkHUD::DMApplet, true, false, 3); // Default on tile 3
inkhud->addApplet("Channel 0", new InkHUD::ThreadedMessageApplet(0), true, false, 2); // Default on tile 2
inkhud->addApplet("Channel 1", new InkHUD::ThreadedMessageApplet(1));
inkhud->addApplet("Positions", new InkHUD::PositionsApplet, true, false, 1); // Default on tile 1
inkhud->addApplet("Recents List", new InkHUD::RecentsListApplet, true, false, 0); // Default on tile 0
inkhud->addApplet("Heard", new InkHUD::HeardApplet, true); // Background
// 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); // Internal pull up
buttons->setHandlerShortPress(0, [inkhud]() { inkhud->shortpress(); });
buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); });
buttons->start();
}
#endif

View File

@@ -22,26 +22,26 @@ extern "C" {
/*
NRF52 PRO MICRO PIN ASSIGNMENT
| Pin   | Function   |   | Pin     | Function     | RF95 |
| Pin   | Function   |   | Pin     | Function     | RF95 |
| ----- | ----------- | --- | -------- | ------------ | ----- |
| Gnd   |             |   | vbat     |             | |
| P0.06 | Serial2 RX |   | vbat     |             | |
| P0.08 | Serial2 TX |   | Gnd     |             | |
| Gnd   |             |   | reset   |             | |
| Gnd   |             |   | ext_vcc | *see 0.13   | |
| P0.17 | RXEN       |   | P0.31   | BATTERY_PIN | |
| P0.20 | GPS_RX     |   | P0.29   | BUSY         | DIO0 |
| P0.22 | GPS_TX     |   | P0.02   | MISO | MISO |
| P0.24 | GPS_EN     |   | P1.15   | MOSI         | MOSI |
| P1.00 | BUTTON_PIN |   | P1.13   | CS           | CS   |
| P0.11 | SCL         |   | P1.11   | SCK         | SCK |
| P1.04 | SDA         |   | P0.10   | DIO1/IRQ     | DIO1 |
| P1.06 | Free pin   |   | P0.09   | RESET       | RST |
|       |             |   |         |             | |
|       | Mid board   |   |         | Internal     | |
| P1.01 | Free pin   |   | 0.15     | LED         | |
| P1.02 | Free pin   |   | 0.13     | 3V3_EN       | |
| P1.07 | Free pin   |   |         |             | |
| Gnd   |             |   | vbat     |             | |
| P0.06 | Serial2 RX |   | vbat     |             | |
| P0.08 | Serial2 TX |   | Gnd     |             | |
| Gnd   |             |   | reset   |             | |
| Gnd   |             |   | ext_vcc | *see 0.13   | |
| P0.17 | RXEN       |   | P0.31   | BATTERY_PIN | |
| P0.20 | GPS_RX     |   | P0.29   | BUSY         | DIO0 |
| P0.22 | GPS_TX     |   | P0.02   | MISO | MISO |
| P0.24 | GPS_EN     |   | P1.15   | MOSI         | MOSI |
| P1.00 | BUTTON_PIN |   | P1.13   | CS           | CS   |
| P0.11 | SCL         |   | P1.11   | SCK         | SCK |
| P1.04 | SDA         |   | P0.10   | DIO1/IRQ     | DIO1 |
| P1.06 | Free pin   |   | P0.09   | RESET       | RST |
|       |             |   |         |             | |
|       | Mid board   |   |         | Internal     | |
| P1.01 | Free pin   |   | 0.15     | LED         | |
| P1.02 | Free pin   |   | 0.13     | 3V3_EN       | |
| P1.07 | Free pin   |   |         |             | |
*/
// Number of pins defined in PinDescription array
@@ -185,6 +185,12 @@ settings.
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
#define TCXO_OPTIONAL // make it so that the firmware can try both TCXO and XTAL
// E-Ink DIY
#define PIN_EINK_CS (32 + 7)
#define PIN_EINK_DC (32 + 2)
#define PIN_EINK_RES (32 + 1)
#define PIN_EINK_BUSY (32 + 6)
#ifdef __cplusplus
}
#endif

View File

@@ -68,6 +68,34 @@ lib_deps =
${nrf52840_base.lib_deps}
debug_tool = jlink
; NRF52 ProMicro w/ E-Ink display
[env:nrf52_promicro_diy-inkhud]
board_level = extra
extends = nrf52840_base, inkhud
board = promicro-nrf52840
build_flags =
${nrf52840_base.build_flags}
${inkhud.build_flags}
-I variants/diy/nrf52_promicro_diy_tcxo
-D NRF52_PROMICRO_DIY
build_src_filter =
${nrf52_base.build_src_filter}
${inkhud.build_src_filter}
+<../variants/diy/nrf52_promicro_diy_tcxo>
lib_deps =
${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX
${nrf52840_base.lib_deps}
extra_scripts =
${env.extra_scripts}
variants/diy/nrf52_promicro_diy_tcxo/custom_build_tasks.py ; Add to PIO's Project Tasks pane: preset builds for common displays
; Seeed Xiao BLE: https://www.digikey.com/en/products/detail/seeed-technology-co-ltd/102010448/16652893
[env:xiao_ble]
extends = env:seeed_xiao_nrf52840_kit
board_level = extra
build_flags = ${env:seeed_xiao_nrf52840_kit.build_flags} -D PRIVATE_HW -DXIAO_BLE_LEGACY_PINOUT -DEBYTE_E22 -DEBYTE_E22_900M30S
build_unflags = -DGPS_L76K
; Seeed XIAO nRF52840 + XIAO Wio SX1262 DIY
[env:seeed-xiao-nrf52840-wio-sx1262]
board = xiao_ble_sense

View File

@@ -0,0 +1,13 @@
; The very slick RAK wireless RAK 4631 / 4630 board - Unified firmware for 5005/19003, with or without OLED RAK 1921
[env:gat562_mesh_trial_tracker]
extends = nrf52840_base
board = gat562_mesh_trial_tracker
board_check = true
build_flags = ${nrf52840_base.build_flags} -Ivariants/gat562_mesh_trial_tracker -D GAT562_MESH_TRIAL_TRACKER
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
-DRADIOLIB_EXCLUDE_SX128X=1
-DRADIOLIB_EXCLUDE_SX127X=1
-DRADIOLIB_EXCLUDE_LR11X0=1
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/gat562_mesh_trial_tracker>
lib_deps =
${nrf52840_base.lib_deps}

View File

@@ -0,0 +1,45 @@
/*
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
Copyright (c) 2016 Sandeep Mistry All right reserved.
Copyright (c) 2018, Adafruit Industries (adafruit.com)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "variant.h"
#include "nrf.h"
#include "wiring_constants.h"
#include "wiring_digital.h"
const uint32_t g_ADigitalPinMap[] = {
// P0
0, 1, 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()
{
// LED1 & LED2
pinMode(PIN_LED1, OUTPUT);
ledOff(PIN_LED1);
pinMode(PIN_LED2, OUTPUT);
ledOff(PIN_LED2);
// 3V3 Power Rail
pinMode(PIN_3V3_EN, OUTPUT);
digitalWrite(PIN_3V3_EN, HIGH);
}

View File

@@ -0,0 +1,288 @@
/*
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
Copyright (c) 2016 Sandeep Mistry All right reserved.
Copyright (c) 2018, Adafruit Industries (adafruit.com)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _VARIANT_GAT562_MESH_TRIAL_TRACKER_
#define _VARIANT_GAT562_MESH_TRIAL_TRACKER_
#define GAT562_MESH_TRIAL_TRACKER
// led pin 2 (blue), see https://github.com/meshtastic/firmware/blob/master/src/mesh/NodeDB.cpp#L723
#define RAK4630
/** Master clock frequency */
#define VARIANT_MCK (64000000ul)
#define USE_LFXO // Board uses 32khz crystal for LF
// define USE_LFRC // Board uses RC for LF
/*----------------------------------------------------------------------------
* Headers
*----------------------------------------------------------------------------*/
#include "WVariant.h"
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
// Number of pins defined in PinDescription array
#define PINS_COUNT (48)
#define NUM_DIGITAL_PINS (48)
#define NUM_ANALOG_INPUTS (6)
#define NUM_ANALOG_OUTPUTS (0)
// LEDs
#define PIN_LED1 (35)
#define PIN_LED2 (36)
#define LED_BUILTIN PIN_LED1
#define LED_CONN PIN_LED2
#define LED_GREEN PIN_LED1
#define LED_BLUE PIN_LED2
#define LED_STATE_ON 1 // State when LED is litted
/*
* Buttons
*/
#define PIN_BUTTON1 9 // Pin for button on E-ink button module or IO expansion
#define BUTTON_NEED_PULLUP
#define PIN_BUTTON2 12
#define PIN_BUTTON3 24
#define PIN_BUTTON4 25
/*
* Analog pins
*/
#define PIN_A0 (5)
#define PIN_A1 (31)
#define PIN_A2 (28)
#define PIN_A3 (29)
#define PIN_A4 (30)
#define PIN_A5 (31)
#define PIN_A6 (0xff)
#define PIN_A7 (0xff)
static const uint8_t A0 = PIN_A0;
static const uint8_t A1 = PIN_A1;
static const uint8_t A2 = PIN_A2;
static const uint8_t A3 = PIN_A3;
static const uint8_t A4 = PIN_A4;
static const uint8_t A5 = PIN_A5;
static const uint8_t A6 = PIN_A6;
static const uint8_t A7 = PIN_A7;
#define ADC_RESOLUTION 14
// Other pins
#define PIN_AREF (2)
#define PIN_NFC1 (9)
#define PIN_NFC2 (10)
static const uint8_t AREF = PIN_AREF;
/*
* Serial interfaces
*/
#define PIN_SERIAL1_RX (15)
#define PIN_SERIAL1_TX (16)
// Connected to Jlink CDC
#define PIN_SERIAL2_RX (8)
#define PIN_SERIAL2_TX (6)
/*
* SPI Interfaces
*/
#define SPI_INTERFACES_COUNT 2
#define PIN_SPI_MISO (45)
#define PIN_SPI_MOSI (44)
#define PIN_SPI_SCK (43)
#define PIN_SPI1_MISO (29) // (0 + 29)
#define PIN_SPI1_MOSI (30) // (0 + 30)
#define PIN_SPI1_SCK (3) // (0 + 3)
static const uint8_t SS = 42;
static const uint8_t MOSI = PIN_SPI_MOSI;
static const uint8_t MISO = PIN_SPI_MISO;
static const uint8_t SCK = PIN_SPI_SCK;
/*
* eink display pins
*/
// #define PIN_EINK_CS (0 + 26)
// #define PIN_EINK_BUSY (0 + 4)
// #define PIN_EINK_DC (0 + 17)
// #define PIN_EINK_RES (-1)
// #define PIN_EINK_SCLK (0 + 3)
// #define PIN_EINK_MOSI (0 + 30) // also called SDI
// #define USE_EINK
// Display - OLED connected via I2C
#define HAS_SCREEN 1
#define USE_SSD1306
// RAKRGB
// #define HAS_NCP5623
/*
* Wire Interfaces
*/
#define WIRE_INTERFACES_COUNT 1
#define PIN_WIRE_SDA (13)
#define PIN_WIRE_SCL (14)
// QSPI Pins
#define PIN_QSPI_SCK 3
#define PIN_QSPI_CS 26
#define PIN_QSPI_IO0 30
#define PIN_QSPI_IO1 29
#define PIN_QSPI_IO2 28
#define PIN_QSPI_IO3 2
// On-board QSPI Flash
#define EXTERNAL_FLASH_DEVICES IS25LP080D
#define EXTERNAL_FLASH_USE_QSPI
/* @note RAK5005-O GPIO mapping to RAK4631 GPIO ports
RAK5005-O <-> nRF52840
IO1 <-> P0.17 (Arduino GPIO number 17)
IO2 <-> P1.02 (Arduino GPIO number 34)
IO3 <-> P0.21 (Arduino GPIO number 21)
IO4 <-> P0.04 (Arduino GPIO number 4)
IO5 <-> P0.09 (Arduino GPIO number 9)
IO6 <-> P0.10 (Arduino GPIO number 10)
IO7 <-> P0.28 (Arduino GPIO number 28)
SW1 <-> P0.01 (Arduino GPIO number 1)
A0 <-> P0.04/AIN2 (Arduino Analog A2
A1 <-> P0.31/AIN7 (Arduino Analog A7
SPI_CS <-> P0.26 (Arduino GPIO number 26)
*/
// RAK4630 LoRa module
/* Setup of the SX1262 LoRa module ( https://docs.rakwireless.com/Product-Categories/WisBlock/RAK4631/Datasheet/ )
P1.10 NSS SPI NSS (Arduino GPIO number 42)
P1.11 SCK SPI CLK (Arduino GPIO number 43)
P1.12 MOSI SPI MOSI (Arduino GPIO number 44)
P1.13 MISO SPI MISO (Arduino GPIO number 45)
P1.14 BUSY BUSY signal (Arduino GPIO number 46)
P1.15 DIO1 DIO1 event interrupt (Arduino GPIO number 47)
P1.06 NRESET NRESET manual reset of the SX1262 (Arduino GPIO number 38)
Important for successful SX1262 initialization:
* Setup DIO2 to control the antenna switch
* Setup DIO3 to control the TCXO power supply
* Setup the SX1262 to use it's DCDC regulator and not the LDO
* RAK4630 schematics show GPIO P1.07 connected to the antenna switch, but it should not be initialized, as DIO2 will do the
control of the antenna switch
SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
*/
// configure the SET pin on the RAK12039 sensor board to disable the sensor while not reading
// air quality telemetry. PIN_NFC2 doesn't seem to be used anywhere else in the codebase, but if
// you're having problems with your node behaving weirdly when a RAK12039 board isn't connected,
// try disabling this.
// #define PMSA003I_ENABLE_PIN PIN_NFC2
// #define DETECTION_SENSOR_EN 4
#define USE_SX1262
#define SX126X_CS (42)
#define SX126X_DIO1 (47)
#define SX126X_BUSY (46)
#define SX126X_RESET (38)
// #define SX126X_TXEN (39)
// #define SX126X_RXEN (37)
#define SX126X_POWER_EN (37)
// DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
// Testing USB detection
#define NRF_APM
// enables 3.3V periphery like GPS or IO Module
// Do not toggle this for GPS power savings
#define PIN_3V3_EN (34)
// RAK1910 GPS module
// If using the wisblock GPS module and pluged into Port A on WisBlock base
// IO1 is hooked to PPS (pin 12 on header) = gpio 17
// IO2 is hooked to GPS RESET = gpio 34, but it can not be used to this because IO2 is ALSO used to control 3V3_S power (1 is on).
// Therefore must be 1 to keep peripherals powered
// Power is on the controllable 3V3_S rail
// #define PIN_GPS_RESET (34)
// #define PIN_GPS_EN PIN_3V3_EN
#define PIN_GPS_PPS (17) // Pulse per second input from the GPS
#define GPS_BAUDRATE 9600
#define GPS_RX_PIN PIN_SERIAL1_RX
#define GPS_TX_PIN PIN_SERIAL1_TX
// Define pin to enable GPS toggle (set GPIO to LOW) via user button triple press
// RAK12002 RTC Module
// #define RV3028_RTC (uint8_t)0b1010010
// RAK18001 Buzzer in Slot C
// #define PIN_BUZZER 21 // IO3 is PWM2
// NEW: set this via protobuf instead!
// Battery
// The battery sense is hooked to pin A0 (5)
#define BATTERY_PIN PIN_A0
// and has 12 bit resolution
#define BATTERY_SENSE_RESOLUTION_BITS 12
#define BATTERY_SENSE_RESOLUTION 4096.0
#undef AREF_VOLTAGE
#define AREF_VOLTAGE 3.0
#define VBAT_AR_INTERNAL AR_INTERNAL_3_0
#define ADC_MULTIPLIER 1.73
// #define HAS_RTC 1
// #define HAS_ETHERNET 1
// #define RAK_4631 1
// #define PIN_ETHERNET_RESET 21
// #define PIN_ETHERNET_SS PIN_EINK_CS
// #define ETH_SPI_PORT SPI1
// #define AQ_SET_PIN 10
#ifdef __cplusplus
}
#endif
/*----------------------------------------------------------------------------
* Arduino objects - C++ only
*----------------------------------------------------------------------------*/
#endif

View File

@@ -3,6 +3,8 @@
#define EXT_PWR_DETECT 35
#define BUTTON_PIN 18
#define BUTTON_ACTIVE_LOW false
#define BUTTON_ACTIVE_PULLUP false
#define BATTERY_PIN 7 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
#define ADC_CHANNEL ADC1_GPIO7_CHANNEL

View File

@@ -0,0 +1,62 @@
# Simplifies DIY InkHUD builds, with presets for several common E-Ink displays
# - build using custom task in Platformio's "Project Tasks" panel
# - build with `pio run -e <variant> -t build_weact_154` (or similar)
# Silence trunk's objections to the import statements
# trunk-ignore-all(ruff/F821)
# trunk-ignore-all(flake8/F821)
from SCons.Script import COMMAND_LINE_TARGETS
Import("env")
Import("projenv")
# Custom targets
# These wrappers just run the normal build task under a different target name
# We intercept the build later on, based on the target name
env.AddTarget(
name="build_weact_154",
dependencies=["buildprog"],
actions=None,
title='Build (WeAct 1.54")',
)
env.AddTarget(
name="build_weact_213",
dependencies=["buildprog"],
actions=None,
title='Build (WeAct 2.13")',
)
env.AddTarget(
name="build_weact_290",
dependencies=["buildprog"],
actions=None,
title='Build (WeAct 2.9")',
)
env.AddTarget(
name="build_weact_420",
dependencies=["buildprog"],
actions=None,
title='Build (WeAct 4.2")',
)
# Check whether a build was started via one of our custom targets above
if "build_weact_154" in COMMAND_LINE_TARGETS:
print('Building for WeAct 1.54" Display')
projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DRIVER", "ZJY200200_0154DAAMFGN"))
projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DISPLAYRESILIENCE", "15"))
elif "build_weact_213" in COMMAND_LINE_TARGETS:
print('Building for WeAct 2.13" Display')
projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DRIVER", "HINK_E0213A289"))
projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DISPLAYRESILIENCE", "10"))
elif "build_weact_290" in COMMAND_LINE_TARGETS:
print('Building for WeAct 2.9" Display')
projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DRIVER", "ZJY128296_029EAAMFGN"))
projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DISPLAYRESILIENCE", "15"))
elif "build_weact_420" in COMMAND_LINE_TARGETS:
print('Building for WeAct 4.2" Display')
projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DRIVER", "HINK_E042A87"))
projenv["CPPDEFINES"].append(("INKHUD_BUILDCONF_DISPLAYRESILIENCE", "15"))

View File

@@ -0,0 +1,95 @@
#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/HINK_E0213A289.h" // WeAct 2.13"
#include "graphics/niche/Drivers/EInk/HINK_E042A87.h" // WeAct 4.2"
#include "graphics/niche/Drivers/EInk/ZJY128296_029EAAMFGN.h" // WeAct 2.9"
#include "graphics/niche/Drivers/EInk/ZJY200200_0154DAAMFGN.h" // WeACt 1.54"
#include "graphics/niche/Inputs/TwoButton.h"
#if !defined(INKHUD_BUILDCONF_DRIVER) || !defined(INKHUD_BUILDCONF_DISPLAYRESILIENCE)
// cppcheck-suppress preprocessorErrorDirective
#error If not using a DIY preset, display model and resilience must be set manually
#endif
void setupNicheGraphics()
{
using namespace NicheGraphics;
// SPI
// -----------------------------
SPI1.begin();
// Driver
// -----------------------------
// Use E-Ink driver
Drivers::EInk *driver = new Drivers::INKHUD_BUILDCONF_DRIVER;
driver->begin(&SPI1, 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.
inkhud->setDisplayResilience(INKHUD_BUILDCONF_DISPLAYRESILIENCE); // Suggest roughly ten
// Prepare fonts
InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1252;
InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252;
// Init settings, and customize defaults
// Values ignored individually if found saved to flash
inkhud->persistence->settings.rotation = (driver->height > driver->width ? 1 : 0); // Rotate 90deg to landscape, if needed
inkhud->persistence->settings.userTiles.maxCount = 4;
inkhud->persistence->settings.optionalFeatures.batteryIcon = true;
// Pick applets
// Note: order of applets determines priority of "auto-show" feature
inkhud->addApplet("All Messages", new InkHUD::AllMessageApplet);
inkhud->addApplet("DMs", new InkHUD::DMApplet, true, false, 3); // Default on tile 3
inkhud->addApplet("Channel 0", new InkHUD::ThreadedMessageApplet(0), true, false, 2); // Default on tile 2
inkhud->addApplet("Channel 1", new InkHUD::ThreadedMessageApplet(1));
inkhud->addApplet("Positions", new InkHUD::PositionsApplet, true, false, 1); // Default on tile 1
inkhud->addApplet("Recents List", new InkHUD::RecentsListApplet, true, false, 0); // Default on tile 0
inkhud->addApplet("Heard", new InkHUD::HeardApplet, true); // Background
// 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->setHandlerShortPress(0, [inkhud]() { inkhud->shortpress(); });
buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); });
buttons->start();
}
#endif

View File

@@ -0,0 +1,19 @@
[env:heltec-mesh-node-t114-inkhud]
board_level = extra
extends = nrf52840_base, inkhud
board = heltec_mesh_node_t114
board_check = true
build_flags =
${nrf52840_base.build_flags}
${inkhud.build_flags}
-I variants/heltec_mesh_node_t114-inkhud
build_src_filter =
${nrf52_base.build_src_filter}
${inkhud.build_src_filter}
lib_deps =
${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX
${nrf52840_base.lib_deps}
lewisxhe/PCF8563_Library@^1.0.1
extra_scripts =
${env.extra_scripts}
variants/diy/nrf52_promicro_diy_tcxo/custom_build_tasks.py ; Add to PIO's Project Tasks pane: preset builds for common displays

View File

@@ -0,0 +1,38 @@
/*
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
Copyright (c) 2016 Sandeep Mistry All right reserved.
Copyright (c) 2018, Adafruit Industries (adafruit.com)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "variant.h"
#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()
{
// LED1
pinMode(PIN_LED1, OUTPUT);
ledOff(PIN_LED1);
}

View File

@@ -0,0 +1,175 @@
// Unlike many other InkHUD variants, this environment does require its own variant.h file
// This is because the default T114 variant maps SPI1 pins to the optional TFT display, and those pins are not broken out
#ifndef _VARIANT_HELTEC_NRF_
#define _VARIANT_HELTEC_NRF_
/** Master clock frequency */
#define VARIANT_MCK (64000000ul)
#define USE_LFXO // Board uses 32khz crystal for LF
/*----------------------------------------------------------------------------
* Headers
*----------------------------------------------------------------------------*/
#include "WVariant.h"
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#define HELTEC_MESH_NODE_T114
// Number of pins defined in PinDescription array
#define PINS_COUNT (48)
#define NUM_DIGITAL_PINS (48)
#define NUM_ANALOG_INPUTS (1)
#define NUM_ANALOG_OUTPUTS (0)
// LEDs
#define PIN_LED1 (32 + 3) // green (confirmed on 1.0 board)
#define LED_BLUE PIN_LED1 // fake for bluefruit library
#define LED_GREEN PIN_LED1
#define LED_BUILTIN LED_GREEN
#define LED_STATE_ON 0 // State when LED is lit
#define HAS_NEOPIXEL // Enable the use of neopixels
#define NEOPIXEL_COUNT 2 // How many neopixels are connected
#define NEOPIXEL_DATA 14 // gpio pin used to send data to the neopixels
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use
/*
* Buttons
*/
#define PIN_BUTTON1 (32 + 10)
// #define PIN_BUTTON2 (0 + 18) // 0.18 is labeled on the board as RESET but we configure it in the bootloader as a regular
// GPIO
/*
No longer populated on PCB
*/
#define PIN_SERIAL2_RX (0 + 9)
#define PIN_SERIAL2_TX (0 + 10)
// #define PIN_SERIAL2_EN (0 + 17)
/*
* I2C
*/
#define WIRE_INTERFACES_COUNT 2
// I2C bus 0
// Routed to footprint for PCF8563TS RTC
// Not populated on T114 V1, maybe in future?
#define PIN_WIRE_SDA (0 + 26) // P0.26
#define PIN_WIRE_SCL (0 + 27) // P0.27
// I2C bus 1
// Available on header pins, for general use
#define PIN_WIRE1_SDA (0 + 16) // P0.16
#define PIN_WIRE1_SCL (0 + 13) // P0.13
/*
* Lora radio
*/
#define USE_SX1262
// #define USE_SX1268
#define SX126X_CS (0 + 24) // FIXME - we really should define LORA_CS instead
#define LORA_CS (0 + 24)
#define SX126X_DIO1 (0 + 20)
// Note DIO2 is attached internally to the module to an analog switch for TX/RX switching
// #define SX1262_DIO3 (0 + 21)
// This is used as an *output* from the sx1262 and connected internally to power the tcxo, do not drive from the
// main
// CPU?
#define SX126X_BUSY (0 + 17)
#define SX126X_RESET (0 + 25)
// Not really an E22 but TTGO seems to be trying to clone that
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
/*
* E-Ink DIY
*/
#define PIN_EINK_MOSI (0 + 8) // also called SDA
#define PIN_EINK_SCLK (0 + 7)
#define PIN_EINK_CS (32 + 12)
#define PIN_EINK_DC (32 + 14)
#define PIN_EINK_RES (0 + 5)
#define PIN_EINK_BUSY (32 + 15)
/*
* GPS pins
*/
#define GPS_L76K
// #define PIN_GPS_RESET (32 + 6) // An output to reset L76K GPS. As per datasheet, low for > 100ms will reset the L76K
#define GPS_RESET_MODE LOW
// #define PIN_GPS_EN (21)
#define VEXT_ENABLE (0 + 21)
#define PERIPHERAL_WARMUP_MS 1000 // Make sure I2C QuickLink has stable power before continuing
#define VEXT_ON_VALUE HIGH
// #define GPS_EN_ACTIVE HIGH
#define PIN_GPS_STANDBY (32 + 2) // An output to wake GPS, low means allow sleep, high means force wake
#define PIN_GPS_PPS (32 + 4)
// Seems to be missing on this new board
// #define PIN_GPS_PPS (32 + 4) // Pulse per second input from the GPS
#define GPS_TX_PIN (32 + 5) // This is for bits going TOWARDS the CPU
#define GPS_RX_PIN (32 + 7) // This is for bits going TOWARDS the GPS
#define GPS_THREAD_INTERVAL 50
#define PIN_SERIAL1_RX GPS_TX_PIN
#define PIN_SERIAL1_TX GPS_RX_PIN
// PCF8563 RTC Module
#define PCF8563_RTC 0x51
/*
* SPI Interfaces
*/
#define SPI_INTERFACES_COUNT 2
// For LORA, spi 0
#define PIN_SPI_MISO (0 + 23)
#define PIN_SPI_MOSI (0 + 22)
#define PIN_SPI_SCK (0 + 19)
#define PIN_SPI1_MISO -1
#define PIN_SPI1_MOSI PIN_EINK_MOSI
#define PIN_SPI1_SCK PIN_EINK_SCLK
// #define PIN_PWR_EN (0 + 6)
// To debug via the segger JLINK console rather than the CDC-ACM serial device
// #define USE_SEGGER
// Battery
// The battery sense is hooked to pin A0 (4)
// it is defined in the anlaolgue pin section of this file
// and has 12 bit resolution
#define ADC_CTRL 6
#define ADC_CTRL_ENABLED HIGH
#define BATTERY_PIN 4
#define ADC_RESOLUTION 14
#define BATTERY_SENSE_RESOLUTION_BITS 12
#define BATTERY_SENSE_RESOLUTION 4096.0
#undef AREF_VOLTAGE
#define AREF_VOLTAGE 3.0
#define VBAT_AR_INTERNAL AR_INTERNAL_3_0
#define ADC_MULTIPLIER (4.90F)
#define HAS_RTC 0
#ifdef __cplusplus
}
#endif
/*----------------------------------------------------------------------------
* Arduino objects - C++ only
*----------------------------------------------------------------------------*/
#endif

View File

@@ -56,6 +56,7 @@ extern "C" {
#define TFT_WIDTH 240
#define TFT_OFFSET_X 0
#define TFT_OFFSET_Y 0
// #define TFT_OFFSET_ROTATION 0
// #define SCREEN_ROTATE
// #define SCREEN_TRANSITION_FRAMERATE 5

View File

@@ -28,7 +28,7 @@ lib_deps =
https://github.com/meshtastic/GxEPD2#b202ebfec6a4821e098cf7a625ba0f6f2400292d
[env:heltec-mesh-pocket-inkhud-5000]
[env:heltec-mesh-pocket-5000-inkhud]
extends = nrf52840_base, inkhud
board = heltec_mesh_pocket
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/heltec_mesh_pocket> ${inkhud.build_src_filter}
@@ -73,7 +73,7 @@ lib_deps =
https://github.com/meshtastic/GxEPD2#b202ebfec6a4821e098cf7a625ba0f6f2400292d
[env:heltec-mesh-pocket-inkhud-10000]
[env:heltec-mesh-pocket-10000-inkhud]
extends = nrf52840_base, inkhud
board = heltec_mesh_pocket
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/heltec_mesh_pocket> ${inkhud.build_src_filter}

View File

@@ -1,6 +1,8 @@
#define EXT_PWR_DETECT 20
#define BUTTON_PIN 17
#define BUTTON_ACTIVE_LOW false
#define BUTTON_ACTIVE_PULLUP false
#define BATTERY_PIN 7 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
#define ADC_CHANNEL ADC1_GPIO7_CHANNEL

View File

@@ -21,6 +21,9 @@
#include "graphics/niche/Drivers/EInk/LCMEN2R13EFC1.h"
#include "graphics/niche/Inputs/TwoButton.h"
// Button feedback
#include "buzz.h"
void setupNicheGraphics()
{
using namespace NicheGraphics;
@@ -84,8 +87,11 @@ void setupNicheGraphics()
buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); });
// #1: Aux Button
buttons->setWiring(1, BUTTON_PIN_SECONDARY);
buttons->setHandlerShortPress(1, [inkhud]() { inkhud->nextTile(); });
buttons->setWiring(1, PIN_BUTTON2);
buttons->setHandlerShortPress(1, [inkhud]() {
inkhud->nextTile();
playBoop();
});
// Begin handling button events
buttons->start();

View File

@@ -1,7 +1,7 @@
#define LED_PIN 45 // LED is not populated on earliest board variant
#define BUTTON_PIN 0
#define BUTTON_PIN_SECONDARY 21 // Second built-in button
#define BUTTON_SECONDARY_CANNEDMESSAGES // By default, use the secondary button as canned message input
#define PIN_BUTTON2 21 // Second built-in button
#define ALT_BUTTON_PIN PIN_BUTTON2 // Send the up event
// I2C
#define I2C_SDA SDA

View File

@@ -34,6 +34,9 @@ Different NicheGraphics UIs and different hardware variants will each have their
#include "graphics/niche/Drivers/EInk/DEPG0290BNS800.h"
#include "graphics/niche/Inputs/TwoButton.h"
// Button feedback
#include "buzz.h"
void setupNicheGraphics()
{
using namespace NicheGraphics;
@@ -97,8 +100,11 @@ void setupNicheGraphics()
buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); });
// #1: Aux Button
buttons->setWiring(1, BUTTON_PIN_SECONDARY);
buttons->setHandlerShortPress(1, [inkhud]() { inkhud->nextTile(); });
buttons->setWiring(1, PIN_BUTTON2);
buttons->setHandlerShortPress(1, [inkhud]() {
inkhud->nextTile();
playBoop();
});
// Begin handling button events
buttons->start();

View File

@@ -1,7 +1,7 @@
#define LED_PIN 45 // LED is not populated on earliest board variant
#define BUTTON_PIN 0
#define BUTTON_PIN_SECONDARY 21 // Second built-in button
#define BUTTON_SECONDARY_CANNEDMESSAGES // By default, use the secondary button as canned message input
#define PIN_BUTTON2 21 // Second built-in button
#define ALT_BUTTON_PIN PIN_BUTTON2 // Send the up event
// I2C
#define I2C_SDA SDA

View File

@@ -1,6 +1,7 @@
#ifndef HAS_TFT
#define BUTTON_PIN 0
#define BUTTON_PIN_SECONDARY 21 // Second built-in button
#define BUTTON_SECONDARY_CANNEDMESSAGES // By default, use the secondary button as canned message input
#define PIN_BUTTON2 21 // Second built-in button
#define ALT_BUTTON_PIN PIN_BUTTON2 // Send the up event
// I2C
#define I2C_SDA SDA
@@ -68,4 +69,5 @@
#define SX126X_RESET LORA_RESET
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
#endif // HAS_TFT

View File

@@ -6,7 +6,9 @@
#define USE_SSD1306
#define BUTTON_PIN 0 // Button pin for this board
#define BUTTON_PIN_ALT 36
#define CANCEL_BUTTON_PIN 36
#define CANCEL_BUTTON_ACTIVE_LOW true
#define CANCEL_BUTTON_ACTIVE_PULLUP true
#define HAS_NEOPIXEL // If defined, we will use the neopixel library
#define NEOPIXEL_DATA 35 // Neopixel pin for this board

View File

@@ -3,9 +3,7 @@
#define I2C_SDA 21
#define I2C_SCL 22
#define BUTTON_PIN 36 // The user button (information button) GPIO on the Nano G1 explorer
// #define BUTTON_PIN_ALT 13 // Alternate GPIO for an external button if needed. Does anyone use this? It is not documented
// anywhere.
#define BUTTON_PIN 36 // The user button (information button) GPIO on the Nano G1 explorer
#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
// common pinout for their SX1262 vs RF95 modules - both can be enabled and we will probe at runtime for RF95 and if

View File

@@ -3,9 +3,7 @@
#define I2C_SDA 21
#define I2C_SCL 22
#define BUTTON_PIN 36 // The middle button GPIO on the Nano G1
// #define BUTTON_PIN_ALT 13 // Alternate GPIO for an external button if needed. Does anyone use this? It is not documented
// anywhere.
#define BUTTON_PIN 36 // The middle button GPIO on the Nano G1
#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
// common pinout for their SX1262 vs RF95 modules - both can be enabled and we will probe at runtime for RF95 and if

View File

@@ -2,5 +2,5 @@
extends = esp32s3_base
board = lolin_s3_mini
board_level = extra
build_flags =
${esp32s3_base.build_flags} -D PRIVATE_HW -I variants/nugget_s3_lora
build_flags =
${esp32s3_base.build_flags} -D ARDUINO_USB_CDC_ON_BOOT=1 -D PRIVATE_HW -I variants/nugget_s3_lora

View File

@@ -1,5 +1,8 @@
#define I2C_SDA 34 // I2C pins for this board
#define I2C_SCL 38
#define I2C_SDA 35 // I2C pins for this board
#define I2C_SCL 36
#define USE_SSD1306
#define DISPLAY_FLIP_SCREEN
#define LED_PIN 15 // If defined we will blink this LED
@@ -8,7 +11,8 @@
#define NEOPIXEL_DATA 10 // gpio pin used to send data to the neopixels
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
// Button A (44), B (43), R (12), U (13), L (11), D (18)
#define BUTTON_PIN 44 // If defined, this will be used for user button presses
#define BUTTON_NEED_PULLUP
#define USE_RF95

View File

@@ -26,21 +26,15 @@ extends = env:picomputer-s3
build_flags =
${env:picomputer-s3.build_flags}
-D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1
-D MESHTASTIC_EXCLUDE_INPUTBROKER=1
-D MESHTASTIC_EXCLUDE_BLUETOOTH=1
-D MESHTASTIC_EXCLUDE_WEBSERVER=1
-D MESHTASTIC_EXCLUDE_SERIAL=1
-D MESHTASTIC_EXCLUDE_SOCKETAPI=1
-D INPUTDRIVER_MATRIX_TYPE=1
-D USE_PIN_BUZZER=PIN_BUZZER
-D USE_SX127x
-D HAS_SCREEN=0
-D HAS_SCREEN=1
-D HAS_TFT=1
-D RAM_SIZE=1024
-D LV_LVGL_H_INCLUDE_SIMPLE
-D LV_CONF_INCLUDE_SIMPLE
-D LV_COMP_CONF_INCLUDE_SIMPLE
-D RAM_SIZE=1560
-D LV_LVGL_H_INCLUDE_SIMPLE
-D LV_CONF_INCLUDE_SIMPLE
-D LV_COMP_CONF_INCLUDE_SIMPLE
-D LV_USE_SYSMON=0
-D LV_USE_PROFILER=0
-D LV_USE_PERF_MONITOR=0
@@ -51,7 +45,7 @@ build_flags =
-D LGFX_DRIVER=LGFX_PICOMPUTER_S3
-D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_PICOMPUTER_S3.h\"
-D VIEW_320x240
; -D USE_DOUBLE_BUFFER
; -D USE_DOUBLE_BUFFER
-D USE_PACKET_API
lib_deps =

View File

@@ -26,7 +26,8 @@ build_flags = ${native_base.build_flags} -Os -lX11 -linput -lxkbcommon -ffunctio
-D RAM_SIZE=16384
-D USE_X11=1
-D HAS_TFT=1
-D HAS_SCREEN=0
-D HAS_SCREEN=1
-D LV_CACHE_DEF_SIZE=6291456
-D LV_BUILD_TEST=0
-D LV_USE_LIBINPUT=1
@@ -41,7 +42,6 @@ build_flags = ${native_base.build_flags} -Os -lX11 -linput -lxkbcommon -ffunctio
!pkg-config --libs openssl --silence-errors || :
build_src_filter =
${native_base.build_src_filter}
-<graphics/TFTDisplay.cpp>
[env:native-fb]
extends = native_base
@@ -56,7 +56,7 @@ build_flags = ${native_base.build_flags} -Os -ffunction-sections -fdata-sections
-D USE_FRAMEBUFFER=1
-D LV_COLOR_DEPTH=32
-D HAS_TFT=1
-D HAS_SCREEN=0
-D HAS_SCREEN=1
-D LV_BUILD_TEST=0
-D LV_USE_LOG=0
-D LV_USE_EVDEV=1
@@ -72,7 +72,6 @@ build_flags = ${native_base.build_flags} -Os -ffunction-sections -fdata-sections
!pkg-config --libs openssl --silence-errors || :
build_src_filter =
${native_base.build_src_filter}
-<graphics/TFTDisplay.cpp>
[env:native-tft-debug]
extends = native_base

View File

@@ -18,6 +18,7 @@ lib_deps =
melopero/Melopero RV3028@^1.1.0
https://github.com/RAKWireless/RAK13800-W5100S/archive/1.0.2.zip
rakwireless/RAKwireless NCP5623 RGB LED library@^1.0.2
beegee-tokyo/RAK12035_SoilMoisture@^1.0.4
https://github.com/RAKWireless/RAK12034-BMX160/archive/dcead07ffa267d3c906e9ca4a1330ab989e957e2.zip
; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm)
@@ -51,4 +52,4 @@ lib_deps =
upload_protocol = stlink
; eventually use platformio/tool-pyocd@^2.3600.0 instad
;upload_protocol = custom
;upload_command = pyocd flash -t nrf52840 $UPLOADERFLAGS $SOURCE
;upload_command = pyocd flash -t nrf52840 $UPLOADERFLAGS $SOURCE

View File

@@ -88,8 +88,13 @@ static const uint8_t A7 = PIN_A7;
#define ADC_RESOLUTION 14
// Other pins
#define WB_I2C1_SDA (13) // SENSOR_SLOT IO_SLOT
#define WB_I2C1_SCL (14) // SENSOR_SLOT IO_SLOT
#define PIN_AREF (2)
#define PIN_NFC1 (9)
#define WB_IO5 PIN_NFC1
#define WB_IO4 (4)
#define PIN_NFC2 (10)
static const uint8_t AREF = PIN_AREF;
@@ -143,8 +148,8 @@ static const uint8_t SCK = PIN_SPI_SCK;
*/
#define WIRE_INTERFACES_COUNT 1
#define PIN_WIRE_SDA (13)
#define PIN_WIRE_SCL (14)
#define PIN_WIRE_SDA (WB_I2C1_SDA)
#define PIN_WIRE_SCL (WB_I2C1_SCL)
// QSPI Pins
#define PIN_QSPI_SCK 3
@@ -219,10 +224,15 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
// Testing USB detection
#define NRF_APM
// If using a power chip like the INA3221 you can override the default battery voltage channel below
// and comment out NRF_APM to use the INA3221 instead of the USB detection for charging
// #define INA3221_BAT_CH INA3221_CH2
// #define INA3221_ENV_CH INA3221_CH1
// enables 3.3V periphery like GPS or IO Module
// Do not toggle this for GPS power savings
#define PIN_3V3_EN (34)
#define WB_IO2 PIN_3V3_EN
// RAK1910 GPS module
// If using the wisblock GPS module and pluged into Port A on WisBlock base
@@ -276,4 +286,4 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
* Arduino objects - C++ only
*----------------------------------------------------------------------------*/
#endif
#endif

View File

@@ -16,6 +16,7 @@ lib_deps =
melopero/Melopero RV3028@^1.1.0
rakwireless/RAKwireless NCP5623 RGB LED library@^1.0.2
beegee-tokyo/RAKwireless RAK12034@^1.0.0
beegee-tokyo/RAK12035_SoilMoisture@^1.0.4
debug_tool = jlink
; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm)
;upload_protocol = jlink

View File

@@ -90,6 +90,8 @@ static const uint8_t A7 = PIN_A7;
// Other pins
#define PIN_AREF (2)
#define PIN_NFC1 (9)
#define WB_IO5 PIN_NFC1
#define WB_IO4 (4)
#define PIN_NFC2 (10)
static const uint8_t AREF = PIN_AREF;
@@ -188,6 +190,7 @@ static const uint8_t SCK = PIN_SPI_SCK;
// enables 3.3V periphery like GPS or IO Module
#define PIN_3V3_EN (34)
#define WB_IO2 PIN_3V3_EN
// RAK1910 GPS module
// If using the wisblock GPS module and pluged into Port A on WisBlock base
@@ -231,4 +234,4 @@ static const uint8_t SCK = PIN_SPI_SCK;
* Arduino objects - C++ only
*----------------------------------------------------------------------------*/
#endif
#endif

View File

@@ -18,6 +18,7 @@ lib_deps =
melopero/Melopero RV3028@^1.1.0
rakwireless/RAKwireless NCP5623 RGB LED library@^1.0.2
beegee-tokyo/RAKwireless RAK12034@^1.0.0
beegee-tokyo/RAK12035_SoilMoisture@^1.0.4
debug_tool = jlink
; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm)
;upload_protocol = jlink

View File

@@ -69,7 +69,9 @@ static const uint8_t A7 = PIN_A7;
// Other pins
#define PIN_AREF (2)
// #define PIN_NFC1 (9)
#define PIN_NFC1 (9)
#define WB_IO5 PIN_NFC1
#define WB_IO4 (4)
// #define PIN_NFC2 (10)
static const uint8_t AREF = PIN_AREF;
@@ -160,6 +162,7 @@ static const uint8_t SCK = PIN_SPI_SCK;
// enables 3.3V periphery like GPS or IO Module
#define PIN_3V3_EN (34)
#define WB_IO2 PIN_3V3_EN
// NO GPS
#undef GPS_RX_PIN
@@ -202,4 +205,4 @@ static const uint8_t SCK = PIN_SPI_SCK;
* Arduino objects - C++ only
*----------------------------------------------------------------------------*/
#endif
#endif

View File

@@ -90,6 +90,8 @@ static const uint8_t A7 = PIN_A7;
// Other pins
#define PIN_AREF (2)
#define PIN_NFC1 (9)
#define WB_IO5 PIN_NFC1
#define WB_IO4 (4)
#define PIN_NFC2 (10)
static const uint8_t AREF = PIN_AREF;
@@ -217,6 +219,7 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
// enables 3.3V periphery like GPS or IO Module
// Do not toggle this for GPS power savings
#define PIN_3V3_EN (34)
#define WB_IO2 PIN_3V3_EN
// RAK1910 GPS module
// If using the wisblock GPS module and pluged into Port A on WisBlock base
@@ -270,4 +273,4 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
* Arduino objects - C++ only
*----------------------------------------------------------------------------*/
#endif
#endif

View File

@@ -22,6 +22,7 @@ lib_deps =
bodmer/TFT_eSPI
beegee-tokyo/RAKwireless RAK12034@^1.0.0
beegee-tokyo/RAK14014-FT6336U @ 1.0.1
beegee-tokyo/RAK12035_SoilMoisture@^1.0.4
debug_tool = jlink
; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm)
;upload_protocol = jlink

View File

@@ -90,6 +90,8 @@ static const uint8_t A7 = PIN_A7;
// Other pins
#define PIN_AREF (2)
#define PIN_NFC1 (9)
#define WB_IO5 PIN_NFC1
#define WB_IO4 (4)
#define PIN_NFC2 (10)
static const uint8_t AREF = PIN_AREF;
@@ -176,11 +178,11 @@ static const uint8_t SCK = PIN_SPI_SCK;
// No reason not to have the RAK Wireless pin defs here too. This allows code from example RAK sketches to run without
// modification.
static const uint8_t WB_IO1 = 17; // SLOT_A SLOT_B
static const uint8_t WB_IO2 = 34; // SLOT_A SLOT_B
static const uint8_t WB_IO3 = 21; // SLOT_C
static const uint8_t WB_IO4 = 4; // SLOT_C
static const uint8_t WB_IO5 = 9; // SLOT_D
static const uint8_t WB_IO1 = 17; // SLOT_A SLOT_B
static const uint8_t WB_IO2 = 34; // SLOT_A SLOT_B
static const uint8_t WB_IO3 = 21; // SLOT_C
// static const uint8_t WB_IO4 = 4; // SLOT_C <- already defined above (ln. 94)
// static const uint8_t WB_IO5 = 9; // SLOT_D <- already defined above (ln. 93)
static const uint8_t WB_IO6 = 10; // SLOT_D
static const uint8_t WB_SW1 = 33; // IO_SLOT
static const uint8_t WB_A0 = 5; // IO_SLOT
@@ -314,4 +316,4 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
* Arduino objects - C++ only
*----------------------------------------------------------------------------*/
#endif
#endif

View File

@@ -36,17 +36,9 @@ upload_speed = 460800
build_flags =
${env:seeed-sensecap-indicator.build_flags}
-D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1
-D MESHTASTIC_EXCLUDE_INPUTBROKER=1
-D MESHTASTIC_EXCLUDE_SCREEN=1
-D MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1
-D MESHTASTIC_EXCLUDE_WEBSERVER=1
-D MESHTASTIC_EXCLUDE_SERIAL=1
-D MESHTASTIC_EXCLUDE_SOCKETAPI=1
-D INPUTDRIVER_BUTTON_TYPE=38
-D HAS_TELEMETRY=0
-D CONFIG_DISABLE_HAL_LOCKS=1
-D HAS_SCREEN=0
-D HAS_SCREEN=1
-D HAS_TFT=1
-D DISPLAY_SET_RESOLUTION
-D RAM_SIZE=4096

View File

@@ -7,9 +7,10 @@
#define SENSOR_PORT_NUM 2
#define SENSOR_BAUD_RATE 115200
#if !HAS_TFT
#define BUTTON_PIN 38
#endif
#define BUTTON_ACTIVE_LOW true
#define BUTTON_ACTIVE_PULLUP true
// #define BUTTON_NEED_PULLUP
// #define BATTERY_PIN 27 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage

View File

@@ -59,8 +59,8 @@ const uint32_t g_ADigitalPinMap[] = {
// D16 - Battery voltage ADC input
31, // D16 P0.31 VBAT_ADC
// GROVE
0, // D17 P0.00 GROVESDA
1, // D18 P0.01 GROVESCL
43, // D17 P0.00 GROVESDA
44, // D18 P0.01 GROVESCL
// FLASH
21, // D19 P0.21 (QSPI_SCK)

View File

@@ -33,15 +33,15 @@
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// Button Configuration
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
#define BUTTON_PIN D13 // This is the Program Button
#define CANCEL_BUTTON_PIN D13 // This is the Program Button
// #define BUTTON_NEED_PULLUP 1
#define BUTTON_ACTIVE_LOW true
#define BUTTON_ACTIVE_PULLUP false
#define CANCEL_BUTTON_ACTIVE_LOW true
#define CANCEL_BUTTON_ACTIVE_PULLUP false
#define BUTTON_PIN_TOUCH 13 // Touch button
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// Digital Pin Mapping (D0-D10)
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// #define BUTTON_PIN_TOUCH 13 // Touch button
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// Digital Pin Mapping (D0-D10)
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
#define D0 0 // P1.06 GNSS_WAKEUP/IO0
#define D1 1 // P0.07 LORA_DIO1
#define D2 2 // P1.07 LORA_RESET
@@ -74,10 +74,12 @@
// Communication Interfaces
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// I2C Configuration
#define HAS_WIRE 1
// #define HAS_WIRE 1
#define PIN_WIRE_SDA D14 // P0.09
#define PIN_WIRE_SCL D15 // P0.10
#define WIRE_INTERFACES_COUNT 1
#define WIRE_INTERFACES_COUNT 2
#define PIN_WIRE1_SDA D18
#define PIN_WIRE1_SCL D17
#define I2C_NO_RESCAN
static const uint8_t SDA = PIN_WIRE_SDA;

View File

@@ -2,7 +2,7 @@
[env:seeed_xiao_nrf52840_kit]
extends = nrf52840_base
board = xiao_ble_sense
build_flags = ${nrf52840_base.build_flags} -Ivariants/seeed_xiao_nrf52840_kit -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DSEEED_XIAO_NRF52840_KIT
build_flags = ${nrf52840_base.build_flags} -Ivariants/seeed_xiao_nrf52840_kit -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DSEEED_XIAO_NRF52840_KIT -DGPS_L76K
board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/seeed_xiao_nrf52840_kit>
lib_deps =

View File

@@ -1,5 +1,5 @@
#ifndef _SEEED_XIAO_NRF52840_SENSE_H_
#define _SEEED_XIAO_NRF52840_SENSE_H_
#ifndef _SEEED_XIAO_NRF52840_KIT_H_
#define _SEEED_XIAO_NRF52840_KIT_H_
/** Master clock frequency */
#define VARIANT_MCK (64000000ul)
@@ -79,9 +79,8 @@ static const uint8_t A5 = PIN_A5;
*/
/*
* D0 is shared with PIN_GPS_STANDBY on the L76K GNSS Module.
* There are some technical solutions that can solve this problem, and we are
* currently exploring and researching them.
* D0 is shared with PIN_GPS_STANDBY on the L76K GNSS Module, so refer to
* GPS_L76K definition preventing this conflict
*/
// #define BUTTON_PIN D0
@@ -93,51 +92,60 @@ static const uint8_t A5 = PIN_A5;
#define PIN_SERIAL2_TX (-1)
/*
* SPI Interfaces
* Pinout for SX126x
*/
#define SPI_INTERFACES_COUNT 1
#define PIN_SPI_MISO (9)
#define PIN_SPI_MOSI (10)
#define PIN_SPI_SCK (8)
static const uint8_t SS = D4;
static const uint8_t MOSI = PIN_SPI_MOSI;
static const uint8_t MISO = PIN_SPI_MISO;
static const uint8_t SCK = PIN_SPI_SCK;
#define USE_SX1262
// Pinout for SX126X
#ifdef XIAO_BLE_LEGACY_PINOUT
// Legacy xiao_ble variant pinout for third-party SX126x modules e.g. EBYTE E22
#define SX126X_CS D0
#define SX126X_DIO1 D1
#define SX126X_BUSY D2
#define SX126X_RESET D3
#define SX126X_RXEN D7
#elif defined(SEEED_XIAO_WIO_BTB)
// Wio-SX1262 for XIAO with 30-pin board-to-board connector
// https://files.seeedstudio.com/products/SenseCAP/Wio_SX1262/Schematic_Diagram_Wio-SX1262_for_XIAO.pdf
#define SX126X_CS D3
#define SX126X_DIO1 D0
#define SX126X_BUSY D1
#define SX126X_RESET D2
#define SX126X_RXEN D4
#else
// Wio-SX1262 for XIAO (standalone SKU 113010003 or nRF52840 kit SKU 102010710)
// https://files.seeedstudio.com/products/SenseCAP/Wio_SX1262/Wio-SX1262%20for%20XIAO%20V1.0_SCH.pdf
#define SX126X_CS D4
#define SX126X_DIO1 D1
#define SX126X_BUSY D3
#define SX126X_RESET D2
#define SX126X_RXEN D5
#endif
// Common pinouts for all SX126x pinouts above
#define SX126X_TXEN RADIOLIB_NC
#define SX126X_RXEN D5 // This is used to control the RX side of the RF switch
#define SX126X_DIO2_AS_RF_SWITCH // DIO2 is used to control the TX side of the RF switch
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
/*
* Wire Interfaces
* SPI Interfaces
* Defined after pinout for SX1262x to factor in CS pinout variations
*/
#define I2C_NO_RESCAN // I2C is a bit finicky, don't scan too much
#define WIRE_INTERFACES_COUNT 1 // 2
#define SPI_INTERFACES_COUNT 1
// LSM6DS3TR on XIAO nRF52840 Series
#define PIN_WIRE_SDA (17)
#define PIN_WIRE_SCL (16)
#define PIN_SPI_MISO D9
#define PIN_SPI_MOSI D10
#define PIN_SPI_SCK D8
static const uint8_t SDA = PIN_WIRE_SDA;
static const uint8_t SCL = PIN_WIRE_SCL;
static const uint8_t SS = SX126X_CS;
static const uint8_t MOSI = PIN_SPI_MOSI;
static const uint8_t MISO = PIN_SPI_MISO;
static const uint8_t SCK = PIN_SPI_SCK;
/*
* GPS
*/
// GPS L76KB
#define GPS_L76K
// GPS L76K
#ifdef GPS_L76K
#define PIN_GPS_RX D6
#define PIN_GPS_TX D7
@@ -146,6 +154,9 @@ static const uint8_t SCL = PIN_WIRE_SCL;
#define PIN_SERIAL1_RX PIN_GPS_TX
#define PIN_SERIAL1_TX PIN_GPS_RX
#define PIN_GPS_STANDBY D0
#else
#define PIN_SERIAL1_RX (-1)
#define PIN_SERIAL1_TX (-1)
#endif
/*
@@ -161,6 +172,39 @@ static const uint8_t SCL = PIN_WIRE_SCL;
#define BATTERY_SENSE_RESOLUTION_BITS (10)
/*
* Wire Interfaces
* Keep this section after potentially conflicting pin definitions
*/
#define I2C_NO_RESCAN // I2C is a bit finicky, don't scan too much
#define WIRE_INTERFACES_COUNT 1
#if !defined(XIAO_BLE_LEGACY_PINOUT) && !defined(GPS_L76K)
// If D6 and D7 are free, I2C is probably the most versatile assignment
#define PIN_WIRE_SDA D6
#define PIN_WIRE_SCL D7
#else
// Internal LSM6DS3TR on XIAO nRF52840 Series
#define PIN_WIRE_SDA (17)
#define PIN_WIRE_SCL (16)
#endif
static const uint8_t SDA = PIN_WIRE_SDA;
static const uint8_t SCL = PIN_WIRE_SCL;
/*
* Buttons
* Keep this section after potentially conflicting pin definitions
* because D0 has multiple possible conflicts with various XIAO modules:
* - PIN_GPS_STANDBY on the L76K GNSS Module
* - DIO1 on the Wio-SX1262 - 30-pin board-to-board connector version
* - SX1262X CS on XIAO BLE legacy pinout
*/
#if !defined(GPS_L76K) && !defined(SEEED_XIAO_WIO_BTB) && !defined(XIAO_BLE_LEGACY_PINOUT)
#define BUTTON_PIN D0
#endif
#ifdef __cplusplus
}
#endif

View File

@@ -6,9 +6,7 @@
#define I2C_SDA1 14 // Second i2c channel on external IO connector
#define I2C_SCL1 15 // Second i2c channel on external IO connector
#define BUTTON_PIN 36 // The middle button GPIO on the Nano G1
// #define BUTTON_PIN_ALT 13 // Alternate GPIO for an external button if needed. Does anyone use this? It is not documented
// anywhere.
#define BUTTON_PIN 36 // The middle button GPIO on the Nano G1
#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
// common pinout for their SX1262 vs RF95 modules - both can be enabled and we will probe at runtime for RF95 and if

View File

@@ -25,11 +25,6 @@ extends = env:t-deck
build_flags =
${env:t-deck.build_flags}
-D CONFIG_DISABLE_HAL_LOCKS=1 ; "feels" to be a bit more stable without locks
-D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1
-D MESHTASTIC_EXCLUDE_INPUTBROKER=1
-D MESHTASTIC_EXCLUDE_WEBSERVER=1
-D MESHTASTIC_EXCLUDE_SERIAL=1
-D MESHTASTIC_EXCLUDE_SOCKETAPI=1
-D INPUTDRIVER_I2C_KBD_TYPE=0x55
-D INPUTDRIVER_ENCODER_TYPE=3
-D INPUTDRIVER_ENCODER_LEFT=1
@@ -39,7 +34,7 @@ build_flags =
-D INPUTDRIVER_ENCODER_BTN=0
-D INPUTDRIVER_BUTTON_TYPE=0
-D HAS_SDCARD
-D HAS_SCREEN=0
-D HAS_SCREEN=1
-D HAS_TFT=1
-D USE_I2S_BUZZER
-D RAM_SIZE=5120

View File

@@ -1,7 +1,5 @@
#define TFT_CS 12
#ifndef HAS_TFT // for TFT-UI the definitions are in device-ui
#define BUTTON_PIN 0
// ST7789 TFT LCD
#define ST7789_CS TFT_CS
@@ -24,7 +22,6 @@
#define SCREEN_ROTATE
#define SCREEN_TRANSITION_FRAMERATE 5
#define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness
#endif
#define HAS_TOUCHSCREEN 1
#define SCREEN_TOUCH_INT 16
@@ -34,10 +31,10 @@
#define USE_POWERSAVE
#define SLEEP_TIME 120
#ifndef HAS_TFT
#define BUTTON_PIN 0
// #define BUTTON_NEED_PULLUP
#endif
#define TB_PRESS 0
#define BUTTON_ACTIVE_LOW true
#define BUTTON_ACTIVE_PULLUP true
#define GPS_DEFAULT_NOT_PRESENT 1
#define GPS_RX_PIN 44
#define GPS_TX_PIN 43

View File

@@ -61,8 +61,12 @@ extern "C" {
* Buttons
*/
#define PIN_BUTTON1 (32 + 10)
#define BUTTON_ACTIVE_LOW true
#define BUTTON_ACTIVE_PULLUP true
#define PIN_BUTTON2 (0 + 18) // 0.18 is labeled on the board as RESET but we configure it in the bootloader as a regular GPIO
#define PIN_BUTTON_TOUCH (0 + 11) // 0.11 is the soft touch button on T-Echo
#define BUTTON_TOUCH_ACTIVE_LOW true
#define BUTTON_TOUCH_ACTIVE_PULLUP true
#define BUTTON_CLICK_MS 400
#define BUTTON_TOUCH_MS 200
@@ -139,6 +143,7 @@ External serial flash WP25R1635FZUIL0
// Not really an E22 but TTGO seems to be trying to clone that
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
#define TCXO_OPTIONAL
// Internally the TTGO module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface
// code)
@@ -214,7 +219,7 @@ External serial flash WP25R1635FZUIL0
#define VBAT_AR_INTERNAL AR_INTERNAL_3_0
#define ADC_MULTIPLIER (2.0F)
#define NO_EXT_GPIO 1
// #define NO_EXT_GPIO 1
#define HAS_RTC 1

View File

@@ -7,8 +7,6 @@
#define I2C_SCL 18 // For QMC6310 sensors and screens
#define BUTTON_PIN 0 // The middle button GPIO on the T-Beam S3
// #define BUTTON_PIN_ALT 13 // Alternate GPIO for an external button if needed. Does anyone use this? It is not documented
// anywhere.
// #define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
#define LED_STATE_ON 0 // State when LED is lit

View File

@@ -4,8 +4,8 @@
#define I2C_SCL 22
#define BUTTON_PIN 38 // The middle button GPIO on the T-Beam
// #define BUTTON_PIN_ALT 13 // Alternate GPIO for an external button if needed. Does anyone use this? It is not documented
// anywhere.
#define BUTTON_ACTIVE_LOW true
#define BUTTON_ACTIVE_PULLUP true
#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
#define LED_STATE_ON 0 // State when LED is lit

View File

@@ -36,21 +36,16 @@ extends = env:unphone
build_flags =
${env:unphone.build_flags}
-D CONFIG_DISABLE_HAL_LOCKS=1
-D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1
-D MESHTASTIC_EXCLUDE_INPUTBROKER=1
-D MESHTASTIC_EXCLUDE_WEBSERVER=1
-D MESHTASTIC_EXCLUDE_SERIAL=1
-D MESHTASTIC_EXCLUDE_SOCKETAPI=1
-D INPUTDRIVER_BUTTON_TYPE=21
-D HAS_SCREEN=0
-D HAS_SCREEN=1
-D HAS_TFT=1
-D HAS_SDCARD
-D DISPLAY_SET_RESOLUTION
-D RAM_SIZE=6144
-D LV_CACHE_DEF_SIZE=2097152
-D LV_LVGL_H_INCLUDE_SIMPLE
-D LV_CONF_INCLUDE_SIMPLE
-D LV_COMP_CONF_INCLUDE_SIMPLE
-D LV_LVGL_H_INCLUDE_SIMPLE
-D LV_CONF_INCLUDE_SIMPLE
-D LV_COMP_CONF_INCLUDE_SIMPLE
-D LV_BUILD_TEST=0
-D LV_USE_SYSMON=0
-D LV_USE_PROFILER=0

View File

@@ -57,9 +57,13 @@
#define LED_PIN 13 // the red part of the RGB LED
#define LED_STATE_ON 0 // State when LED is lit
#define BUTTON_PIN 21 // Button 3 - square - top button in landscape mode
#define BUTTON_NEED_PULLUP // we do need a helping hand up
#define BUTTON_PIN_ALT 45 // Button 1 - triangle - bottom button in landscape mode
#define ALT_BUTTON_PIN 21 // Button 3 - square - top button in landscape mode
#define BUTTON_NEED_PULLUP2 TB_UP
#define BUTTON_PIN 0 // Circle button
#define BUTTON_NEED_PULLUP // we do need a helping hand up
#define CANCEL_BUTTON_PIN 45 // Button 1 - triangle - bottom button in landscape mode
#define CANCEL_BUTTON_ACTIVE_LOW true
#define CANCEL_BUTTON_ACTIVE_PULLUP true
#define I2C_SDA 3 // I2C pins for this board
#define I2C_SCL 4

View File

@@ -1,13 +0,0 @@
; Seeed Xiao BLE: https://www.digikey.com/en/products/detail/seeed-technology-co-ltd/102010448/16652893
[env:xiao_ble]
extends = nrf52840_base
board = xiao_ble_sense
board_level = extra
build_flags = ${nrf52840_base.build_flags} -Ivariants/xiao_ble -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -D EBYTE_E22 -DEBYTE_E22_900M30S -DPRIVATE_HW
board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/xiao_ble>
lib_deps =
${nrf52840_base.lib_deps}
debug_tool = jlink
; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm)
;upload_protocol = jlink

View File

@@ -1,62 +0,0 @@
#include "variant.h"
#include "nrf.h"
#include "wiring_constants.h"
#include "wiring_digital.h"
const uint32_t g_ADigitalPinMap[] = {
// D0 .. D13
2, // D0 is P0.02 (A0)
3, // D1 is P0.03 (A1)
28, // D2 is P0.28 (A2)
29, // D3 is P0.29 (A3)
4, // D4 is P0.04 (A4,SDA)
5, // D5 is P0.05 (A5,SCL)
43, // D6 is P1.11 (TX)
44, // D7 is P1.12 (RX)
45, // D8 is P1.13 (SCK)
46, // D9 is P1.14 (MISO)
47, // D10 is P1.15 (MOSI)
// LEDs
26, // D11 is P0.26 (LED RED)
6, // D12 is P0.06 (LED BLUE)
30, // D13 is P0.30 (LED GREEN)
14, // D14 is P0.14 (READ_BAT)
// LSM6DS3TR
40, // D15 is P1.08 (6D_PWR)
27, // D16 is P0.27 (6D_I2C_SCL)
7, // D17 is P0.07 (6D_I2C_SDA)
11, // D18 is P0.11 (6D_INT1)
// MIC
42, // 17,//42, // D19 is P1.10 (MIC_PWR)
32, // 26,//32, // D20 is P1.00 (PDM_CLK)
16, // 25,//16, // D21 is P0.16 (PDM_DATA)
// BQ25100
13, // D22 is P0.13 (HICHG)
17, // D23 is P0.17 (~CHG)
//
21, // D24 is P0.21 (QSPI_SCK)
25, // D25 is P0.25 (QSPI_CSN)
20, // D26 is P0.20 (QSPI_SIO_0 DI)
24, // D27 is P0.24 (QSPI_SIO_1 DO)
22, // D28 is P0.22 (QSPI_SIO_2 WP)
23, // D29 is P0.23 (QSPI_SIO_3 HOLD)
// NFC
9, // D30 is P0.09 (NFC1)
10, // D31 is P0.10 (NFC2)
// VBAT
31, // D32 is P0.10 (VBAT)
};
void initVariant()
{
// Set BQ25101 ISET to 100mA instead of 50mA
pinMode(HICHG, OUTPUT);
digitalWrite(HICHG, LOW);
}

View File

@@ -1,212 +0,0 @@
#ifndef _SEEED_XIAO_NRF52840_SENSE_H_
#define _SEEED_XIAO_NRF52840_SENSE_H_
/** Master clock frequency */
#define VARIANT_MCK (64000000ul)
#define USE_LFXO // Board uses 32khz crystal for LF
// #define USE_LFRC // Board uses RC for LF
/*----------------------------------------------------------------------------
* Headers
*----------------------------------------------------------------------------*/
#include "WVariant.h"
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#define PINS_COUNT (33)
#define NUM_DIGITAL_PINS (33)
#define NUM_ANALOG_INPUTS (8) // A6 is used for battery, A7 is analog reference
#define NUM_ANALOG_OUTPUTS (0)
// LEDs
#define LED_RED 11
#define LED_BLUE 12
#define LED_GREEN 13
#define PIN_LED1 LED_GREEN
#define PIN_LED2 LED_BLUE
#define PIN_LED3 LED_RED
#define PIN_LED PIN_LED1
#define LED_PWR (PINS_COUNT)
#define LED_BUILTIN PIN_LED
#define LED_STATE_ON 1 // State when LED is lit
/*
* Buttons
*/
#define PIN_BUTTON1 (PINS_COUNT)
// Digital PINs
#define D0 (0ul)
#define D1 (1ul)
#define D2 (2ul)
#define D3 (3ul)
#define D4 (4ul)
#define D5 (5ul)
#define D6 (6ul)
#define D7 (7ul)
#define D8 (8ul)
#define D9 (9ul)
#define D10 (10ul)
/*
* Analog pins
*/
#define PIN_A0 (0)
#define PIN_A1 (1)
#define PIN_A2 (2)
#define PIN_A3 (3)
#define PIN_A4 (4)
#define PIN_A5 (5)
#define PIN_VBAT (32)
#define VBAT_ENABLE (14)
static const uint8_t A0 = PIN_A0;
static const uint8_t A1 = PIN_A1;
static const uint8_t A2 = PIN_A2;
static const uint8_t A3 = PIN_A3;
static const uint8_t A4 = PIN_A4;
static const uint8_t A5 = PIN_A5;
#define ADC_RESOLUTION 12
// Other pins
#define PIN_NFC1 (30)
#define PIN_NFC2 (31)
/*
* Serial interfaces
*/
#define PIN_SERIAL1_RX (-1) // (7)
#define PIN_SERIAL1_TX (-1) // (6)
#define PIN_SERIAL2_RX (-1)
#define PIN_SERIAL2_TX (-1)
/*
* SPI Interfaces
*/
#define SPI_INTERFACES_COUNT 1
#define PIN_SPI_MISO (9)
#define PIN_SPI_MOSI (10)
#define PIN_SPI_SCK (8)
static const uint8_t SS = D0;
static const uint8_t MOSI = PIN_SPI_MOSI;
static const uint8_t MISO = PIN_SPI_MISO;
static const uint8_t SCK = PIN_SPI_SCK;
// supported modules list
#define USE_SX1262
// common pinouts for SX126X modules
#define SX126X_CS D0
#define SX126X_DIO1 D1
#define SX126X_BUSY D2
#define SX126X_RESET D3
// ----------------------------------------------------------------
// E22 Tx/Rx control options:
// 1. Let the E22 control Tx and Rx automagically via DIO2.
// * The E22's TXEN and DIO2 pins are connected to each other, but not to the MCU.
// * The E22's RXEN pin *is* connected to the MCU.
// * E22_TXEN_CONNECTED_TO_DIO2 is defined so the logic in SX126XInterface.cpp handles this configuration correctly.
#define SX126X_TXEN RADIOLIB_NC
#define SX126X_RXEN D7
// ------------------------------ OR ------------------------------
// 2. Control Tx and Rx manually.
// * The E22's TXEN and RXEN pins are both connected to the MCU.
// #define SX126X_TXEN D6
// #define SX126X_RXEN D7
// ----------------------------------------------------------------
#ifdef EBYTE_E22
// 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_DIO2_AS_RF_SWITCH
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
#ifdef EBYTE_E22_900M30S
// 10dB PA gain and 30dB rated output; based on measurements from
// https://github.com/S5NC/EBYTE_ESP32-S3/blob/main/E22-900M30S%20power%20output%20testing.txt
#define TX_GAIN_LORA 7
#define SX126X_MAX_POWER 22
#endif
#ifdef EBYTE_E22_900M33S
// 25dB PA gain and 33dB rated output; based on TX Power Curve from E22-900M33S_UserManual_EN_v1.0.pdf
#define TX_GAIN_LORA 25
#define SX126X_MAX_POWER 8
#endif
#endif
/*
* Wire Interfaces
*/
#define WIRE_INTERFACES_COUNT 1 // 2
#define PIN_WIRE_SDA (4)
#define PIN_WIRE_SCL (5)
static const uint8_t SDA = PIN_WIRE_SDA;
static const uint8_t SCL = PIN_WIRE_SCL;
#define PIN_LSM6DS3TR_C_POWER (15)
#define PIN_LSM6DS3TR_C_INT1 (18)
// PDM Interfaces
// ---------------
#define PIN_PDM_PWR (19)
#define PIN_PDM_CLK (20)
#define PIN_PDM_DIN (21)
// QSPI Pins
#define PIN_QSPI_SCK (24)
#define PIN_QSPI_CS (25)
#define PIN_QSPI_IO0 (26)
#define PIN_QSPI_IO1 (27)
#define PIN_QSPI_IO2 (28)
#define PIN_QSPI_IO3 (29)
// On-board QSPI Flash
#define EXTERNAL_FLASH_DEVICES P25Q16H
#define EXTERNAL_FLASH_USE_QSPI
// Battery
#define ADC_CTRL VBAT_ENABLE // P0.14: VBAT voltage divider
#define ADC_CTRL_ENABLED LOW // ... sink
#define BATTERY_SENSE_RESOLUTION_BITS 10
#define CHARGE_LED 23 // P0_17 = 17 D23 YELLOW CHARGE LED
#define HICHG 22 // P0_13 = 13 D22 Charge-select pin for Lipo for 100 mA instead of default 50mA charge
// The battery sense is hooked to pin A0 (5)
#define BATTERY_PIN PIN_VBAT // PIN_A0
// ratio of voltage divider = 3.0 (R17=1M, R18=510k)
#define ADC_MULTIPLIER 3 // 3.0 + a bit for being optimistic
#ifdef __cplusplus
}
#endif
/*----------------------------------------------------------------------------
* Arduino objects - C++ only
*----------------------------------------------------------------------------*/
#endif

View File

@@ -1,15 +0,0 @@
#!/bin/bash
# adapted from the script linked in this very helpful article: https://enzolombardi.net/low-power-bluetooth-advertising-with-xiao-ble-and-platformio-e8e7d0da80d2
# source: https://gist.githubusercontent.com/turing-complete-labs/b3105ee653782183c54b4fdbe18f411f/raw/d86779ba7702775d3b79781da63d85442acd9de6/xiao_ble.sh
# download the core for arduino from seeedstudio. Softdevice 7.3.0, linker and variants folder are what we need
curl https://files.seeedstudio.com/arduino/core/nRF52840/Arduino_core_nRF52840.tar.bz2 -o arduino.core.1.0.0.tar.bz2
tar -xjf arduino.core.1.0.0.tar.bz2
rm arduino.core.1.0.0.tar.bz2
# copy the needed files
cp 1.0.0/cores/nRF5/linker/nrf52840_s140_v7.ld ~/.platformio/packages/framework-arduinoadafruitnrf52/cores/nRF5/linker
cp -r 1.0.0/cores/nRF5/nordic/softdevice/s140_nrf52_7.3.0_API ~/.platformio/packages/framework-arduinoadafruitnrf52/cores/nRF5/nordic/softdevice
rm -rf 1.0.0
echo done!