mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-07 10:27:43 +00:00
Merge branch 'master' into moar-nxp
This commit is contained in:
@@ -3,7 +3,6 @@ board_level = extra
|
||||
extends = nrf52840_base
|
||||
board = nordic_pca10059
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/Dongle_nRF52840-pca10059-v1 -D NORDIC_PCA10059
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_420_M01
|
||||
-DEINK_WIDTH=300
|
||||
-DEINK_HEIGHT=400
|
||||
|
||||
118
variants/ELECROW-ThinkNode-M1/nicheGraphics.h
Normal file
118
variants/ELECROW-ThinkNode-M1/nicheGraphics.h
Normal file
@@ -0,0 +1,118 @@
|
||||
#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/GDEY0154D67.h"
|
||||
#include "graphics/niche/Inputs/TwoButton.h"
|
||||
|
||||
// Button feedback
|
||||
#include "buzz.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::GDEY0154D67;
|
||||
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
|
||||
// Todo: observe the display's performance in-person and adjust accordingly.
|
||||
// Currently set to the values given by Elecrow for EInkDynamicDisplay.
|
||||
inkhud->setDisplayResilience(10, 1.5);
|
||||
|
||||
// Select fonts
|
||||
InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252;
|
||||
InkHUD::Applet::fontMedium = FREESANS_9PT_WIN1252;
|
||||
InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252;
|
||||
|
||||
// Customize default settings
|
||||
inkhud->persistence->settings.userTiles.maxCount = 2; // Two applets side-by-side
|
||||
inkhud->persistence->settings.optionalFeatures.batteryIcon = true; // Device definitely has a battery
|
||||
|
||||
// Setup backlight controller
|
||||
// Note: button is 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
|
||||
|
||||
// Start running InkHUD
|
||||
inkhud->begin();
|
||||
|
||||
// Buttons
|
||||
// --------------------------
|
||||
|
||||
Inputs::TwoButton *buttons = Inputs::TwoButton::getInstance(); // Shared NicheGraphics component
|
||||
|
||||
// Elecrow diagram: https://www.elecrow.com/download/product/CIL12901M/ThinkNode-M1_User_Manual.pdf
|
||||
|
||||
// #0: Main User Button
|
||||
// Labeled "Page Turn Button" by manual
|
||||
buttons->setWiring(0, PIN_BUTTON2);
|
||||
buttons->setTiming(0, 50, 500); // Todo: confirm 50ms is adequate debounce
|
||||
buttons->setHandlerShortPress(0, [inkhud]() { inkhud->shortpress(); });
|
||||
buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); });
|
||||
|
||||
// #1: Aux Button
|
||||
// Labeled "Function Button" by manual
|
||||
// Todo: additional features
|
||||
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();
|
||||
playBoop();
|
||||
});
|
||||
buttons->setHandlerShortPress(1, [backlight]() {
|
||||
backlight->off();
|
||||
playChirp();
|
||||
});
|
||||
|
||||
// Begin handling button events
|
||||
buttons->start();
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -9,7 +9,7 @@ debug_tool = jlink
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/ELECROW-ThinkNode-M1
|
||||
-DELECROW_ThinkNode_M1
|
||||
-DGPS_POWER_TOGGLE
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-DUSE_EINK
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_154_D67
|
||||
-DEINK_WIDTH=200
|
||||
-DEINK_HEIGHT=200
|
||||
@@ -26,4 +26,22 @@ lib_deps =
|
||||
https://github.com/meshtastic/GxEPD2/archive/33db3fa8ee6fc47d160bdb44f8f127c9a9203a10.zip
|
||||
lewisxhe/PCF8563_Library@^1.0.1
|
||||
khoih-prog/nRF52_PWM@^1.0.1
|
||||
;upload_protocol = fs
|
||||
;upload_protocol = fs
|
||||
|
||||
[env:thinknode_m1-inkhud]
|
||||
extends = nrf52840_base, inkhud
|
||||
board = ThinkNode-M1
|
||||
board_check = true
|
||||
debug_tool = jlink
|
||||
build_flags =
|
||||
${nrf52840_base.build_flags}
|
||||
${inkhud.build_flags}
|
||||
-I variants/ELECROW-ThinkNode-M1
|
||||
-D ELECROW_ThinkNode_M1
|
||||
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
|
||||
@@ -41,16 +41,15 @@ extern "C" {
|
||||
#define NUM_ANALOG_INPUTS (1)
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
#define PIN_LED1 -1
|
||||
#define PIN_LED2 -1
|
||||
#define PIN_LED3 -1
|
||||
|
||||
// LED
|
||||
#define POWER_LED (32 + 6) // red
|
||||
#define PIN_LED1 (32 + 6) // red
|
||||
#define LED_POWER (32 + 4)
|
||||
#define USER_LED (0 + 13) // green
|
||||
// USB_CHECK
|
||||
#define USB_CHECK (32 + 3)
|
||||
#define EXT_PWR_DETECT (32 + 3)
|
||||
#define ADC_V (0 + 8)
|
||||
|
||||
#define LED_RED PIN_LED3
|
||||
@@ -59,11 +58,14 @@ extern "C" {
|
||||
#define LED_BUILTIN LED_BLUE
|
||||
#define LED_CONN PIN_GREEN
|
||||
#define LED_STATE_ON 0 // State when LED is lit // LED灯亮时的状态
|
||||
#define M1_buzzer (0 + 6)
|
||||
#define PIN_BUZZER (0 + 6)
|
||||
/*
|
||||
* Buttons
|
||||
*/
|
||||
#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)
|
||||
@@ -82,6 +84,7 @@ extern "C" {
|
||||
static const uint8_t A0 = PIN_A0;
|
||||
|
||||
#define ADC_RESOLUTION 14
|
||||
#define BATTERY_SENSE_SAMPLES 30
|
||||
|
||||
#define PIN_NFC1 (9)
|
||||
#define PIN_NFC2 (10)
|
||||
@@ -140,8 +143,6 @@ External serial flash WP25R1635FZUIL0
|
||||
// Controls power for all peripherals (eink + GPS + LoRa + Sensor)
|
||||
#define PIN_POWER_EN (0 + 12)
|
||||
|
||||
#define USE_EINK
|
||||
|
||||
#define PIN_SPI1_MISO (32 + 7)
|
||||
#define PIN_SPI1_MOSI PIN_EINK_MOSI
|
||||
#define PIN_SPI1_SCK PIN_EINK_SCLK
|
||||
@@ -161,7 +162,7 @@ External serial flash WP25R1635FZUIL0
|
||||
|
||||
#define GPS_THREAD_INTERVAL 50
|
||||
|
||||
#define PIN_GPS_PPS (32 + 1) // GPS开关判断
|
||||
#define PIN_GPS_SWITCH (32 + 1) // GPS开关判断
|
||||
|
||||
#define PIN_SERIAL1_RX GPS_TX_PIN
|
||||
#define PIN_SERIAL1_TX GPS_RX_PIN
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
// Status
|
||||
#define LED_PIN_POWER 1
|
||||
#define BIAS_T_ENABLE LED_PIN_POWER
|
||||
#define BIAS_T_VALUE HIGH
|
||||
#define LED_PIN 1
|
||||
|
||||
#define PIN_BUTTON1 47 // 功能键
|
||||
#define PIN_BUTTON2 4 // 电源键
|
||||
#define ALT_BUTTON_PIN PIN_BUTTON2
|
||||
#define ALT_BUTTON_ACTIVE_LOW false
|
||||
#define ALT_BUTTON_ACTIVE_PULLUP false
|
||||
|
||||
#define POWER_CFG
|
||||
#define POWER_CHRG 6
|
||||
#define POWER_FULL 42
|
||||
#define LED_POWER 6
|
||||
#define ADC_V 42
|
||||
// USB_CHECK
|
||||
#define EXT_PWR_DETECT 7
|
||||
|
||||
#define PIN_BUZZER 5
|
||||
|
||||
@@ -61,4 +63,3 @@
|
||||
#define HAS_GPS 0
|
||||
|
||||
#define BUTTON_PIN PIN_BUTTON1
|
||||
#define BUTTON_PIN_ALT PIN_BUTTON2
|
||||
|
||||
@@ -4,7 +4,6 @@ board = me25ls01-4y10td
|
||||
board_level = extra
|
||||
; platform = https://github.com/maxgerhardt/platform-nordicnrf52#cac6fcf943a41accd2aeb4f3659ae297a73f422e
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/ME25LS01-4Y10TD -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DME25LS01_4Y10TD
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||
board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/ME25LS01-4Y10TD>
|
||||
|
||||
@@ -4,7 +4,6 @@ board = me25ls01-4y10td
|
||||
board_level = extra
|
||||
; platform = https://github.com/maxgerhardt/platform-nordicnrf52#cac6fcf943a41accd2aeb4f3659ae297a73f422e
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/ME25LS01-4Y10TD_e-ink -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DME25LS01_4Y10TD
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_420_GDEY042T81
|
||||
-DEINK_WIDTH=400
|
||||
|
||||
@@ -4,7 +4,6 @@ board = ms24sf1
|
||||
board_level = extra
|
||||
; platform = https://github.com/maxgerhardt/platform-nordicnrf52#cac6fcf943a41accd2aeb4f3659ae297a73f422e
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/MS24SF1 -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||
board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/MS24SF1>
|
||||
|
||||
@@ -3,7 +3,6 @@ board_level = extra
|
||||
extends = nrf52840_base
|
||||
board = nordic_pca10059
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/MakePython_nRF52840_eink -D PRIVATE_HW
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-D PIN_EINK_EN
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_290_T5D
|
||||
-DEINK_WIDTH=296
|
||||
|
||||
@@ -3,7 +3,6 @@ board_level = extra
|
||||
extends = nrf52840_base
|
||||
board = nordic_pca10059
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/MakePython_nRF52840_oled -D PRIVATE_HW
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/MakePython_nRF52840_oled>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
|
||||
@@ -6,7 +6,6 @@ debug_tool = jlink
|
||||
|
||||
# add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling.
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/canaryone
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/canaryone>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
|
||||
@@ -11,7 +11,7 @@ board = esp32-s3-devkitc-1
|
||||
board_level = extra
|
||||
upload_protocol = esptool
|
||||
build_flags =
|
||||
${esp32_base.build_flags} -D CROWPANEL_ESP32S3_5_EPAPER -I variants/crowpanel-esp32s3-5-epaper
|
||||
${esp32s3_base.build_flags} -D CROWPANEL_ESP32S3_5_EPAPER -I variants/crowpanel-esp32s3-5-epaper
|
||||
-D PRIVATE_HW
|
||||
-DBOARD_HAS_PSRAM
|
||||
-DGPS_POWER_TOGGLE
|
||||
@@ -39,7 +39,7 @@ board = esp32-s3-devkitc-1
|
||||
board_level = extra
|
||||
upload_protocol = esptool
|
||||
build_flags =
|
||||
${esp32_base.build_flags} -D CROWPANEL_ESP32S3_4_EPAPER -I variants/crowpanel-esp32s3-5-epaper
|
||||
${esp32s3_base.build_flags} -D CROWPANEL_ESP32S3_4_EPAPER -I variants/crowpanel-esp32s3-5-epaper
|
||||
-D PRIVATE_HW
|
||||
-DBOARD_HAS_PSRAM
|
||||
-DGPS_POWER_TOGGLE
|
||||
@@ -67,7 +67,7 @@ board = esp32-s3-devkitc-1
|
||||
board_level = extra
|
||||
upload_protocol = esptool
|
||||
build_flags =
|
||||
${esp32_base.build_flags} -D CROWPANEL_ESP32S3_2_EPAPER -I variants/crowpanel-esp32s3-5-epaper
|
||||
${esp32s3_base.build_flags} -D CROWPANEL_ESP32S3_2_EPAPER -I variants/crowpanel-esp32s3-5-epaper
|
||||
-D PRIVATE_HW
|
||||
-DBOARD_HAS_PSRAM
|
||||
-DGPS_POWER_TOGGLE
|
||||
|
||||
24
variants/diy/esp32c3_super_mini/pins_arduino.h
Normal file
24
variants/diy/esp32c3_super_mini/pins_arduino.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
static const uint8_t TX = 21;
|
||||
static const uint8_t RX = 20;
|
||||
|
||||
static const uint8_t SDA = 1;
|
||||
static const uint8_t SCL = 0;
|
||||
|
||||
static const uint8_t SS = 8;
|
||||
static const uint8_t MOSI = 7;
|
||||
static const uint8_t MISO = 6;
|
||||
static const uint8_t SCK = 10;
|
||||
|
||||
static const uint8_t A0 = 0;
|
||||
static const uint8_t A1 = 1;
|
||||
static const uint8_t A2 = 2;
|
||||
static const uint8_t A3 = 3;
|
||||
static const uint8_t A4 = 4;
|
||||
static const uint8_t A5 = 5;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
61
variants/diy/esp32c3_super_mini/variant.h
Normal file
61
variants/diy/esp32c3_super_mini/variant.h
Normal file
@@ -0,0 +1,61 @@
|
||||
#ifndef _VARIANT_ESP32C3_SUPER_MINI_
|
||||
#define _VARIANT_ESP32C3_SUPER_MINI_
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Headers
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
// I2C (Wire) & OLED
|
||||
#define WIRE_INTERFACES_COUNT (1)
|
||||
#define I2C_SDA (1)
|
||||
#define I2C_SCL (0)
|
||||
|
||||
#define USE_SSD1306
|
||||
|
||||
// GPS
|
||||
#undef GPS_RX_PIN
|
||||
#undef GPS_TX_PIN
|
||||
#define GPS_RX_PIN (20)
|
||||
#define GPS_TX_PIN (21)
|
||||
|
||||
// Button
|
||||
#define BUTTON_PIN (9) // BOOT button
|
||||
|
||||
// LoRa
|
||||
#define USE_LLCC68
|
||||
#define USE_SX1262
|
||||
// #define USE_RF95
|
||||
#define USE_SX1268
|
||||
|
||||
#define LORA_DIO0 RADIOLIB_NC
|
||||
#define LORA_RESET (5)
|
||||
#define LORA_DIO1 (3)
|
||||
#define LORA_RXEN (2)
|
||||
#define LORA_BUSY (4)
|
||||
#define LORA_SCK (10)
|
||||
#define LORA_MISO (6)
|
||||
#define LORA_MOSI (7)
|
||||
#define LORA_CS (8)
|
||||
|
||||
#define SX126X_CS LORA_CS
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_BUSY
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_RXEN LORA_RXEN
|
||||
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE (1.8)
|
||||
#define TCXO_OPTIONAL // make it so that the firmware can try both TCXO and XTAL
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
@@ -8,7 +8,9 @@
|
||||
#define PIN_GPS_EN 4
|
||||
#define GPS_POWER_TOGGLE // Moved definition from platformio.ini to here
|
||||
|
||||
#define BUTTON_PIN 39 // The middle button GPIO on the T-Beam
|
||||
#define BUTTON_PIN 39 // The middle button GPIO on the T-Beam
|
||||
// Note: On the ESP32 base version, gpio34-39 are input-only, and do not have internal pull-ups.
|
||||
// If 39 is not being used for a button, it is suggested to remove the #define.
|
||||
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||
#define ADC_CHANNEL ADC1_GPIO35_CHANNEL
|
||||
#define ADC_MULTIPLIER 1.85 // (R1 = 470k, R2 = 680k)
|
||||
@@ -34,8 +36,12 @@
|
||||
#define SX126X_TXEN 13 // Schematic connects EBYTE module's TXEN pin to MCU
|
||||
#define SX126X_RXEN 14 // Schematic connects EBYTE module's RXEN pin to MCU
|
||||
|
||||
#define LORA_CS SX126X_CS // Compatibility with variant file configuration structure
|
||||
#define LORA_SCK SX126X_SCK // Compatibility with variant file configuration structure
|
||||
#define LORA_MOSI SX126X_MOSI // Compatibility with variant file configuration structure
|
||||
#define LORA_MISO SX126X_MISO // Compatibility with variant file configuration structure
|
||||
#define LORA_DIO1 SX126X_DIO1 // Compatibility with variant file configuration structure
|
||||
#define LORA_CS SX126X_CS // Compatibility with variant file configuration structure
|
||||
#define LORA_SCK SX126X_SCK // Compatibility with variant file configuration structure
|
||||
#define LORA_MOSI SX126X_MOSI // Compatibility with variant file configuration structure
|
||||
#define LORA_MISO SX126X_MISO // Compatibility with variant file configuration structure
|
||||
#define LORA_DIO1 SX126X_DIO1 // Compatibility with variant file configuration structure
|
||||
#define LORA_TXEN SX126X_TXEN // Compatibility with variant file configuration structure
|
||||
#define LORA_RXEN SX126X_RXEN // Compatibility with variant file configuration structure
|
||||
#define LORA_RESET SX126X_RESET // Compatibility with variant file configuration structure
|
||||
#define LORA_DIO2 SX126X_BUSY // Compatibility with variant file configuration structure
|
||||
62
variants/diy/nrf52_promicro_diy_tcxo/custom_build_tasks.py
Normal file
62
variants/diy/nrf52_promicro_diy_tcxo/custom_build_tasks.py
Normal 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"))
|
||||
95
variants/diy/nrf52_promicro_diy_tcxo/nicheGraphics.h
Normal file
95
variants/diy/nrf52_promicro_diy_tcxo/nicheGraphics.h
Normal 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)
|
||||
#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
|
||||
|
||||
// Select fonts
|
||||
InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252;
|
||||
InkHUD::Applet::fontMedium = 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
|
||||
@@ -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
|
||||
|
||||
@@ -50,7 +50,6 @@ board_level = extra
|
||||
build_flags = ${nrf52840_base.build_flags}
|
||||
-I variants/diy/nrf52_promicro_diy_xtal
|
||||
-D NRF52_PROMICRO_DIY
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/diy/nrf52_promicro_diy_xtal>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
@@ -64,12 +63,53 @@ board = promicro-nrf52840
|
||||
build_flags = ${nrf52840_base.build_flags}
|
||||
-I variants/diy/nrf52_promicro_diy_tcxo
|
||||
-D NRF52_PROMICRO_DIY
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/diy/nrf52_promicro_diy_tcxo>
|
||||
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 + EBYTE E22-900M30S - Pinout matching Wio-SX1262 (SKU 113010003)
|
||||
[env:seeed_xiao_nrf52840_e22_900m30s]
|
||||
extends = env:seeed_xiao_nrf52840_kit
|
||||
board_level = extra
|
||||
build_flags = ${env:seeed_xiao_nrf52840_kit.build_flags} -D PRIVATE_HW -DEBYTE_E22 -DEBYTE_E22_900M30S
|
||||
build_unflags = -DGPS_L76K
|
||||
|
||||
; Seeed XIAO nRF52840 + EBYTE E22-900M33S - Pinout matching Wio-SX1262 (SKU 113010003)
|
||||
[env:seeed_xiao_nrf52840_e22_900m33s]
|
||||
extends = env:seeed_xiao_nrf52840_kit
|
||||
board_level = extra
|
||||
build_flags = ${env:seeed_xiao_nrf52840_kit.build_flags} -D PRIVATE_HW -DEBYTE_E22 -DEBYTE_E22_900M33S
|
||||
build_unflags = -DGPS_L76K
|
||||
|
||||
; Seeed XIAO nRF52840 + XIAO Wio SX1262 DIY
|
||||
[env:seeed-xiao-nrf52840-wio-sx1262]
|
||||
board = xiao_ble_sense
|
||||
@@ -77,7 +117,6 @@ extends = nrf52840_base
|
||||
board_level = extra
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/diy/seeed-xiao-nrf52840-wio-sx1262 -D PRIVATE_HW
|
||||
-Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/diy/seeed-xiao-nrf52840-wio-sx1262>
|
||||
lib_deps =
|
||||
@@ -102,3 +141,16 @@ build_flags =
|
||||
-D ARDUINO_USB_MODE=0
|
||||
-D ARDUINO_USB_CDC_ON_BOOT=1
|
||||
-I variants/diy/t-energy-s3_e22
|
||||
|
||||
; ESP32 C3 Super Mini Development Board
|
||||
; https://www.espboards.dev/esp32/esp32-c3-super-mini/
|
||||
[env:esp32c3_super_mini]
|
||||
extends = esp32c3_base
|
||||
board = esp32-c3-devkitm-1
|
||||
build_flags =
|
||||
${esp32_base.build_flags}
|
||||
-D PRIVATE_HW
|
||||
-I variants/diy/esp32c3_super_mini
|
||||
-D ARDUINO_USB_MODE=1
|
||||
-D ARDUINO_USB_CDC_ON_BOOT=1
|
||||
board_level = extra
|
||||
|
||||
@@ -52,4 +52,11 @@ const uint32_t g_ADigitalPinMap[] = {
|
||||
|
||||
// VBAT
|
||||
31, // D32 is P0.10 (VBAT)
|
||||
};
|
||||
};
|
||||
|
||||
void initVariant()
|
||||
{
|
||||
// Set BQ25101 ISET to 100mA instead of 50mA
|
||||
pinMode(HICHG, OUTPUT);
|
||||
digitalWrite(HICHG, LOW);
|
||||
}
|
||||
|
||||
@@ -164,7 +164,8 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
||||
// -------
|
||||
// P0_14 = 14 Reads battery voltage from divider on signal board.
|
||||
// PIN_VBAT is reading voltage divider on XIAO and is program pin 32 / or P0.31
|
||||
#define BAT_READ 14
|
||||
#define ADC_CTRL VBAT_ENABLE
|
||||
#define ADC_CTRL_ENABLED LOW
|
||||
#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
|
||||
|
||||
@@ -53,4 +53,5 @@
|
||||
// Internally the TTGO module hooks the SX126x-DIO2 in to control the TX/RX switch
|
||||
// (which is the default for the sx1262interface code)
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#define TCXO_OPTIONAL // make it so that the firmware can try both TCXO and XTAL
|
||||
#endif
|
||||
|
||||
@@ -54,4 +54,5 @@
|
||||
// Internally the TTGO module hooks the SX126x-DIO2 in to control the TX/RX switch
|
||||
// (which is the default for the sx1262interface code)
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#define TCXO_OPTIONAL // make it so that the firmware can try both TCXO and XTAL
|
||||
#endif
|
||||
|
||||
168
variants/diy/xiao_ble/README.md
Normal file
168
variants/diy/xiao_ble/README.md
Normal file
@@ -0,0 +1,168 @@
|
||||
# XIAO nrf52840/nrf52840 Sense + Ebyte E22-900M30S
|
||||
|
||||
_A step-by-step guide for macOS and Linux._
|
||||
|
||||
## Introduction
|
||||
|
||||
This guide will walk you through everything needed to get the XIAO nrf52840 (or XIAO nrf52840 Sense) running Meshtastic using an Ebyte E22-900M30S LoRa module. The combination of the E22 with an nRF52840 MCU is desirable because it allows for both very low idle (Rx) power draw _and_ high transmit power.
|
||||
|
||||
The XIAO nrf52840 is a small but surprisingly well-appointed nRF52840 board, with enough GPIO for most Meshtastic applications and a built-in LiPo charger.
|
||||
|
||||
The E22, on the other hand, is a famously inscrutable and mysterious beast. It is one of the more readily available LoRa modules capable of transmitting at 30 dBm, and includes an LNA to boost its Rx sensitivity a few dB beyond that of the SX1262.
|
||||
|
||||
However, its documentation is relatively sparse overall, and seems to merely hint at (or completely omit) several key details regarding its functionality. Thus, much of what follows is a synthesis of my observations and inferences over the course of many hours of trial and error.
|
||||
|
||||
### Acknowledgement and Friendly Disclaimer
|
||||
|
||||
Huge thanks to those in the community who have forged the way with the E22, without whose hard work none of this would have been possible! (thebentern, riddick, rainer_vie, beegee-tokyo, geeksville, caveman99, Der_Bear, PlumRugOfDoom, BigCorvus, and many others.)
|
||||
|
||||
Please take the conclusions here as a tentative work in progress, representing my current (and fairly limited) understanding of the E22 when paired with this particular MCU. It is my hope that this guide will be helpful to others who are interested in trying a DIY Meshtastic build, and also be subject to revision by folks with more experience and better test equipment.
|
||||
|
||||
### Obligatory Liability Disclaimer
|
||||
|
||||
This guide and all associated content is for informational purposes only. The information presented is intended for consumption only by persons having appropriate technical skill and judgement, to be used entirely at their own discretion and risk. The authors of this guide in no way provide any warranty, express or implied, toward the content herein, nor its correctness, safety, or suitability to any particular purpose. By following the instructions in this guide in part or in full, you assume all responsibility for all potential risks, including but not limited to fire, property damage, bodily injury, and death.
|
||||
|
||||
## 1. Wire the board
|
||||
|
||||
Connecting the E22 to the XIAO nrf52840 is straightforward, but there are a few gotchas to be mindful of.
|
||||
|
||||
### On the XIAO nrf52840
|
||||
|
||||
- Pins D4 and D5 are currently mapped to `PIN_WIRE_SDA` and `PIN_WIRE_SCL`, respectively. If you are not using I²C and would like to free up pins D4 and D5 for use as GPIO, `PIN_WIRE_SDA` and `PIN_WIRE_SCL` can be reassigned to any two other unused pin numbers.
|
||||
- Pins D6 and D7 were originally mapped to the TX and RX pins for serial interface 1 (`PIN_SERIAL1_RX` and `PIN_SERIAL1_TX`) but are currently set to -1 in `variant.h`. If you need to expose a serial interface, you can restore these pins and move e.g. `SX126X_RXEN` to pin 4 or 5 (the opposite should work too).
|
||||
|
||||
### On the E22
|
||||
|
||||
- There are two options for the E22's `TXEN` pin:
|
||||
1. It can be connected to the MCU on the pin defined as `SX126X_TXEN` in `variant.h`. In this configuration, the MCU will control Tx/Rx switching "manually". As long as `SX126X_TXEN` and `SX126X_RXEN` are both defined in `variant.h` (and neither is set to `RADIOLIB_NC`), `SX126xInterface.cpp` will initialize the E22 correctly for this mode.
|
||||
2. Alternately, it can be connected to the E22's `DIO2` pin only, with neither `TXEN` nor `DIO2` being connected to the MCU. In this configuration, the E22 will control Tx/Rx switching automatically. In `variant.h`, as long as `SX126X_TXEN` is defined as `RADIOLIB_NC`, and `SX126X_RXEN` is defined and connected to the E22's `RXEN` pin, and `E22_TXEN_CONNECTED_TO_DIO2` is defined, `SX126xInterface.cpp` will initialize the E22 correctly for this mode. This configuration frees up a GPIO, and presents no drawbacks that I have found.
|
||||
- Note that any combination other than the two described above will likely result in unexpected behavior. In my testing, some of these other configurations appeared to "work" at first glance, but every one I tried had at least one of the following flaws: weak Tx power, extremely poor Rx sensitivity, or the E22 overheating because TXEN was never pulled low, causing its PA to stay on indefinitely.
|
||||
- Along the same lines, it is a good idea to check the E22's temperature frequently by lightly touching the shield. If you feel the shield getting hot (i.e. approaching uncomfortable to touch) near pins 1, 2, and 3, something is probably misconfigured; disconnect both the XIAO nrf52840 and E22 from power and double check wiring and pin mapping.
|
||||
- Whether you opt to let the E22 control Rx and Tx or handle this manually, **the E22's `RXEN` pin must always be connected to the MCU** on the pin defined as `SX126X_RXEN` in `variant.h`.
|
||||
|
||||
#### Note
|
||||
|
||||
The default pin mapping in `variant.h` uses "Automatic Tx/Rx switching" mode.
|
||||
|
||||
If you wire your board for Manual Tx/Rx Switching Mode, `SX126X_TXEN` must be defined (`#define #define SX126X_TXEN D6`) in `variants/seeed_xiao_nrf52840_kit/variant.h` in the code block following:
|
||||
|
||||
```c
|
||||
#ifdef XIAO_BLE_LEGACY_PINOUT
|
||||
// Legacy xiao_ble variant pinout for third-party SX126x modules e.g. EBYTE E22
|
||||
```
|
||||
|
||||
### Example Wiring for Automatic Tx/Rx Switching Mode
|
||||
|
||||
#### MCU -> E22 Connections
|
||||
|
||||
| XIAO nrf52840 pin | variant.h definition | E22 pin | Notes |
|
||||
| :---------------- | :------------------- | :-------- | :------------------------------------------------------------------------------------------------------------------- |
|
||||
| D0 | SX126X_CS | 19 (NSS) | |
|
||||
| D1 | SX126X_DIO1 | 13 (DIO1) | |
|
||||
| D2 | SX126X_BUSY | 14 (BUSY) | |
|
||||
| D3 | SX126X_RESET | 15 (NRST) | |
|
||||
| D7 | SX126X_RXEN | 6 (RXEN) | These pins must still be connected, and `SX126X_RXEN` defined in `variant.h`, otherwise Rx sensitivity will be poor. |
|
||||
| D8 | PIN_SPI_SCK | 18 (SCK) | |
|
||||
| D9 | PIN_SPI_MISO | 16 (MISO) | |
|
||||
| D10 | PIN_SPI_MOSI | 17 (MOSI) | |
|
||||
|
||||
#### E22 -> E22 Connections
|
||||
|
||||
| E22 pin | E22 pin | Notes |
|
||||
| :------ | :------ | :------------------------------------------------------------------------ |
|
||||
| TXEN | DIO2 | These must be physically connected for automatic Tx/Rx switching to work. |
|
||||
|
||||
#### Note
|
||||
|
||||
The schematic (`xiao-ble-e22-schematic.png`) in the `eagle-project` directory uses this wiring.
|
||||
|
||||
### Example Wiring for Manual Tx/Rx Switching Mode
|
||||
|
||||
#### MCU -> E22 Connections
|
||||
|
||||
| XIAO nrf52840 pin | variant.h definition | E22 pin | Notes |
|
||||
| :---------------- | :------------------- | :-------- | :---- |
|
||||
| D0 | SX126X_CS | 19 (NSS) | |
|
||||
| D1 | SX126X_DIO1 | 13 (DIO1) | |
|
||||
| D2 | SX126X_BUSY | 14 (BUSY) | |
|
||||
| D3 | SX126X_RESET | 15 (NRST) | |
|
||||
| D6 | SX126X_TXEN | 7 (TXEN) | |
|
||||
| D7 | SX126X_RXEN | 6 (RXEN) | |
|
||||
| D8 | PIN_SPI_SCK | 18 (SCK) | |
|
||||
| D9 | PIN_SPI_MISO | 16 (MISO) | |
|
||||
| D10 | PIN_SPI_MOSI | 17 (MOSI) | |
|
||||
|
||||
#### E22 -> E22 connections
|
||||
|
||||
_(none)_
|
||||
|
||||
## 2. Build Meshtastic
|
||||
|
||||
1. Follow the [Building Meshtastic Firmware](https://meshtastic.org/docs/development/firmware/build/) documentation, stop after **Build** → **Step 2**
|
||||
2. For **Build** → **Step 3**, select `xiao_ble` as your target
|
||||
3. Adjust source code if you:
|
||||
- Wired your board for Manual Tx/Rx Switching Mode: see [Wire the Board](#1-wire-the-board)
|
||||
- Used an E22-900M33S module
|
||||
(this step is important to avoid **damaging the power amplifier** in the M33S module and **transmitting power above legal limits**!):
|
||||
1. Open `variants/diy/platformio.ini`
|
||||
2. Search for `[env:xiao_ble]`
|
||||
3. In the line starting with `build_flags` within this section, change `-DEBYTE_E22_900M30S` to `-DEBYTE_E22_900M33S`
|
||||
4. Follow **Build** → **Step 4** to build the firmware
|
||||
5. Stop here, because the **PlatformIO: Upload** step does not work for factory-fresh XIAO nrf52840 (the automatic reset to bootloader only works if Meshtastic firmware is already running)
|
||||
6. The built `firmware.uf2` binary can be found in the folder `.pio/build/xiao_ble/firmware.uf2` (relative to where you cloned the Git repository to), we will need it for [flashing the firmware](#3-flash-the-firmware-to-the-xiao-nrf52840) (manually)
|
||||
|
||||
## 3. Flash the Firmware to the XIAO nrf52840
|
||||
|
||||
1. Double press the XIAO nrf52840's `reset` button to put it in bootloader mode, and a USB volume named `XIAO SENSE` will appear
|
||||
2. Copy the `firmware.uf2` file to the `XIAO SENSE` volume (refer to the last step of [Build Meshtastic](#2-build-meshtastic))
|
||||
3. The XIAO nrf52840's red LED will flash for several seconds as the firmware is copied
|
||||
4. Once Meshtastic firmware succesfully boots, the:
|
||||
1. Green LED will turn on
|
||||
2. Red LED will flash several times to indicate flash memory writes during initial settings file creation
|
||||
3. Green LED will blink every second once the firmware is running normally
|
||||
5. If you do not see the above LED patters, proceed to [Troubleshooting](#4-troubleshooting)
|
||||
|
||||
## 4. Troubleshooting
|
||||
|
||||
- If after flashing Meshtastic, the XIAO is bootlooped, look at the serial output (you can see this by running `meshtastic --noproto` with the device connected to your computer via USB).
|
||||
- If you see that the SX1262 init result was -2, this likely indicates a wiring problem; double check your wiring and pin mapping in `variant.h`.
|
||||
- If you see an error mentioning tinyFS, this may mean you need to reformat the XIAO's storage:
|
||||
1. Open the [Meshtastic web flasher](https://flasher.meshtastic.org/)
|
||||
2. Select the **_Seeed XIAO NRF52840 Kit_**
|
||||
3. Click the **_trash can icon_** to the right of **_Flash_**
|
||||
4. Follow the instructions on the screen
|
||||
**Do not flash the Seeed XIAO NRF52840 Kit firmware** if you have wired the LoRa module according to this variant, as the Seeed XIAO NRF52840 Kit uses different wiring for the SX1262 LoRa chip
|
||||
- If you don't see any specific error message, but the boot process is stuck or not proceeding as expected, this might also mean there is a conflict in `variant.h`. If you have made any changes to the pin mapping, ensure they do not result in a conflict. If all else fails, try reverting your changes and using the known-good configuration included here.
|
||||
- The above might also mean something is wired incorrectly. Try reverting to one of the known-good example wirings in section 4.
|
||||
- If the E22 gets hot to the touch:
|
||||
- The power amplifier is likely running continually. Disconnect it and the XIAO from power immediately, and double check wiring and pin mapping. In my experimentation this occurred in cases where TXEN was inadvertenly high (usually due to a pin mapping conflict).
|
||||
|
||||
## 5. Notes
|
||||
|
||||
- **Transmit Power**
|
||||
- There is a power amplifier after the SX1262's Tx, so the actual Tx power is just over 7 dB greater than the SX1262's set Tx power (the E22-900M30S actually tops out just over 29dB at 5V according to the datasheet)
|
||||
- Meshtastic firmware is aware of the gain of the E22-900M30S module, so the Meshtastic clients' Tx power setting reflects the actual output power, i.e. setting 30 dBm in the Meshtastic app programs the E22 module to correctly output 30 dBm, setting 24 dBm will output 24 dBm, etc.
|
||||
- **Adequate 5V Power Supply to the E22 Module**
|
||||
- Have a bypass capacitor from its 5V supply to ground; 100 µF works well
|
||||
- Voltage must be between 5V–5.5V, lower supply voltage results in less output power; for example, with a fully charged LiPo at 4.2V, Tx power appears to max out around 26-27 dBm
|
||||
|
||||
### Additional Reading
|
||||
|
||||
- [S5NC/CDEBYTE_Modules](https://github.com/S5NC/CDEBYTE_Modules) has additional information about EBYTE E22 modules' internal workings, including photographs
|
||||
- [RadioLib High power Radio Modules Guide](https://github.com/jgromes/RadioLib/wiki/High-power-Radio-Modules-Guide)
|
||||
|
||||
## 6. Testing Methodology
|
||||
|
||||
During what became a fairly long trial-and-error process, I did a lot of careful testing of Tx power and Rx sensitivity. My methodology in these tests was as follows:
|
||||
|
||||
- All tests were conducted between two nodes:
|
||||
1. The XIAO nrf52840 + E22 coupled with an [Abracon ARRKP4065-S915A](https://www.digikey.com/en/products/detail/abracon-llc/ARRKP4065-S915A/8593263") ceramic patch antenna
|
||||
2. A RAK 5005/4631 coupled with a [Laird MA9-5N](https://www.streakwave.com/laird-technologies-ma9-5n-55dbi-900mhz-mobile-omni-select-mount) antenna via a 4" U.FL to Type N pigtail.
|
||||
- No other nodes were powered up onsite or nearby.
|
||||
- Each node and its antenna was kept in exactly the same position and orientation throughout testing.
|
||||
- Other environmental factors (e.g. the location and resting position of my body in the room while testing) were controlled as carefully as possible.
|
||||
- Each test comprised at least five (and often ten) runs, after which the results were averaged.
|
||||
- All testing was done by sending single-character messages between nodes and observing the received RSSI reported in the message acknowledgement. Messages were sent one by one, waiting for each to be acknowledged or time out before sending the next.
|
||||
- The E22's Tx power was observed by sending messages from the RAK to the XIAO nrf52840 + E22 and recording the received RSSI.
|
||||
- The opposite was done to observe the E22's Rx sensitivity: messages were sent from the XIAO nrf52840 + E22 to the RAK, and the received RSSI was recorded.
|
||||
While this cannot match the level of accuracy achievable with actual test equipment in a lab setting, it was nonetheless sufficient to demonstrate the (sometimes very large) differences in Tx power and Rx sensitivity between various configurations.
|
||||
14
variants/ec_catsniffer/platformio.ini
Normal file
14
variants/ec_catsniffer/platformio.ini
Normal file
@@ -0,0 +1,14 @@
|
||||
[env:catsniffer]
|
||||
extends = rp2040_base
|
||||
board = rpipico
|
||||
upload_protocol = picotool
|
||||
|
||||
build_flags = ${rp2040_base.build_flags}
|
||||
-DRPI_PICO
|
||||
-Ivariants/ec_catsniffer
|
||||
-DDEBUG_RP2040_PORT=Serial
|
||||
# -DHW_SPI1_DEVICE
|
||||
lib_deps =
|
||||
${rp2040_base.lib_deps}
|
||||
debug_build_flags = ${rp2040_base.build_flags}, -g
|
||||
debug_tool = cmsis-dap
|
||||
39
variants/ec_catsniffer/variant.cpp
Normal file
39
variants/ec_catsniffer/variant.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
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 "wiring_constants.h"
|
||||
#include "wiring_digital.h"
|
||||
|
||||
#define CTF1 8
|
||||
#define CTF2 9
|
||||
#define CTF3 10
|
||||
|
||||
void initVariant()
|
||||
{
|
||||
// Config the LoRa Switch
|
||||
pinMode(CTF1, OUTPUT);
|
||||
pinMode(CTF2, OUTPUT);
|
||||
pinMode(CTF3, OUTPUT);
|
||||
|
||||
digitalWrite(CTF1, HIGH);
|
||||
digitalWrite(CTF2, LOW);
|
||||
digitalWrite(CTF3, LOW);
|
||||
}
|
||||
41
variants/ec_catsniffer/variant.h
Normal file
41
variants/ec_catsniffer/variant.h
Normal file
@@ -0,0 +1,41 @@
|
||||
// #define RADIOLIB_CUSTOM_ARDUINO 1
|
||||
// #define RADIOLIB_TONE_UNSUPPORTED 1
|
||||
// #define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED 1
|
||||
|
||||
#define ARDUINO_ARCH_AVR
|
||||
|
||||
#define HAS_SCREEN 0
|
||||
#define HAS_GPS 0
|
||||
#undef GPS_RX_PIN
|
||||
#undef GPS_TX_PIN
|
||||
|
||||
#define LED_PIN 27
|
||||
|
||||
#define USE_SX1262
|
||||
|
||||
#undef LORA_SCK
|
||||
#undef LORA_MISO
|
||||
#undef LORA_MOSI
|
||||
#undef LORA_CS
|
||||
|
||||
#define LORA_SCK 18
|
||||
#define LORA_MISO 16
|
||||
#define LORA_MOSI 19
|
||||
#define LORA_CS 17 // NSS
|
||||
|
||||
#define LORA_DIO0 5
|
||||
#define LORA_RESET 24
|
||||
#define LORA_DIO1 4
|
||||
#define LORA_DIO2 23
|
||||
#define LORA_DIO3 25
|
||||
#define SX126X_RXEN 21
|
||||
#define SX126X_TXEN 20
|
||||
|
||||
#ifdef USE_SX1262
|
||||
#define SX126X_CS LORA_CS
|
||||
#define SX126X_DIO1 LORA_DIO0
|
||||
#define SX126X_BUSY LORA_DIO1
|
||||
#define SX126X_RESET LORA_RESET
|
||||
// #define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 0
|
||||
#endif
|
||||
58
variants/elecrow_panel/pins_arduino.h
Normal file
58
variants/elecrow_panel/pins_arduino.h
Normal file
@@ -0,0 +1,58 @@
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
static const uint8_t SDA = 15;
|
||||
static const uint8_t SCL = 16;
|
||||
|
||||
// Default SPI will be mapped to Radio
|
||||
static const uint8_t SS = -1;
|
||||
static const uint8_t MOSI = 48;
|
||||
static const uint8_t MISO = 47;
|
||||
static const uint8_t SCK = 41;
|
||||
|
||||
static const uint8_t SPI_MOSI = 6;
|
||||
static const uint8_t SPI_SCK = 5;
|
||||
static const uint8_t SPI_MISO = 4;
|
||||
|
||||
static const uint8_t A0 = 1;
|
||||
static const uint8_t A1 = 2;
|
||||
static const uint8_t A2 = 3;
|
||||
static const uint8_t A3 = 4;
|
||||
static const uint8_t A4 = 5;
|
||||
static const uint8_t A5 = 6;
|
||||
static const uint8_t A6 = 7;
|
||||
static const uint8_t A7 = 8;
|
||||
static const uint8_t A8 = 9;
|
||||
static const uint8_t A9 = 10;
|
||||
static const uint8_t A10 = 11;
|
||||
static const uint8_t A11 = 12;
|
||||
static const uint8_t A12 = 13;
|
||||
static const uint8_t A13 = 14;
|
||||
static const uint8_t A14 = 15;
|
||||
static const uint8_t A15 = 16;
|
||||
static const uint8_t A16 = 17;
|
||||
static const uint8_t A17 = 18;
|
||||
static const uint8_t A18 = 19;
|
||||
static const uint8_t A19 = 20;
|
||||
|
||||
static const uint8_t T1 = 1;
|
||||
static const uint8_t T2 = 2;
|
||||
static const uint8_t T3 = 3;
|
||||
static const uint8_t T4 = 4;
|
||||
static const uint8_t T5 = 5;
|
||||
static const uint8_t T6 = 6;
|
||||
static const uint8_t T7 = 7;
|
||||
static const uint8_t T8 = 8;
|
||||
static const uint8_t T9 = 9;
|
||||
static const uint8_t T10 = 10;
|
||||
static const uint8_t T11 = 11;
|
||||
static const uint8_t T12 = 12;
|
||||
static const uint8_t T13 = 13;
|
||||
static const uint8_t T14 = 14;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
131
variants/elecrow_panel/platformio.ini
Normal file
131
variants/elecrow_panel/platformio.ini
Normal file
@@ -0,0 +1,131 @@
|
||||
[crowpanel_base]
|
||||
extends = esp32s3_base
|
||||
board = crowpanel
|
||||
board_check = true
|
||||
upload_protocol = esptool
|
||||
board_build.partitions = default_16MB.csv ; must be here for some reason, board.json is not enough !?
|
||||
build_flags = ${esp32s3_base.build_flags} -Os
|
||||
-I variants/elecrow_panel
|
||||
-D ELECROW_PANEL
|
||||
-D CONFIG_ARDUHAL_LOG_COLORS
|
||||
-D RADIOLIB_DEBUG_SPI=0
|
||||
-D RADIOLIB_DEBUG_PROTOCOL=0
|
||||
-D RADIOLIB_DEBUG_BASIC=0
|
||||
-D RADIOLIB_VERBOSE_ASSERT=0
|
||||
-D RADIOLIB_SPI_PARANOID=0
|
||||
-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 MESHTASTIC_EXCLUDE_SCREEN=1
|
||||
-D MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1
|
||||
-D HAS_TELEMETRY=0
|
||||
-D CONFIG_DISABLE_HAL_LOCKS=1
|
||||
-D USE_PIN_BUZZER
|
||||
-D HAS_SCREEN=0
|
||||
-D HAS_TFT=1
|
||||
-D RAM_SIZE=6144
|
||||
-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
|
||||
-D LV_USE_MEM_MONITOR=0
|
||||
-D LV_USE_LOG=0
|
||||
-D LV_BUILD_TEST=0
|
||||
-D USE_LOG_DEBUG
|
||||
-D LOG_DEBUG_INC=\"DebugConfiguration.h\"
|
||||
-D USE_PACKET_API
|
||||
-D HAS_SDCARD
|
||||
-D SD_SPI_FREQUENCY=75000000
|
||||
|
||||
lib_deps = ${esp32s3_base.lib_deps}
|
||||
${device-ui_base.lib_deps}
|
||||
earlephilhower/ESP8266Audio@1.9.9
|
||||
earlephilhower/ESP8266SAM@1.0.1
|
||||
lovyan03/LovyanGFX@1.2.0 ; note: v1.2.7 breaks the elecrow 7" display functionality
|
||||
hideakitai/TCA9534@0.1.1
|
||||
|
||||
[crowpanel_small_esp32s3_base] ; 2.4, 2.8, 3.5 inch
|
||||
extends = crowpanel_base
|
||||
build_flags =
|
||||
${crowpanel_base.build_flags}
|
||||
-D CROW_SELECT=1
|
||||
-D SDCARD_USE_SOFT_SPI
|
||||
-D SDCARD_CS=7
|
||||
-D SPI_DRIVER_SELECT=2
|
||||
-D LGFX_DRIVER_TEMPLATE
|
||||
-D LGFX_DRIVER=LGFX_GENERIC
|
||||
-D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_GENERIC.h\"
|
||||
-D VIEW_320x240
|
||||
-D MAP_FULL_REDRAW
|
||||
|
||||
[crowpanel_large_esp32s3_base] ; 4.3, 5.0, 7.0 inch
|
||||
extends = crowpanel_base
|
||||
build_flags =
|
||||
${crowpanel_base.build_flags}
|
||||
-D CROW_SELECT=2
|
||||
-D SDCARD_CS=7
|
||||
-D LGFX_DRIVER=LGFX_ELECROW70
|
||||
-D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_ELECROW70.h\"
|
||||
-D DISPLAY_SET_RESOLUTION
|
||||
|
||||
[env:elecrow-adv-24-28-tft]
|
||||
extends = crowpanel_small_esp32s3_base
|
||||
build_flags =
|
||||
${crowpanel_small_esp32s3_base.build_flags}
|
||||
-D SPI_FREQUENCY=80000000
|
||||
-D LGFX_SCREEN_WIDTH=240
|
||||
-D LGFX_SCREEN_HEIGHT=320
|
||||
-D DISPLAY_SIZE=320x240 ; landscape mode
|
||||
-D LGFX_PANEL=ST7789
|
||||
-D LGFX_ROTATION=1
|
||||
-D LGFX_CFG_HOST=SPI2_HOST
|
||||
-D LGFX_PIN_SCK=42
|
||||
-D LGFX_PIN_MOSI=39
|
||||
-D LGFX_PIN_DC=41
|
||||
-D LGFX_PIN_CS=40
|
||||
-D LGFX_PIN_BL=38
|
||||
-D LGFX_TOUCH=FT5x06
|
||||
-D LGFX_TOUCH_I2C_ADDR=0x38
|
||||
-D LGFX_TOUCH_I2C_SDA=15
|
||||
-D LGFX_TOUCH_I2C_SCL=16
|
||||
-D LGFX_TOUCH_INT=47
|
||||
-D LGFX_TOUCH_RST=48
|
||||
-D LGFX_TOUCH_ROTATION=0
|
||||
|
||||
[env:elecrow-adv-35-tft]
|
||||
extends = crowpanel_small_esp32s3_base
|
||||
build_flags =
|
||||
${crowpanel_small_esp32s3_base.build_flags}
|
||||
-D LV_CACHE_DEF_SIZE=2097152
|
||||
-D SPI_FREQUENCY=60000000
|
||||
-D LGFX_SCREEN_WIDTH=320
|
||||
-D LGFX_SCREEN_HEIGHT=480
|
||||
-D DISPLAY_SIZE=320x480 ; portrait mode
|
||||
-D LGFX_PANEL=ILI9488
|
||||
-D LGFX_ROTATION=0
|
||||
-D LGFX_CFG_HOST=SPI2_HOST
|
||||
-D LGFX_PIN_SCK=42
|
||||
-D LGFX_PIN_MOSI=39
|
||||
-D LGFX_PIN_DC=41
|
||||
-D LGFX_PIN_CS=40
|
||||
-D LGFX_PIN_BL=38
|
||||
-D LGFX_TOUCH=GT911
|
||||
-D LGFX_TOUCH_I2C_ADDR=0x5D
|
||||
-D LGFX_TOUCH_I2C_SDA=15
|
||||
-D LGFX_TOUCH_I2C_SCL=16
|
||||
-D LGFX_TOUCH_INT=47
|
||||
-D LGFX_TOUCH_RST=48
|
||||
-D LGFX_TOUCH_ROTATION=0
|
||||
-D DISPLAY_SET_RESOLUTION
|
||||
|
||||
; 4.3, 5.0, 7.0 inch 800x480 IPS (V1)
|
||||
[env:elecrow-adv1-43-50-70-tft]
|
||||
extends = crowpanel_large_esp32s3_base
|
||||
build_flags =
|
||||
${crowpanel_large_esp32s3_base.build_flags}
|
||||
-D VIEW_320x240
|
||||
-D DISPLAY_SIZE=800x480 ; landscape mode
|
||||
90
variants/elecrow_panel/variant.h
Normal file
90
variants/elecrow_panel/variant.h
Normal file
@@ -0,0 +1,90 @@
|
||||
#define I2C_SDA 15
|
||||
#define I2C_SCL 16
|
||||
|
||||
#if CROW_SELECT == 1
|
||||
#define WAKE_ON_TOUCH
|
||||
#define SCREEN_TOUCH_INT 47
|
||||
#define USE_POWERSAVE
|
||||
#define SLEEP_TIME 180
|
||||
#endif
|
||||
|
||||
#if CROW_SELECT == 1
|
||||
// dac / amp
|
||||
// #define HAS_I2S // didn't get I2S sound working
|
||||
#define PIN_BUZZER 8 // using pwm buzzer instead (nobody will notice, lol)
|
||||
#define DAC_I2S_BCK 13
|
||||
#define DAC_I2S_WS 11
|
||||
#define DAC_I2S_DOUT 12
|
||||
#define DAC_I2S_MCLK 8 // don't use GPIO0 because it's assigned to LoRa or button
|
||||
#else
|
||||
#define PIN_BUZZER 8
|
||||
#endif
|
||||
|
||||
// GPS via UART1 connector
|
||||
#define GPS_DEFAULT_NOT_PRESENT 1
|
||||
#define HAS_GPS 1
|
||||
#if CROW_SELECT == 1
|
||||
#define GPS_RX_PIN 18
|
||||
#define GPS_TX_PIN 17
|
||||
#else
|
||||
// GPIOs shared with LoRa or MIC module
|
||||
#define GPS_RX_PIN 19
|
||||
#define GPS_TX_PIN 20
|
||||
#endif
|
||||
|
||||
// Extension Slot Layout, viewed from above (2.4-3.5)
|
||||
// DIO1/IO1 o o IO2/NRESET
|
||||
// SCK/IO10 o o IO16/NC
|
||||
// MISO/IO9 o o IO15/NC
|
||||
// MOSI/IO3 o o NC/DIO2
|
||||
// 3V3 o o IO46/BUSY
|
||||
// GND o o IO0/NSS
|
||||
// 5V/NC o o NC/DIO3
|
||||
// J9 J8
|
||||
|
||||
// Extension Slot Layout, viewed from above (4.3-7.0)
|
||||
// !! DIO1/IO20 o o IO19/NRESET !!
|
||||
// !! SCK/IO5 o o IO16/NC
|
||||
// !! MISO/IO4 o o IO15/NC
|
||||
// !! MOSI/IO6 o o NC/DIO2
|
||||
// 3V3 o o IO2/BUSY !!
|
||||
// GND o o IO0/NSS
|
||||
// 5V/NC o o NC/DIO3
|
||||
// J9 J8
|
||||
|
||||
// LoRa
|
||||
#define USE_SX1262
|
||||
|
||||
#if CROW_SELECT == 1
|
||||
// 2.4", 2.8, 3.5"""
|
||||
#define HW_SPI1_DEVICE
|
||||
#define LORA_CS 0
|
||||
#define LORA_SCK 10
|
||||
#define LORA_MISO 9
|
||||
#define LORA_MOSI 3
|
||||
|
||||
#define LORA_RESET 2
|
||||
#define LORA_DIO1 1 // SX1262 IRQ
|
||||
#define LORA_DIO2 46 // SX1262 BUSY
|
||||
|
||||
// need to pull IO45 low to enable LORA and disable Microphone on 24 28 35
|
||||
#define SENSOR_POWER_CTRL_PIN 45
|
||||
#define SENSOR_POWER_ON LOW
|
||||
#else
|
||||
// 4.3", 5.0", 7.0"
|
||||
#define LORA_CS 0
|
||||
#define LORA_SCK 5
|
||||
#define LORA_MISO 4
|
||||
#define LORA_MOSI 6
|
||||
|
||||
#define LORA_RESET 19
|
||||
#define LORA_DIO1 20 // SX1262 IRQ
|
||||
#define LORA_DIO2 2 // SX1262 BUSY
|
||||
#endif
|
||||
|
||||
#define SX126X_CS LORA_CS
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 3.3
|
||||
@@ -3,7 +3,6 @@
|
||||
extends = nrf52840_base
|
||||
board = adafruit_feather_nrf52840
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/feather_diy -Dfeather_diy
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/feather_diy>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
|
||||
@@ -9,7 +9,6 @@ build_flags = ${rp2040_base.build_flags}
|
||||
-Ivariants/feather_rp2040_rfm95
|
||||
-DDEBUG_RP2040_PORT=Serial
|
||||
-DHW_SPI1_DEVICE
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus"
|
||||
lib_deps =
|
||||
${rp2040_base.lib_deps}
|
||||
debug_build_flags = ${rp2040_base.build_flags}
|
||||
|
||||
13
variants/gat562_mesh_trial_tracker/platformio.ini
Normal file
13
variants/gat562_mesh_trial_tracker/platformio.ini
Normal 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}
|
||||
45
variants/gat562_mesh_trial_tracker/variant.cpp
Normal file
45
variants/gat562_mesh_trial_tracker/variant.cpp
Normal 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);
|
||||
}
|
||||
288
variants/gat562_mesh_trial_tracker/variant.h
Normal file
288
variants/gat562_mesh_trial_tracker/variant.h
Normal 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
|
||||
@@ -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
|
||||
|
||||
62
variants/heltec_mesh_node_t114-inkhud/custom_build_tasks.py
Normal file
62
variants/heltec_mesh_node_t114-inkhud/custom_build_tasks.py
Normal 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"))
|
||||
96
variants/heltec_mesh_node_t114-inkhud/nicheGraphics.h
Normal file
96
variants/heltec_mesh_node_t114-inkhud/nicheGraphics.h
Normal file
@@ -0,0 +1,96 @@
|
||||
#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
|
||||
|
||||
// Select fonts
|
||||
InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252;
|
||||
InkHUD::Applet::fontMedium = 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
|
||||
19
variants/heltec_mesh_node_t114-inkhud/platformio.ini
Normal file
19
variants/heltec_mesh_node_t114-inkhud/platformio.ini
Normal 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
|
||||
38
variants/heltec_mesh_node_t114-inkhud/variant.cpp
Normal file
38
variants/heltec_mesh_node_t114-inkhud/variant.cpp
Normal 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);
|
||||
}
|
||||
175
variants/heltec_mesh_node_t114-inkhud/variant.h
Normal file
175
variants/heltec_mesh_node_t114-inkhud/variant.h
Normal 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
|
||||
@@ -6,7 +6,6 @@ debug_tool = jlink
|
||||
|
||||
# add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling.
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/heltec_mesh_node_t114
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-DGPS_POWER_TOGGLE
|
||||
-DHELTEC_T114
|
||||
|
||||
|
||||
@@ -56,6 +56,10 @@ extern "C" {
|
||||
#define TFT_WIDTH 240
|
||||
#define TFT_OFFSET_X 0
|
||||
#define TFT_OFFSET_Y 0
|
||||
|
||||
// T114 gets a muted yellow on black display
|
||||
#define TFT_MESH_OVERRIDE COLOR565(255, 255, 128)
|
||||
|
||||
// #define TFT_OFFSET_ROTATION 0
|
||||
// #define SCREEN_ROTATE
|
||||
// #define SCREEN_TRANSITION_FRAMERATE 5
|
||||
|
||||
90
variants/heltec_mesh_pocket/nicheGraphics.h
Normal file
90
variants/heltec_mesh_pocket/nicheGraphics.h
Normal file
@@ -0,0 +1,90 @@
|
||||
#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/LCMEN2R13ECC1.h"
|
||||
#include "graphics/niche/Inputs/TwoButton.h"
|
||||
|
||||
void setupNicheGraphics()
|
||||
{
|
||||
using namespace NicheGraphics;
|
||||
|
||||
// SPI
|
||||
// -----------------------------
|
||||
|
||||
// For NRF52 platforms, SPI pins are defined in variant.h
|
||||
SPI1.begin();
|
||||
|
||||
// E-Ink Driver
|
||||
// -----------------------------
|
||||
|
||||
Drivers::EInk *driver = new Drivers::LCMEN2R13ECC1;
|
||||
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(10, 1.5);
|
||||
|
||||
// Select fonts
|
||||
InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252;
|
||||
InkHUD::Applet::fontMedium = FREESANS_9PT_WIN1252;
|
||||
InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252;
|
||||
|
||||
// Customize default settings
|
||||
inkhud->persistence->settings.userTiles.maxCount = 2; // How many tiles can the display handle?
|
||||
inkhud->persistence->settings.rotation = 3; // 270 degrees clockwise
|
||||
inkhud->persistence->settings.userTiles.count = 1; // One tile only by default, keep things simple for new users
|
||||
inkhud->persistence->settings.optionalMenuItems.nextTile = true;
|
||||
|
||||
// Pick applets
|
||||
// Note: order of applets determines priority of "auto-show" feature
|
||||
inkhud->addApplet("All Messages", new InkHUD::AllMessageApplet, true, true); // Activated, autoshown
|
||||
inkhud->addApplet("DMs", new InkHUD::DMApplet); // -
|
||||
inkhud->addApplet("Channel 0", new InkHUD::ThreadedMessageApplet(0)); // -
|
||||
inkhud->addApplet("Channel 1", new InkHUD::ThreadedMessageApplet(1)); // -
|
||||
inkhud->addApplet("Positions", new InkHUD::PositionsApplet, true); // Activated
|
||||
inkhud->addApplet("Recents List", new InkHUD::RecentsListApplet); // -
|
||||
inkhud->addApplet("Heard", new InkHUD::HeardApplet, true, false, 0); // Activated, no autoshow, default on tile 0
|
||||
|
||||
// Start running InkHUD
|
||||
inkhud->begin();
|
||||
|
||||
// Buttons
|
||||
// --------------------------
|
||||
|
||||
Inputs::TwoButton *buttons = Inputs::TwoButton::getInstance(); // Shared NicheGraphics component
|
||||
|
||||
// #0: Main User Button
|
||||
buttons->setWiring(0, Inputs::TwoButton::getUserButtonPin());
|
||||
buttons->setHandlerShortPress(0, [inkhud]() { inkhud->shortpress(); });
|
||||
buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); });
|
||||
|
||||
// Begin handling button events
|
||||
buttons->start();
|
||||
}
|
||||
|
||||
#endif
|
||||
88
variants/heltec_mesh_pocket/platformio.ini
Normal file
88
variants/heltec_mesh_pocket/platformio.ini
Normal file
@@ -0,0 +1,88 @@
|
||||
; First prototype nrf52840/sx1262 device
|
||||
[env:heltec-mesh-pocket-5000]
|
||||
extends = nrf52840_base
|
||||
board = heltec_mesh_pocket
|
||||
debug_tool = jlink
|
||||
|
||||
# add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling.
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/heltec_mesh_pocket
|
||||
-DHELTEC_MESH_POCKET
|
||||
-DHELTEC_MESH_POCKET_BATTERY_5000
|
||||
-DUSE_EINK
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_213_B74
|
||||
-DEINK_WIDTH=250
|
||||
-DEINK_HEIGHT=122
|
||||
-DUSE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk
|
||||
-DEINK_LIMIT_FASTREFRESH=10 ; How many consecutive fast-refreshes are permitted
|
||||
-DEINK_LIMIT_RATE_BACKGROUND_SEC=30 ; Minimum interval between BACKGROUND updates
|
||||
-DEINK_LIMIT_RATE_RESPONSIVE_SEC=1 ; Minimum interval between RESPONSIVE updates
|
||||
; -D EINK_LIMIT_GHOSTING_PX=2000 ; (Optional) How much image ghosting is tolerated
|
||||
-DEINK_BACKGROUND_USES_FAST ; (Optional) Use FAST refresh for both BACKGROUND and RESPONSIVE, until a limit is reached.
|
||||
-DEINK_HASQUIRK_GHOSTING ; Display model is identified as "prone to ghosting"
|
||||
-DEINK_HASQUIRK_WEAKFASTREFRESH ; Pixels set with fast-refresh are easy to clear, disrupted by sunlight
|
||||
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/heltec_mesh_pocket>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
lewisxhe/PCF8563_Library@^1.0.1
|
||||
https://github.com/meshtastic/GxEPD2#b202ebfec6a4821e098cf7a625ba0f6f2400292d
|
||||
|
||||
|
||||
[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}
|
||||
build_flags =
|
||||
${inkhud.build_flags}
|
||||
${nrf52840_base.build_flags}
|
||||
-I variants/heltec_mesh_pocket
|
||||
-D HELTEC_MESH_POCKET
|
||||
-D HELTEC_MESH_POCKET_BATTERY_5000
|
||||
lib_deps =
|
||||
${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX
|
||||
${nrf52840_base.lib_deps}
|
||||
|
||||
|
||||
; First prototype nrf52840/sx1262 device
|
||||
[env:heltec-mesh-pocket-10000]
|
||||
extends = nrf52840_base
|
||||
board = heltec_mesh_pocket
|
||||
debug_tool = jlink
|
||||
|
||||
# add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling.
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/heltec_mesh_pocket
|
||||
-DHELTEC_MESH_POCKET
|
||||
-DHELTEC_MESH_POCKET_BATTERY_10000
|
||||
-DUSE_EINK
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_213_B74
|
||||
-DEINK_WIDTH=250
|
||||
-DEINK_HEIGHT=122
|
||||
-DUSE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk
|
||||
-DEINK_LIMIT_FASTREFRESH=10 ; How many consecutive fast-refreshes are permitted
|
||||
-DEINK_LIMIT_RATE_BACKGROUND_SEC=30 ; Minimum interval between BACKGROUND updates
|
||||
-DEINK_LIMIT_RATE_RESPONSIVE_SEC=1 ; Minimum interval between RESPONSIVE updates
|
||||
; -D EINK_LIMIT_GHOSTING_PX=2000 ; (Optional) How much image ghosting is tolerated
|
||||
-DEINK_BACKGROUND_USES_FAST ; (Optional) Use FAST refresh for both BACKGROUND and RESPONSIVE, until a limit is reached.
|
||||
-DEINK_HASQUIRK_GHOSTING ; Display model is identified as "prone to ghosting"
|
||||
-DEINK_HASQUIRK_WEAKFASTREFRESH ; Pixels set with fast-refresh are easy to clear, disrupted by sunlight
|
||||
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/heltec_mesh_pocket>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
lewisxhe/PCF8563_Library@^1.0.1
|
||||
https://github.com/meshtastic/GxEPD2#b202ebfec6a4821e098cf7a625ba0f6f2400292d
|
||||
|
||||
|
||||
[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}
|
||||
build_flags =
|
||||
${inkhud.build_flags}
|
||||
${nrf52840_base.build_flags}
|
||||
-I variants/heltec_mesh_pocket
|
||||
-D HELTEC_MESH_POCKET
|
||||
-D HELTEC_MESH_POCKET_BATTERY_10000
|
||||
lib_deps =
|
||||
${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX
|
||||
${nrf52840_base.lib_deps}
|
||||
11
variants/heltec_mesh_pocket/variant.cpp
Normal file
11
variants/heltec_mesh_pocket/variant.cpp
Normal file
@@ -0,0 +1,11 @@
|
||||
#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};
|
||||
132
variants/heltec_mesh_pocket/variant.h
Normal file
132
variants/heltec_mesh_pocket/variant.h
Normal file
@@ -0,0 +1,132 @@
|
||||
#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
|
||||
|
||||
// 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 (13) // 13 red (confirmed on 1.0 board)
|
||||
#define LED_RED PIN_LED1
|
||||
#define LED_BLUE PIN_LED1
|
||||
#define LED_GREEN PIN_LED1
|
||||
#define LED_BUILTIN LED_BLUE
|
||||
#define LED_CONN LED_BLUE
|
||||
#define LED_STATE_ON 0 // State when LED is lit
|
||||
|
||||
/*
|
||||
* 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 + 7)
|
||||
#define PIN_SERIAL2_TX (0 + 8)
|
||||
// #define PIN_SERIAL2_EN (0 + 17)
|
||||
|
||||
/**
|
||||
Wire Interfaces
|
||||
*/
|
||||
#define WIRE_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_WIRE_SDA (32 + 15)
|
||||
#define PIN_WIRE_SCL (32 + 13)
|
||||
|
||||
/*
|
||||
* Lora radio
|
||||
*/
|
||||
|
||||
#define USE_SX1262
|
||||
#define SX126X_CS (0 + 26) // FIXME - we really should define LORA_CS instead
|
||||
#define LORA_CS (0 + 26)
|
||||
#define SX126X_DIO1 (0 + 16)
|
||||
// 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 + 15)
|
||||
#define SX126X_RESET (0 + 12)
|
||||
// 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
|
||||
|
||||
// Display (E-Ink)
|
||||
#define PIN_EINK_CS 24
|
||||
#define PIN_EINK_BUSY 32 + 6
|
||||
#define PIN_EINK_DC 31
|
||||
#define PIN_EINK_RES 32 + 4
|
||||
#define PIN_EINK_SCLK 22
|
||||
#define PIN_EINK_MOSI 20
|
||||
|
||||
#define PIN_SPI1_MISO -1
|
||||
#define PIN_SPI1_MOSI PIN_EINK_MOSI
|
||||
#define PIN_SPI1_SCK PIN_EINK_SCLK
|
||||
|
||||
/*
|
||||
* GPS pins
|
||||
*/
|
||||
|
||||
#define PIN_SERIAL1_RX 32 + 5
|
||||
#define PIN_SERIAL1_TX 32 + 7
|
||||
|
||||
/*
|
||||
* SPI Interfaces
|
||||
*/
|
||||
#define SPI_INTERFACES_COUNT 2
|
||||
|
||||
// For LORA, spi 0
|
||||
#define PIN_SPI_MISO (32 + 9)
|
||||
#define PIN_SPI_MOSI (0 + 5)
|
||||
#define PIN_SPI_SCK (0 + 4)
|
||||
|
||||
// #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 32 + 2
|
||||
#define ADC_CTRL_ENABLED HIGH
|
||||
#define BATTERY_PIN 29
|
||||
#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)
|
||||
|
||||
#undef HAS_GPS
|
||||
#define HAS_GPS 0
|
||||
#define HAS_RTC 0
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -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
|
||||
|
||||
35
variants/heltec_vision_master_e213/einkDetect.h
Normal file
35
variants/heltec_vision_master_e213/einkDetect.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include "configuration.h"
|
||||
|
||||
enum class EInkDetectionResult : uint8_t {
|
||||
LCMEN213EFC1 = 0, // Initial version
|
||||
E0213A367 = 1, // E213 PCB marked V1.1 (Mid 2025)
|
||||
};
|
||||
|
||||
EInkDetectionResult detectEInk()
|
||||
{
|
||||
// Test 1: Logic of BUSY pin
|
||||
|
||||
// Determines controller IC manufacturer
|
||||
// Fitipower: busy when LOW
|
||||
// Solomon Systech: busy when HIGH
|
||||
|
||||
// Force display BUSY by holding reset pin active
|
||||
pinMode(PIN_EINK_RES, OUTPUT);
|
||||
digitalWrite(PIN_EINK_RES, LOW);
|
||||
|
||||
delay(10);
|
||||
|
||||
// Read whether pin is HIGH or LOW while busy
|
||||
pinMode(PIN_EINK_BUSY, INPUT);
|
||||
bool busyLogic = digitalRead(PIN_EINK_BUSY);
|
||||
|
||||
// Test complete. Release pin
|
||||
pinMode(PIN_EINK_RES, INPUT);
|
||||
|
||||
if (busyLogic == LOW)
|
||||
return EInkDetectionResult::LCMEN213EFC1;
|
||||
else // busy HIGH
|
||||
return EInkDetectionResult::E0213A367;
|
||||
}
|
||||
@@ -16,22 +16,24 @@
|
||||
#include "graphics/niche/InkHUD/Applets/User/RecentsList/RecentsListApplet.h"
|
||||
#include "graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.h"
|
||||
|
||||
// #include "graphics/niche/InkHUD/Applets/Examples/BasicExample/BasicExampleApplet.h"
|
||||
// #include "graphics/niche/InkHUD/Applets/Examples/NewMsgExample/NewMsgExampleApplet.h"
|
||||
|
||||
// Shared NicheGraphics components
|
||||
// --------------------------------
|
||||
#include "graphics/niche/Drivers/EInk/E0213A367.h"
|
||||
#include "graphics/niche/Drivers/EInk/LCMEN2R13EFC1.h"
|
||||
#include "graphics/niche/Inputs/TwoButton.h"
|
||||
|
||||
#include "graphics/niche/Fonts/FreeSans6pt7b.h"
|
||||
#include "graphics/niche/Fonts/FreeSans6pt8bCyrillic.h"
|
||||
#include <Fonts/FreeSans9pt7b.h>
|
||||
#include "buzz.h" // Button feedback
|
||||
#include "einkDetect.h" // Detect display model at runtime
|
||||
|
||||
void setupNicheGraphics()
|
||||
{
|
||||
using namespace NicheGraphics;
|
||||
|
||||
// Detect E-Ink Model
|
||||
// -------------------
|
||||
|
||||
EInkDetectionResult displayModel = detectEInk();
|
||||
|
||||
// SPI
|
||||
// -----------------------------
|
||||
|
||||
@@ -42,8 +44,13 @@ void setupNicheGraphics()
|
||||
// E-Ink Driver
|
||||
// -----------------------------
|
||||
|
||||
// Use E-Ink driver
|
||||
Drivers::EInk *driver = new Drivers::LCMEN213EFC1;
|
||||
Drivers::EInk *driver;
|
||||
|
||||
if (displayModel == EInkDetectionResult::LCMEN213EFC1) // V1 (unmarked)
|
||||
driver = new Drivers::LCMEN213EFC1;
|
||||
else if (displayModel == EInkDetectionResult::E0213A367) // V1.1
|
||||
driver = new Drivers::E0213A367;
|
||||
|
||||
driver->begin(hspi, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES);
|
||||
|
||||
// InkHUD
|
||||
@@ -51,21 +58,21 @@ void setupNicheGraphics()
|
||||
|
||||
InkHUD::InkHUD *inkhud = InkHUD::InkHUD::getInstance();
|
||||
|
||||
// Set the driver
|
||||
// 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(10, 1.5);
|
||||
|
||||
// Prepare fonts
|
||||
InkHUD::Applet::fontLarge = InkHUD::AppletFont(FreeSans9pt7b);
|
||||
InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt7b);
|
||||
/*
|
||||
// Font localization demo: Cyrillic
|
||||
InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt8bCyrillic);
|
||||
InkHUD::Applet::fontSmall.addSubstitutionsWin1251();
|
||||
*/
|
||||
if (displayModel == EInkDetectionResult::LCMEN213EFC1) // V1 (unmarked)
|
||||
inkhud->setDisplayResilience(10, 1.5);
|
||||
else if (displayModel == EInkDetectionResult::E0213A367) // V1.1
|
||||
inkhud->setDisplayResilience(15, 3);
|
||||
|
||||
// Select fonts
|
||||
InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252;
|
||||
InkHUD::Applet::fontMedium = FREESANS_9PT_WIN1252;
|
||||
InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252;
|
||||
|
||||
// Customize default settings
|
||||
inkhud->persistence->settings.userTiles.maxCount = 2; // How many tiles can the display handle?
|
||||
@@ -74,15 +81,14 @@ void setupNicheGraphics()
|
||||
inkhud->persistence->settings.optionalMenuItems.nextTile = false; // Behavior handled by aux button instead
|
||||
|
||||
// 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); // Inactive
|
||||
inkhud->addApplet("Channel 0", new InkHUD::ThreadedMessageApplet(0)); // Inactive
|
||||
inkhud->addApplet("Channel 1", new InkHUD::ThreadedMessageApplet(1)); // Inactive
|
||||
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); // Inactive
|
||||
inkhud->addApplet("Recents List", new InkHUD::RecentsListApplet); // -
|
||||
inkhud->addApplet("Heard", new InkHUD::HeardApplet, true, false, 0); // Activated, not autoshown, default on tile 0
|
||||
// inkhud->addApplet("Basic", new InkHUD::BasicExampleApplet);
|
||||
// inkhud->addApplet("NewMsg", new InkHUD::NewMsgExampleApplet);
|
||||
|
||||
// Start running InkHUD
|
||||
inkhud->begin();
|
||||
@@ -91,18 +97,20 @@ void setupNicheGraphics()
|
||||
// --------------------------
|
||||
|
||||
Inputs::TwoButton *buttons = Inputs::TwoButton::getInstance(); // Shared NicheGraphics component
|
||||
constexpr uint8_t MAIN_BUTTON = 0;
|
||||
constexpr uint8_t AUX_BUTTON = 1;
|
||||
|
||||
// Setup the main user button
|
||||
buttons->setWiring(MAIN_BUTTON, BUTTON_PIN);
|
||||
buttons->setHandlerShortPress(MAIN_BUTTON, []() { InkHUD::InkHUD::getInstance()->shortpress(); });
|
||||
buttons->setHandlerLongPress(MAIN_BUTTON, []() { InkHUD::InkHUD::getInstance()->longpress(); });
|
||||
// #0: Main User Button
|
||||
buttons->setWiring(0, Inputs::TwoButton::getUserButtonPin());
|
||||
buttons->setHandlerShortPress(0, [inkhud]() { inkhud->shortpress(); });
|
||||
buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); });
|
||||
|
||||
// Setup the aux button
|
||||
// Bonus feature of VME213
|
||||
buttons->setWiring(AUX_BUTTON, BUTTON_PIN_SECONDARY);
|
||||
buttons->setHandlerShortPress(AUX_BUTTON, []() { InkHUD::InkHUD::getInstance()->nextTile(); });
|
||||
// #1: Aux Button
|
||||
buttons->setWiring(1, PIN_BUTTON2);
|
||||
buttons->setHandlerShortPress(1, [inkhud]() {
|
||||
inkhud->nextTile();
|
||||
playChirp();
|
||||
});
|
||||
|
||||
// Begin handling button events
|
||||
buttons->start();
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@ build_flags =
|
||||
-Ivariants/heltec_vision_master_e213
|
||||
-DHELTEC_VISION_MASTER_E213
|
||||
-DUSE_EINK
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_213_FC1
|
||||
-DGXEPD2_DRIVER_0=GxEPD2_213_FC1
|
||||
-DGXEPD2_DRIVER_1=GxEPD2_213_E0213A367
|
||||
-DEINK_WIDTH=250
|
||||
-DEINK_HEIGHT=122
|
||||
-DUSE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk
|
||||
@@ -16,7 +17,7 @@ build_flags =
|
||||
-DEINK_HASQUIRK_GHOSTING ; Display model is identified as "prone to ghosting"
|
||||
lib_deps =
|
||||
${esp32s3_base.lib_deps}
|
||||
https://github.com/meshtastic/GxEPD2/archive/b202ebfec6a4821e098cf7a625ba0f6f2400292d.zip
|
||||
https://github.com/meshtastic/GxEPD2/archive/1655054ba298e0e29fc2044741940f927f9c2a43.zip
|
||||
lewisxhe/PCF8563_Library@^1.0.1
|
||||
upload_speed = 115200
|
||||
|
||||
@@ -32,7 +33,6 @@ build_flags =
|
||||
${inkhud.build_flags}
|
||||
-I variants/heltec_vision_master_e213
|
||||
-D HELTEC_VISION_MASTER_E213
|
||||
-D MAX_THREADS=40 ; Required if used with WiFi
|
||||
lib_deps =
|
||||
${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX
|
||||
${esp32s3_base.lib_deps}
|
||||
|
||||
@@ -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
|
||||
@@ -31,7 +31,6 @@
|
||||
#define ADC_CHANNEL ADC1_GPIO7_CHANNEL
|
||||
#define ADC_MULTIPLIER 4.9 * 1.03
|
||||
#define ADC_ATTENUATION ADC_ATTEN_DB_2_5
|
||||
#define HAS_32768HZ
|
||||
|
||||
// LoRa
|
||||
#define USE_SX1262
|
||||
|
||||
@@ -19,7 +19,7 @@ Different NicheGraphics UIs and different hardware variants will each have their
|
||||
|
||||
// InkHUD-specific components
|
||||
// ---------------------------
|
||||
#include "graphics/niche/InkHUD/WindowManager.h"
|
||||
#include "graphics/niche/InkHUD/InkHUD.h"
|
||||
|
||||
// Applets
|
||||
#include "graphics/niche/InkHUD/Applets/User/AllMessage/AllMessageApplet.h"
|
||||
@@ -29,17 +29,13 @@ Different NicheGraphics UIs and different hardware variants will each have their
|
||||
#include "graphics/niche/InkHUD/Applets/User/RecentsList/RecentsListApplet.h"
|
||||
#include "graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.h"
|
||||
|
||||
// #include "graphics/niche/InkHUD/Applets/Examples/BasicExample/BasicExampleApplet.h"
|
||||
// #include "graphics/niche/InkHUD/Applets/Examples/NewMsgExample/NewMsgExampleApplet.h"
|
||||
|
||||
// Shared NicheGraphics components
|
||||
// --------------------------------
|
||||
#include "graphics/niche/Drivers/EInk/DEPG0290BNS800.h"
|
||||
#include "graphics/niche/Inputs/TwoButton.h"
|
||||
|
||||
#include "graphics/niche/Fonts/FreeSans6pt7b.h"
|
||||
#include "graphics/niche/Fonts/FreeSans6pt8bCyrillic.h"
|
||||
#include <Fonts/FreeSans9pt7b.h>
|
||||
// Button feedback
|
||||
#include "buzz.h"
|
||||
|
||||
void setupNicheGraphics()
|
||||
{
|
||||
@@ -55,7 +51,6 @@ void setupNicheGraphics()
|
||||
// E-Ink Driver
|
||||
// -----------------------------
|
||||
|
||||
// Use E-Ink driver
|
||||
Drivers::EInk *driver = new Drivers::DEPG0290BNS800;
|
||||
driver->begin(hspi, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY);
|
||||
|
||||
@@ -64,21 +59,17 @@ void setupNicheGraphics()
|
||||
|
||||
InkHUD::InkHUD *inkhud = InkHUD::InkHUD::getInstance();
|
||||
|
||||
// Set the driver
|
||||
// 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);
|
||||
|
||||
// Prepare fonts
|
||||
InkHUD::Applet::fontLarge = InkHUD::AppletFont(FreeSans9pt7b);
|
||||
InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt7b);
|
||||
/*
|
||||
// Font localization demo: Cyrillic
|
||||
InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt8bCyrillic);
|
||||
InkHUD::Applet::fontSmall.addSubstitutionsWin1251();
|
||||
*/
|
||||
// Select fonts
|
||||
InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252;
|
||||
InkHUD::Applet::fontMedium = FREESANS_9PT_WIN1252;
|
||||
InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252;
|
||||
|
||||
// Customize default settings
|
||||
inkhud->persistence->settings.userTiles.maxCount = 2; // How many tiles can the display handle?
|
||||
@@ -87,22 +78,14 @@ void setupNicheGraphics()
|
||||
inkhud->persistence->settings.optionalMenuItems.nextTile = false; // Behavior handled by aux button instead
|
||||
|
||||
// Pick applets
|
||||
|
||||
// Order of applets determines priority of "auto-show" feature.
|
||||
// Optional arguments for default state:
|
||||
// - is activated?
|
||||
// - is autoshown?
|
||||
// - is foreground on a specific tile (index)?
|
||||
|
||||
// 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); // Inactive
|
||||
inkhud->addApplet("Channel 0", new InkHUD::ThreadedMessageApplet(0)); // Inactive
|
||||
inkhud->addApplet("Channel 1", new InkHUD::ThreadedMessageApplet(1)); // Inactive
|
||||
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); // Inactive
|
||||
inkhud->addApplet("Recents List", new InkHUD::RecentsListApplet); // -
|
||||
inkhud->addApplet("Heard", new InkHUD::HeardApplet, true, false, 0); // Activated, not autoshown, default on tile 0
|
||||
// inkhud->addApplet("Basic", new InkHUD::BasicExampleApplet);
|
||||
// inkhud->addApplet("NewMsg", new InkHUD::NewMsgExampleApplet);
|
||||
|
||||
// Start running InkHUD
|
||||
inkhud->begin();
|
||||
@@ -112,16 +95,19 @@ void setupNicheGraphics()
|
||||
|
||||
Inputs::TwoButton *buttons = Inputs::TwoButton::getInstance(); // A shared NicheGraphics component
|
||||
|
||||
// Setup the main user button (0)
|
||||
buttons->setWiring(0, BUTTON_PIN);
|
||||
buttons->setHandlerShortPress(0, []() { InkHUD::InkHUD::getInstance()->shortpress(); });
|
||||
buttons->setHandlerLongPress(0, []() { InkHUD::InkHUD::getInstance()->longpress(); });
|
||||
// #0: Main User Button
|
||||
buttons->setWiring(0, Inputs::TwoButton::getUserButtonPin());
|
||||
buttons->setHandlerShortPress(0, [inkhud]() { inkhud->shortpress(); });
|
||||
buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); });
|
||||
|
||||
// Setup the aux button (1)
|
||||
// Bonus feature of VME290
|
||||
buttons->setWiring(1, BUTTON_PIN_SECONDARY);
|
||||
buttons->setHandlerShortPress(1, []() { InkHUD::InkHUD::getInstance()->nextTile(); });
|
||||
// #1: Aux Button
|
||||
buttons->setWiring(1, PIN_BUTTON2);
|
||||
buttons->setHandlerShortPress(1, [inkhud]() {
|
||||
inkhud->nextTile();
|
||||
playChirp();
|
||||
});
|
||||
|
||||
// Begin handling button events
|
||||
buttons->start();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ build_flags =
|
||||
${inkhud.build_flags}
|
||||
-I variants/heltec_vision_master_e290
|
||||
-D HELTEC_VISION_MASTER_E290
|
||||
-D MAX_THREADS=40 ; Required if used with WiFi
|
||||
lib_deps =
|
||||
${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX
|
||||
${esp32s3_base.lib_deps}
|
||||
|
||||
@@ -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
|
||||
@@ -30,7 +30,6 @@
|
||||
#define ADC_CHANNEL ADC1_GPIO7_CHANNEL
|
||||
#define ADC_MULTIPLIER 4.9 * 1.03
|
||||
#define ADC_ATTENUATION ADC_ATTEN_DB_2_5
|
||||
#define HAS_32768HZ
|
||||
|
||||
// LoRa
|
||||
#define USE_SX1262
|
||||
|
||||
@@ -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
|
||||
@@ -47,7 +48,6 @@
|
||||
#define ADC_CHANNEL ADC1_GPIO6_CHANNEL
|
||||
#define ADC_MULTIPLIER 4.9 * 1.03 // Voltage divider is roughly 1:1
|
||||
#define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // Voltage divider output is quite high
|
||||
#define HAS_32768HZ
|
||||
|
||||
// LoRa
|
||||
#define USE_SX1262
|
||||
@@ -69,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
|
||||
@@ -3,4 +3,21 @@
|
||||
extends = esp32_base
|
||||
board = heltec_wifi_lora_32
|
||||
build_flags =
|
||||
${esp32_base.build_flags} -D HELTEC_WIRELESS_BRIDGE -I variants/heltec_wireless_bridge
|
||||
${esp32_base.build_flags}
|
||||
-I variants/heltec_wireless_bridge
|
||||
-D HELTEC_WIRELESS_BRIDGE
|
||||
-D BOARD_HAS_PSRAM
|
||||
-D RADIOLIB_EXCLUDE_LR11X0=1
|
||||
-D RADIOLIB_EXCLUDE_SX128X=1
|
||||
-D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1
|
||||
-D MESHTASTIC_EXCLUDE_DETECTIONSENSOR=1
|
||||
-D MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1
|
||||
-D MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR_EXTERNAL=1
|
||||
-D MESHTASTIC_EXCLUDE_EXTERNALNOTIFICATION=1
|
||||
-D MESHTASTIC_EXCLUDE_GPS=1
|
||||
-D MESHTASTIC_EXCLUDE_I2C=1
|
||||
-D MESHTASTIC_EXCLUDE_INPUTBROKER=1
|
||||
-D MESHTASTIC_EXCLUDE_POWER_FSM=1
|
||||
-D MESHTASTIC_EXCLUDE_SERIAL=1
|
||||
-D MESHTASTIC_EXCLUDE_SCREEN=1
|
||||
-D MESHTASTIC_EXCLUDE_WAYPOINT=1
|
||||
|
||||
@@ -1,29 +1,41 @@
|
||||
// the default ESP32 Pin of 15 is the Oled SCL, set to 36 and 37 and works fine.
|
||||
// Tested on Neo6m module.
|
||||
|
||||
// updated variant 20250420 berlincount, tested with HTIT-TB
|
||||
//
|
||||
// connections in HTIT-WB
|
||||
// per https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf
|
||||
// md5: a0e6ae10ff76611aa61433366b2e4f5c esp32_datasheet_en.pdf
|
||||
// per https://resource.heltec.cn/download/Wireless_Bridge/Schematic_Diagram_HTIT-WB_V0.2.pdf
|
||||
// md5: d5c1b0219ece347dd8cee866d7d3ab0a Schematic_Diagram_HTIT-WB_V0.2.pdf
|
||||
|
||||
#define NO_EXT_GPIO 1
|
||||
#define NO_GPS 1
|
||||
|
||||
#define HAS_GPS 0 // GPS is not equipped
|
||||
#undef GPS_RX_PIN
|
||||
#undef GPS_TX_PIN
|
||||
#define GPS_RX_PIN 36
|
||||
#define GPS_TX_PIN 33
|
||||
|
||||
#ifndef USE_JTAG // gpio15 is TDO for JTAG, so no I2C on this board while doing jtag
|
||||
#define I2C_SDA 4 // I2C pins for this board
|
||||
#define I2C_SCL 15
|
||||
#endif
|
||||
|
||||
#define LED_PIN 25 // If defined we will blink this LED
|
||||
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
|
||||
// Green / Lora = PIN 22 / GPIO2, Yellow / Wifi = PIN 23 / GPIO0, Blue / BLE = PIN 25 / GPIO16
|
||||
#define LED_PIN 22
|
||||
#define WIFI_LED 23
|
||||
#define BLE_LED 25
|
||||
|
||||
// ESP32-D0WDQ6 direct pins SX1276
|
||||
#define USE_RF95
|
||||
#define LORA_DIO0 26 // a No connect on the SX1262 module
|
||||
#ifndef USE_JTAG
|
||||
#define LORA_RESET 14
|
||||
#endif
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 35
|
||||
#define LORA_DIO2 34 // Not really used
|
||||
#define LORA_DIO2 34
|
||||
#define LORA_SCK 05
|
||||
#define LORA_MISO 19
|
||||
#define LORA_MOSI 27
|
||||
#define LORA_CS 18
|
||||
|
||||
// ratio of voltage divider = 3.20 (R1=100k, R2=220k)
|
||||
#define ADC_MULTIPLIER 3.2
|
||||
// several things are not possible with JTAG enabled
|
||||
#ifndef USE_JTAG
|
||||
#define LORA_RESET 14 // LoRa Reset shares a pin with MTMS
|
||||
#define I2C_SDA 4 // SD_DATA1 going to W25Q64, but
|
||||
#define I2C_SCL 15 // SD_CMD shared a pin with MTD0
|
||||
#endif
|
||||
|
||||
#define BATTERY_PIN 13 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||
#define ADC_CHANNEL ADC2_GPIO13_CHANNEL
|
||||
#define BAT_MEASURE_ADC_UNIT 2
|
||||
// user button is present on device, but currently untested & unconfigured - couldn't figure out how it's connected
|
||||
|
||||
// battery support is present within device, but currently untested & unconfigured - couldn't find reliable information yet
|
||||
|
||||
35
variants/heltec_wireless_paper/einkDetect.h
Normal file
35
variants/heltec_wireless_paper/einkDetect.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include "configuration.h"
|
||||
|
||||
enum class EInkDetectionResult : uint8_t {
|
||||
LCMEN213EFC1 = 0, // V1.1
|
||||
E0213A367 = 1, // V1.1.1, V1.2
|
||||
};
|
||||
|
||||
EInkDetectionResult detectEInk()
|
||||
{
|
||||
// Test 1: Logic of BUSY pin
|
||||
|
||||
// Determines controller IC manufacturer
|
||||
// Fitipower: busy when LOW
|
||||
// Solomon Systech: busy when HIGH
|
||||
|
||||
// Force display BUSY by holding reset pin active
|
||||
pinMode(PIN_EINK_RES, OUTPUT);
|
||||
digitalWrite(PIN_EINK_RES, LOW);
|
||||
|
||||
delay(10);
|
||||
|
||||
// Read whether pin is HIGH or LOW while busy
|
||||
pinMode(PIN_EINK_BUSY, INPUT);
|
||||
bool busyLogic = digitalRead(PIN_EINK_BUSY);
|
||||
|
||||
// Test complete. Release pin
|
||||
pinMode(PIN_EINK_RES, INPUT);
|
||||
|
||||
if (busyLogic == LOW)
|
||||
return EInkDetectionResult::LCMEN213EFC1;
|
||||
else // busy HIGH
|
||||
return EInkDetectionResult::E0213A367;
|
||||
}
|
||||
@@ -16,22 +16,23 @@
|
||||
#include "graphics/niche/InkHUD/Applets/User/RecentsList/RecentsListApplet.h"
|
||||
#include "graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.h"
|
||||
|
||||
// #include "graphics/niche/InkHUD/Applets/Examples/BasicExample/BasicExampleApplet.h"
|
||||
// #include "graphics/niche/InkHUD/Applets/Examples/NewMsgExample/NewMsgExampleApplet.h"
|
||||
|
||||
// Shared NicheGraphics components
|
||||
// --------------------------------
|
||||
#include "graphics/niche/Drivers/EInk/E0213A367.h"
|
||||
#include "graphics/niche/Drivers/EInk/LCMEN2R13EFC1.h"
|
||||
#include "graphics/niche/Inputs/TwoButton.h"
|
||||
|
||||
#include "graphics/niche/Fonts/FreeSans6pt7b.h"
|
||||
#include "graphics/niche/Fonts/FreeSans6pt8bCyrillic.h"
|
||||
#include <Fonts/FreeSans9pt7b.h>
|
||||
#include "einkDetect.h" // Detect display model at runtime
|
||||
|
||||
void setupNicheGraphics()
|
||||
{
|
||||
using namespace NicheGraphics;
|
||||
|
||||
// Detect E-Ink Model
|
||||
// -------------------
|
||||
|
||||
EInkDetectionResult displayModel = detectEInk();
|
||||
|
||||
// SPI
|
||||
// -----------------------------
|
||||
|
||||
@@ -42,8 +43,13 @@ void setupNicheGraphics()
|
||||
// E-Ink Driver
|
||||
// -----------------------------
|
||||
|
||||
// Use E-Ink driver
|
||||
Drivers::EInk *driver = new Drivers::LCMEN213EFC1;
|
||||
Drivers::EInk *driver;
|
||||
|
||||
if (displayModel == EInkDetectionResult::LCMEN213EFC1) // V1.1
|
||||
driver = new Drivers::LCMEN213EFC1;
|
||||
else if (displayModel == EInkDetectionResult::E0213A367) // V1.1.1, V1.2
|
||||
driver = new Drivers::E0213A367;
|
||||
|
||||
driver->begin(hspi, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES);
|
||||
|
||||
// InkHUD
|
||||
@@ -51,21 +57,21 @@ void setupNicheGraphics()
|
||||
|
||||
InkHUD::InkHUD *inkhud = InkHUD::InkHUD::getInstance();
|
||||
|
||||
// Set the driver
|
||||
// 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(10, 1.5);
|
||||
|
||||
// Prepare fonts
|
||||
InkHUD::Applet::fontLarge = InkHUD::AppletFont(FreeSans9pt7b);
|
||||
InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt7b);
|
||||
/*
|
||||
// Font localization demo: Cyrillic
|
||||
InkHUD::Applet::fontSmall = InkHUD::AppletFont(FreeSans6pt8bCyrillic);
|
||||
InkHUD::Applet::fontSmall.addSubstitutionsWin1251();
|
||||
*/
|
||||
if (displayModel == EInkDetectionResult::LCMEN213EFC1) // V1.1 (unmarked)
|
||||
inkhud->setDisplayResilience(10, 1.5);
|
||||
else if (displayModel == EInkDetectionResult::E0213A367) // V1.1.1, V1.2
|
||||
inkhud->setDisplayResilience(15, 3);
|
||||
|
||||
// Select fonts
|
||||
InkHUD::Applet::fontLarge = FREESANS_12PT_WIN1252;
|
||||
InkHUD::Applet::fontMedium = FREESANS_9PT_WIN1252;
|
||||
InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252;
|
||||
|
||||
// Customize default settings
|
||||
inkhud->persistence->settings.userTiles.maxCount = 2; // How many tiles can the display handle?
|
||||
@@ -73,15 +79,14 @@ void setupNicheGraphics()
|
||||
inkhud->persistence->settings.userTiles.count = 1; // One tile only by default, keep things simple for new users
|
||||
|
||||
// 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); // Inactive
|
||||
inkhud->addApplet("Channel 0", new InkHUD::ThreadedMessageApplet(0)); // Inactive
|
||||
inkhud->addApplet("Channel 1", new InkHUD::ThreadedMessageApplet(1)); // Inactive
|
||||
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); // Inactive
|
||||
inkhud->addApplet("Recents List", new InkHUD::RecentsListApplet); // -
|
||||
inkhud->addApplet("Heard", new InkHUD::HeardApplet, true, false, 0); // Activated, not autoshown, default on tile 0
|
||||
// inkhud->addApplet("Basic", new InkHUD::BasicExampleApplet);
|
||||
// inkhud->addApplet("NewMsg", new InkHUD::NewMsgExampleApplet);
|
||||
|
||||
// Start running InkHUD
|
||||
inkhud->begin();
|
||||
@@ -90,15 +95,15 @@ void setupNicheGraphics()
|
||||
// --------------------------
|
||||
|
||||
Inputs::TwoButton *buttons = Inputs::TwoButton::getInstance(); // Shared NicheGraphics component
|
||||
constexpr uint8_t MAIN_BUTTON = 0;
|
||||
|
||||
// Setup the main user button
|
||||
buttons->setWiring(MAIN_BUTTON, BUTTON_PIN);
|
||||
buttons->setHandlerShortPress(MAIN_BUTTON, []() { InkHUD::InkHUD::getInstance()->shortpress(); });
|
||||
buttons->setHandlerLongPress(MAIN_BUTTON, []() { InkHUD::InkHUD::getInstance()->longpress(); });
|
||||
// #0: Main User Button
|
||||
buttons->setWiring(0, Inputs::TwoButton::getUserButtonPin());
|
||||
buttons->setHandlerShortPress(0, [inkhud]() { inkhud->shortpress(); });
|
||||
buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); });
|
||||
|
||||
// No aux button on this board
|
||||
|
||||
// Begin handling button events
|
||||
buttons->start();
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@ build_flags =
|
||||
${esp32s3_base.build_flags}
|
||||
-I variants/heltec_wireless_paper
|
||||
-D HELTEC_WIRELESS_PAPER
|
||||
-D EINK_DISPLAY_MODEL=GxEPD2_213_FC1
|
||||
-D GXEPD2_DRIVER_0=GxEPD2_213_FC1
|
||||
-D GXEPD2_DRIVER_1=GxEPD2_213_E0213A367
|
||||
-D EINK_WIDTH=250
|
||||
-D EINK_HEIGHT=122
|
||||
-D USE_EINK
|
||||
@@ -17,7 +18,7 @@ build_flags =
|
||||
-D EINK_HASQUIRK_GHOSTING ; Display model is identified as "prone to ghosting"
|
||||
lib_deps =
|
||||
${esp32s3_base.lib_deps}
|
||||
https://github.com/meshtastic/GxEPD2/archive/b202ebfec6a4821e098cf7a625ba0f6f2400292d.zip
|
||||
https://github.com/meshtastic/GxEPD2/archive/1655054ba298e0e29fc2044741940f927f9c2a43.zip
|
||||
lewisxhe/PCF8563_Library@^1.0.1
|
||||
upload_speed = 115200
|
||||
|
||||
@@ -33,7 +34,6 @@ build_flags =
|
||||
${inkhud.build_flags}
|
||||
-I variants/heltec_wireless_paper
|
||||
-D HELTEC_WIRELESS_PAPER
|
||||
-D MAX_THREADS=40 ; Required if used with WiFi
|
||||
lib_deps =
|
||||
${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX
|
||||
${esp32s3_base.lib_deps}
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#define ADC_MULTIPLIER 2 // Voltage divider is roughly 1:1
|
||||
#define BAT_MEASURE_ADC_UNIT 2 // Use ADC2
|
||||
#define ADC_ATTENUATION ADC_ATTEN_DB_12 // Voltage divider output is quite high
|
||||
#define HAS_32768HZ
|
||||
#define ADC_CTRL_ENABLED LOW
|
||||
|
||||
#define NO_EXT_GPIO 1
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#define ADC_MULTIPLIER 2 // Voltage divider is roughly 1:1
|
||||
#define BAT_MEASURE_ADC_UNIT 2 // Use ADC2
|
||||
#define ADC_ATTENUATION ADC_ATTEN_DB_12 // Voltage divider output is quite high
|
||||
#define HAS_32768HZ
|
||||
#define ADC_CTRL_ENABLED LOW
|
||||
|
||||
#define NO_EXT_GPIO 1
|
||||
|
||||
19
variants/link32_s3_v1/pins_arduino.h
Normal file
19
variants/link32_s3_v1/pins_arduino.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define USB_VID 0x303a
|
||||
#define USB_PID 0x1001
|
||||
|
||||
// The default Wire will be mapped to PMU and RTC
|
||||
static const uint8_t SDA = 47;
|
||||
static const uint8_t SCL = 48;
|
||||
|
||||
// Default SPI will be mapped to Radio
|
||||
static const uint8_t SS = 21;
|
||||
static const uint8_t MOSI = 34;
|
||||
static const uint8_t MISO = 33;
|
||||
static const uint8_t SCK = 16;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
11
variants/link32_s3_v1/platformio.ini
Normal file
11
variants/link32_s3_v1/platformio.ini
Normal file
@@ -0,0 +1,11 @@
|
||||
[env:link32-s3-v1]
|
||||
extends = esp32s3_base
|
||||
board = esp32-s3-devkitc-1
|
||||
build_flags =
|
||||
${esp32_base.build_flags} -D LINK_32 -I variants/link32_s3_v1
|
||||
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||
-DARDUINO_USB_CDC_ON_BOOT
|
||||
-DARDUINO_USB_MODE=1
|
||||
-DRADIOLIB_EXCLUDE_SX128X=1
|
||||
-DRADIOLIB_EXCLUDE_SX127X=1
|
||||
-DRADIOLIB_EXCLUDE_LR11X0=1
|
||||
44
variants/link32_s3_v1/variant.h
Normal file
44
variants/link32_s3_v1/variant.h
Normal file
@@ -0,0 +1,44 @@
|
||||
#define BATTERY_PIN 15
|
||||
#define ADC_CHANNEL ADC2_GPIO15_CHANNEL // ADC channel for battery voltage measurement
|
||||
#define BATTERY_SENSE_SAMPLES 30
|
||||
#define BAT_MEASURE_ADC_UNIT 2 // Use ADC2 for battery measurement
|
||||
|
||||
#define USE_SSD1306
|
||||
|
||||
#define BUTTON_PIN 0 // Button pin for this board
|
||||
#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
|
||||
#define NEOPIXEL_COUNT 1 // Number of neopixels on this board
|
||||
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use
|
||||
|
||||
#define ADC_MULTIPLIER 2
|
||||
|
||||
#define I2C_SDA 47 // I2C pins for this board
|
||||
#define I2C_SCL 48
|
||||
|
||||
#define USE_SX1262
|
||||
|
||||
#define LORA_SCK 16
|
||||
#define LORA_MISO 33
|
||||
#define LORA_MOSI 34
|
||||
#define LORA_CS 21
|
||||
#define LORA_RESET 18
|
||||
|
||||
#define LORA_DIO0 12 // a No connect on the SX1262 module
|
||||
#define LORA_DIO1 13
|
||||
#define LORA_DIO2 14 // Not really used
|
||||
|
||||
#define LORA_TCXO_GPIO 17
|
||||
|
||||
#define TCXO_OPTIONAL
|
||||
|
||||
#define SX126X_CS LORA_CS
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
@@ -28,7 +28,6 @@ build_flags = ${esp32s3_base.build_flags}
|
||||
-D USE_LOG_DEBUG
|
||||
-D LOG_DEBUG_INC=\"DebugConfiguration.h\"
|
||||
-D RADIOLIB_SPI_PARANOID=0
|
||||
-D MAX_THREADS=40
|
||||
-D HAS_SCREEN=0
|
||||
-D HAS_TFT=1
|
||||
-D USE_PIN_BUZZER
|
||||
@@ -86,6 +85,7 @@ build_flags = ${mesh_tab_xpt2046.build_flags}
|
||||
-D SPI_FREQUENCY=60000000
|
||||
-D LGFX_SCREEN_WIDTH=240
|
||||
-D LGFX_SCREEN_HEIGHT=320
|
||||
-D DISPLAY_SIZE=320x240 ; landscape mode
|
||||
-D LGFX_PANEL=ST7789
|
||||
-D LGFX_INVERT_COLOR=false
|
||||
-D LGFX_ROTATION=3
|
||||
@@ -98,6 +98,7 @@ build_flags = ${mesh_tab_xpt2046.build_flags}
|
||||
-D SPI_FREQUENCY=60000000 ; if image is distorted then lower to 40 MHz
|
||||
-D LGFX_SCREEN_WIDTH=240
|
||||
-D LGFX_SCREEN_HEIGHT=320
|
||||
-D DISPLAY_SIZE=320x240 ; landscape mode
|
||||
-D LGFX_PANEL=ILI9341
|
||||
-D LGFX_ROTATION=1
|
||||
-D LGFX_TOUCH_ROTATION=4
|
||||
@@ -110,6 +111,7 @@ build_flags = ${mesh_tab_xpt2046.build_flags}
|
||||
-D DISPLAY_SET_RESOLUTION
|
||||
-D LGFX_SCREEN_WIDTH=320
|
||||
-D LGFX_SCREEN_HEIGHT=480
|
||||
-D DISPLAY_SIZE=320x480 ; portrait mode
|
||||
-D LGFX_PANEL=ILI9488
|
||||
-D LGFX_ROTATION=0
|
||||
-D LGFX_TOUCH_ROTATION=0
|
||||
@@ -122,6 +124,7 @@ build_flags = ${mesh_tab_xpt2046.build_flags}
|
||||
-D DISPLAY_SET_RESOLUTION
|
||||
-D LGFX_SCREEN_WIDTH=320
|
||||
-D LGFX_SCREEN_HEIGHT=480
|
||||
-D DISPLAY_SIZE=320x480 ; portrait mode
|
||||
-D LGFX_PANEL=HX8357B
|
||||
-D LGFX_INVERT_COLOR=false
|
||||
-D LGFX_ROTATION=4
|
||||
@@ -134,6 +137,7 @@ build_flags = ${mesh_tab_ft5x06.build_flags}
|
||||
-D SPI_FREQUENCY=75000000 ; may go higher upto 60/80 MHz
|
||||
-D LGFX_SCREEN_WIDTH=240
|
||||
-D LGFX_SCREEN_HEIGHT=320
|
||||
-D DISPLAY_SIZE=320x240 ; landscape mode
|
||||
-D LGFX_PANEL=ILI9341
|
||||
-D LGFX_ROTATION=1
|
||||
-D LGFX_TOUCH_X_MIN=0
|
||||
@@ -150,6 +154,7 @@ build_flags = ${mesh_tab_ft5x06.build_flags}
|
||||
-D DISPLAY_SET_RESOLUTION
|
||||
-D LGFX_SCREEN_WIDTH=320
|
||||
-D LGFX_SCREEN_HEIGHT=480
|
||||
-D DISPLAY_SIZE=320x480 ; portrait mode
|
||||
-D LGFX_PANEL=ILI9488
|
||||
-D LGFX_ROTATION=2
|
||||
-D LGFX_TOUCH_X_MIN=0
|
||||
@@ -166,6 +171,7 @@ build_flags = ${mesh_tab_ft5x06.build_flags}
|
||||
-D DISPLAY_SET_RESOLUTION
|
||||
-D LGFX_SCREEN_WIDTH=320
|
||||
-D LGFX_SCREEN_HEIGHT=480
|
||||
-D DISPLAY_SIZE=320x480 ; portrait mode
|
||||
-D LGFX_PANEL=HX8357B
|
||||
-D LGFX_ROTATION=4
|
||||
-D LGFX_TOUCH_X_MIN=0
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
|
||||
#define HAS_TOUCHSCREEN 1
|
||||
|
||||
#define SLEEP_TIME 120
|
||||
#define USE_POWERSAVE
|
||||
#define SLEEP_TIME 180
|
||||
|
||||
// Analog pins
|
||||
#define BATTERY_PIN 4 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||
|
||||
@@ -6,7 +6,6 @@ extends = nrf52840_base
|
||||
board = meshlink
|
||||
;board_check = true
|
||||
build_flags = ${nrf52840_base.build_flags} -I variants/meshlink -D MESHLINK
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||
-D EINK_DISPLAY_MODEL=GxEPD2_213_B74
|
||||
-D EINK_WIDTH=250
|
||||
|
||||
@@ -6,7 +6,6 @@ extends = nrf52840_base
|
||||
board = meshlink
|
||||
;board_check = true
|
||||
build_flags = ${nrf52840_base.build_flags} -I variants/meshlink_eink -D MESHLINK
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||
-D EINK_DISPLAY_MODEL=GxEPD2_213_B74
|
||||
-D EINK_WIDTH=250
|
||||
|
||||
@@ -4,7 +4,6 @@ board_level = extra
|
||||
extends = nrf52840_base
|
||||
board = wiscore_rak4631
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/monteops_hw1 -D MONTEOPS_HW1
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/monteops_hw1> +<mesh/eth/> +<mesh/api/> +<mqtt/>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -5,7 +5,6 @@ board = nano-g2-ultra
|
||||
debug_tool = jlink
|
||||
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/nano-g2-ultra -D NANO_G2_ULTRA
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nano-g2-ultra>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
|
||||
@@ -10,7 +10,6 @@ build_flags = ${rp2040_base.build_flags}
|
||||
-Ivariants/nibble_rp2040
|
||||
-DDEBUG_RP2040_PORT=Serial
|
||||
-DHW_SPI1_DEVICE
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus"
|
||||
lib_deps =
|
||||
${rp2040_base.lib_deps}
|
||||
debug_build_flags = ${rp2040_base.build_flags}, -g
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -48,10 +42,13 @@ 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 DISPLAY_SIZE=320x240 ; landscape mode
|
||||
-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 =
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#define SCREEN_TRANSITION_FRAMERATE 5
|
||||
|
||||
// Picomputer gets a white on black display
|
||||
#define TFT_MESH COLOR565(0xFF, 0xFF, 0xFF)
|
||||
#define TFT_MESH_OVERRIDE COLOR565(255, 255, 255)
|
||||
|
||||
#define CANNED_MESSAGE_MODULE_ENABLE 1
|
||||
|
||||
|
||||
@@ -22,11 +22,11 @@ lib_deps =
|
||||
${native_base.lib_deps}
|
||||
${device-ui_base.lib_deps}
|
||||
build_flags = ${native_base.build_flags} -Os -lX11 -linput -lxkbcommon -ffunction-sections -fdata-sections -Wl,--gc-sections
|
||||
-D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1
|
||||
-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 +41,35 @@ 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
|
||||
build_type = release
|
||||
lib_deps =
|
||||
${native_base.lib_deps}
|
||||
${device-ui_base.lib_deps}
|
||||
board_level = extra
|
||||
build_flags = ${native_base.build_flags} -Os -ffunction-sections -fdata-sections -Wl,--gc-sections
|
||||
-D RAM_SIZE=8192
|
||||
-D USE_FRAMEBUFFER=1
|
||||
-D LV_COLOR_DEPTH=32
|
||||
-D HAS_TFT=1
|
||||
-D HAS_SCREEN=1
|
||||
-D LV_BUILD_TEST=0
|
||||
-D LV_USE_LOG=0
|
||||
-D LV_USE_EVDEV=1
|
||||
-D LV_LVGL_H_INCLUDE_SIMPLE
|
||||
-D LV_CONF_INCLUDE_SIMPLE
|
||||
-D LV_COMP_CONF_INCLUDE_SIMPLE
|
||||
-D USE_LOG_DEBUG
|
||||
-D LOG_DEBUG_INC=\"DebugConfiguration.h\"
|
||||
-D USE_PACKET_API
|
||||
-D VIEW_320x240
|
||||
-D MAP_FULL_REDRAW
|
||||
!pkg-config --libs libulfius --silence-errors || :
|
||||
!pkg-config --libs openssl --silence-errors || :
|
||||
build_src_filter =
|
||||
${native_base.build_src_filter}
|
||||
|
||||
[env:native-tft-debug]
|
||||
extends = native_base
|
||||
@@ -51,7 +79,6 @@ lib_deps =
|
||||
${device-ui_base.lib_deps}
|
||||
board_level = extra
|
||||
build_flags = ${native_base.build_flags} -O0 -fsanitize=address -lX11 -linput -lxkbcommon
|
||||
-D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1
|
||||
-D DEBUG_HEAP
|
||||
-D RAM_SIZE=16384
|
||||
-D USE_X11=1
|
||||
|
||||
@@ -9,7 +9,6 @@ build_flags = ${rp2040_base.build_flags}
|
||||
-Ivariants/rak11310
|
||||
-DDEBUG_RP2040_PORT=Serial
|
||||
-DRV3028_RTC=0x52
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus"
|
||||
build_src_filter = ${rp2040_base.build_src_filter} +<../variants/rak11310> +<mesh/eth/> +<mesh/api/> +<mqtt/>
|
||||
lib_deps =
|
||||
${rp2040_base.lib_deps}
|
||||
|
||||
@@ -4,7 +4,6 @@ extends = nrf52840_base
|
||||
board = wiscore_rak4631
|
||||
board_check = true
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/rak2560 -D RAK_4631
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-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
|
||||
|
||||
@@ -5,6 +5,8 @@ board_upload.maximum_size = 233472 ; reserve the last 28KB for filesystem
|
||||
build_flags =
|
||||
${stm32_base.build_flags}
|
||||
-Ivariants/rak3172
|
||||
-DPIN_WIRE_SDA=PA11
|
||||
-DPIN_WIRE_SCL=PA12
|
||||
-DHAL_DAC_MODULE_ONLY
|
||||
-DHAL_RNG_MODULE_ENABLED
|
||||
-DRADIOLIB_EXCLUDE_SX128X=1
|
||||
@@ -18,6 +20,5 @@ build_flags =
|
||||
-DMESHTASTIC_EXCLUDE_SCREEN=1
|
||||
-DMESHTASTIC_EXCLUDE_MQTT=1
|
||||
-DMESHTASTIC_EXCLUDE_POWERMON=1
|
||||
;-DPIO_FRAMEWORK_ARDUINO_NANOLIB_FLOAT_PRINTF
|
||||
;-DCFG_DEBUG
|
||||
upload_port = stlink
|
||||
|
||||
28
variants/rak3312/pins_arduino.h
Normal file
28
variants/rak3312/pins_arduino.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include "variant.h"
|
||||
#include <stdint.h>
|
||||
|
||||
#define USB_VID 0x303a
|
||||
#define USB_PID 0x1001
|
||||
|
||||
// The default Wire will be mapped to PMU and RTC
|
||||
static const uint8_t SDA = 9;
|
||||
static const uint8_t SCL = 40;
|
||||
|
||||
// Default SPI will be mapped to Radio
|
||||
static const uint8_t SS = 12;
|
||||
static const uint8_t MOSI = 11;
|
||||
static const uint8_t MISO = 10;
|
||||
static const uint8_t SCK = 13;
|
||||
|
||||
#define SPI_MOSI (11)
|
||||
#define SPI_SCK (13)
|
||||
#define SPI_MISO (10)
|
||||
#define SPI_CS (12)
|
||||
|
||||
// LEDs
|
||||
#define LED_BUILTIN LED_GREEN
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
8
variants/rak3312/platformio.ini
Normal file
8
variants/rak3312/platformio.ini
Normal file
@@ -0,0 +1,8 @@
|
||||
[env:rak3312]
|
||||
extends = esp32s3_base
|
||||
board = wiscore_rak3312
|
||||
board_check = true
|
||||
upload_protocol = esptool
|
||||
|
||||
build_flags =
|
||||
${esp32_base.build_flags} -D RAK3312 -I variants/rak3312
|
||||
44
variants/rak3312/variant.h
Normal file
44
variants/rak3312/variant.h
Normal file
@@ -0,0 +1,44 @@
|
||||
#define I2C_SDA 9
|
||||
#define I2C_SCL 40
|
||||
|
||||
#define USE_SX1262
|
||||
|
||||
#define LORA_SCK 5
|
||||
#define LORA_MISO 3
|
||||
#define LORA_MOSI 6
|
||||
#define LORA_CS 7
|
||||
#define LORA_RESET 8
|
||||
|
||||
#ifdef USE_SX1262
|
||||
#define SX126X_CS LORA_CS
|
||||
#define SX126X_DIO1 47
|
||||
#define SX126X_BUSY 48
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#endif
|
||||
|
||||
#define SX126X_POWER_EN (4)
|
||||
|
||||
#define PIN_POWER_EN PIN_3V3_EN
|
||||
#define PIN_3V3_EN (14)
|
||||
|
||||
#define LED_GREEN 46
|
||||
#define LED_BLUE 45
|
||||
|
||||
#define PIN_LED1 LED_GREEN
|
||||
#define PIN_LED2 LED_BLUE
|
||||
|
||||
#define LED_CONN LED_BLUE
|
||||
#define LED_PIN LED_GREEN
|
||||
#define ledOff(pin) pinMode(pin, INPUT)
|
||||
|
||||
#define LED_STATE_ON 1 // State when LED is litted
|
||||
|
||||
#define HAS_GPS 1
|
||||
#define GPS_TX_PIN 43
|
||||
#define GPS_RX_PIN 44
|
||||
|
||||
#define BATTERY_PIN 1
|
||||
#define ADC_CHANNEL ADC1_GPIO1_CHANNEL
|
||||
#define ADC_MULTIPLIER 1.667
|
||||
@@ -4,7 +4,6 @@ extends = nrf52840_base
|
||||
board = wiscore_rak4631
|
||||
board_check = true
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631 -D RAK_4631
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_213_BN
|
||||
-DEINK_WIDTH=250
|
||||
@@ -20,6 +19,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)
|
||||
@@ -53,4 +53,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
|
||||
|
||||
@@ -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
|
||||
@@ -197,6 +202,12 @@ 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
|
||||
@@ -213,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
|
||||
@@ -270,4 +286,4 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
extends = nrf52840_base
|
||||
board = wiscore_rak4631
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631_epaper -D RAK_4631
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_213_BN
|
||||
-DEINK_WIDTH=250
|
||||
-DEINK_HEIGHT=122
|
||||
@@ -17,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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -4,7 +4,6 @@ board_level = extra
|
||||
extends = nrf52840_base
|
||||
board = wiscore_rak4631
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631_epaper -D RAK_4631
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-D PIN_EINK_EN=34
|
||||
-D EINK_DISPLAY_MODEL=GxEPD2_213_BN
|
||||
-D EINK_WIDTH=250
|
||||
@@ -19,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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -4,7 +4,6 @@ extends = nrf52840_base
|
||||
board = wiscore_rak4631
|
||||
board_check = true
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631_eth_gw -D RAK_4631
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_213_BN
|
||||
-DEINK_WIDTH=250
|
||||
|
||||
@@ -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
|
||||
|
||||
51
variants/rak4631_nomadstar_meteor_pro/platformio.ini
Normal file
51
variants/rak4631_nomadstar_meteor_pro/platformio.ini
Normal file
@@ -0,0 +1,51 @@
|
||||
; NomadStar Meteor Pro based on RAK4631 with RGBW LED LP5562 support
|
||||
[env:rak4631_nomadstar_meteor_pro]
|
||||
extends = nrf52840_base
|
||||
board = wiscore_rak4631
|
||||
board_check = true
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/rak4631_nomadstar_meteor_pro -D NOMADSTAR_METEOR_PRO
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
;-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_213_BN
|
||||
-DEINK_WIDTH=250
|
||||
-DEINK_HEIGHT=122
|
||||
-DRADIOLIB_EXCLUDE_SX128X=1
|
||||
-DRADIOLIB_EXCLUDE_SX127X=1
|
||||
-DRADIOLIB_EXCLUDE_LR11X0=1
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak4631_nomadstar_meteor_pro> +<mesh/api/> +<mqtt/>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
https://github.com/NomadStar-outdoor/IOBoard-RGB-LP5562-Library.git#9c366c8
|
||||
|
||||
; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm)
|
||||
; Note: as of 6/2013 the serial/bootloader based programming takes approximately 30 seconds
|
||||
;upload_protocol = jlink
|
||||
|
||||
; Allows programming and debug via the RAK NanoDAP as the default debugger tool for the RAK4631 (it is only $10!)
|
||||
; programming time is about the same as the bootloader version.
|
||||
; For information on this see the meshtastic developers documentation for "Development on the NRF52"
|
||||
[env:rak4631_nomadstar_meteor_pro_dbg]
|
||||
extends = env:rak4631_nomadstar_meteor_pro
|
||||
board_level = extra
|
||||
|
||||
; if the builtin version of openocd has a buggy version of semihosting, so use the external version
|
||||
; platform_packages = platformio/tool-openocd@^3.1200.0
|
||||
|
||||
build_flags =
|
||||
${env:rak4631.build_flags}
|
||||
-D USE_SEMIHOSTING
|
||||
|
||||
lib_deps =
|
||||
${env:rak4631.lib_deps}
|
||||
https://github.com/geeksville/Armduino-Semihosting/archive/35b538fdf208c3530c1434cd099a08e486672ee4.zip
|
||||
|
||||
; NOTE: the pyocd support for semihosting is buggy. So I switched to using the builtin platformio support for the stlink adapter which worked much better.
|
||||
; However the built in openocd version in platformio has buggy support for TCP to semihosting.
|
||||
;
|
||||
; So I'm now trying the external openocd - but the openocd scripts for nrf52.cfg assume you are using a DAP adapter not an STLINK adapter.
|
||||
; In theory I could change those scripts. But for now I'm trying going back to a DAP adapter but with the external openocd.
|
||||
|
||||
upload_protocol = stlink
|
||||
; eventually use platformio/tool-pyocd@^2.3600.0 instad
|
||||
;upload_protocol = custom
|
||||
;upload_command = pyocd flash -t nrf52840 $UPLOADERFLAGS $SOURCE
|
||||
45
variants/rak4631_nomadstar_meteor_pro/variant.cpp
Normal file
45
variants/rak4631_nomadstar_meteor_pro/variant.cpp
Normal 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);
|
||||
}
|
||||
271
variants/rak4631_nomadstar_meteor_pro/variant.h
Normal file
271
variants/rak4631_nomadstar_meteor_pro/variant.h
Normal file
@@ -0,0 +1,271 @@
|
||||
/*
|
||||
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_RAK4630_
|
||||
#define _VARIANT_RAK4630_
|
||||
|
||||
#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
|
||||
|
||||
// Texas Instrument LP5562
|
||||
#define HAS_LP5562
|
||||
#define ENABLE_AMBIENTLIGHTING
|
||||
|
||||
/*
|
||||
* 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
|
||||
|
||||
*/
|
||||
|
||||
#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_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
|
||||
|
||||
// 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 0
|
||||
|
||||
#define HAS_ETHERNET 0
|
||||
|
||||
#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
|
||||
@@ -3,7 +3,6 @@
|
||||
extends = nrf52840_base
|
||||
board = wiscore_rak4631
|
||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/rak_wismeshtap -DWISMESH_TAP -DRAK_4631
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||
-DEINK_DISPLAY_MODEL=GxEPD2_213_BN
|
||||
-DEINK_WIDTH=250
|
||||
@@ -23,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
|
||||
|
||||
@@ -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
|
||||
@@ -305,10 +307,13 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
|
||||
#define HAS_TOUCHSCREEN 1
|
||||
#define SCREEN_TOUCH_INT WB_IO6
|
||||
|
||||
#define USE_POWERSAVE
|
||||
#define SLEEP_TIME 120
|
||||
|
||||
#define CANNED_MESSAGE_MODULE_ENABLE 1
|
||||
#define USE_VIRTUAL_KEYBOARD 1
|
||||
/*----------------------------------------------------------------------------
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -9,7 +9,6 @@ build_flags = ${rp2040_base.build_flags}
|
||||
-Ivariants/rp2040-lora
|
||||
-DDEBUG_RP2040_PORT=Serial
|
||||
-DHW_SPI1_DEVICE
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus"
|
||||
lib_deps =
|
||||
${rp2040_base.lib_deps}
|
||||
debug_build_flags = ${rp2040_base.build_flags}, -g
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user