Add tbeam esp32s3 version support, replace AXP202X_Library with XPowersLIb

This commit is contained in:
lewishe
2022-09-06 15:58:33 +08:00
parent f767fd5075
commit 5621719eef
20 changed files with 473 additions and 257 deletions

View File

@@ -0,0 +1,29 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#define USB_VID 0x303a
#define USB_PID 0x1001
#define EXTERNAL_NUM_INTERRUPTS 46
#define NUM_DIGITAL_PINS 48
#define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1)
#define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43;
static const uint8_t RX = 44;
static const uint8_t SDA = 42;
static const uint8_t SCL = 41;
static const uint8_t SS = 10;
static const uint8_t MOSI = 11;
static const uint8_t MISO = 13;
static const uint8_t SCK = 12;
#endif /* Pins_Arduino_h */

View File

@@ -0,0 +1,11 @@
; The 1.0 release of the LilyGo TBEAM-S3-Core board
[env:tbeam-s3-core]
extends = esp32s3_base
board = tbeam-s3-core
lib_deps =
${esp32s3_base.lib_deps}
build_flags =
${esp32s3_base.build_flags}
-Ivariants/tbeam-s3-core

View File

@@ -0,0 +1,49 @@
// #define BUTTON_NEED_PULLUP // if set we need to turn on the internal CPU pullup during sleep
#define I2C_SDA 42
#define I2C_SCL 41
#define BUTTON_PIN 0 // The middle button GPIO on the T-Beam S3
//#define BUTTON_PIN_ALT 13 // Alternate GPIO for an external button if needed. Does anyone use this? It is not documented anywhere.
// #define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
#define LED_INVERTED 1
// #define LED_PIN 4 // Newer tbeams (1.1) have an extra led on GPIO4
// TTGO uses a common pinout for their SX1262 vs RF95 modules - both can be enabled and we will probe at runtime for RF95 and if
// not found then probe for SX1262
#define USE_SX1262
#define USE_SX1268
#define LORA_DIO0 -1 // a No connect on the SX1262 module
#define LORA_RESET 5
#define LORA_DIO1 1 // SX1262 IRQ
#define LORA_DIO2 4 // SX1262 BUSY
#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262, if DIO3 is high the TXCO is enabled
#ifdef USE_SX1262
#define SX126X_CS 10 // FIXME - we really should define LORA_CS instead
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_DIO2
#define SX126X_RESET LORA_RESET
#define SX126X_E22 // Not really an E22 but TTGO seems to be trying to clone that
// Internally the TTGO module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface
// code)
#endif
// Leave undefined to disable our PMU IRQ handler. DO NOT ENABLE THIS because the pmuirq can cause sperious interrupts
// and waking from light sleep
// #define PMU_IRQ 40
#define HAS_AXP2101
#define RF95_SCK 12
#define RF95_MISO 13
#define RF95_MOSI 11
#define RF95_NSS 10
#define GPS_RX_PIN 9
#define GPS_TX_PIN 8
#define GPS_WAKEUP_PIN 7
#define GPS_1PPS_PIN 6

View File

@@ -1,18 +0,0 @@
; The 1.0 release of the TBEAM board
[env:tbeam-s3]
extends = esp32s3_base
board = esp32-s3-devkitc-1
lib_deps =
${esp32s3_base.lib_deps}
lewisxhe/XPowersLib @ ^0.1.3
build_flags =
${esp32s3_base.build_flags}
-D TBEAM_S3_M2
-DMBEDTLS_USE_PSA_CRYPTO
-I variants/tbeam-s3
-DBOARD_HAS_PSRAM
-DARDUINO_USB_MODE=1
-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_DFU_ON_BOOT=1
-DARDUINO_USB_MSC_ON_BOOT=1

View File

@@ -1,37 +0,0 @@
// #define BUTTON_NEED_PULLUP // if set we need to turn on the internal CPU pullup during sleep
#define I2C_SDA 42
#define I2C_SCL 41
#define BUTTON_PIN 43 // The middle button GPIO on the T-Beam
//#define BUTTON_PIN_ALT 13 // Alternate GPIO for an external button if needed. Does anyone use this? It is not documented anywhere.
// #define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
#define LED_INVERTED 1
// #define LED_PIN 4 // Newer tbeams (1.1) have an extra led on GPIO4
// TTGO uses a common pinout for their SX1262 vs RF95 modules - both can be enabled and we will probe at runtime for RF95 and if
// not found then probe for SX1262
#define USE_SX1262
#define USE_SX1268
#define LORA_DIO0 -1 // a No connect on the SX1262 module
#define LORA_RESET 5
#define LORA_DIO1 1 // SX1262 IRQ
#define LORA_DIO2 4 // SX1262 BUSY
#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262, if DIO3 is high the TXCO is enabled
#ifdef USE_SX1262
#define SX126X_CS 10 // FIXME - we really should define LORA_CS instead
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_DIO2
#define SX126X_RESET LORA_RESET
#define SX126X_E22 // Not really an E22 but TTGO seems to be trying to clone that
// Internally the TTGO module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface
// code)
#endif
// Leave undefined to disable our PMU IRQ handler. DO NOT ENABLE THIS because the pmuirq can cause sperious interrupts
// and waking from light sleep
#define PMU_IRQ 40
#define HAS_AXP2101