mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-07 18:37:52 +00:00
Merge remote-tracking branch 'upstream/master' into StandaloneAddons
This commit is contained in:
14
variants/Seeed_Solar_Node/platformio.ini
Normal file
14
variants/Seeed_Solar_Node/platformio.ini
Normal file
@@ -0,0 +1,14 @@
|
||||
[env:Seeed_Solar_Node]
|
||||
board = Seeed_Solar_Node
|
||||
extends = nrf52840_base
|
||||
;board_level = extra
|
||||
build_flags = ${nrf52840_base.build_flags}
|
||||
-I $PROJECT_DIR/variants/Seeed_Solar_Node
|
||||
-D SEEED_SOLAR_NODE
|
||||
-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/Seeed_Solar_Node>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
debug_tool = jlink
|
||||
108
variants/Seeed_Solar_Node/variant.cpp
Normal file
108
variants/Seeed_Solar_Node/variant.cpp
Normal file
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* variant.cpp - Digital pin mapping for nRF52-based development board
|
||||
*
|
||||
* This file defines the pin mapping array that maps logical digital pins (D0-D17)
|
||||
* to physical GPIO ports/pins on the Nordic nRF52 series microcontroller.
|
||||
*
|
||||
* Board: [Seeed Studio XIAO nRF52840 Sense (Seeed Solar Node)]
|
||||
* Hardware Features:
|
||||
* - LoRa module (CS/SCK/MISO/MOSI control pins)
|
||||
* - GNSS module (TX/RX/Reset/Wakeup)
|
||||
* - User LEDs (D11-D12)
|
||||
* - User button (D13)
|
||||
* - Grove/NFC interface (D14-D15)
|
||||
* - Battery voltage monitoring (D16)
|
||||
*
|
||||
* Created [20250225]
|
||||
* By [Dylan]
|
||||
* Version 1.0
|
||||
* License: [MIT]
|
||||
*/
|
||||
|
||||
#include "variant.h"
|
||||
#include "nrf.h"
|
||||
#include "wiring_constants.h"
|
||||
#include "wiring_digital.h"
|
||||
|
||||
/**
|
||||
* @brief Digital pin to GPIO port/pin mapping table
|
||||
*
|
||||
* Format: Logical Pin (Dx) -> nRF Port.Pin (Px.xx)
|
||||
*
|
||||
* Pin Groupings:
|
||||
* [D0-D10] - Peripheral control (LoRa, GNSS)
|
||||
* [D11-D12] - LED outputs
|
||||
* [D13] - User button
|
||||
* [D14-D15] - Grove/NFC interface
|
||||
* [D16] - Battery voltage ADC input
|
||||
* [D17] - GNSS module reset
|
||||
*/
|
||||
|
||||
extern "C" {
|
||||
const uint32_t g_ADigitalPinMap[] = {
|
||||
// D0 .. D10 - Peripheral control pins
|
||||
2, // D0 P0.02 (A0) GNSS_WAKEUP
|
||||
3, // D1 P0.03 (A1) LORA_DIO1
|
||||
28, // D2 P0.28 (A2) LORA_RESET
|
||||
29, // D3 P0.29 (A3) LORA_BUSY
|
||||
4, // D4 P0.04 (A4/SDA) LORA_CS
|
||||
5, // D5 P0.05 (A5/SCL) LORA_SW
|
||||
43, // D6 P1.11 (UART_TX) GNSS_TX
|
||||
44, // D7 P1.12 (UART_RX) GNSS_RX
|
||||
45, // D8 P1.13 (SPI_SCK) LORA_SCK
|
||||
46, // D9 P1.14 (SPI_MISO) LORA_MISO
|
||||
47, // D10 P1.15 (SPI_MOSI) LORA_MOSI
|
||||
|
||||
// D11-D12 - LED outputs
|
||||
15, // D11 P0.15 User LED
|
||||
19, // D12 P0.19 Breathing LED
|
||||
|
||||
// D13 - User input
|
||||
33, // D13 P1.01 User Button
|
||||
|
||||
// D14-D15 - Grove/NFC interface
|
||||
9, // D14 P0.09 NFC1/GROVE_D1
|
||||
10, // D15 P0.10 NFC2/GROVE_D0
|
||||
|
||||
// D16 - Power management
|
||||
// 31, // D16 P0.31 VBAT_ADC (Battery voltage)
|
||||
31, // D16 P0.31 VBAT_ADC (Battery voltage)
|
||||
// D17 - GNSS control
|
||||
35, // D17 P1.03 GNSS_RESET
|
||||
|
||||
37, // D18 P1.05 GNSS_ENABLE
|
||||
14, // D19 P0.14 BAT_READ
|
||||
39, // D20 P1.07 USER_BUTTON
|
||||
|
||||
//
|
||||
21, // D21 P0.21 (QSPI_SCK)
|
||||
25, // D22 P0.25 (QSPI_CSN)
|
||||
20, // D23 P0.20 (QSPI_SIO_0 DI)
|
||||
24, // D24 P0.24 (QSPI_SIO_1 DO)
|
||||
22, // D25 P0.22 (QSPI_SIO_2 WP)
|
||||
23, // D26 P0.23 (QSPI_SIO_3 HOLD)
|
||||
};
|
||||
}
|
||||
|
||||
void initVariant()
|
||||
{
|
||||
pinMode(PIN_QSPI_CS, OUTPUT);
|
||||
digitalWrite(PIN_QSPI_CS, HIGH);
|
||||
// This setup is crucial for ensuring low power consumption and proper initialization of the hardware components.
|
||||
pinMode(GPS_EN, OUTPUT);
|
||||
digitalWrite(GPS_EN, LOW);
|
||||
|
||||
// VBAT_ENABLE
|
||||
pinMode(BAT_READ, OUTPUT);
|
||||
digitalWrite(BAT_READ, LOW);
|
||||
|
||||
pinMode(PIN_LED1, OUTPUT);
|
||||
digitalWrite(PIN_LED1, LOW);
|
||||
pinMode(PIN_LED2, OUTPUT);
|
||||
digitalWrite(PIN_LED2, LOW);
|
||||
pinMode(PIN_LED2, OUTPUT);
|
||||
// digitalWrite(LED_PIN, LOW);
|
||||
|
||||
pinMode(GPS_EN, OUTPUT);
|
||||
digitalWrite(GPS_EN, HIGH);
|
||||
}
|
||||
157
variants/Seeed_Solar_Node/variant.h
Normal file
157
variants/Seeed_Solar_Node/variant.h
Normal file
@@ -0,0 +1,157 @@
|
||||
#ifndef _SEEED_SOLAR_NODE_H_
|
||||
#define _SEEED_SOLAR_NODE_H_
|
||||
#include "WVariant.h"
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// Clock Configuration
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
#define VARIANT_MCK (64000000ul) // Master clock frequency
|
||||
#define USE_LFXO // 32.768kHz crystal for LFCLK
|
||||
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// Pin Capacity Definitions
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
#define PINS_COUNT (33u) // Total GPIO pins
|
||||
#define NUM_DIGITAL_PINS (33u) // Digital I/O pins
|
||||
#define NUM_ANALOG_INPUTS (8u) // Analog inputs (A0-A5 + VBAT + AREF)
|
||||
#define NUM_ANALOG_OUTPUTS (0u)
|
||||
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// LED Configuration
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// LEDs
|
||||
// LEDs
|
||||
#define PIN_LED1 (11) // LED P1.15
|
||||
#define PIN_LED2 (12) //
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
#define LED_BLUE PIN_LED2
|
||||
// #define LED_PIN PIN_LED2
|
||||
#define LED_STATE_ON 1 // State when LED is litted
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// Button Configuration
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
#define BUTTON_PIN D13 // This is the Program Button
|
||||
// #define BUTTON_NEED_PULLUP 1
|
||||
#define BUTTON_ACTIVE_LOW true
|
||||
#define BUTTON_ACTIVE_PULLUP false
|
||||
|
||||
#define BUTTON_PIN_TOUCH 20 // Touch button
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// Digital Pin Mapping (D0-D10)
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
#define D0 0 // P0.02 GNSS_WAKEUP/IO0
|
||||
#define D1 1 // P0.03 LORA_DIO1
|
||||
#define D2 2 // P0.28 LORA_RESET
|
||||
#define D3 3 // P0.29 LORA_BUSY
|
||||
#define D4 4 // P0.04 LORA_CS/I2C_SDA
|
||||
#define D5 5 // P0.05 LORA_SW/I2C_SCL
|
||||
#define D6 6 // P1.11 GNSS_TX
|
||||
#define D7 7 // P1.12 GNSS_RX
|
||||
#define D8 8 // P1.13 SPI_SCK
|
||||
#define D9 9 // P1.14 SPI_MISO
|
||||
#define D10 10 // P1.15 SPI_MOSI
|
||||
#define D13 13 // P1.01 User Button
|
||||
#define D14 14 // P0.09 NFC1/GROVE_D1
|
||||
#define D15 15 // P0.10 NFC2/GROVE_D0
|
||||
#define D16 16 // P0.31 VBAT_ADC (Battery voltage)
|
||||
#define D17 17 // P1.03 GNSS_RESET
|
||||
#define D18 18 // P1.05 GNSS_ENABLE
|
||||
#define D19 19 // P0.14 BAT_READ
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// Analog Pin Definitions
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
#define PIN_A0 0 // P0.02 Analog Input 0
|
||||
#define PIN_A1 1 // P0.03 Analog Input 1
|
||||
#define PIN_A2 2 // P0.28 Analog Input 2
|
||||
#define PIN_A3 3 // P0.29 Analog Input 3
|
||||
#define PIN_A4 4 // P0.04 Analog Input 4
|
||||
#define PIN_A5 5 // P0.05 Analog Input 5
|
||||
#define PIN_VBAT D16 // P0.31 Battery voltage sense
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// Communication Interfaces
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// I2C Configuration
|
||||
#define HAS_WIRE 1
|
||||
#define PIN_WIRE_SDA D14 // P0.09
|
||||
#define PIN_WIRE_SCL D15 // P0.10
|
||||
#define WIRE_INTERFACES_COUNT 1
|
||||
#define I2C_NO_RESCAN
|
||||
|
||||
static const uint8_t SDA = PIN_WIRE_SDA;
|
||||
static const uint8_t SCL = PIN_WIRE_SCL;
|
||||
// SPI Configuration (SX1262)
|
||||
|
||||
#define SPI_INTERFACES_COUNT 1
|
||||
#define PIN_SPI_MISO 9 // P1.14 (D9)
|
||||
#define PIN_SPI_MOSI 10 // P1.15 (D10)
|
||||
#define PIN_SPI_SCK 8 // P1.13 (D8)
|
||||
|
||||
// SX1262 LoRa Module Pins
|
||||
#define USE_SX1262
|
||||
#define SX126X_CS D4 // Chip select
|
||||
#define SX126X_DIO1 D1 // Digital IO 1 (Interrupt)
|
||||
#define SX126X_BUSY D3 // Busy status
|
||||
#define SX126X_RESET D2 // Reset control
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8 // TCXO supply voltage
|
||||
#define SX126X_RXEN D5 // RX enable control
|
||||
#define SX126X_TXEN RADIOLIB_NC
|
||||
#define SX126X_DIO2_AS_RF_SWITCH // This Line is really necessary for SX1262 to work with RF switch or will loss TX power
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// Power Management
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
#define BAT_READ \
|
||||
D19 // 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 BATTERY_SENSE_RESOLUTION_BITS 12
|
||||
#define ADC_MULTIPLIER 3.3
|
||||
#define BATTERY_PIN PIN_VBAT // PIN_A7
|
||||
#define AREF_VOLTAGE 3.3
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// GPS L76KB
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
#define GPS_L76K
|
||||
#ifdef GPS_L76K
|
||||
#define PIN_GPS_RX D6 // 44
|
||||
#define PIN_GPS_TX D7 // 43
|
||||
#define HAS_GPS 1
|
||||
#define GPS_BAUDRATE 9600
|
||||
#define GPS_THREAD_INTERVAL 50
|
||||
#define PIN_SERIAL1_RX PIN_GPS_TX
|
||||
#define PIN_SERIAL1_TX PIN_GPS_RX
|
||||
#define PIN_GPS_STANDBY D0
|
||||
#define GPS_EN D18 // P1.05
|
||||
#endif
|
||||
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// On-board QSPI Flash
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// On-board QSPI Flash
|
||||
#define PIN_QSPI_SCK (21)
|
||||
#define PIN_QSPI_CS (22)
|
||||
#define PIN_QSPI_IO0 (23)
|
||||
#define PIN_QSPI_IO1 (24)
|
||||
#define PIN_QSPI_IO2 (25)
|
||||
#define PIN_QSPI_IO3 (26)
|
||||
|
||||
#define EXTERNAL_FLASH_DEVICES P25Q16H
|
||||
#define EXTERNAL_FLASH_USE_QSPI
|
||||
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// Compatibility Definitions
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
// Serial port placeholders
|
||||
|
||||
#define PIN_SERIAL2_RX (-1)
|
||||
#define PIN_SERIAL2_TX (-1)
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _SEEED_SOLAR_NODE_H_
|
||||
15
variants/ec_catsniffer/platformio.ini
Normal file
15
variants/ec_catsniffer/platformio.ini
Normal file
@@ -0,0 +1,15 @@
|
||||
[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
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m0plus"
|
||||
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
|
||||
64
variants/elecrow_panel/pins_arduino.h
Normal file
64
variants/elecrow_panel/pins_arduino.h
Normal file
@@ -0,0 +1,64 @@
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// static const uint8_t LED_BUILTIN = -1;
|
||||
|
||||
// static const uint8_t TX = 43;
|
||||
// static const uint8_t RX = 44;
|
||||
|
||||
static const uint8_t SDA = 39;
|
||||
static const uint8_t SCL = 40;
|
||||
|
||||
// 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;
|
||||
|
||||
#ifndef CROW_SELECT
|
||||
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 SPI_CS = 7; // SD does not support -1
|
||||
static const uint8_t SDCARD_CS = SPI_CS;
|
||||
#endif
|
||||
|
||||
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 */
|
||||
123
variants/elecrow_panel/platformio.ini
Normal file
123
variants/elecrow_panel/platformio.ini
Normal file
@@ -0,0 +1,123 @@
|
||||
[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
|
||||
-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 INPUTDRIVER_BUTTON_TYPE=0
|
||||
-D HAS_TELEMETRY=0
|
||||
-D CONFIG_DISABLE_HAL_LOCKS=1
|
||||
-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
|
||||
|
||||
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
|
||||
hideakitai/TCA9534@^0.1.1
|
||||
|
||||
[env:elecrow-24-28-tft]
|
||||
extends = crowpanel_base
|
||||
|
||||
build_flags =
|
||||
${crowpanel_base.build_flags}
|
||||
-D TFT_HEIGHT=320 ; needed in variant.h
|
||||
-D HAS_SDCARD
|
||||
-D SDCARD_USE_SOFT_SPI
|
||||
-D SPI_DRIVER_SELECT=2
|
||||
-D USE_PIN_BUZZER
|
||||
; -D INPUTDRIVER_BUTTON_TYPE=0 ; no button as this pin is assigned to LoRa cs!
|
||||
-D SCREEN_TOUCH_INT=47 ; used to wake up the MCU by touch
|
||||
-D LGFX_DRIVER_TEMPLATE
|
||||
-D LGFX_DRIVER=LGFX_GENERIC
|
||||
-D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_GENERIC.h\"
|
||||
-D SPI_FREQUENCY=80000000
|
||||
-D LGFX_SCREEN_WIDTH=240
|
||||
-D LGFX_SCREEN_HEIGHT=320
|
||||
-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
|
||||
-D VIEW_320x240
|
||||
-D MAP_FULL_REDRAW
|
||||
|
||||
[env:elecrow-35-tft]
|
||||
extends = crowpanel_base
|
||||
|
||||
build_flags =
|
||||
${crowpanel_base.build_flags}
|
||||
-D TFT_HEIGHT=480 ; needed in variant.h
|
||||
-D HAS_SDCARD
|
||||
-D SDCARD_USE_SOFT_SPI
|
||||
-D SPI_DRIVER_SELECT=2
|
||||
-D USE_PIN_BUZZER
|
||||
; -D INPUTDRIVER_BUTTON_TYPE=0 ; no button as this pin is assigned to LoRa cs!
|
||||
-D SCREEN_TOUCH_INT=47 ; used to wake up the MCU by touch
|
||||
-D LV_CACHE_DEF_SIZE=2097152
|
||||
-D LGFX_DRIVER_TEMPLATE
|
||||
-D LGFX_DRIVER=LGFX_GENERIC
|
||||
-D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_GENERIC.h\"
|
||||
-D SPI_FREQUENCY=60000000
|
||||
-D LGFX_SCREEN_WIDTH=320
|
||||
-D LGFX_SCREEN_HEIGHT=480
|
||||
-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
|
||||
-D VIEW_320x240
|
||||
-D MAP_FULL_REDRAW
|
||||
195
variants/elecrow_panel/variant.h
Normal file
195
variants/elecrow_panel/variant.h
Normal file
@@ -0,0 +1,195 @@
|
||||
#define I2C_SDA 15
|
||||
#define I2C_SCL 16
|
||||
|
||||
#if TFT_HEIGHT == 320 && not defined(HAS_TFT) // 2.4 and 2.8 TFT
|
||||
// ST7789 TFT LCD
|
||||
#define ST7789_CS 40
|
||||
#define ST7789_RS 41 // DC
|
||||
#define ST7789_SDA 39 // MOSI
|
||||
#define ST7789_SCK 42
|
||||
#define ST7789_RESET -1
|
||||
#define ST7789_MISO 38
|
||||
#define ST7789_BUSY -1
|
||||
#define ST7789_BL 38
|
||||
#define ST7789_SPI_HOST SPI2_HOST
|
||||
#define TFT_BL 38
|
||||
#define SPI_FREQUENCY 60000000
|
||||
#define SPI_READ_FREQUENCY 16000000
|
||||
#define TFT_OFFSET_ROTATION 0
|
||||
#define SCREEN_ROTATE
|
||||
#define TFT_DUMMY_READ_PIXELS 8
|
||||
#define SCREEN_TRANSITION_FRAMERATE 5
|
||||
#define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness
|
||||
|
||||
#define HAS_TOUCHSCREEN 1
|
||||
#define SCREEN_TOUCH_INT 47
|
||||
#define SCREEN_TOUCH_RST 48
|
||||
#define TOUCH_I2C_PORT 0
|
||||
#define TOUCH_SLAVE_ADDRESS 0x38 // FT5x06
|
||||
#endif
|
||||
|
||||
#if TFT_HEIGHT == 480 && not defined(HAS_TFT) // 3.5 TFT
|
||||
// ILI9488 TFT LCD
|
||||
#define ILI9488_CS 40
|
||||
#define ILI9488_RS 41 // DC
|
||||
#define ILI9488_SDA 39 // MOSI
|
||||
#define ILI9488_SCK 42
|
||||
#define ILI9488_RESET -1
|
||||
#define ILI9488_MISO 38
|
||||
#define ILI9488_BUSY -1
|
||||
#define ILI9488_BL 38
|
||||
#define ILI9488_SPI_HOST SPI2_HOST
|
||||
#define TFT_BL 38
|
||||
#define SPI_FREQUENCY 40000000
|
||||
#define SPI_READ_FREQUENCY 16000000
|
||||
#define TFT_OFFSET_ROTATION 0
|
||||
#define SCREEN_ROTATE
|
||||
#define TFT_DUMMY_READ_PIXELS 8
|
||||
#define SCREEN_TRANSITION_FRAMERATE 5
|
||||
#define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness
|
||||
|
||||
#define HAS_TOUCHSCREEN 1
|
||||
#define SCREEN_TOUCH_INT 47
|
||||
#define SCREEN_TOUCH_RST 48
|
||||
#define TOUCH_I2C_PORT 0
|
||||
#define TOUCH_SLAVE_ADDRESS 0x5D // GT911
|
||||
#endif
|
||||
|
||||
#ifdef CROW_SELECT
|
||||
#define ST72xx_DE 42
|
||||
#define ST72xx_VSYNC 41
|
||||
#define ST72xx_HSYNC 40
|
||||
#define ST72xx_PCLK 39
|
||||
#define ST72xx_R0 7
|
||||
#define ST72xx_R1 17
|
||||
#define ST72xx_R2 18
|
||||
#define ST72xx_R3 3
|
||||
#define ST72xx_R4 46
|
||||
#define ST72xx_G0 9
|
||||
#define ST72xx_G1 10
|
||||
#define ST72xx_G2 11
|
||||
#define ST72xx_G3 12
|
||||
#define ST72xx_G4 13
|
||||
#define ST72xx_G5 14
|
||||
#define ST72xx_B0 21
|
||||
#define ST72xx_B1 47
|
||||
#define ST72xx_B2 48
|
||||
#define ST72xx_B3 45
|
||||
#define ST72xx_B4 38
|
||||
|
||||
#define HAS_TOUCHSCREEN 1
|
||||
#define TOUCH_I2C_PORT 0
|
||||
#define TOUCH_SLAVE_ADDRESS 0x5D // GT911
|
||||
#endif
|
||||
|
||||
#if defined(CROW_SELECT) && CROW_SELECT == 1 // 4.3 TFT 800x480
|
||||
#define ST7265_HSYNC_POLARITY 0
|
||||
#define ST7265_HSYNC_FRONT_PORCH 24
|
||||
#define ST7265_HSYNC_PULSE_WIDTH 8
|
||||
#define ST7265_HSYNC_BACK_PORCH 24
|
||||
#define ST7265_VSYNC_POLARITY 1
|
||||
#define ST7265_VSYNC_FRONT_PORCH 24
|
||||
#define ST7265_VSYNC_PULSE_WIDTH 8
|
||||
#define ST7265_VSYNC_BACK_PORCH 24
|
||||
#define ST7265_PCLK_ACTIVE_NEG 1
|
||||
#endif
|
||||
|
||||
#if defined(CROW_SELECT) && CROW_SELECT == 2 // 5.0 TFT 800x480
|
||||
#define ST7262_HSYNC_POLARITY 0
|
||||
#define ST7262_HSYNC_FRONT_PORCH 8
|
||||
#define ST7262_HSYNC_PULSE_WIDTH 4
|
||||
#define ST7262_HSYNC_BACK_PORCH 8
|
||||
#define ST7262_VSYNC_POLARITY 0
|
||||
#define ST7262_VSYNC_FRONT_PORCH 8
|
||||
#define ST7262_VSYNC_PULSE_WIDTH 4
|
||||
#define ST7262_VSYNC_BACK_PORCH 8
|
||||
#define ST7262_PCLK_ACTIVE_NEG 0
|
||||
#endif
|
||||
|
||||
#if defined(CROW_SELECT) && CROW_SELECT == 3 // 7.0 TFT 800x480
|
||||
#define SC7277_HSYNC_POLARITY 0
|
||||
#define SC7277_HSYNC_FRONT_PORCH 8
|
||||
#define SC7277_HSYNC_PULSE_WIDTH 4
|
||||
#define SC7277_HSYNC_BACK_PORCH 8
|
||||
#define SC7277_VSYNC_POLARITY 0
|
||||
#define SC7277_VSYNC_FRONT_PORCH 8
|
||||
#define SC7277_VSYNC_PULSE_WIDTH 4
|
||||
#define SC7277_VSYNC_BACK_PORCH 8
|
||||
#define SC7277_PCLK_ACTIVE_NEG 0
|
||||
#endif
|
||||
|
||||
#if TFT_HEIGHT == 320 // 2.4-2.8 have I2S audio
|
||||
// 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 HAS_GPS 1
|
||||
#define GPS_DEFAULT_NOT_PRESENT 1
|
||||
#define GPS_RX_PIN 18
|
||||
#define GPS_TX_PIN 17
|
||||
|
||||
// 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
|
||||
#define LORA_CS 0 // GND
|
||||
|
||||
#if TFT_HEIGHT == 320 || TFT_HEIGHT == 480 // 2.4 - 3.5 TFT
|
||||
#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
|
||||
#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 HW_SPI1_DEVICE
|
||||
#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
|
||||
|
||||
#define USE_VIRTUAL_KEYBOARD 1
|
||||
#define DISPLAY_CLOCK_FRAME 1
|
||||
107
variants/heltec_mesh_pocket/nicheGraphics.h
Normal file
107
variants/heltec_mesh_pocket/nicheGraphics.h
Normal file
@@ -0,0 +1,107 @@
|
||||
#pragma once
|
||||
|
||||
#include "configuration.h"
|
||||
|
||||
#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS
|
||||
|
||||
// InkHUD-specific components
|
||||
// ---------------------------
|
||||
#include "graphics/niche/InkHUD/InkHUD.h"
|
||||
|
||||
// Applets
|
||||
#include "graphics/niche/InkHUD/Applets/User/AllMessage/AllMessageApplet.h"
|
||||
#include "graphics/niche/InkHUD/Applets/User/DM/DMApplet.h"
|
||||
#include "graphics/niche/InkHUD/Applets/User/Heard/HeardApplet.h"
|
||||
#include "graphics/niche/InkHUD/Applets/User/Positions/PositionsApplet.h"
|
||||
#include "graphics/niche/InkHUD/Applets/User/RecentsList/RecentsListApplet.h"
|
||||
#include "graphics/niche/InkHUD/Applets/User/ThreadedMessage/ThreadedMessageApplet.h"
|
||||
|
||||
// #include "graphics/niche/InkHUD/Applets/Examples/BasicExample/BasicExampleApplet.h"
|
||||
// #include "graphics/niche/InkHUD/Applets/Examples/NewMsgExample/NewMsgExampleApplet.h"
|
||||
|
||||
// Shared NicheGraphics components
|
||||
// --------------------------------
|
||||
#include "graphics/niche/Drivers/EInk/LCMEN2R13ECC1.h"
|
||||
#include "graphics/niche/Inputs/TwoButton.h"
|
||||
|
||||
#include "graphics/niche/Fonts/FreeSans6pt7b.h"
|
||||
#include "graphics/niche/Fonts/FreeSans6pt8bCyrillic.h"
|
||||
#include <Fonts/FreeSans9pt7b.h>
|
||||
|
||||
void setupNicheGraphics()
|
||||
{
|
||||
using namespace NicheGraphics;
|
||||
|
||||
// SPI
|
||||
// -----------------------------
|
||||
SPIClass *spi1 = &SPI1;
|
||||
spi1->begin();
|
||||
// Display is connected to SPI1
|
||||
|
||||
// E-Ink Driver
|
||||
// -----------------------------
|
||||
// Use 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 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();
|
||||
*/
|
||||
|
||||
// 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
|
||||
inkhud->addApplet("All Messages", new InkHUD::AllMessageApplet, true, true); // Activated, autoshown
|
||||
inkhud->addApplet("DMs", new InkHUD::DMApplet); // Inactive
|
||||
inkhud->addApplet("Channel 0", new InkHUD::ThreadedMessageApplet(0)); // Inactive
|
||||
inkhud->addApplet("Channel 1", new InkHUD::ThreadedMessageApplet(1)); // Inactive
|
||||
inkhud->addApplet("Positions", new InkHUD::PositionsApplet, true); // Activated
|
||||
inkhud->addApplet("Recents List", new InkHUD::RecentsListApplet); // Inactive
|
||||
inkhud->addApplet("Heard", new InkHUD::HeardApplet, true, false, 0); // Activated, not autoshown, default on tile 0
|
||||
// inkhud->addApplet("Basic", new InkHUD::BasicExampleApplet);
|
||||
// inkhud->addApplet("NewMsg", new InkHUD::NewMsgExampleApplet);
|
||||
|
||||
// Start running InkHUD
|
||||
inkhud->begin();
|
||||
|
||||
// Buttons
|
||||
// --------------------------
|
||||
|
||||
Inputs::TwoButton *buttons = Inputs::TwoButton::getInstance(); // Shared NicheGraphics component
|
||||
constexpr uint8_t MAIN_BUTTON = 0;
|
||||
// constexpr uint8_t AUX_BUTTON = 1;
|
||||
|
||||
// Setup the main user button
|
||||
buttons->setWiring(MAIN_BUTTON, Inputs::TwoButton::getUserButtonPin());
|
||||
buttons->setHandlerShortPress(MAIN_BUTTON, []() { InkHUD::InkHUD::getInstance()->shortpress(); });
|
||||
buttons->setHandlerLongPress(MAIN_BUTTON, []() { InkHUD::InkHUD::getInstance()->longpress(); });
|
||||
|
||||
// Setup the aux button
|
||||
// Bonus feature of VME213
|
||||
// buttons->setWiring(AUX_BUTTON, BUTTON_PIN_SECONDARY);
|
||||
// buttons->setHandlerShortPress(AUX_BUTTON, []() { InkHUD::InkHUD::getInstance()->nextTile(); });
|
||||
buttons->start();
|
||||
}
|
||||
|
||||
#endif
|
||||
92
variants/heltec_mesh_pocket/platformio.ini
Normal file
92
variants/heltec_mesh_pocket/platformio.ini
Normal file
@@ -0,0 +1,92 @@
|
||||
; 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
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-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-inkhud-5000]
|
||||
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}
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-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
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-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-inkhud-10000]
|
||||
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}
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-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
|
||||
@@ -197,6 +197,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
|
||||
|
||||
@@ -49,7 +49,6 @@ build_flags =
|
||||
-D HAS_SCREEN=0
|
||||
-D HAS_TFT=1
|
||||
-D DISPLAY_SET_RESOLUTION
|
||||
-D USE_PIN_BUZZER
|
||||
-D RAM_SIZE=4096
|
||||
-D LV_LVGL_H_INCLUDE_SIMPLE
|
||||
-D LV_CONF_INCLUDE_SIMPLE
|
||||
|
||||
@@ -29,6 +29,12 @@
|
||||
#include "graphics/niche/Fonts/FreeSans6pt8bCyrillic.h"
|
||||
#include <Fonts/FreeSans9pt7b.h>
|
||||
|
||||
// Special case - fix T-Echo's touch button
|
||||
// ----------------------------------------
|
||||
// On a handful of T-Echos, LoRa TX triggers the capacitive touch
|
||||
// To avoid this, we lockout the button during TX
|
||||
#include "mesh/RadioLibInterface.h"
|
||||
|
||||
void setupNicheGraphics()
|
||||
{
|
||||
using namespace NicheGraphics;
|
||||
@@ -115,13 +121,22 @@ void setupNicheGraphics()
|
||||
buttons->setWiring(TOUCH_BUTTON, PIN_BUTTON_TOUCH);
|
||||
buttons->setTiming(TOUCH_BUTTON, 50, 5000); // 5 seconds before latch - limited by T-Echo's capacitive touch IC
|
||||
buttons->setHandlerDown(TOUCH_BUTTON, [backlight]() {
|
||||
// Discard the button press if radio is active
|
||||
// Rare hardware fault: LoRa activity triggers touch button
|
||||
if (!RadioLibInterface::instance || RadioLibInterface::instance->isSending())
|
||||
return;
|
||||
|
||||
// Backlight on (while held)
|
||||
backlight->peek();
|
||||
InkHUD::InkHUD::getInstance()->persistence->settings.optionalMenuItems.backlight =
|
||||
false; // We've proved user still has the button. No need to make backlight togglable via the menu.
|
||||
|
||||
// Handler has run, which confirms touch button wasn't removed as part of DIY build.
|
||||
// No longer need the fallback backlight toggle in menu.
|
||||
InkHUD::InkHUD::getInstance()->persistence->settings.optionalMenuItems.backlight = false;
|
||||
});
|
||||
buttons->setHandlerLongPress(TOUCH_BUTTON, [backlight]() { backlight->latch(); });
|
||||
buttons->setHandlerShortPress(TOUCH_BUTTON, [backlight]() { backlight->off(); });
|
||||
|
||||
// Begin handling button events
|
||||
buttons->start();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
extends = esp32s3_base
|
||||
board = t-watch-s3
|
||||
board_check = true
|
||||
board_build.partitions = default_8MB.csv
|
||||
board_build.partitions = default_16MB.csv
|
||||
upload_protocol = esptool
|
||||
|
||||
build_flags = ${esp32_base.build_flags}
|
||||
|
||||
@@ -3,4 +3,5 @@ board_level = extra
|
||||
extends = esp32_base
|
||||
board = ttgo-lora32-v1
|
||||
build_flags =
|
||||
${esp32_base.build_flags} -D TLORA_V1 -I variants/tlora_v1
|
||||
${esp32_base.build_flags} -D TLORA_V1 -I variants/tlora_v1
|
||||
upload_speed = 115200
|
||||
@@ -3,4 +3,5 @@ board_level = extra
|
||||
extends = esp32_base
|
||||
board = ttgo-lora32-v1
|
||||
build_flags =
|
||||
${esp32_base.build_flags} -D TLORA_V1_3 -I variants/tlora_v1_3
|
||||
${esp32_base.build_flags} -D TLORA_V1_3 -I variants/tlora_v1_3
|
||||
upload_speed = 115200
|
||||
@@ -4,4 +4,5 @@ board = ttgo-lora32-v21
|
||||
board_check = true
|
||||
build_flags =
|
||||
${esp32_base.build_flags} -D TLORA_V2_1_16 -I variants/tlora_v2_1_16
|
||||
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||
upload_speed = 115200
|
||||
@@ -7,4 +7,5 @@ build_flags =
|
||||
-D TLORA_V2_1_16
|
||||
-I variants/tlora_v2_1_16
|
||||
-D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
|
||||
-D LORA_TCXO_GPIO=33
|
||||
-D LORA_TCXO_GPIO=33
|
||||
upload_speed = 115200
|
||||
@@ -5,6 +5,10 @@ build_flags = ${nrf52840_base.build_flags} -Ivariants/tracker-t1000-e -Isrc/plat
|
||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||
-DGPS_POWER_TOGGLE
|
||||
-DMESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR_EXTERNAL=1
|
||||
-DMESHTASTIC_EXCLUDE_CANNEDMESSAGES=1
|
||||
-DMESHTASTIC_EXCLUDE_SCREEN=1
|
||||
-DMESHTASTIC_EXCLUDE_DETECTIONSENSOR=1
|
||||
-DMESHTASTIC_EXCLUDE_WIFI=1
|
||||
board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/tracker-t1000-e>
|
||||
lib_deps =
|
||||
@@ -12,4 +16,4 @@ lib_deps =
|
||||
https://github.com/meshtastic/QMA6100P_Arduino_Library/archive/14c900b8b2e4feaac5007a7e41e0c1b7f0841136.zip
|
||||
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 = nrfutil
|
||||
upload_protocol = nrfutil
|
||||
|
||||
@@ -152,6 +152,8 @@ extern "C" {
|
||||
#define T1000X_NTC_PIN (0 + 31) // P0.31/AIN7
|
||||
#define T1000X_LUX_PIN (0 + 29) // P0.29/AIN5
|
||||
|
||||
#define HAS_SCREEN 0
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -160,4 +162,4 @@ extern "C" {
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif // _VARIANT_TRACKER_T1000_E_
|
||||
#endif // _VARIANT_TRACKER_T1000_E_
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// This board has no GPS or Screen for now
|
||||
#undef GPS_RX_PIN
|
||||
#undef GPS_TX_PIN
|
||||
#define NO_GPS
|
||||
#define NO_GPS 1
|
||||
#define HAS_GPS 0
|
||||
#define NO_SCREEN
|
||||
#define HAS_SCREEN 0
|
||||
|
||||
Reference in New Issue
Block a user