Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix t-display-s3 pins and lib dependency #655

Merged
merged 3 commits into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
epiHATR marked this conversation as resolved.
Show resolved Hide resolved
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.
Loading