mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-27 11:31:47 +00:00
Merge branch 'master' into T-beam-display-no-touch
This commit is contained in:
commit
fc6857cef5
@ -4,13 +4,13 @@ cli:
|
||||
plugins:
|
||||
sources:
|
||||
- id: trunk
|
||||
ref: v1.7.0
|
||||
ref: v1.7.1
|
||||
uri: https://github.com/trunk-io/plugins
|
||||
lint:
|
||||
enabled:
|
||||
- checkov@3.2.442
|
||||
- renovate@40.60.3
|
||||
- prettier@3.5.3
|
||||
- checkov@3.2.446
|
||||
- renovate@41.10.0
|
||||
- prettier@3.6.1
|
||||
- trufflehog@3.89.2
|
||||
- yamllint@1.37.1
|
||||
- bandit@1.8.5
|
||||
@ -20,9 +20,9 @@ lint:
|
||||
- isort@6.0.1
|
||||
- markdownlint@0.45.0
|
||||
- oxipng@9.1.5
|
||||
- svgo@3.3.2
|
||||
- svgo@4.0.0
|
||||
- actionlint@1.7.7
|
||||
- flake8@7.2.0
|
||||
- flake8@7.3.0
|
||||
- hadolint@2.12.1-beta
|
||||
- shfmt@3.6.0
|
||||
- shellcheck@0.10.0
|
||||
|
@ -6,6 +6,6 @@ Lora:
|
||||
IRQ: 16
|
||||
Busy: 20
|
||||
Reset: 24
|
||||
TXen: 13
|
||||
RXen: 12
|
||||
DIO2_AS_RF_SWITCH: true
|
||||
DIO3_TCXO_VOLTAGE: true
|
||||
|
@ -7,7 +7,12 @@ using namespace NicheGraphics;
|
||||
|
||||
// Timing for "maintenance"
|
||||
// Paying off full-refresh debt with unprovoked updates, if the display is not very active
|
||||
|
||||
#ifdef SEEED_WIO_TRACKER_L1
|
||||
static constexpr uint32_t MAINTENANCE_MS_INITIAL = 5 * 1000UL;
|
||||
#else
|
||||
static constexpr uint32_t MAINTENANCE_MS_INITIAL = 60 * 1000UL;
|
||||
#endif
|
||||
static constexpr uint32_t MAINTENANCE_MS = 60 * 60 * 1000UL;
|
||||
|
||||
InkHUD::DisplayHealth::DisplayHealth() : concurrency::OSThread("Mediator")
|
||||
|
@ -5,6 +5,7 @@
|
||||
#define ONE_DAY 24 * 60 * 60
|
||||
#define ONE_MINUTE_MS 60 * 1000
|
||||
#define THIRTY_SECONDS_MS 30 * 1000
|
||||
#define TWO_SECONDS_MS 2 * 1000
|
||||
#define FIVE_SECONDS_MS 5 * 1000
|
||||
#define TEN_SECONDS_MS 10 * 1000
|
||||
|
||||
|
@ -850,10 +850,12 @@ void NodeDB::installRoleDefaults(meshtastic_Config_DeviceConfig_Role role)
|
||||
if (role == meshtastic_Config_DeviceConfig_Role_ROUTER) {
|
||||
initConfigIntervals();
|
||||
initModuleConfigIntervals();
|
||||
moduleConfig.telemetry.device_update_interval = default_telemetry_broadcast_interval_secs;
|
||||
config.device.rebroadcast_mode = meshtastic_Config_DeviceConfig_RebroadcastMode_CORE_PORTNUMS_ONLY;
|
||||
owner.has_is_unmessagable = true;
|
||||
owner.is_unmessagable = true;
|
||||
} else if (role == meshtastic_Config_DeviceConfig_Role_ROUTER_LATE) {
|
||||
moduleConfig.telemetry.device_update_interval = ONE_DAY;
|
||||
owner.has_is_unmessagable = true;
|
||||
owner.is_unmessagable = true;
|
||||
} else if (role == meshtastic_Config_DeviceConfig_Role_REPEATER) {
|
||||
@ -864,6 +866,7 @@ void NodeDB::installRoleDefaults(meshtastic_Config_DeviceConfig_Role role)
|
||||
} else if (role == meshtastic_Config_DeviceConfig_Role_SENSOR) {
|
||||
owner.has_is_unmessagable = true;
|
||||
owner.is_unmessagable = true;
|
||||
moduleConfig.telemetry.device_update_interval = default_telemetry_broadcast_interval_secs;
|
||||
moduleConfig.telemetry.environment_measurement_enabled = true;
|
||||
moduleConfig.telemetry.environment_update_interval = 300;
|
||||
} else if (role == meshtastic_Config_DeviceConfig_Role_LOST_AND_FOUND) {
|
||||
@ -881,6 +884,7 @@ void NodeDB::installRoleDefaults(meshtastic_Config_DeviceConfig_Role role)
|
||||
} else if (role == meshtastic_Config_DeviceConfig_Role_TRACKER) {
|
||||
owner.has_is_unmessagable = true;
|
||||
owner.is_unmessagable = true;
|
||||
moduleConfig.telemetry.device_update_interval = default_telemetry_broadcast_interval_secs;
|
||||
} else if (role == meshtastic_Config_DeviceConfig_Role_TAK_TRACKER) {
|
||||
owner.has_is_unmessagable = true;
|
||||
owner.is_unmessagable = true;
|
||||
@ -910,7 +914,11 @@ void NodeDB::installRoleDefaults(meshtastic_Config_DeviceConfig_Role role)
|
||||
void NodeDB::initModuleConfigIntervals()
|
||||
{
|
||||
// Zero out telemetry intervals so that they coalesce to defaults in Default.h
|
||||
moduleConfig.telemetry.device_update_interval = 0;
|
||||
#ifdef USERPREFS_CONFIG_DEVICE_TELEM_UPDATE_INTERVAL
|
||||
moduleConfig.telemetry.device_update_interval = USERPREFS_CONFIG_DEVICE_TELEM_UPDATE_INTERVAL;
|
||||
#else
|
||||
moduleConfig.telemetry.device_update_interval = UINT32_MAX;
|
||||
#endif
|
||||
moduleConfig.telemetry.environment_update_interval = 0;
|
||||
moduleConfig.telemetry.air_quality_interval = 0;
|
||||
moduleConfig.telemetry.power_update_interval = 0;
|
||||
|
@ -670,7 +670,8 @@ bool PhoneAPI::handleToRadioPacket(meshtastic_MeshPacket &p)
|
||||
meshtastic_QueueStatus qs = router->getQueueStatus();
|
||||
service->sendQueueStatusToPhone(qs, 0, p.id);
|
||||
return false;
|
||||
} else if (IS_ONE_OF(meshtastic_PortNum_POSITION_APP, meshtastic_PortNum_WAYPOINT_APP, meshtastic_PortNum_ALERT_APP) &&
|
||||
} else if (IS_ONE_OF(p.decoded.portnum, meshtastic_PortNum_POSITION_APP, meshtastic_PortNum_WAYPOINT_APP,
|
||||
meshtastic_PortNum_ALERT_APP, meshtastic_PortNum_TELEMETRY_APP) &&
|
||||
lastPortNumToRadio[p.decoded.portnum] &&
|
||||
Throttle::isWithinTimespanMs(lastPortNumToRadio[p.decoded.portnum], TEN_SECONDS_MS)) {
|
||||
// TODO: [Issue #6700] Make this rate limit throttling scale up / down with the preset
|
||||
@ -680,6 +681,13 @@ bool PhoneAPI::handleToRadioPacket(meshtastic_MeshPacket &p)
|
||||
// FIXME: Figure out why this continues to happen
|
||||
// sendNotification(meshtastic_LogRecord_Level_WARNING, p.id, "Position can only be sent once every 5 seconds");
|
||||
return false;
|
||||
} else if (p.decoded.portnum == meshtastic_PortNum_TEXT_MESSAGE_APP && lastPortNumToRadio[p.decoded.portnum] &&
|
||||
Throttle::isWithinTimespanMs(lastPortNumToRadio[p.decoded.portnum], TWO_SECONDS_MS)) {
|
||||
LOG_WARN("Rate limit portnum %d", p.decoded.portnum);
|
||||
meshtastic_QueueStatus qs = router->getQueueStatus();
|
||||
service->sendQueueStatusToPhone(qs, 0, p.id);
|
||||
sendNotification(meshtastic_LogRecord_Level_WARNING, p.id, "Text messages can only be sent once every 2 seconds");
|
||||
return false;
|
||||
}
|
||||
lastPortNumToRadio[p.decoded.portnum] = millis();
|
||||
service->handleToRadio(p);
|
||||
|
@ -11,7 +11,7 @@
|
||||
inline const std::unordered_map<std::string, std::string> configProducts = {{"MESHTOAD", "lora-usb-meshtoad-e22.yaml"},
|
||||
{"MESHSTICK", "lora-meshstick-1262.yaml"},
|
||||
{"MESHADV-PI", "lora-MeshAdv-900M30S.yaml"},
|
||||
{"MESHADV-MINI", "lora-MeshAdv-Mini-900M22S.yaml"},
|
||||
{"MeshAdv Mini", "lora-MeshAdv-Mini-900M22S.yaml"},
|
||||
{"POWERPI", "lora-MeshAdv-900M30S.yaml"}};
|
||||
|
||||
enum configNames {
|
||||
|
@ -31,6 +31,7 @@
|
||||
// "USERPREFS_CONFIG_SMART_POSITION_ENABLED": "false",
|
||||
// "USERPREFS_CONFIG_GPS_UPDATE_INTERVAL": "600",
|
||||
// "USERPREFS_CONFIG_POSITION_BROADCAST_INTERVAL": "1800",
|
||||
// "USERPREFS_CONFIG_DEVICE_TELEM_UPDATE_INTERVAL": "900", // Device telemetry update interval in seconds
|
||||
// "USERPREFS_LORACONFIG_CHANNEL_NUM": "31",
|
||||
// "USERPREFS_LORACONFIG_MODEM_PRESET": "meshtastic_Config_LoRaConfig_ModemPreset_SHORT_FAST",
|
||||
// "USERPREFS_USE_ADMIN_KEY_0": "{ 0xcd, 0xc0, 0xb4, 0x3c, 0x53, 0x24, 0xdf, 0x13, 0xca, 0x5a, 0xa6, 0x0c, 0x0d, 0xec, 0x85, 0x5a, 0x4c, 0xf6, 0x1a, 0x96, 0x04, 0x1a, 0x3e, 0xfc, 0xbb, 0x8e, 0x33, 0x71, 0xe5, 0xfc, 0xff, 0x3c }",
|
||||
|
@ -42,6 +42,8 @@ build_flags =
|
||||
-D LV_USE_LOG=0
|
||||
-D USE_LOG_DEBUG
|
||||
-D LOG_DEBUG_INC=\"DebugConfiguration.h\"
|
||||
-D LGFX_SCREEN_WIDTH=240
|
||||
-D LGFX_SCREEN_HEIGHT=320
|
||||
-D LGFX_DRIVER=LGFX_PICOMPUTER_S3
|
||||
-D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_PICOMPUTER_S3.h\"
|
||||
-D VIEW_320x240
|
||||
|
@ -53,6 +53,8 @@ build_flags =
|
||||
-D USE_LOG_DEBUG
|
||||
-D LOG_DEBUG_INC=\"DebugConfiguration.h\"
|
||||
-D CUSTOM_TOUCH_DRIVER
|
||||
-D LGFX_SCREEN_WIDTH=480
|
||||
-D LGFX_SCREEN_HEIGHT=480
|
||||
-D LGFX_DRIVER=LGFX_INDICATOR
|
||||
-D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_INDICATOR.h\"
|
||||
-D VIEW_320x240
|
||||
|
106
variants/seeed_wio_tracker_L1_eink/nicheGraphics.h
Normal file
106
variants/seeed_wio_tracker_L1_eink/nicheGraphics.h
Normal file
@ -0,0 +1,106 @@
|
||||
#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/Backlight/LatchingBacklight.h"
|
||||
#include "graphics/niche/Drivers/EInk/GDEY0213B74.h"
|
||||
#include "graphics/niche/Inputs/TwoButton.h"
|
||||
|
||||
// Special case - fix T-Echo's touch button
|
||||
// ----------------------------------------
|
||||
// On a handful of T-Echos, LoRa TX triggers the capacitive touch
|
||||
// To avoid this, we lockout the button during TX
|
||||
#include "mesh/RadioLibInterface.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::GDEY0213B74;
|
||||
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
|
||||
// Set how unhealthy additional FAST updates beyond this number are
|
||||
inkhud->setDisplayResilience(7, 1.5);
|
||||
|
||||
// Select fonts
|
||||
InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1252;
|
||||
InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252;
|
||||
|
||||
// Customize default settings
|
||||
inkhud->persistence->settings.userTiles.maxCount = 2; // Two applets side-by-side
|
||||
// 270 degrees clockwise
|
||||
inkhud->persistence->settings.optionalFeatures.batteryIcon = true; // Device definitely has a battery
|
||||
inkhud->persistence->settings.optionalMenuItems.backlight = true; // Until proves capacitive button works by touching it
|
||||
inkhud->persistence->settings.userTiles.count = 1; // One tile only by default, keep things simple for new users
|
||||
inkhud->persistence->settings.optionalMenuItems.nextTile = false; // Behavior handled by aux button instead
|
||||
|
||||
// Setup backlight controller
|
||||
// Note: AUX button attached further down
|
||||
Drivers::LatchingBacklight *backlight = Drivers::LatchingBacklight::getInstance();
|
||||
backlight->setPin(PIN_EINK_EN);
|
||||
|
||||
// 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
|
||||
|
||||
inkhud->persistence->settings.rotation = 1;
|
||||
// inkhud->persistence->printSettings(&inkhud->persistence->settings);
|
||||
// Start running InkHUD
|
||||
inkhud->begin();
|
||||
// inkhud->persistence->printSettings(&inkhud->persistence->settings);
|
||||
// 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
|
14
variants/seeed_wio_tracker_L1_eink/platformio.ini
Normal file
14
variants/seeed_wio_tracker_L1_eink/platformio.ini
Normal file
@ -0,0 +1,14 @@
|
||||
[env:seeed_wio_tracker_L1_eink]
|
||||
board = seeed_wio_tracker_L1
|
||||
extends = nrf52840_base, inkhud
|
||||
;board_level = extra
|
||||
build_flags = ${nrf52840_base.build_flags} ${inkhud.build_flags}
|
||||
-I $PROJECT_DIR/variants/seeed_wio_tracker_L1_eink
|
||||
-D SEEED_WIO_TRACKER_L1
|
||||
-Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52
|
||||
board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/seeed_wio_tracker_L1_eink> ${inkhud.build_src_filter}
|
||||
lib_deps =
|
||||
${inkhud.lib_deps}
|
||||
${nrf52840_base.lib_deps}
|
||||
debug_tool = jlink
|
103
variants/seeed_wio_tracker_L1_eink/variant.cpp
Normal file
103
variants/seeed_wio_tracker_L1_eink/variant.cpp
Normal file
@ -0,0 +1,103 @@
|
||||
/*
|
||||
* variant.cpp - Digital pin mapping for TRACKER L1
|
||||
*
|
||||
* This file defines the pin mapping array that maps logical digital pins (D0-D17)
|
||||
* to physical GPIO ports/pins on the Nordic nRF52 series microcontroller.
|
||||
*
|
||||
* Board: [Seeed Studio WIO TRACKER L1]
|
||||
* Hardware Features:
|
||||
* - LoRa module (CS/SCK/MISO/MOSI control pins)
|
||||
* - GNSS module (TX/RX/Reset/Wakeup)
|
||||
* - User LEDs (D11-D12)
|
||||
* - User button (D13)
|
||||
* - Grove/NFC interface (D14-D15)
|
||||
* - Battery voltage monitoring (D16)
|
||||
*
|
||||
* Created [20250521]
|
||||
* By [Dylan]
|
||||
*/
|
||||
|
||||
#include "variant.h"
|
||||
#include "nrf.h"
|
||||
#include "wiring_constants.h"
|
||||
#include "wiring_digital.h"
|
||||
|
||||
/**
|
||||
* @brief Digital pin to GPIO port/pin mapping table
|
||||
*
|
||||
* Format: Logical Pin (Dx) -> nRF Port.Pin (Px.xx)
|
||||
*
|
||||
*/
|
||||
|
||||
extern "C" {
|
||||
const uint32_t g_ADigitalPinMap[] = {
|
||||
// D0 .. D10 - Peripheral control pins
|
||||
41, // D0 P1.09 GNSS_WAKEUP
|
||||
7, // D1 P0.07 LORA_DIO1
|
||||
39, // D2 P1.07 LORA_RESET
|
||||
42, // D3 P1.10 LORA_BUSY
|
||||
46, // D4 P1.14 (A4/SDA) LORA_CS
|
||||
40, // D5 P1.08 (A5/SCL) LORA_SW
|
||||
27, // D6 P0.27 (UART_TX) GNSS_TX
|
||||
26, // D7 P0.26 (UART_RX) GNSS_RX
|
||||
30, // D8 P0.30 (SPI_SCK) LORA_SCK
|
||||
3, // D9 P0.3 (SPI_MISO) LORA_MISO
|
||||
28, // D10 P0.28 (SPI_MOSI) LORA_MOSI
|
||||
|
||||
// D11-D12 - LED outputs
|
||||
33, // D11 P1.1 User LED
|
||||
// Buzzer
|
||||
32, // D12 P1.0 Buzzer
|
||||
|
||||
// D13 - User input
|
||||
8, // D13 P0.08 User Button
|
||||
|
||||
// D14-D15 - Grove interface
|
||||
6, // D14 P0.06 OLED SDA
|
||||
5, // D15 P0.05 OLED SCL
|
||||
|
||||
// D16 - Battery voltage ADC input
|
||||
31, // D16 P0.31 VBAT_ADC
|
||||
// GROVE
|
||||
43, // D17 P0.00 GROVESDA
|
||||
44, // D18 P0.01 GROVESCL
|
||||
|
||||
// FLASH
|
||||
21, // D19 P0.21 (QSPI_SCK)
|
||||
25, // D20 P0.25 (QSPI_CSN)
|
||||
20, // D21 P0.20 (QSPI_SIO_0 DI)
|
||||
24, // D22 P0.24 (QSPI_SIO_1 DO)
|
||||
22, // D23 P0.22 (QSPI_SIO_2 WP)
|
||||
23, // D24 P0.23 (QSPI_SIO_3 HOLD)
|
||||
|
||||
36, // D25 TB_UP
|
||||
12, // D26 TB_DOWN
|
||||
11, // D27 TB_LEFT
|
||||
35, // D28 TB_RIGHT
|
||||
37, // D29 TB_PRESS
|
||||
4, // D30 BAT_CTL
|
||||
|
||||
13, // D31 EINK_SCK
|
||||
14, // D32 EINK_RST
|
||||
15, // D33 EINK_MOSI
|
||||
16, // D34 EINK_DC
|
||||
17, // D35 EINK_BUSY
|
||||
19, // D36 EINK_CS
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
void initVariant()
|
||||
{
|
||||
pinMode(PIN_QSPI_CS, OUTPUT);
|
||||
digitalWrite(PIN_QSPI_CS, HIGH);
|
||||
// This setup is crucial for ensuring low power consumption and proper initialization of the hardware components.
|
||||
// VBAT_ENABLE
|
||||
pinMode(BAT_READ, OUTPUT);
|
||||
digitalWrite(BAT_READ, HIGH);
|
||||
|
||||
pinMode(PIN_LED1, OUTPUT);
|
||||
digitalWrite(PIN_LED1, LOW);
|
||||
pinMode(PIN_LED2, OUTPUT);
|
||||
digitalWrite(PIN_LED2, LOW);
|
||||
}
|
194
variants/seeed_wio_tracker_L1_eink/variant.h
Normal file
194
variants/seeed_wio_tracker_L1_eink/variant.h
Normal file
@ -0,0 +1,194 @@
|
||||
#ifndef _SEEED_TRACKER_L1_H_
|
||||
#define _SEEED_TRACKER_L1_H_
|
||||
#include "WVariant.h"
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// Clock Configuration
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
#define VARIANT_MCK (64000000ul) // Master clock frequency
|
||||
#define USE_LFXO // 32.768kHz crystal for LFCLK
|
||||
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// Pin Capacity Definitions
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
#define PINS_COUNT (38u) // Total GPIO pins
|
||||
#define NUM_DIGITAL_PINS (38u) // Digital I/O pins
|
||||
#define NUM_ANALOG_INPUTS (8u) // Analog inputs (A0-A5 + VBAT + AREF)
|
||||
#define NUM_ANALOG_OUTPUTS (0u)
|
||||
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// LED Configuration
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// LEDs
|
||||
// LEDs
|
||||
#define PIN_LED1 (11) // LED P1.15
|
||||
#define PIN_LED2 (12) //
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
#define LED_BLUE PIN_LED2
|
||||
// #define LED_PIN PIN_LED2
|
||||
#define LED_STATE_ON 1 // State when LED is litted
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// Button Configuration
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
#ifdef BUTTON_PIN
|
||||
#undef BUTTON_PIN
|
||||
#endif
|
||||
|
||||
#define BUTTON_PIN D13 // This is the Program Button
|
||||
// #define BUTTON_NEED_PULLUP 1
|
||||
#define BUTTON_ACTIVE_LOW true
|
||||
#define BUTTON_ACTIVE_PULLUP false
|
||||
|
||||
#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
|
||||
#define D3 3 // P1.10 LORA_BUSY
|
||||
#define D4 4 // P1.14 LORA_CS
|
||||
#define D5 5 // P1.08 LORA_SW
|
||||
#define D6 6 // P0.27 GNSS_TX
|
||||
#define D7 7 // P0.26 GNSS_RX
|
||||
#define D8 8 // P0.30 SPI_SCK
|
||||
#define D9 9 // P0.03 SPI_MISO
|
||||
#define D10 10 // P0.28 SPI_MOSI
|
||||
#define D12 12 // P1.00 Buzzer
|
||||
#define D13 13 // P0.08 User Button
|
||||
#define D14 14 // P0.05 OLED SCL
|
||||
#define D15 15 // P0.06 OLED SDA
|
||||
#define D16 16 // P0.31 VBAT_ADC
|
||||
#define D17 17 // P0.00 GROVE SDA
|
||||
#define D18 18 // P0.01 GROVE_SCL
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// Analog Pin Definitions
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
#define PIN_A0 0 // P0.02 Analog Input 0
|
||||
#define PIN_A1 1 // P0.03 Analog Input 1
|
||||
#define PIN_A2 2 // P0.28 Analog Input 2
|
||||
#define PIN_A3 3 // P0.29 Analog Input 3
|
||||
#define PIN_A4 4 // P0.04 Analog Input 4
|
||||
#define PIN_A5 5 // P0.05 Analog Input 5
|
||||
#define PIN_VBAT D16 // P0.31 Battery voltage sense
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// Communication Interfaces
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// I2C Configuration
|
||||
#define HAS_WIRE 1
|
||||
#define PIN_WIRE_SDA D18 // P0.09
|
||||
#define PIN_WIRE_SCL D17 // P0.10
|
||||
#define WIRE_INTERFACES_COUNT 1
|
||||
|
||||
static const uint8_t SDA = PIN_WIRE_SDA;
|
||||
static const uint8_t SCL = PIN_WIRE_SCL;
|
||||
|
||||
// SPI Configuration (SX1262)
|
||||
|
||||
// #define SPI_INTERFACES_COUNT 1
|
||||
#define PIN_SPI_MISO 9 // P0.03 (D9)
|
||||
#define PIN_SPI_MOSI 10 // P0.28 (D10)
|
||||
#define PIN_SPI_SCK 8 // P0.30 (D8)
|
||||
|
||||
// SX1262 LoRa Module Pins
|
||||
#define USE_SX1262
|
||||
#define SX126X_CS D4 // Chip select
|
||||
#define SX126X_DIO1 D1 // Digital IO 1 (Interrupt)
|
||||
#define SX126X_BUSY D3 // Busy status
|
||||
#define SX126X_RESET D2 // Reset control
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8 // TCXO supply voltage
|
||||
#define SX126X_RXEN D5 // RX enable control
|
||||
#define SX126X_TXEN RADIOLIB_NC
|
||||
#define SX126X_DIO2_AS_RF_SWITCH // This Line is really necessary for SX1262 to work with RF switch or will loss TX power
|
||||
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// EINK
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
#define SPI_INTERFACES_COUNT 2
|
||||
#define PIN_EINK_CS 36
|
||||
#define PIN_EINK_BUSY 35
|
||||
#define PIN_EINK_DC 34
|
||||
#define PIN_EINK_RES 32
|
||||
#define PIN_EINK_SCLK 31
|
||||
#define PIN_EINK_MOSI 33
|
||||
#define PIN_EINK_EN 14 // unused
|
||||
#define PIN_SPI1_MISO 15 // unused
|
||||
#define PIN_SPI1_MOSI PIN_EINK_MOSI
|
||||
#define PIN_SPI1_SCK PIN_EINK_SCLK
|
||||
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// Power Management
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
#define BAT_READ 30 // D30 = P0.04 Reads battery voltage from divider on signal board.
|
||||
#define BATTERY_SENSE_RESOLUTION_BITS 12
|
||||
#define ADC_MULTIPLIER 2.0
|
||||
#define BATTERY_PIN PIN_VBAT // PIN_A7
|
||||
#define AREF_VOLTAGE 3.6
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// GPS L76KB
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
#define GPS_L76K
|
||||
#ifdef GPS_L76K
|
||||
#define PIN_GPS_RX D6 // P0.26
|
||||
#define PIN_GPS_TX D7
|
||||
#define HAS_GPS 1
|
||||
#define GPS_BAUDRATE 9600
|
||||
#define GPS_THREAD_INTERVAL 50
|
||||
#define PIN_SERIAL1_RX PIN_GPS_TX
|
||||
#define PIN_SERIAL1_TX PIN_GPS_RX
|
||||
|
||||
#define GPS_RX_PIN PIN_GPS_TX
|
||||
#define GPS_TX_PIN PIN_GPS_RX
|
||||
#define PIN_GPS_STANDBY D0
|
||||
|
||||
// #define GPS_DEBUG
|
||||
// #define GPS_EN D18 // P1.05
|
||||
#endif
|
||||
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// On-board QSPI Flash
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// On-board QSPI Flash
|
||||
#define PIN_QSPI_SCK (21)
|
||||
#define PIN_QSPI_CS (22)
|
||||
#define PIN_QSPI_IO0 (23)
|
||||
#define PIN_QSPI_IO1 (24)
|
||||
#define PIN_QSPI_IO2 (25)
|
||||
#define PIN_QSPI_IO3 (26)
|
||||
|
||||
#define EXTERNAL_FLASH_DEVICES P25Q16H
|
||||
#define EXTERNAL_FLASH_USE_QSPI
|
||||
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// Buzzer
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// Buzzer
|
||||
|
||||
#define PIN_BUZZER D12 // P1.00, pwm output
|
||||
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// joystick
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
#define CANNED_MESSAGE_MODULE_ENABLE 1
|
||||
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// Compatibility Definitions
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
// Serial port placeholders
|
||||
|
||||
#define PIN_SERIAL2_RX (-1)
|
||||
#define PIN_SERIAL2_TX (-1)
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _SEEED_TRACKER_L1_H_
|
@ -51,7 +51,9 @@ build_flags =
|
||||
-D RADIOLIB_DEBUG_SPI=0
|
||||
-D RADIOLIB_DEBUG_PROTOCOL=0
|
||||
-D RADIOLIB_SPI_PARANOID=0
|
||||
-D CALIBRATE_TOUCH=0
|
||||
; -D CALIBRATE_TOUCH=0
|
||||
-D LGFX_SCREEN_WIDTH=240
|
||||
-D LGFX_SCREEN_HEIGHT=320
|
||||
-D LGFX_DRIVER=LGFX_TDECK
|
||||
-D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_T_DECK.h\"
|
||||
; -D LVGL_DRIVER=LVGL_TDECK
|
||||
|
@ -54,6 +54,8 @@ build_flags =
|
||||
-D LV_USE_LOG=0
|
||||
-D USE_LOG_DEBUG
|
||||
-D LOG_DEBUG_INC=\"DebugConfiguration.h\"
|
||||
-D LGFX_SCREEN_WIDTH=320
|
||||
-D LGFX_SCREEN_HEIGHT=480
|
||||
-D LGFX_DRIVER=LGFX_UNPHONE_V9
|
||||
-D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_UNPHONE.h\"
|
||||
-D VIEW_320x240
|
||||
|
Loading…
Reference in New Issue
Block a user