Skip to content

Commit

Permalink
Merge pull request #655 from epiHATR/fix-t-display-s3-and-lib-dependency
Browse files Browse the repository at this point in the history
Fix t-display-s3 pins and lib dependency
  • Loading branch information
pr3y authored Jan 12, 2025
2 parents 0f3510b + 6575da8 commit 6294483
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
21 changes: 15 additions & 6 deletions boards/lilygo-t-display-s3/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,19 @@ void _setup_gpio()
pinMode(UP_BTN, INPUT_PULLUP);
pinMode(SEL_BTN, INPUT_PULLUP);

// setup POWER pin required by the vendor
pinMode(PIN_POWER_ON, OUTPUT);
digitalWrite(PIN_POWER_ON, HIGH);

// setup Battery pin for reading voltage value
pinMode(BAT_PIN, INPUT);

// Start with default IR, RF and RFID Configs, replace old
bruceConfig.rfModule = CC1101_SPI_MODULE;
bruceConfig.rfidModule = PN532_I2C_MODULE;
bruceConfig.irRx = 1;

bruceConfig.irRx = RXLED;
bruceConfig.irTx = LED;
}

/***************************************************************************************
Expand Down Expand Up @@ -120,10 +124,14 @@ void InputHandler(void)

void powerOff()
{
#ifdef T_DISPLAY_S3
esp_sleep_enable_ext0_wakeup((gpio_num_t)SEL_BTN,BTN_ACT);
esp_deep_sleep_start();
#endif
#ifdef T_DISPLAY_S3
tft.fillScreen(TFT_BLACK);
digitalWrite(PIN_POWER_ON, LOW);
digitalWrite(TFT_BL, LOW);
tft.writecommand(0x10);
esp_sleep_enable_ext0_wakeup((gpio_num_t)SEL_BTN, BTN_ACT);
esp_deep_sleep_start();
#endif
}

void checkReboot()
Expand All @@ -147,7 +155,8 @@ void checkReboot()
else
{
tft.fillScreen(bruceConfig.bgColor);
while (digitalRead(UP_BTN) == BTN_ACT || digitalRead(DW_BTN) == BTN_ACT);
while (digitalRead(UP_BTN) == BTN_ACT || digitalRead(DW_BTN) == BTN_ACT)
;
delay(200);
powerOff();
}
Expand Down
3 changes: 2 additions & 1 deletion boards/pinouts/lilygo-t-display-s3.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ static const uint8_t SCL = GROVE_SCL;
#define PIN_CLK 39
#define PIN_DATA 42

// Buttons & Navigation
#define BTN_ALIAS '"OK"'
#define HAS_3_BUTTONS
#define SEL_BTN 1
Expand All @@ -92,7 +93,7 @@ static const uint8_t SCL = GROVE_SCL;
#define BK_BTN 3
#define BTN_ACT LOW

// IR
// IR pins
#define LED 44
#define RXLED 43
#define LED_ON HIGH
Expand Down
Binary file added media/pictures/lilygo-t-display-s3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6294483

Please sign in to comment.