mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-20 09:43:03 +00:00
Add DIY nRF82540 PCA10059 4.2inch NiceRF 868 (#1354)
* Update build-all.sh * Update configuration.h * Update EInkDisplay2.cpp * Create platformio.ini * Create variant.cpp * Create variant.h * Update platformio.ini * Update check-all.sh * Create nordic_pca10059.json * Update variant.h * Update EInkDisplay2.cpp * Update configuration.h * Update platformio.ini * Update EInkDisplay2.cpp * Update variant.h * Update EInkDisplay2.cpp * Update configuration.h * Update EInkDisplay2.cpp * Update variant.h * Update nordic_pca10059.json * Update platformio.ini * Update platformio.ini * Update platformio.ini * Update platformio.ini * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update configuration.h * Update EInkDisplay2.cpp * Update variant.h * Update variant.h * Update platformio.ini * Update configuration.h * Update configuration.h * Update platformio.ini * Update platformio.ini * Update configuration.h * Update platformio.ini * Update configuration.h * Update platformio.ini * Update configuration.h * Update configuration.h * Update platformio.ini * Update configuration.h Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
committed by
GitHub
parent
279def7911
commit
b7aa1397c7
@@ -25,6 +25,11 @@
|
||||
//1.54 inch 200x200 - GxEPD2_154_M09
|
||||
//#define TECHO_DISPLAY_MODEL GxEPD2_154_M09
|
||||
|
||||
#elif defined(PCA10059)
|
||||
|
||||
//4.2 inch 300x400 - GxEPD2_420_M01
|
||||
#define TECHO_DISPLAY_MODEL GxEPD2_420_M01
|
||||
|
||||
#endif
|
||||
|
||||
GxEPD2_BW<TECHO_DISPLAY_MODEL, TECHO_DISPLAY_MODEL::HEIGHT> *adafruitDisplay;
|
||||
@@ -47,6 +52,11 @@ EInkDisplay::EInkDisplay(uint8_t address, int sda, int scl)
|
||||
//GxEPD2_154_M09
|
||||
//setGeometry(GEOMETRY_RAWMODE, 200, 200);
|
||||
|
||||
#elif defined(PCA10059)
|
||||
|
||||
//GxEPD2_420_M01
|
||||
setGeometry(GEOMETRY_RAWMODE, 300, 400);
|
||||
|
||||
#endif
|
||||
// setGeometry(GEOMETRY_RAWMODE, 128, 64); // old resolution
|
||||
// setGeometry(GEOMETRY_128_64); // We originally used this because I wasn't sure if rawmode worked - it does
|
||||
@@ -71,8 +81,8 @@ bool EInkDisplay::forceDisplay(uint32_t msecLimit)
|
||||
|
||||
// FIXME - only draw bits have changed (use backbuf similar to the other displays)
|
||||
// tft.drawBitmap(0, 0, buffer, 128, 64, TFT_YELLOW, TFT_BLACK);
|
||||
for (uint64_t y = 0; y < displayHeight; y++) {
|
||||
for (uint64_t x = 0; x < displayWidth; x++) {
|
||||
for (uint32_t y = 0; y < displayHeight; y++) {
|
||||
for (uint32_t x = 0; x < displayWidth; x++) {
|
||||
|
||||
// get src pixel in the page based ordering the OLED lib uses FIXME, super inefficent
|
||||
auto b = buffer[x + (y / 8) * displayWidth];
|
||||
@@ -81,11 +91,7 @@ bool EInkDisplay::forceDisplay(uint32_t msecLimit)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(TTGO_T_ECHO)
|
||||
DEBUG_MSG("Updating T-ECHO E-Paper... ");
|
||||
#elif defined(RAK4630)
|
||||
DEBUG_MSG("Updating RAK4361_5005 E-Paper... ");
|
||||
#endif
|
||||
DEBUG_MSG("Updating E-Paper... ");
|
||||
|
||||
#if defined(TTGO_T_ECHO)
|
||||
// ePaper.Reset(); // wake the screen from sleep
|
||||
@@ -101,6 +107,8 @@ bool EInkDisplay::forceDisplay(uint32_t msecLimit)
|
||||
// 4.2 inch 300x400 - GxEPD2_420_M01
|
||||
//adafruitDisplay->nextPage();
|
||||
|
||||
#elif defined(PCA10059)
|
||||
adafruitDisplay->nextPage();
|
||||
#endif
|
||||
|
||||
// Put screen to sleep to save power (possibly not necessary because we already did poweroff inside of display)
|
||||
@@ -176,6 +184,14 @@ bool EInkDisplay::connect()
|
||||
|
||||
adafruitDisplay->setPartialWindow(0, 0, displayWidth, displayHeight);
|
||||
}
|
||||
#elif defined(PCA10059)
|
||||
{
|
||||
auto lowLevel = new TECHO_DISPLAY_MODEL(PIN_EINK_CS, PIN_EINK_DC, PIN_EINK_RES, PIN_EINK_BUSY);
|
||||
adafruitDisplay = new GxEPD2_BW<TECHO_DISPLAY_MODEL, TECHO_DISPLAY_MODEL::HEIGHT>(*lowLevel);
|
||||
adafruitDisplay->init(115200, true, 10, false, SPI1, SPISettings(4000000, MSBFIRST, SPI_MODE0));
|
||||
adafruitDisplay->setRotation(3);
|
||||
adafruitDisplay->setPartialWindow(0, 0, displayWidth, displayHeight);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user