This reverts commit ba53543354.
This commit is contained in:
@@ -19,58 +19,12 @@
|
||||
// Shared NicheGraphics components
|
||||
// --------------------------------
|
||||
#include "graphics/niche/Drivers/EInk/LCMEN2R13EFC1.h"
|
||||
#include "graphics/niche/Drivers/EInk/E0213A367.h"
|
||||
#include "graphics/niche/Inputs/TwoButton.h"
|
||||
|
||||
void setupNicheGraphics()
|
||||
{
|
||||
using namespace NicheGraphics;
|
||||
|
||||
pinMode(PIN_EINK_SCLK, OUTPUT);
|
||||
pinMode(PIN_EINK_DC, OUTPUT);
|
||||
pinMode(PIN_EINK_CS, OUTPUT);
|
||||
pinMode(PIN_EINK_RES, OUTPUT);
|
||||
|
||||
//rest e-ink
|
||||
digitalWrite(PIN_EINK_RES, LOW);
|
||||
delay(20);
|
||||
digitalWrite(PIN_EINK_RES, HIGH);
|
||||
delay(20);
|
||||
|
||||
digitalWrite(PIN_EINK_DC, LOW);
|
||||
digitalWrite(PIN_EINK_CS, LOW);
|
||||
|
||||
// write cmd
|
||||
uint8_t cmd = 0x2F;
|
||||
pinMode(PIN_EINK_MOSI, OUTPUT);
|
||||
digitalWrite(PIN_EINK_SCLK, LOW);
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
digitalWrite(PIN_EINK_MOSI, (cmd & 0x80) ? HIGH : LOW);
|
||||
cmd <<= 1;
|
||||
digitalWrite(PIN_EINK_SCLK, HIGH);
|
||||
delayMicroseconds(1);
|
||||
digitalWrite(PIN_EINK_SCLK, LOW);
|
||||
delayMicroseconds(1);
|
||||
}
|
||||
delay(10);
|
||||
|
||||
digitalWrite(PIN_EINK_DC, HIGH);
|
||||
pinMode(PIN_EINK_MOSI, INPUT_PULLUP);
|
||||
|
||||
// read chip ID
|
||||
uint8_t chipId = 0;
|
||||
for (int8_t b = 7; b >= 0; b--)
|
||||
{
|
||||
digitalWrite(PIN_EINK_SCLK, LOW);
|
||||
delayMicroseconds(1);
|
||||
digitalWrite(PIN_EINK_SCLK, HIGH);
|
||||
delayMicroseconds(1);
|
||||
if (digitalRead(PIN_EINK_MOSI)) chipId |= (1 << b);
|
||||
}
|
||||
digitalWrite(PIN_EINK_CS, HIGH);
|
||||
LOG_INFO("eink chipId: %02X", chipId);
|
||||
|
||||
// SPI
|
||||
// -----------------------------
|
||||
|
||||
@@ -80,15 +34,8 @@ void setupNicheGraphics()
|
||||
|
||||
// E-Ink Driver
|
||||
// -----------------------------
|
||||
Drivers::EInk *driver;
|
||||
if((chipId &0x03) !=0x01)
|
||||
{
|
||||
driver = new Drivers::LCMEN213EFC1;
|
||||
}
|
||||
else
|
||||
{
|
||||
driver = new Drivers::E0213A367;
|
||||
}
|
||||
|
||||
Drivers::EInk *driver = new Drivers::LCMEN213EFC1;
|
||||
driver->begin(hspi, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY, PIN_EINK_RES);
|
||||
|
||||
// InkHUD
|
||||
|
||||
@@ -8,8 +8,6 @@ build_flags =
|
||||
-I variants/heltec_wireless_paper
|
||||
-D HELTEC_WIRELESS_PAPER
|
||||
-D EINK_DISPLAY_MODEL=GxEPD2_213_FC1
|
||||
-D EINK_DISPLAY_MODEL1=GxEPD2_213_FC1
|
||||
-D EINK_DISPLAY_MODEL2=GxEPD2_213_E0213A367
|
||||
-D EINK_WIDTH=250
|
||||
-D EINK_HEIGHT=122
|
||||
-D USE_EINK
|
||||
@@ -19,9 +17,9 @@ build_flags =
|
||||
-D EINK_HASQUIRK_GHOSTING ; Display model is identified as "prone to ghosting"
|
||||
lib_deps =
|
||||
${esp32s3_base.lib_deps}
|
||||
https://github.com/Quency-D/GxEPD2/archive/0513405847b281d9dea400488714643ef84507ec.zip
|
||||
https://github.com/meshtastic/GxEPD2/archive/b202ebfec6a4821e098cf7a625ba0f6f2400292d.zip
|
||||
lewisxhe/PCF8563_Library@^1.0.1
|
||||
upload_speed = 921600
|
||||
upload_speed = 115200
|
||||
|
||||
[env:heltec-wireless-paper-inkhud]
|
||||
extends = esp32s3_base, inkhud
|
||||
|
||||
Reference in New Issue
Block a user