firmware/variants/ELECROW-ThinkNode-M2/variant.h
Thomas Göttgens 6c7c0770f9
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>
2025-03-28 19:55:00 -05:00

65 lines
1.5 KiB
C

// 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