From 9f85274d4bf07e1751753f0df4b009af0fbfc8d1 Mon Sep 17 00:00:00 2001 From: cyberman54 Date: Sun, 26 Jan 2025 23:40:53 +0100 Subject: [PATCH] add ttgobeam12.h --- shared/hal/ttgobeam12.h | 54 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 shared/hal/ttgobeam12.h diff --git a/shared/hal/ttgobeam12.h b/shared/hal/ttgobeam12.h new file mode 100644 index 00000000..97b1cb8a --- /dev/null +++ b/shared/hal/ttgobeam12.h @@ -0,0 +1,54 @@ +// clang-format off +// upload_speed 921600 +// board ttgo-t-beam + +#ifndef _TTGOBEAM_H +#define _TTGOBEAM_H + +#include + +/* +Hardware related definitions for TTGO T-Beam board +for T-Beam version T22_V12 +see https://lilygo.cc/products/t-beam-softrf + +/// Button functions: /// +Power, short press -> set device on / while device is on: goto sleep +Power, long press -> set device off +User, short press -> flip display page +User, long press -> send a button message +Reset -> reset device +*/ + +#define HAS_DISPLAY 1 +#define MY_DISPLAY_SDA SDA +#define MY_DISPLAY_SCL SCL +#define MY_DISPLAY_RST NOT_A_PIN +//#define MY_DISPLAY_FLIP 1 // use if display is rotated + +#define HAS_LORA 1 // comment out if device shall not send data via LoRa +#define CFG_sx1262_radio 1 // HPD13A LoRa SoC +#define HAS_BUTTON GPIO_NUM_38 // middle on board button +#define HAS_LED GPIO_NUM_4 // not present on all T-Beam 1.0 boards +#define LED_ACTIVE_LOW 1 + +// power management settings +#define HAS_PMU 1 // has AXP2101 chip +#define XPOWERS_CHIP_AXP2101 1 +#define PMU_SDA 21 // PMU is on I2C bus #2 +#define PMU_SCL 22 // PMU is on I2C bus #2 +#define PMU_INT GPIO_NUM_35 // PMU interrupt +#define PMU_WIRE Wire1 // use I2C bus #2 +#define PMU_CHG_CURRENT XPOWERS_AXP192_CHG_CUR_1000MA // battery charge current +// possible values (mA): +// 100/190/280/360/450/550/630/700/780/880/960/1000/1080/1160/1240/1320 +#define PMU_CHG_CUTOFF XPOWERS_AXP192_CHG_VOL_4V2 // battery charge cutoff +// possible values (V): +// 4V1/4V15/4V2/4V36 + +// GPS settings +#define HAS_GPS 1 // use on board GPS +#define GPS_SERIAL 9600, SERIAL_8N1, GPIO_NUM_34, GPIO_NUM_12 // UBlox NEO 6M +#define GPS_INT GPIO_NUM_37 // 30ns accurary timepulse generated by NEO 6M Pin #3 + +#endif