mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-21 18:22:32 +00:00
T-Lora Pager (#7613)
* initial commit * preset rotary1 encoder * define TAB+ESC * haptic feedback * allow switch off haptic feedback * enable audio amplifier * include PR4684 * fix for tft target * add ES8311 audio codec * fix KB scan duplicate * display workaround to avoid debris * fix debris on display * keyboard backlight * enable screen options * fsm based bounce-free rotary encoder implementation * use fsm RotaryEncoder only for T-Lora Pager * change inputbroker default config to allow using rotary wheel for screens AND menues --------- Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com> Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
19
variants/esp32s3/tlora-pager/pins_arduino.h
Normal file
19
variants/esp32s3/tlora-pager/pins_arduino.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define USB_VID 0x303a
|
||||
#define USB_PID 0x1001
|
||||
|
||||
// used for keyboard, battery gauge, charger and haptic driver
|
||||
static const uint8_t SDA = 3;
|
||||
static const uint8_t SCL = 2;
|
||||
|
||||
// Default SPI will be mapped to Radio
|
||||
static const uint8_t SS = 36;
|
||||
static const uint8_t MOSI = 34;
|
||||
static const uint8_t MISO = 33;
|
||||
static const uint8_t SCK = 35;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
70
variants/esp32s3/tlora-pager/platformio.ini
Normal file
70
variants/esp32s3/tlora-pager/platformio.ini
Normal file
@@ -0,0 +1,70 @@
|
||||
; LilyGo T-Lora-Pager
|
||||
[env:tlora-pager]
|
||||
extends = esp32s3_base
|
||||
board = t-deck-pro ; same as T-Deck Pro
|
||||
board_check = true
|
||||
board_build.partitions = default_16MB.csv
|
||||
upload_protocol = esptool
|
||||
|
||||
build_flags = ${esp32s3_base.build_flags}
|
||||
-I variants/esp32s3/tlora-pager
|
||||
-D T_LORA_PAGER
|
||||
-D BOARD_HAS_PSRAM
|
||||
-D GPS_POWER_TOGGLE
|
||||
-D HAS_SDCARD
|
||||
-D SDCARD_USE_SPI1
|
||||
-D ENABLE_ROTARY_PULLUP
|
||||
-D ENABLE_BUTTON_PULLUP
|
||||
-D HALF_STEP
|
||||
|
||||
lib_deps = ${esp32s3_base.lib_deps}
|
||||
lovyan03/LovyanGFX@1.2.7
|
||||
earlephilhower/ESP8266Audio@1.9.9
|
||||
earlephilhower/ESP8266SAM@1.0.1
|
||||
adafruit/Adafruit DRV2605 Library@1.2.4
|
||||
lewisxhe/PCF8563_Library@1.0.1
|
||||
lewisxhe/SensorLib@0.3.1
|
||||
https://github.com/pschatzmann/arduino-audio-driver/archive/refs/tags/v0.1.3.zip
|
||||
https://github.com/mverch67/BQ27220/archive/07d92be846abd8a0258a50c23198dac0858b22ed.zip
|
||||
https://github.com/mverch67/RotaryEncoder
|
||||
|
||||
[env:tlora-pager-tft]
|
||||
extends = env:tlora-pager
|
||||
build_flags =
|
||||
${env:tlora-pager.build_flags}
|
||||
-D CONFIG_DISABLE_HAL_LOCKS=1
|
||||
-D INPUTDRIVER_ROTARY_TYPE=1
|
||||
-D INPUTDRIVER_ROTARY_UP=40
|
||||
-D INPUTDRIVER_ROTARY_DOWN=41
|
||||
-D INPUTDRIVER_ROTARY_BTN=7
|
||||
-D INPUTDRIVER_BUTTON_TYPE=0
|
||||
-D HAS_SCREEN=1
|
||||
-D HAS_TFT=1
|
||||
-D USE_I2S_BUZZER
|
||||
-D RAM_SIZE=5120
|
||||
-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 USE_LOG_DEBUG
|
||||
-D LOG_DEBUG_INC=\"DebugConfiguration.h\"
|
||||
-D RADIOLIB_SPI_PARANOID=0
|
||||
-D LGFX_SCREEN_WIDTH=222
|
||||
-D LGFX_SCREEN_HEIGHT=480
|
||||
-D DISPLAY_SIZE=480x222 ; landscape mode
|
||||
-D DISPLAY_SET_RESOLUTION
|
||||
-D LGFX_DRIVER=LGFX_TLORA_PAGER
|
||||
-D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_T_LORA_PAGER.h\"
|
||||
; -D LVGL_DRIVER=LVGL_T_LORA_PAGER
|
||||
; -D LV_USE_ST7796=1
|
||||
-D VIEW_480x222
|
||||
-D USE_PACKET_API
|
||||
-D MAP_FULL_REDRAW
|
||||
|
||||
lib_deps =
|
||||
${env:tlora-pager.lib_deps}
|
||||
${device-ui_base.lib_deps}
|
||||
125
variants/esp32s3/tlora-pager/variant.h
Normal file
125
variants/esp32s3/tlora-pager/variant.h
Normal file
@@ -0,0 +1,125 @@
|
||||
// ST7796 TFT LCD
|
||||
#define TFT_CS 38
|
||||
#define ST7796_CS TFT_CS
|
||||
#define ST7796_RS 37 // DC
|
||||
#define ST7796_SDA MOSI // MOSI
|
||||
#define ST7796_SCK SCK
|
||||
#define ST7796_RESET -1
|
||||
#define ST7796_MISO MISO
|
||||
#define ST7796_BUSY -1
|
||||
#define ST7796_BL 42
|
||||
#define ST7796_SPI_HOST SPI2_HOST
|
||||
#define TFT_BL 42
|
||||
#define SPI_FREQUENCY 75000000
|
||||
#define SPI_READ_FREQUENCY 16000000
|
||||
#define TFT_HEIGHT 480
|
||||
#define TFT_WIDTH 222
|
||||
#define TFT_OFFSET_X 49
|
||||
#define TFT_OFFSET_Y 0
|
||||
#define TFT_OFFSET_ROTATION 3
|
||||
#define SCREEN_ROTATE
|
||||
#define SCREEN_TRANSITION_FRAMERATE 5
|
||||
#define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness
|
||||
|
||||
#define I2C_SDA SDA
|
||||
#define I2C_SCL SCL
|
||||
|
||||
#define USE_POWERSAVE
|
||||
#define SLEEP_TIME 120
|
||||
|
||||
// GNNS
|
||||
#define HAS_GPS 1
|
||||
#define GPS_BAUDRATE 38400
|
||||
#define GPS_RX_PIN 4
|
||||
#define GPS_TX_PIN 12
|
||||
#define PIN_GPS_PPS 13
|
||||
|
||||
// PCF8563 RTC Module
|
||||
#if __has_include("pcf8563.h")
|
||||
#include "pcf8563.h"
|
||||
#endif
|
||||
#define PCF8563_RTC 0x51
|
||||
#define HAS_RTC 1
|
||||
|
||||
// Rotary
|
||||
#define ROTARY_A (40)
|
||||
#define ROTARY_B (41)
|
||||
#define ROTARY_PRESS (7)
|
||||
|
||||
#define BUTTON_PIN 0
|
||||
|
||||
// SPI interface SD card slot
|
||||
#define SPI_MOSI MOSI
|
||||
#define SPI_SCK SCK
|
||||
#define SPI_MISO MISO
|
||||
#define SPI_CS 21
|
||||
#define SDCARD_CS SPI_CS
|
||||
#define SD_SPI_FREQUENCY 75000000U
|
||||
|
||||
// TCA8418 keyboard
|
||||
#define I2C_NO_RESCAN
|
||||
#define KB_BL_PIN 46
|
||||
#define KB_INT 6
|
||||
#define CANNED_MESSAGE_MODULE_ENABLE 1
|
||||
|
||||
// audio codec ES8311
|
||||
#define HAS_I2S
|
||||
#define DAC_I2S_BCK 11
|
||||
#define DAC_I2S_WS 18
|
||||
#define DAC_I2S_DOUT 45
|
||||
#define DAC_I2S_DIN 17
|
||||
#define DAC_I2S_MCLK 10
|
||||
|
||||
// gyroscope BHI260AP
|
||||
#define HAS_BHI260AP
|
||||
|
||||
// battery charger BQ25896
|
||||
#define HAS_PPM 1
|
||||
#define XPOWERS_CHIP_BQ25896
|
||||
|
||||
// battery quality management BQ27220
|
||||
#define HAS_BQ27220 1
|
||||
#define BQ27220_I2C_SDA SDA
|
||||
#define BQ27220_I2C_SCL SCL
|
||||
#define BQ27220_DESIGN_CAPACITY 1500
|
||||
|
||||
// NFC ST25R3916
|
||||
#define NFC_INT 5
|
||||
#define NFC_CS 39
|
||||
|
||||
// External expansion chip XL9555
|
||||
#define USE_XL9555
|
||||
#define EXPANDS_DRV_EN (0)
|
||||
#define EXPANDS_AMP_EN (1)
|
||||
#define EXPANDS_KB_RST (2)
|
||||
#define EXPANDS_LORA_EN (3)
|
||||
#define EXPANDS_GPS_EN (4)
|
||||
#define EXPANDS_NFC_EN (5)
|
||||
#define EXPANDS_GPS_RST (7)
|
||||
#define EXPANDS_KB_EN (8)
|
||||
#define EXPANDS_GPIO_EN (9)
|
||||
#define EXPANDS_SD_DET (10)
|
||||
#define EXPANDS_SD_PULLEN (11)
|
||||
#define EXPANDS_SD_EN (12)
|
||||
|
||||
// LoRa
|
||||
#define USE_SX1262
|
||||
#define USE_SX1268
|
||||
|
||||
#define LORA_SCK 35
|
||||
#define LORA_MISO 33
|
||||
#define LORA_MOSI 34
|
||||
#define LORA_CS 36
|
||||
|
||||
#define LORA_DIO0 -1 // a No connect on the SX1262 module
|
||||
#define LORA_RESET 47
|
||||
#define LORA_DIO1 14 // SX1262 IRQ
|
||||
#define LORA_DIO2 48 // SX1262 BUSY
|
||||
#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262, if DIO3 is high the TXCO is enabled
|
||||
|
||||
#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.0
|
||||
Reference in New Issue
Block a user