Browse Source

Merge pull request #2815 from UltimateCodeWarrior/fix/tbeam-supreme-v3-oled-i2c

Fix blank OLED on T-Beam Supreme V3 (I2C bus init + 0x3D address)
pull/1632/merge
Liam Cottle 5 days ago
committed by GitHub
parent
commit
7124fa1439
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 10
      src/helpers/esp32/TBeamBoard.cpp
  2. 5
      src/helpers/ui/SH1106Display.cpp
  3. 1
      variants/lilygo_tbeam_supreme_SX1262/platformio.ini

10
src/helpers/esp32/TBeamBoard.cpp

@ -16,6 +16,16 @@ void TBeamBoard::begin() {
ESP32Board::begin();
#ifdef TBEAM_SUPREME_SX1262
// On the T-Beam S3 Supreme the PMU + RTC sit on Wire1 (GPIO 42/41, brought
// up by XPowersLib), while the SH1106 OLED and the BME280/QMC6310 sensors
// sit on the primary bus, Wire (GPIO PIN_BOARD_SDA/PIN_BOARD_SCL). Nothing
// else initialises Wire on this board, so the display driver would
// otherwise talk on the wrong (default) pins and display.begin() fails,
// leaving the screen blank. Bring the OLED bus up here.
Wire.begin(PIN_BOARD_SDA, PIN_BOARD_SCL);
#endif
power_init();
//Configure user button

5
src/helpers/ui/SH1106Display.cpp

@ -11,7 +11,10 @@ bool SH1106Display::i2c_probe(TwoWire &wire, uint8_t addr)
bool SH1106Display::begin()
{
return display.begin(DISPLAY_ADDRESS, true) && i2c_probe(Wire, DISPLAY_ADDRESS);
// Wire must already be initialised by board.begin() before this is called.
// Boards with non-standard SH1106 addresses should define DISPLAY_ADDRESS
// in their variant/platformio configuration.
return i2c_probe(Wire, DISPLAY_ADDRESS) && display.begin(DISPLAY_ADDRESS, true);
}
void SH1106Display::turnOn()

1
variants/lilygo_tbeam_supreme_SX1262/platformio.ini

@ -18,6 +18,7 @@ build_flags =
-D RADIO_CLASS=CustomSX1262
-D WRAPPER_CLASS=CustomSX1262Wrapper
-D DISPLAY_CLASS=SH1106Display
-D DISPLAY_ADDRESS=0x3D
-D LORA_TX_POWER=22
-D P_LORA_TX_LED=6
-D PIN_BOARD_SDA=17

Loading…
Cancel
Save