Skip to content

Commit

Permalink
[nRF52] build with GDEW0371W7 display driver [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Jul 8, 2024
1 parent d077c5d commit 3de3432
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 4 deletions.
30 changes: 26 additions & 4 deletions software/firmware/source/SoftRF/src/platform/nRF52.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,11 @@ GxEPD2_BW<GxEPD2_150_BN, GxEPD2_150_BN::HEIGHT> epd_bn (GxEPD2_150_BN(
SOC_GPIO_PIN_EPD_DC,
SOC_GPIO_PIN_EPD_RST,
SOC_GPIO_PIN_EPD_BUSY));

GxEPD2_BW<GxEPD2_371, GxEPD2_371::HEIGHT> epd_w7 (GxEPD2_371(
SOC_GPIO_PIN_EPD_TULTIMA_SS,
SOC_GPIO_PIN_EPD_TULTIMA_DC,
SOC_GPIO_PIN_EPD_TULTIMA_RST,
SOC_GPIO_PIN_EPD_TULTIMA_BUSY));
GxEPD2_GFX *display;
#endif /* USE_EPAPER */

Expand Down Expand Up @@ -1979,9 +1983,24 @@ static byte nRF52_Display_setup()
#if defined(USE_EPAPER)

#if SPI_INTERFACES_COUNT >= 2
SPI1.setPins(SOC_GPIO_PIN_EPD_MISO,
SOC_GPIO_PIN_EPD_SCK,
SOC_GPIO_PIN_EPD_MOSI);
switch (nRF52_board)
{
case NRF52_LILYGO_TULTIMA:
SPI1.setPins(SOC_GPIO_PIN_EPD_TULTIMA_MISO,
SOC_GPIO_PIN_EPD_TULTIMA_SCK,
SOC_GPIO_PIN_EPD_TULTIMA_MOSI);
nRF52_display = EP_GDEW0371W7;
break;
case NRF52_LILYGO_TECHO_REV_0:
case NRF52_LILYGO_TECHO_REV_1:
case NRF52_LILYGO_TECHO_REV_2:
case NRF52_NORDIC_PCA10059:
default:
SPI1.setPins(SOC_GPIO_PIN_EPD_MISO,
SOC_GPIO_PIN_EPD_SCK,
SOC_GPIO_PIN_EPD_MOSI);
break;
}
#endif

if (nRF52_display == EP_UNKNOWN) {
Expand All @@ -1996,6 +2015,9 @@ static byte nRF52_Display_setup()
case EP_DEPG0150BN:
display = &epd_bn;
break;
case EP_GDEW0371W7:
display = &epd_w7;
break;
case EP_GDEH0154D67:
default:
display = &epd_d67;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,3 +400,12 @@ void GxEPD2_371::_Update_Part()
_writeCommand(0x12); //display refresh
_waitWhileBusy("_Update_Part", partial_refresh_time);
}

bool GxEPD2_371::probe()
{
if (_timeout_expired) {
return false;
} else {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class GxEPD2_371 : public GxEPD2_EPD
void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen
void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time
void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0)
bool probe();
private:
void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h);
void _PowerOn();
Expand Down

0 comments on commit 3de3432

Please sign in to comment.