add ThinkNode M2 Support (#6354)

* [WIP] Base firmware pending support for 2nd button

* Update button behaviour. Still WIP

* [WIP] Base firmware pending support for 2nd button

* Update button behaviour. Still WIP

* change env to lowercase

Co-authored-by: rcarteraz <robert.l.carter2@gmail.com>

* yea - well - what else is new?

* fix secondary button behavior and update trunk

---------

Co-authored-by: rcarteraz <robert.l.carter2@gmail.com>
This commit is contained in:
Thomas Göttgens
2025-03-29 01:55:00 +01:00
committed by GitHub
parent 89cde1a8e6
commit 6c7c0770f9
14 changed files with 201 additions and 12 deletions

View File

@@ -0,0 +1,28 @@
// Need this file for ESP32-S3
// No need to modify this file, changes to pins imported from variant.h
// Most is similar to https://github.com/espressif/arduino-esp32/blob/master/variants/esp32s3/pins_arduino.h
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#include <variant.h>
#define USB_VID 0x303a
#define USB_PID 0x1001
// Serial
static const uint8_t TX = UART_TX;
static const uint8_t RX = UART_RX;
// Default SPI will be mapped to Radio
static const uint8_t SS = LORA_CS;
static const uint8_t SCK = LORA_SCK;
static const uint8_t MOSI = LORA_MOSI;
static const uint8_t MISO = LORA_MISO;
// The default Wire will be mapped to PMU and RTC
static const uint8_t SCL = I2C_SCL;
static const uint8_t SDA = I2C_SDA;
#endif /* Pins_Arduino_h */

View File

@@ -0,0 +1,7 @@
[env:thinknode_m2]
extends = esp32s3_base
board = ESP32-S3-WROOM-1-N4
build_flags =
${esp32s3_base.build_flags}
-D ELECROW_ThinkNode_M2
-I variants/ELECROW-ThinkNode-M2

View File

@@ -0,0 +1,64 @@
// Status
#define LED_PIN_POWER 1
#define BIAS_T_ENABLE LED_PIN_POWER
#define BIAS_T_VALUE HIGH
#define PIN_BUTTON1 47 // 功能键
#define PIN_BUTTON2 4 // 电源键
#define POWER_CFG
#define POWER_CHRG 6
#define POWER_FULL 42
#define PIN_BUZZER 5
#define I2C_SCL 15
#define I2C_SDA 16
#define UART_TX 43
#define UART_RX 44
#define VEXT_ENABLE 46 // for OLED
#define VEXT_ON_VALUE HIGH
#define SX126X_CS 10
#define LORA_SCK 12
#define LORA_MOSI 11
#define LORA_MISO 13
#define SX126X_RESET 21
#define SX126X_BUSY 14
#define SX126X_DIO1 3
#define SX126X_DIO2_AS_RF_SWITCH
// #define SX126X_DIO3 9
#define SX126X_DIO3_TCXO_VOLTAGE 3.3
#define SX126X_MAX_POWER 22 // SX126xInterface.cpp defaults to 22 if not defined, but here we define it for good practice
#define USE_SX1262
#define LORA_CS SX126X_CS // FIXME: for some reason both are used in /src
#define LORA_DIO1 SX126X_DIO1
#define SX126X_POWER_EN 48
// Battery
// #define BATTERY_PIN 2
#define BATTERY_PIN 17
// #define ADC_CHANNEL ADC1_GPIO2_CHANNEL
#define ADC_CHANNEL ADC2_GPIO17_CHANNEL
#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.548F)
#define BAT_MEASURE_ADC_UNIT 2
#define HAS_SCREEN 1
#define USE_SH1106 1
// PCF8563 RTC Module
// #define PCF8563_RTC 0x51
// #define PIN_RTC_INT 48 // Interrupt from the PCF8563 RTC
#define HAS_RTC 0
#define HAS_GPS 0
#define BUTTON_PIN PIN_BUTTON1
#define BUTTON_PIN_ALT PIN_BUTTON2