Skip to content

Commit

Permalink
Merge branch 'dev' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
BitMaker-hub authored Sep 12, 2023
2 parents c0c3acd + 4965352 commit 347358e
Show file tree
Hide file tree
Showing 97 changed files with 8,477 additions and 1,014 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
NerdMinerLog.txt
bin/0x10000_firmware.bin
logs
boards/ESP32_wroom_guide.md
Binary file added bin/bin LILYGO S3 Dongle/0x0000_bootloader.bin
Binary file not shown.
Binary file added bin/bin LILYGO S3 Dongle/0x10000_firmware.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added bin/bin LILYGO TQ-T pro/0x0000_bootloader.bin
Binary file not shown.
Binary file added bin/bin LILYGO TQ-T pro/0x10000_firmware.bin
Binary file not shown.
Binary file added bin/bin LILYGO TQ-T pro/0x8000_partitions.bin
Binary file not shown.
Binary file added bin/bin LILYGO TQ-T pro/0xe000_boot_app0.bin
Binary file not shown.
51 changes: 51 additions & 0 deletions boards/esp32-s3-t-qt-pro.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"build": {
"arduino":{
"ldscript": "esp32s3_out.ld",
"partitions": "default.csv"
},
"core": "esp32",
"extra_flags": [
"-DARDUINO_ESP32S3_DEV",
"-DARDUINO_USB_MODE=1",
"-DARDUINO_USB_CDC_ON_BOOT=1",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"hwids": [
[
"0x303A",
"0x1001"
]
],
"mcu": "esp32s3",
"variant": "esp32s3"
},
"connectivity": [
"wifi"
],
"debug": {
"default_tool": "esp-builtin",
"onboard_tools": [
"esp-builtin"
],
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "Espressif ESP32-S3-T-QT (4 MB QD, No PSRAM)",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 460800
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html",
"vendor": "Espressif"
}
46 changes: 46 additions & 0 deletions boards/lilygo-t-amoled.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-DISPLAY-AMOLED",
"upload": {
"flash_size": "16MB",
"maximum_ram_size": 327680,
"maximum_size": 16777216,
"require_upload_port": true,
"speed": 921600
},
"url": "https://www.lilygo.cc/products/t-display-s3-amoled",
"vendor": "LILYGO"
}
4 changes: 2 additions & 2 deletions lib/TFT_eSPI/Extensions/Button.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// within button
***************************************************************************************/

