Skip to content

Commit

Permalink
Merge pull request #302 from cosmicpsyop/feature/lilygo-t-hmi-dev-too
Browse files Browse the repository at this point in the history
feature: add lilygo t-hmi duex
  • Loading branch information
BitMaker-hub authored Apr 9, 2024
2 parents d1cadd4 + f4b77a2 commit c13960a
Show file tree
Hide file tree
Showing 11 changed files with 1,918 additions and 5 deletions.
46 changes: 46 additions & 0 deletions boards/lilygo-t-hmi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"build": {
"arduino":{
"ldscript": "esp32s3_out.ld",
"memory_type": "qio_opi",
"partitions": "default_16MB.csv"
},
"core": "esp32",
"extra_flags": [
"-DBOARD_HAS_PSRAM",
"-DARDUINO_USB_MODE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"hwids": [
[
"0X303A",
"0x1001"
]
],
"mcu": "esp32s3",
"variant": "esp32s3"
},
"connectivity": [
"wifi",
"bluetooth"
],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "LILYGO T-HMI",
"upload": {
"flash_size": "16MB",
"maximum_ram_size": 327680,
"maximum_size": 16777216,
"require_upload_port": true,
"speed": 921600
},
"url": "https://www.adafruit.com/product/5290",
"vendor": "LILYGO"
}
5 changes: 3 additions & 2 deletions lib/TFT_eSPI/User_Setup_Select.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@
#ifdef NERMINER_S3_AMOLED
#include <User_Setups/Setup206_LilyGo_T_Display_S3.h> //Just a stub. No driver implementation for S3 AMOLED in TFT_eSPI
#endif
//#include <User_Setups/Setup207_LilyGo_T_HMI.h> // For the LilyGo T-HMI S3 based ESP32S3 with ST7789 240 x 320 TFT

#ifdef NERDMINER_T_HMI
#include <User_Setups/Setup207_LilyGo_T_HMI.h> // For the LilyGo T-HMI S3 based ESP32S3 with ST7789 240 x 320 TFT
#endif
//#include <User_Setups/Setup208_ESP32_S3_Box_Lite.h> // For the ESP32 S3 Box Lite (may also work with ESP32 S3 Box)

//#include <User_Setups/Setup209_LilyGo_T_Dongle_S3.h> // For the LilyGo T-Dongle S3 based ESP32 with ST7735 80 x 160 TFT
Expand Down
36 changes: 35 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

[platformio]
globallib_dir = lib
default_envs = NerminerV2 ; esp32cam, ESP32-2432S028R, NerminerV2, ESP32-devKitv1, NerminerV2-S3-DONGLE, NerminerV2-S3-AMOLED, NerminerV2-T-QT, NerdminerV2-T-Display_V1, ESP32-2432S028R, M5-StampS3
default_envs = NerminerV2 ; esp32cam, ESP32-2432S028R, NerminerV2, ESP32-devKitv1, NerminerV2-S3-DONGLE, NerminerV2-S3-AMOLED, NerminerV2-T-QT, NerdminerV2-T-Display_V1, ESP32-2432S028R, NerdminerV2-T-HMI, M5-StampS3



Expand Down Expand Up @@ -238,6 +238,40 @@ lib_deps =

;--------------------------------------------------------------------

[env:NerdminerV2-T-HMI]
platform = espressif32
board = lilygo-t-hmi
framework = arduino
board_build.partitions = default_16MB.csv
monitor_filters =
esp32_exception_decoder
time
log2file

monitor_speed = 115200
upload_speed = 921600
upload_port = /dev/ttyACM0

build_flags =
-D ARDUINO_USB_MODE=1
-D ARDUINO_USB_CDC_ON_BOOT=1
-D BOARD_HAS_PSRAM
-D NERDMINER_T_HMI=1
-D USER_SETUP_LOADED=1
-include $PROJECT_LIBDEPS_DIR/$PIOENV/TFT_eSPI/User_Setups/Setup207_LilyGo_T_HMI.h

board_build.arduino.memory_type = qio_opi
lib_deps =
https://github.com/takkaO/OpenFontRender
bblanchon/ArduinoJson@^6.21.2
https://github.com/tzapu/WiFiManager.git#v2.0.16-rc.2
mathertel/OneButton @ ^2.0.3
arduino-libraries/NTPClient
bodmer/TFT_eSPI @ ^2.5.31
https://github.com/achillhasler/TFT_eTouch

;--------------------------------------------------------------------

[env:NerdminerV2-T-Display_V1]
platform = espressif32
board = ttgo-lora32-v1
Expand Down
4 changes: 3 additions & 1 deletion src/drivers/devices/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
#include "esp32CAM.h"
#elif defined(M5_STAMP_S3)
#include "m5StampS3.h"
#elif defined(NERDMINER_T_HMI)
#include "lilygoT_HMI.h"

#else
#error "No device defined"
#endif

#endif // __DEVICE_H__
#endif // __DEVICE_H__
42 changes: 42 additions & 0 deletions src/drivers/devices/lilygoT_HMI.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#ifndef _NERD_MINER_T_HMI_H
#define _NERD_MINER_T_HMI_H

#define T_HMI_DISPLAY

#define PWR_EN_PIN (10)
#define PWR_ON_PIN (14)
#define BAT_ADC_PIN (5)
#define BUTTON1_PIN (0)
#define BUTTON2_PIN (21)

#define PIN_BUTTON_1 BUTTON1_PIN
// #define PIN_BUTTON_2 BUTTON2_PIN


// touch screen
#define TOUCHSCREEN_SCLK_PIN (1)
#define TOUCHSCREEN_MISO_PIN (4)
#define TOUCHSCREEN_MOSI_PIN (3)
#define TOUCHSCREEN_CS_PIN (2)
#define TOUCHSCREEN_IRQ_PIN (9)
#define TOUCH_CLK TOUCHSCREEN_SCLK_PIN
#define TOUCH_MISO TOUCHSCREEN_MISO_PIN
#define TOUCH_MOSI TOUCHSCREEN_MOSI_PIN
#define ETOUCH_CS TOUCHSCREEN_CS_PIN


// lcd
#define PCLK_PIN (8)
#define CS_PIN (6)
#define DC_PIN (7)
#define RST_PIN (-1)
#define BK_LIGHT_PIN (38)
#define LED_PIN (8)

#ifndef TFT_BL
// XXX - defined in User_Setups/Setup207_LilyGo_T_HMI.h:37
#define TFT_BL (38) // LED back-light
#endif


#endif
3 changes: 3 additions & 0 deletions src/drivers/displays/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ DisplayDriver *currentDisplayDriver = &t_qtDisplayDriver;
DisplayDriver *currentDisplayDriver = &tDisplayV1Driver;
#endif

#ifdef T_HMI_DISPLAY
DisplayDriver *currentDisplayDriver = &t_hmiDisplayDriver;
#endif

// Initialize the display
void initDisplay()
Expand Down
1 change: 1 addition & 0 deletions src/drivers/displays/displayDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ extern DisplayDriver dongleDisplayDriver;
extern DisplayDriver esp32_2432S028RDriver;
extern DisplayDriver t_qtDisplayDriver;
extern DisplayDriver tDisplayV1Driver;
extern DisplayDriver t_hmiDisplayDriver;

#define SCREENS_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))

Expand Down
Loading

0 comments on commit c13960a

Please sign in to comment.