class TFT_eSPI_Button : public TFT_eSPI {

class TFT_eSPI_Button
{
public:
TFT_eSPI_Button(void);
// "Classic" initButton() uses centre & size
Expand Down
23 changes: 9 additions & 14 deletions lib/TFT_eSPI/Extensions/Sprite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,7 @@ void* TFT_eSprite::callocSprite(int16_t w, int16_t h, uint8_t frames)
***************************************************************************************/
void TFT_eSprite::createPalette(uint16_t colorMap[], uint8_t colors)
{
if (_colorMap != nullptr)
{
free(_colorMap);
}
if (!_created) return;

if (colorMap == nullptr)
{
Expand All @@ -236,7 +233,7 @@ void TFT_eSprite::createPalette(uint16_t colorMap[], uint8_t colors)
}

// Allocate and clear memory for 16 color map
_colorMap = (uint16_t *)calloc(16, sizeof(uint16_t));
if (_colorMap == nullptr) _colorMap = (uint16_t *)calloc(16, sizeof(uint16_t));

if (colors > 16) colors = 16;

Expand All @@ -254,14 +251,16 @@ void TFT_eSprite::createPalette(uint16_t colorMap[], uint8_t colors)
***************************************************************************************/
void TFT_eSprite::createPalette(const uint16_t colorMap[], uint8_t colors)
{
if (!_created) return;

if (colorMap == nullptr)
{
// Create a color map using the default FLASH map
colorMap = default_4bit_palette;
}

// Allocate and clear memory for 16 color map
_colorMap = (uint16_t *)calloc(16, sizeof(uint16_t));
if (_colorMap == nullptr) _colorMap = (uint16_t *)calloc(16, sizeof(uint16_t));

if (colors > 16) colors = 16;

Expand Down Expand Up @@ -310,13 +309,9 @@ void* TFT_eSprite::setColorDepth(int8_t b)
else if ( b > 1 ) _bpp = 4;
else _bpp = 1;

// Can't change an existing sprite's colour depth so delete it
if (_created) free(_img8_1);

// If it existed, re-create the sprite with the new colour depth
if (_created)
{
_created = false;
// Can't change an existing sprite's colour depth so delete and create a new one
if (_created) {
deleteSprite();
return createSprite(_dwidth, _dheight);
}

Expand Down Expand Up @@ -380,7 +375,7 @@ void TFT_eSprite::deleteSprite(void)
if (_colorMap != nullptr)
{
free(_colorMap);
_colorMap = nullptr;
_colorMap = nullptr;
}

if (_created)
Expand Down
6 changes: 5 additions & 1 deletion lib/TFT_eSPI/Extensions/Touch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

// See license in root directory.

// Define a default pressure threshold
#ifndef Z_THRESHOLD
#define Z_THRESHOLD 350 // Touch pressure threshold for validating touches
#endif

/***************************************************************************************
** Function name: begin_touch_read_write - was spi_begin_touch
** Description: Start transaction and select touch controller
Expand Down Expand Up @@ -161,7 +166,6 @@ uint8_t TFT_eSPI::validTouch(uint16_t *x, uint16_t *y, uint16_t threshold){
** Function name: getTouch
** Description: read callibrated position. Return false if not pressed.
***************************************************************************************/
#define Z_THRESHOLD 350 // Touch pressure threshold for validating touches
uint8_t TFT_eSPI::getTouch(uint16_t *x, uint16_t *y, uint16_t threshold){
uint16_t x_tmp, y_tmp;

Expand Down
31 changes: 24 additions & 7 deletions lib/TFT_eSPI/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,16 @@ menu "TFT_eSPI"

endchoice

config TFT_PARALLEL_8_BIT
bool "Enable 8-bit parallel mode (otherwise SPI is assumed)"
default "n"
depends on IDF_TARGET_ESP32
choice TFT_INTERFACE
prompt "LCD Interface"
default TFT_SPI
help
Use 8-bit parallel bus to send data to the LCD. If not set SPI will be used.
Communication interface between the microcontroller and the LCD.
config TFT_SPI
bool "SPI"
config TFT_PARALLEL_8_BIT
bool "Parallel (8 bit)"
endchoice

menu "Display Data pins"
depends on TFT_PARALLEL_8_BIT
Expand Down Expand Up @@ -211,11 +215,11 @@ menu "TFT_eSPI"
endmenu

menu "Display SPI config"
depends on !TFT_PARALLEL_8_BIT
depends on TFT_SPI

choice TFT_SPI_PORT
prompt "SPI port"
default TFT_SPI_2_HOST
default TFT_VSPI_PORT
help
The ESP32 has 2 free SPI ports i.e. VSPI (SPI2) and HSPI (SPI3),
the VSPI is the default. If the VSPI port is in use and pins are
Expand All @@ -232,6 +236,7 @@ menu "TFT_eSPI"
default -1
range -1 32 if IDF_TARGET_ESP32
range -1 45 if IDF_TARGET_ESP32S2
range -1 48 if IDF_TARGET_ESP32S3
help
Master In Slave Out pin.
Can be labelled as SDO in some displays
Expand All @@ -241,6 +246,7 @@ menu "TFT_eSPI"
default -1
range -1 32 if IDF_TARGET_ESP32
range -1 45 if IDF_TARGET_ESP32S2
range -1 48 if IDF_TARGET_ESP32S3
help
Master Out Slave In pin.
Can be labelled as SDA or SDI in some displays
Expand All @@ -250,6 +256,7 @@ menu "TFT_eSPI"
default -1
range -1 32 if IDF_TARGET_ESP32
range -1 45 if IDF_TARGET_ESP32S2
range -1 48 if IDF_TARGET_ESP32S3
help
Labelled in some displays as WR

Expand Down Expand Up @@ -287,6 +294,7 @@ menu "TFT_eSPI"
default -1
range -1 33 if IDF_TARGET_ESP32
range -1 45 if IDF_TARGET_ESP32S2
range -1 48 if IDF_TARGET_ESP32S3

config TFT_DC
int "TFT Data/Command pin"
Expand All @@ -300,6 +308,7 @@ menu "TFT_eSPI"
default -1
range -1 33 if IDF_TARGET_ESP32
range -1 45 if IDF_TARGET_ESP32S2
range -1 48 if IDF_TARGET_ESP32S3

config ENABLE_BL
bool "Enable backlight control"
Expand All @@ -311,6 +320,7 @@ menu "TFT_eSPI"
default -1
range -1 33 if IDF_TARGET_ESP32
range -1 45 if IDF_TARGET_ESP32S2
range -1 48 if IDF_TARGET_ESP32S3
help
Pin for the backlight control signal

Expand Down Expand Up @@ -379,6 +389,7 @@ menu "TFT_eSPI"
default -1
range -1 33 if IDF_TARGET_ESP32
range -1 45 if IDF_TARGET_ESP32S2
range -1 48 if IDF_TARGET_ESP32S3

config SPI_TOUCH_FREQUENCY
int "SPI frequency for XPT2046 chip (Hz)"
Expand All @@ -387,4 +398,10 @@ menu "TFT_eSPI"
endif
endmenu

menu "Other settings"
config DISABLE_WARNINGS
bool "Disable Library warnings"
default n
endmenu

endmenu
Loading

0 comments on commit 347358e

Please sign in to comment.