Compare commits
2 commits
master
...
addcustomp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01008abbb5 | ||
|
|
512bbbc23c |
105 changed files with 888 additions and 3961 deletions
|
|
@ -1,13 +0,0 @@
|
|||
Language: Cpp
|
||||
BasedOnStyle: Google
|
||||
IndentWidth: 2
|
||||
ColumnLimit: 80
|
||||
AllowShortFunctionsOnASingleLine: Empty
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
BinPackArguments: true
|
||||
BinPackParameters: true
|
||||
BreakBeforeBraces: Attach
|
||||
DerivePointerAlignment: false
|
||||
PointerAlignment: Left
|
||||
SpacesBeforeTrailingComments: 1
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -5,4 +5,3 @@ Doxyfile*
|
|||
doxygen_sqlite3.db
|
||||
html
|
||||
.DS_STORE
|
||||
*~
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# Adafruit EPD Library [](https://github.com/adafruit/Adafruit_EPD/actions)[](http://adafruit.github.io/Adafruit_EPD/html/index.html)
|
||||
# Adafruit EPD Library [](https://travis-ci.com/adafruit/Adafruit_EPD)[](http://adafruit.github.io/Adafruit_EPD/html/index.html)
|
||||
|
||||
<img src="https://cdn-shop.adafruit.com/970x728/3625-03.jpg" height="300"/>
|
||||
|
||||
|
|
|
|||
|
|
@ -17,17 +17,17 @@
|
|||
#ifdef ESP32
|
||||
#define SRAM_CS 32
|
||||
#define EPD_CS 15
|
||||
#define EPD_DC 33
|
||||
#define EPD_DC 33
|
||||
#endif
|
||||
#if defined (__AVR_ATmega32U4__) || defined(ARDUINO_SAMD_FEATHER_M0) || defined(ARDUINO_FEATHER_M4) || defined (__AVR_ATmega328P__) || defined(ARDUINO_NRF52840_FEATHER)
|
||||
#define SRAM_CS 6
|
||||
#define EPD_CS 9
|
||||
#define EPD_DC 10
|
||||
#define EPD_DC 10
|
||||
#endif
|
||||
#ifdef TEENSYDUINO
|
||||
#define SRAM_CS 3
|
||||
#define EPD_CS 4
|
||||
#define EPD_DC 10
|
||||
#define EPD_DC 10
|
||||
#endif
|
||||
#ifdef ARDUINO_STM32_FEATHER
|
||||
#define TFT_DC PB4
|
||||
|
|
@ -37,12 +37,7 @@
|
|||
#ifdef ARDUINO_NRF52832_FEATHER
|
||||
#define SRAM_CS 30
|
||||
#define EPD_CS 31
|
||||
#define EPD_DC 11
|
||||
#endif
|
||||
#ifdef ARDUINO_ADAFRUIT_FEATHER_RP2040
|
||||
#define SRAM_CS 8
|
||||
#define EPD_CS 9
|
||||
#define EPD_DC 10
|
||||
#define EPD_DC 11
|
||||
#endif
|
||||
|
||||
#define EPD_RESET -1 // can set to -1 and share with microcontroller Reset!
|
||||
|
|
|
|||
|
|
@ -0,0 +1,137 @@
|
|||
/***************************************************
|
||||
Adafruit invests time and resources providing this open source code,
|
||||
please support Adafruit and open-source hardware by purchasing
|
||||
products from Adafruit!
|
||||
|
||||
Written by Limor Fried/Ladyada for Adafruit Industries.
|
||||
MIT license, all text above must be included in any redistribution
|
||||
****************************************************/
|
||||
|
||||
#include "Adafruit_ThinkInk.h"
|
||||
|
||||
#define EPD_CS 10
|
||||
#define EPD_DC 9
|
||||
#define SRAM_CS 8
|
||||
#define EPD_BUSY -1
|
||||
#define EPD_RESET -1
|
||||
#define EPD_SPI &SPI // primary SPI
|
||||
|
||||
// 2.7" Tricolor Featherwing or Breakout with EK79686 chipset (v2 Black Shield)
|
||||
ThinkInk_270_Tricolor_Z70 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
EPD_BUSY, EPD_SPI);
|
||||
|
||||
#include <Adafruit_XCA9554.h>
|
||||
Adafruit_XCA9554 expander;
|
||||
#define XCA_EPD_RESET 5
|
||||
#define XCA_EPD_CARDDET 6
|
||||
#define XCA_EPD_BUSY 7
|
||||
|
||||
void expanderEPDReset(void) {
|
||||
expander.pinMode(XCA_EPD_RESET, OUTPUT);
|
||||
expander.digitalWrite(XCA_EPD_RESET, HIGH); // start high for sure
|
||||
delay(10);
|
||||
expander.digitalWrite(XCA_EPD_RESET, LOW); // enter reset
|
||||
delay(10);
|
||||
expander.digitalWrite(XCA_EPD_RESET, HIGH); // bring out of reset
|
||||
delay(10);
|
||||
}
|
||||
|
||||
bool expanderEPDBusy(void) {
|
||||
expander.pinMode(XCA_EPD_BUSY, INPUT);
|
||||
return expander.digitalRead(XCA_EPD_BUSY);
|
||||
}
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
while (!Serial) {
|
||||
delay(10);
|
||||
}
|
||||
Serial.println("Adafruit ThinkInk Shield test in red/black/white");
|
||||
|
||||
// Begin communication with the expander
|
||||
if (!expander.begin(0x20)) { // Replace with actual I2C address if different
|
||||
Serial.println("Failed to find XCA9554 chip");
|
||||
while (1);
|
||||
}
|
||||
display.setCustomBusyFunction(expanderEPDBusy);
|
||||
display.setCustomResetFunction(expanderEPDReset);
|
||||
display.begin(THINKINK_TRICOLOR);
|
||||
|
||||
display.clearBuffer();
|
||||
display.setTextSize(2);
|
||||
display.setCursor(10, (display.height() - 24) / 2);
|
||||
display.setTextColor(EPD_BLACK);
|
||||
display.print("Press the ");
|
||||
display.setTextColor(EPD_RED);
|
||||
display.print("Buttons!");
|
||||
display.display();
|
||||
|
||||
// set the 4 buttons to inputs via the expander
|
||||
expander.pinMode(0, INPUT);
|
||||
expander.pinMode(1, INPUT);
|
||||
expander.pinMode(2, INPUT);
|
||||
expander.pinMode(3, INPUT);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
if (! expander.digitalRead(0)) {
|
||||
Serial.println("Button A pressed");
|
||||
Serial.println("Banner demo");
|
||||
display.clearBuffer();
|
||||
display.setTextSize(3);
|
||||
display.setCursor((display.width() - 144) / 2, (display.height() - 24) / 2);
|
||||
display.setTextColor(EPD_BLACK);
|
||||
display.print("Tri");
|
||||
display.setTextColor(EPD_RED);
|
||||
display.print("Color");
|
||||
display.display();
|
||||
}
|
||||
|
||||
if (! expander.digitalRead(1)) {
|
||||
Serial.println("Button B pressed");
|
||||
Serial.println("Color rectangle demo");
|
||||
display.clearBuffer();
|
||||
display.fillRect(display.width() / 3, 0, display.width() / 3,
|
||||
display.height(), EPD_BLACK);
|
||||
display.fillRect((display.width() * 2) / 3, 0, display.width() / 3,
|
||||
display.height(), EPD_RED);
|
||||
display.display();
|
||||
}
|
||||
|
||||
if (! expander.digitalRead(2)) {
|
||||
Serial.println("Button C pressed");
|
||||
Serial.println("Text demo");
|
||||
// large block of text
|
||||
display.clearBuffer();
|
||||
display.setTextSize(1);
|
||||
testdrawtext(
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur "
|
||||
"adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa, "
|
||||
"fringilla sed malesuada et, malesuada sit amet turpis. Sed porttitor "
|
||||
"neque ut ante pretium vitae malesuada nunc bibendum. Nullam aliquet "
|
||||
"ultrices massa eu hendrerit. Ut sed nisi lorem. In vestibulum purus a "
|
||||
"tortor imperdiet posuere. ",
|
||||
EPD_BLACK);
|
||||
display.display();
|
||||
}
|
||||
|
||||
if (! expander.digitalRead(3)) {
|
||||
Serial.println("Button D pressed");
|
||||
display.clearBuffer();
|
||||
for (int16_t i = 0; i < display.width(); i += 4) {
|
||||
display.drawLine(0, 0, i, display.height() - 1, EPD_BLACK);
|
||||
}
|
||||
|
||||
for (int16_t i = 0; i < display.height(); i += 4) {
|
||||
display.drawLine(display.width() - 1, 0, 0, i, EPD_RED);
|
||||
}
|
||||
display.display();
|
||||
}
|
||||
}
|
||||
|
||||
void testdrawtext(const char *text, uint16_t color) {
|
||||
display.setCursor(0, 0);
|
||||
display.setTextColor(color);
|
||||
display.setTextWrap(true);
|
||||
display.print(text);
|
||||
}
|
||||
|
|
@ -27,33 +27,15 @@
|
|||
#endif
|
||||
|
||||
// ThinkInk_154_Grayscale4_T8 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
// EPD_BUSY, EPD_SPI); ThinkInk_213_Grayscale4_T5 display(EPD_DC, EPD_RESET,
|
||||
// EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
|
||||
// 1.54" Grayscale Breakout (SSD1681)
|
||||
//ThinkInk_154_Grayscale4_M05 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
|
||||
// 2.13" 212x104 Grayscale display with IL0373 chipset
|
||||
// ThinkInk_213_Grayscale4_T5 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 2.13" Grayscale Featherwing or Breakout (SSD1680Z)
|
||||
ThinkInk_213_Grayscale4_MFGN display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY,
|
||||
EPD_SPI);
|
||||
|
||||
// 2.66" Monochrome display with 296x152 pixels and SSD1680 chipset
|
||||
// ThinkInk_266_Grayscale4_MFGN display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY,
|
||||
// EPD_SPI);
|
||||
|
||||
// 2.9" Grayscale Featherwing or Breakout with IL0373
|
||||
// ThinkInk_290_Grayscale4_T5 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY,
|
||||
// EPD_SPI);
|
||||
|
||||
// 2.9" 4-Grayscale display with 296x128 pixels and SSD1680 chipset
|
||||
// ThinkInk_290_Grayscale4_EAAMFGN display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 4.2" 4-Grayscale display with SSD1683 chipset
|
||||
// ThinkInk_420_Grayscale4_MFGN display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
// 2.9" Grayscale Featherwing or Breakout:
|
||||
ThinkInk_290_Grayscale4_T5 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY,
|
||||
EPD_SPI);
|
||||
// 4.2" Grayscale display
|
||||
// ThinkInk_420_Grayscale4_T2 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
#define COLOR1 EPD_BLACK
|
||||
#define COLOR2 EPD_LIGHT
|
||||
|
|
@ -82,16 +64,9 @@ void loop() {
|
|||
display.clearBuffer();
|
||||
display.setTextSize(3);
|
||||
display.setTextColor(EPD_BLACK);
|
||||
display.setCursor((display.width() - 180) / 2, (display.height() - 24) / 2);
|
||||
display.setCursor(20, 40);
|
||||
if (gray) {
|
||||
String text = "Grayscale";
|
||||
uint16_t colors[] = {EPD_BLACK, EPD_DARK, EPD_LIGHT};
|
||||
|
||||
for (int i = 0; i < text.length(); i++) {
|
||||
// Change color for every character (0: BLACK, 1: DARK, 2: LIGHT, 3: BLACK, etc.)
|
||||
display.setTextColor(colors[i % 3]);
|
||||
display.print(text.charAt(i));
|
||||
}
|
||||
display.print("Grayscale");
|
||||
} else {
|
||||
display.print("Monochrome");
|
||||
}
|
||||
|
|
@ -99,7 +74,7 @@ void loop() {
|
|||
gray = !gray;
|
||||
|
||||
display.display();
|
||||
delay(2000);
|
||||
delay(1000);
|
||||
|
||||
display.clearBuffer();
|
||||
display.fillRect(display.width() / 4, 0, display.width() / 4,
|
||||
|
|
|
|||
|
|
@ -27,62 +27,40 @@
|
|||
#endif
|
||||
|
||||
// 1.54" Monochrome displays with 200x200 pixels and SSD1681 chipset
|
||||
// ThinkInk_154_Mono_D67 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
// ThinkInk_154_Mono_D67 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
|
||||
// 1.54" Monochrome displays with 200x200 pixels and SSD1608 chipset
|
||||
// ThinkInk_154_Mono_D27 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
// ThinkInk_154_Mono_D27 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
|
||||
// 1.54" Monochrome displays with 152x152 pixels and UC8151D chipset
|
||||
// ThinkInk_154_Mono_M10 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
// ThinkInk_154_Mono_M10 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
|
||||
// 2.13" Monochrome displays with 250x122 pixels and SSD1675 chipset
|
||||
ThinkInk_213_Mono_B72 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
ThinkInk_213_Mono_B72 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
|
||||
// 2.13" Monochrome displays with 250x122 pixels and SSD1675B chipset
|
||||
// ThinkInk_213_Mono_B73 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
// ThinkInk_213_Mono_B73 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
|
||||
// 2.13" Monochrome displays with 250x122 pixels and SSD1680 chipset
|
||||
// ThinkInk_213_Mono_BN display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
// ThinkInk_213_Mono_B74 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
// The GDEY0213B74 is like the B74 above but is not 'shifted down' by 8 pixels
|
||||
// ThinkInk_213_Mono_GDEY0213B74 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
// ThinkInk_213_Mono_BN display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// ThinkInk_213_Mono_B74 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
|
||||
// 2.13" Monochrome displays with 212x104 pixels and UC8151D chipset
|
||||
// ThinkInk_213_Mono_M21 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
// ThinkInk_213_Mono_M21 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
|
||||
// 2.66" Monochrome display with 296x152 pixels and SSD1680 chipset
|
||||
// ThinkInk_266_Grayscale4_MFGN display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY,
|
||||
// EPD_SPI);
|
||||
|
||||
// 2.9" 4-level Grayscale (use mono) displays with 296x128 pixels and SSD1680 chip
|
||||
// ThinkInk_290_Grayscale4_EAAMFGN display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 2.9" 4-level Grayscale (use mono) displays with 296x128 pixels and IL0373 chipset
|
||||
// 2.9" 4-level Grayscale (use mono) displays with 296x128 pixels and IL0373
|
||||
// chipset
|
||||
// ThinkInk_290_Grayscale4_T5 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
// EPD_BUSY);
|
||||
|
||||
// 2.9" Monochrome displays with 296x128 pixels and UC8151D chipset
|
||||
// ThinkInk_290_Mono_M06 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 3.7" Monochrome Display with 420x240 pixels and UC8253 chipset
|
||||
// ThinkInk_370_Mono_BAAMFGN display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
// ThinkInk_290_Mono_M06 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
|
||||
// 4.2" Monochrome displays with 400x300 pixels and SSD1619 chipset
|
||||
// ThinkInk_420_Mono_BN display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
// ThinkInk_420_Mono_BN display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
|
||||
// 4.2" Monochrome displays with 400x300 pixels and UC8276 chipset
|
||||
// ThinkInk_420_Mono_M06 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 4.2" Grayscale/Monochrome displays with 400x300 pixels and SSD1683 chipset
|
||||
// ThinkInk_420_Grayscale4_MFGN display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 5.83" Monochrome displays with 648 x 480 pixels and UC8179 chipset
|
||||
// ThinkInk_583_Mono_AAAMFGN display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 7.5" Monochrome displays with 800 x 480 pixels and UC8179 chipset
|
||||
// ThinkInk_750_Mono_AAAMFGN display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
// ThinkInk_420_Mono_M06 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
|
|
|
|||
|
|
@ -1,114 +0,0 @@
|
|||
/***************************************************
|
||||
Adafruit invests time and resources providing this open source code,
|
||||
please support Adafruit and open-source hardware by purchasing
|
||||
products from Adafruit!
|
||||
|
||||
Written by Limor Fried/Ladyada for Adafruit Industries.
|
||||
MIT license, all text above must be included in any redistribution
|
||||
****************************************************/
|
||||
|
||||
#include "Adafruit_ThinkInk.h"
|
||||
|
||||
#ifdef ARDUINO_ADAFRUIT_FEATHER_RP2040_THINKINK // detects if compiling for
|
||||
// Feather RP2040 ThinkInk
|
||||
#define EPD_DC PIN_EPD_DC // ThinkInk 24-pin connector DC
|
||||
#define EPD_CS PIN_EPD_CS // ThinkInk 24-pin connector CS
|
||||
#define EPD_BUSY PIN_EPD_BUSY // ThinkInk 24-pin connector Busy
|
||||
#define SRAM_CS -1 // use onboard RAM
|
||||
#define EPD_RESET PIN_EPD_RESET // ThinkInk 24-pin connector Reset
|
||||
#define EPD_SPI &SPI1 // secondary SPI for ThinkInk
|
||||
#else
|
||||
#define EPD_DC 10
|
||||
#define EPD_CS 9
|
||||
#define EPD_BUSY 7 // can set to -1 to not use a pin (will wait a fixed delay)
|
||||
#define SRAM_CS 6
|
||||
#define EPD_RESET 8 // can set to -1 and share with microcontroller Reset!
|
||||
#define EPD_SPI &SPI // primary SPI
|
||||
#endif
|
||||
|
||||
// 2.13" Quadcolor EPD with JD79661 chipset
|
||||
ThinkInk_213_Quadcolor_AJHE5 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 3.52" Quadcolor EPD with JD79667 chipset
|
||||
//ThinkInk_352_Quadcolor_AJHE5 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
while (!Serial) {
|
||||
delay(10);
|
||||
}
|
||||
Serial.println("Adafruit EPD full update test in red/yellow/black/white");
|
||||
display.begin(THINKINK_QUADCOLOR);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
Serial.println("Banner demo");
|
||||
display.clearBuffer();
|
||||
display.setTextSize(3);
|
||||
display.setCursor((display.width() - 144) / 2, (display.height() - 24) / 2);
|
||||
String text = "QuadColor";
|
||||
uint16_t colors[] = {EPD_BLACK, EPD_RED, EPD_YELLOW};
|
||||
|
||||
for (int i = 0; i < text.length(); i++) {
|
||||
// Change color for every character (0: BLACK, 1: RED, 2: YELLOW, 3: BLACK, etc.)
|
||||
display.setTextColor(colors[i % 3]);
|
||||
display.print(text.charAt(i));
|
||||
}
|
||||
display.display();
|
||||
|
||||
delay(15000);
|
||||
|
||||
Serial.println("Color quadrant demo");
|
||||
display.clearBuffer();
|
||||
// Top-left quadrant - EPD_BLACK
|
||||
display.fillRect(0, 0, display.width() / 2, display.height() / 2, EPD_BLACK);
|
||||
// Top-right quadrant - EPD_RED
|
||||
display.fillRect(display.width() / 2, 0, display.width() / 2, display.height() / 2, EPD_RED);
|
||||
// Bottom-left quadrant - EPD_YELLOW
|
||||
display.fillRect(0, display.height() / 2, display.width() / 2, display.height() / 2, EPD_YELLOW);
|
||||
// Bottom-right quadrant - assume you have a 4th color like EPD_WHITE or another color
|
||||
display.fillRect(display.width() / 2, display.height() / 2, display.width() / 2, display.height() / 2, EPD_WHITE);
|
||||
|
||||
display.display();
|
||||
|
||||
delay(15000);
|
||||
|
||||
Serial.println("Text demo");
|
||||
// large block of text
|
||||
display.clearBuffer();
|
||||
display.setTextSize(1);
|
||||
testdrawtext(
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur "
|
||||
"adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa, "
|
||||
"fringilla sed malesuada et, malesuada sit amet turpis. Sed porttitor "
|
||||
"neque ut ante pretium vitae malesuada nunc bibendum. Nullam aliquet "
|
||||
"ultrices massa eu hendrerit. Ut sed nisi lorem. In vestibulum purus a "
|
||||
"tortor imperdiet posuere. ",
|
||||
EPD_BLACK);
|
||||
display.display();
|
||||
|
||||
delay(15000);
|
||||
|
||||
display.clearBuffer();
|
||||
for (int16_t i = 0; i < display.width(); i += 4) {
|
||||
display.drawLine(0, 0, i, display.height() - 1, EPD_BLACK);
|
||||
}
|
||||
for (int16_t i = 0; i < display.height(); i += 4) {
|
||||
display.drawLine(display.width() - 1, 0, 0, i, EPD_RED);
|
||||
}
|
||||
for (int16_t i = 0; i < display.width(); i += 4) {
|
||||
display.drawLine(display.width()/2, display.height()-1, i, 0,
|
||||
EPD_YELLOW);
|
||||
}
|
||||
|
||||
display.display();
|
||||
|
||||
delay(15000);
|
||||
}
|
||||
|
||||
void testdrawtext(const char *text, uint16_t color) {
|
||||
display.setCursor(0, 0);
|
||||
display.setTextColor(color);
|
||||
display.setTextWrap(true);
|
||||
display.print(text);
|
||||
}
|
||||
|
|
@ -42,20 +42,10 @@
|
|||
ThinkInk_213_Tricolor_RW display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY,
|
||||
EPD_SPI);
|
||||
|
||||
// 2.13" Tricolor EPD with SSD1680Z chipset
|
||||
// ThinkInk_213_Tricolor_MFGNR display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 2.13" Tricolor EPD with IL0373 chipset
|
||||
// ThinkInk_213_Tricolor_Z16 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
|
||||
// 2.66" Tricolor EPD with SSD1680Z chipset
|
||||
// ThinkInk_266_Tricolor_MFGNR display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
|
||||
// 2.7" Tricolor Featherwing or Breakout with IL91874 chipset
|
||||
// ThinkInk_270_Tricolor_C44 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
|
@ -64,41 +54,21 @@ ThinkInk_213_Tricolor_RW display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY,
|
|||
// ThinkInk_270_Tricolor_Z70 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
|
||||
// 2.9" Tricolor Featherwing or Breakout with IL0373 chipset
|
||||
// ThinkInk_290_Tricolor_Z10 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 2.9" Tricolor Featherwing or Breakout with UC8151D chipset
|
||||
// ThinkInk_290_Tricolor_Z13 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 2.9" Tricolor Featherwing or Breakout with SSD1680 chipset and negative
|
||||
// offset
|
||||
// ThinkInk_290_Tricolor_Z94 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 3.7" Tricolor Display with 420x240 pixels and UC8253 chipset
|
||||
// ThinkInk_370_Tricolor_BABMFGNR display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// ThinkInk_420_Tricolor_RW display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// ThinkInk_420_Tricolor_Z21 display(EPD_DC, EPD_RESET,
|
||||
// EPD_BUSY, EPD_SPI); ThinkInk_420_Tricolor_Z21 display(EPD_DC, EPD_RESET,
|
||||
// EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 4.2" Tricolor EPD with SSD1683 chipset
|
||||
// ThinkInk_420_Tricolor_MFGNR display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 5.83 Tricolor displays with 648x480 pixels and UC8179 chipset
|
||||
// ThinkInk_583_Tricolor_AABMFGNR display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 7.5" Tricolor displays with 800x480 pixels and UC8179 chipset
|
||||
// ThinkInk_750_Tricolor_AABMFGNR display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
while (!Serial) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
name=Adafruit EPD
|
||||
version=4.6.4
|
||||
version=4.5.3
|
||||
author=Adafruit
|
||||
maintainer=Adafruit <info@adafruit.com>
|
||||
sentence=ePaper display driver
|
||||
|
|
|
|||
21
license.txt
21
license.txt
|
|
@ -1,21 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2025 limor fried
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
|
@ -34,7 +34,6 @@
|
|||
*/
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
bool Adafruit_EPD::_isInTransaction = false;
|
||||
|
|
@ -98,7 +97,7 @@ Adafruit_EPD::Adafruit_EPD(int width, int height, int16_t spi_mosi,
|
|||
/**************************************************************************/
|
||||
Adafruit_EPD::Adafruit_EPD(int width, int height, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t BUSY,
|
||||
SPIClass* spi)
|
||||
SPIClass *spi)
|
||||
: Adafruit_GFX(width, height), sram(SRCS) {
|
||||
_cs_pin = CS;
|
||||
_reset_pin = RST;
|
||||
|
|
@ -167,9 +166,9 @@ void Adafruit_EPD::begin(bool reset) {
|
|||
pinMode(_cs_pin, OUTPUT);
|
||||
|
||||
#if defined(BUSIO_USE_FAST_PINIO)
|
||||
csPort = (BusIO_PortReg*)portOutputRegister(digitalPinToPort(_cs_pin));
|
||||
csPort = (BusIO_PortReg *)portOutputRegister(digitalPinToPort(_cs_pin));
|
||||
csPinMask = digitalPinToBitMask(_cs_pin);
|
||||
dcPort = (BusIO_PortReg*)portOutputRegister(digitalPinToPort(_dc_pin));
|
||||
dcPort = (BusIO_PortReg *)portOutputRegister(digitalPinToPort(_dc_pin));
|
||||
dcPinMask = digitalPinToBitMask(_dc_pin);
|
||||
#endif
|
||||
|
||||
|
|
@ -197,6 +196,10 @@ void Adafruit_EPD::begin(bool reset) {
|
|||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_EPD::hardwareReset(void) {
|
||||
if ( _customResetFunction != NULL) {
|
||||
_customResetFunction();
|
||||
return;
|
||||
}
|
||||
if (_reset_pin >= 0) {
|
||||
// Setup reset pin direction
|
||||
pinMode(_reset_pin, OUTPUT);
|
||||
|
|
@ -213,6 +216,37 @@ void Adafruit_EPD::hardwareReset(void) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Sets a custom reset function.
|
||||
*
|
||||
* @param resetFunction The function to be called for custom hardware reset.
|
||||
*/
|
||||
void Adafruit_EPD::setCustomResetFunction(customResetFunction resetFunction) {
|
||||
_customResetFunction = resetFunction;
|
||||
}
|
||||
|
||||
bool Adafruit_EPD::readBusyPin(void) {
|
||||
if (_customBusyFunction) {
|
||||
return _customBusyFunction();
|
||||
}
|
||||
|
||||
if (_busy_pin >= 0) {
|
||||
return digitalRead(_busy_pin);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets a custom busy function.
|
||||
*
|
||||
* @param resetFunction The function to be called for custom business check.
|
||||
*/
|
||||
void Adafruit_EPD::setCustomBusyFunction(customBusyFunction busyFunction) {
|
||||
_customBusyFunction = busyFunction;
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief draw a single pixel on the screen
|
||||
|
|
@ -226,22 +260,21 @@ void Adafruit_EPD::drawPixel(int16_t x, int16_t y, uint16_t color) {
|
|||
return;
|
||||
|
||||
uint8_t *black_pBuf, *color_pBuf;
|
||||
// Serial.printf("(%d, %d) -> ", x, y);
|
||||
|
||||
// check rotation, move pixel around if necessary
|
||||
switch (getRotation()) {
|
||||
case 1:
|
||||
EPD_swap(x, y);
|
||||
x = WIDTH - x - 1;
|
||||
break;
|
||||
case 2:
|
||||
x = WIDTH - x - 1;
|
||||
y = HEIGHT - y - 1;
|
||||
break;
|
||||
case 3:
|
||||
EPD_swap(x, y);
|
||||
y = HEIGHT - y - 1;
|
||||
break;
|
||||
case 1:
|
||||
EPD_swap(x, y);
|
||||
x = WIDTH - x - 1;
|
||||
break;
|
||||
case 2:
|
||||
x = WIDTH - x - 1;
|
||||
y = HEIGHT - y - 1;
|
||||
break;
|
||||
case 3:
|
||||
EPD_swap(x, y);
|
||||
y = HEIGHT - y - 1;
|
||||
break;
|
||||
}
|
||||
|
||||
// deal with non-8-bit heights
|
||||
|
|
@ -249,16 +282,8 @@ void Adafruit_EPD::drawPixel(int16_t x, int16_t y, uint16_t color) {
|
|||
if (_HEIGHT % 8 != 0) {
|
||||
_HEIGHT += 8 - (_HEIGHT % 8);
|
||||
}
|
||||
// Serial.printf("(%d, %d) : ", x, y);
|
||||
|
||||
uint16_t addr;
|
||||
if (_data_entry_mode == THINKINK_UC8179) {
|
||||
addr = ((uint32_t)(HEIGHT - 1 - y) * (uint32_t)WIDTH + x) / 8;
|
||||
} else { // THINKINK_STANDARD default!
|
||||
addr = ((uint32_t)(WIDTH - 1 - x) * (uint32_t)_HEIGHT + y) / 8;
|
||||
}
|
||||
uint16_t addr = ((uint32_t)(WIDTH - 1 - x) * (uint32_t)_HEIGHT + y) / 8;
|
||||
uint8_t black_c, color_c;
|
||||
// Serial.printf("0x%0x\n\r",addr);
|
||||
|
||||
if (use_sram) {
|
||||
black_c = sram.read8(blackbuffer_addr + addr);
|
||||
|
|
@ -275,23 +300,16 @@ void Adafruit_EPD::drawPixel(int16_t x, int16_t y, uint16_t color) {
|
|||
black_bit = layer_colors[color] & 0x1;
|
||||
color_bit = layer_colors[color] & 0x2;
|
||||
|
||||
uint8_t bit_idx;
|
||||
if (_data_entry_mode == THINKINK_UC8179) {
|
||||
bit_idx = x;
|
||||
} else { // THINKINK_STANDARD default!
|
||||
bit_idx = y;
|
||||
}
|
||||
|
||||
if ((color_bit && colorInverted) || (!color_bit && !colorInverted)) {
|
||||
*color_pBuf &= ~(1 << (7 - bit_idx % 8));
|
||||
*color_pBuf &= ~(1 << (7 - y % 8));
|
||||
} else {
|
||||
*color_pBuf |= (1 << (7 - bit_idx % 8));
|
||||
*color_pBuf |= (1 << (7 - y % 8));
|
||||
}
|
||||
|
||||
if ((black_bit && blackInverted) || (!black_bit && !blackInverted)) {
|
||||
*black_pBuf &= ~(1 << (7 - bit_idx % 8));
|
||||
*black_pBuf &= ~(1 << (7 - y % 8));
|
||||
} else {
|
||||
*black_pBuf |= (1 << (7 - bit_idx % 8));
|
||||
*black_pBuf |= (1 << (7 - y % 8));
|
||||
}
|
||||
|
||||
if (use_sram) {
|
||||
|
|
@ -300,7 +318,7 @@ void Adafruit_EPD::drawPixel(int16_t x, int16_t y, uint16_t color) {
|
|||
}
|
||||
}
|
||||
|
||||
void Adafruit_EPD::writeRAMFramebufferToEPD(uint8_t* framebuffer,
|
||||
void Adafruit_EPD::writeRAMFramebufferToEPD(uint8_t *framebuffer,
|
||||
uint32_t framebuffer_size,
|
||||
uint8_t EPDlocation,
|
||||
bool invertdata) {
|
||||
|
|
@ -524,8 +542,8 @@ void Adafruit_EPD::clearDisplay() {
|
|||
/*!
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_EPD::EPD_commandList(const uint8_t* init_code) {
|
||||
uint8_t buf[250];
|
||||
void Adafruit_EPD::EPD_commandList(const uint8_t *init_code) {
|
||||
uint8_t buf[64];
|
||||
|
||||
while (init_code[0] != 0xFE) {
|
||||
uint8_t cmd = init_code[0];
|
||||
|
|
@ -538,7 +556,7 @@ void Adafruit_EPD::EPD_commandList(const uint8_t* init_code) {
|
|||
continue;
|
||||
}
|
||||
if (num_args > sizeof(buf)) {
|
||||
Serial.println(F("ERROR - buf not large enough!"));
|
||||
Serial.println("ERROR - buf not large enough!");
|
||||
while (1)
|
||||
delay(10);
|
||||
}
|
||||
|
|
@ -559,7 +577,7 @@ void Adafruit_EPD::EPD_commandList(const uint8_t* init_code) {
|
|||
@param len the length of the data buffer
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_EPD::EPD_command(uint8_t c, const uint8_t* buf, uint16_t len) {
|
||||
void Adafruit_EPD::EPD_command(uint8_t c, const uint8_t *buf, uint16_t len) {
|
||||
EPD_command(c, false);
|
||||
EPD_data(buf, len);
|
||||
}
|
||||
|
|
@ -581,7 +599,7 @@ uint8_t Adafruit_EPD::EPD_command(uint8_t c, bool end) {
|
|||
|
||||
uint8_t data = SPItransfer(c);
|
||||
#ifdef EPD_DEBUG
|
||||
Serial.print(F("\tCommand: 0x"));
|
||||
Serial.print("\tCommand: 0x");
|
||||
Serial.println(c, HEX);
|
||||
#endif
|
||||
|
||||
|
|
@ -599,7 +617,7 @@ uint8_t Adafruit_EPD::EPD_command(uint8_t c, bool end) {
|
|||
@param len the length of the data buffer
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_EPD::EPD_data(const uint8_t* buf, uint16_t len) {
|
||||
void Adafruit_EPD::EPD_data(const uint8_t *buf, uint16_t len) {
|
||||
// SPI
|
||||
dcHigh();
|
||||
|
||||
|
|
@ -671,6 +689,7 @@ uint8_t Adafruit_EPD::SPItransfer(uint8_t d) {
|
|||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_EPD::csHigh() {
|
||||
|
||||
#ifdef BUSIO_USE_FAST_PINIO
|
||||
*csPort = *csPort | csPinMask;
|
||||
#else
|
||||
|
|
@ -689,6 +708,7 @@ void Adafruit_EPD::csHigh() {
|
|||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_EPD::csLow() {
|
||||
|
||||
if (!_isInTransaction) {
|
||||
spi_dev->beginTransaction();
|
||||
_isInTransaction = true;
|
||||
|
|
|
|||
|
|
@ -20,49 +20,41 @@
|
|||
#ifndef _ADAFRUIT_EPD_H_
|
||||
#define _ADAFRUIT_EPD_H_
|
||||
|
||||
// #define EPD_DEBUG
|
||||
//#define EPD_DEBUG
|
||||
|
||||
#define RAMBUFSIZE 64 ///< size of the ram buffer
|
||||
|
||||
#include "Adafruit_MCPSRAM.h"
|
||||
#include <Adafruit_GFX.h>
|
||||
#include <Adafruit_SPIDevice.h>
|
||||
|
||||
#include "Adafruit_MCPSRAM.h"
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief available EPD colors
|
||||
*/
|
||||
/**************************************************************************/
|
||||
enum {
|
||||
EPD_WHITE, ///< white color
|
||||
EPD_BLACK, ///< black color
|
||||
EPD_RED, ///< red color
|
||||
EPD_GRAY, ///< gray color ('red' on grayscale)
|
||||
EPD_DARK, ///< darker color
|
||||
EPD_LIGHT, ///< lighter color
|
||||
EPD_YELLOW, ///< fourth color on some displays
|
||||
EPD_WHITE, ///< white color
|
||||
EPD_BLACK, ///< black color
|
||||
EPD_RED, ///< red color
|
||||
EPD_GRAY, ///< gray color ('red' on grayscale)
|
||||
EPD_DARK, ///< darker color
|
||||
EPD_LIGHT, ///< lighter color
|
||||
EPD_NUM_COLORS
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
THINKINK_STANDARD = 0, // 99% of panels use this setup!
|
||||
THINKINK_UC8179 = 1, // .... except for UC8179?
|
||||
} thinkink_sramentrymode_t;
|
||||
|
||||
typedef enum {
|
||||
THINKINK_MONO,
|
||||
THINKINK_TRICOLOR,
|
||||
THINKINK_GRAYSCALE4,
|
||||
THINKINK_MONO_PARTIAL,
|
||||
THINKINK_QUADCOLOR,
|
||||
} thinkinkmode_t;
|
||||
|
||||
#define EPD_swap(a, b) \
|
||||
{ \
|
||||
int16_t t = a; \
|
||||
a = b; \
|
||||
b = t; \
|
||||
#define EPD_swap(a, b) \
|
||||
{ \
|
||||
int16_t t = a; \
|
||||
a = b; \
|
||||
b = t; \
|
||||
} ///< simple swap function
|
||||
|
||||
/**************************************************************************/
|
||||
|
|
@ -71,12 +63,12 @@ typedef enum {
|
|||
*/
|
||||
/**************************************************************************/
|
||||
class Adafruit_EPD : public Adafruit_GFX {
|
||||
public:
|
||||
public:
|
||||
Adafruit_EPD(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1);
|
||||
Adafruit_EPD(int width, int height, int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass* spi = &SPI);
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
~Adafruit_EPD();
|
||||
|
||||
void begin(bool reset = true);
|
||||
|
|
@ -87,14 +79,15 @@ class Adafruit_EPD : public Adafruit_GFX {
|
|||
void setColorBuffer(int8_t index, bool inverted);
|
||||
void display(bool sleep = false);
|
||||
|
||||
thinkinkmode_t getMode(void) {
|
||||
return inkmode;
|
||||
}
|
||||
thinkinkmode_t getMode(void) { return inkmode; }
|
||||
|
||||
protected:
|
||||
thinkink_sramentrymode_t _data_entry_mode = THINKINK_STANDARD;
|
||||
typedef void (*customResetFunction)();
|
||||
void setCustomResetFunction(customResetFunction resetFunction);
|
||||
typedef bool (*customBusyFunction)();
|
||||
void setCustomBusyFunction(customBusyFunction busyFunction);
|
||||
|
||||
void writeRAMFramebufferToEPD(uint8_t* buffer, uint32_t buffer_size,
|
||||
protected:
|
||||
void writeRAMFramebufferToEPD(uint8_t *buffer, uint32_t buffer_size,
|
||||
uint8_t EPDlocation, bool invertdata = false);
|
||||
void writeSRAMFramebufferToEPD(uint16_t SRAM_buffer_addr,
|
||||
uint32_t buffer_size, uint8_t EPDlocation,
|
||||
|
|
@ -120,6 +113,7 @@ class Adafruit_EPD : public Adafruit_GFX {
|
|||
/**************************************************************************/
|
||||
virtual void setRAMAddress(uint16_t x, uint16_t y) = 0;
|
||||
|
||||
bool readBusyPin(void);
|
||||
virtual void busy_wait(void) = 0;
|
||||
|
||||
/**************************************************************************/
|
||||
|
|
@ -143,20 +137,22 @@ class Adafruit_EPD : public Adafruit_GFX {
|
|||
/**************************************************************************/
|
||||
virtual void powerDown(void) = 0;
|
||||
void hardwareReset(void);
|
||||
customResetFunction _customResetFunction = NULL;
|
||||
customBusyFunction _customBusyFunction = NULL;
|
||||
|
||||
int16_t _dc_pin, ///< data/command pin
|
||||
_reset_pin, ///< reset pin
|
||||
_cs_pin, ///< chip select pin
|
||||
_busy_pin; ///< busy pin
|
||||
Adafruit_SPIDevice* spi_dev = NULL; ///< SPI object
|
||||
Adafruit_SPIDevice *spi_dev = NULL; ///< SPI object
|
||||
static bool _isInTransaction; ///< true if SPI bus is in trasnfer state
|
||||
bool singleByteTxns; ///< if true CS will go high after every data byte
|
||||
///< transferred
|
||||
|
||||
const uint8_t* _epd_init_code = NULL;
|
||||
const uint8_t* _epd_lut_code = NULL;
|
||||
const uint8_t* _epd_partial_init_code = NULL;
|
||||
const uint8_t* _epd_partial_lut_code = NULL;
|
||||
const uint8_t *_epd_init_code = NULL;
|
||||
const uint8_t *_epd_lut_code = NULL;
|
||||
const uint8_t *_epd_partial_init_code = NULL;
|
||||
const uint8_t *_epd_partial_lut_code = NULL;
|
||||
|
||||
uint16_t default_refresh_delay = 15000;
|
||||
|
||||
|
|
@ -169,22 +165,22 @@ class Adafruit_EPD : public Adafruit_GFX {
|
|||
|
||||
uint32_t buffer1_size; ///< size of the primary buffer
|
||||
uint32_t buffer2_size; ///< size of the secondary buffer
|
||||
uint8_t* buffer1; ///< the pointer to the primary buffer if using on-chip ram
|
||||
uint8_t*
|
||||
buffer2; ///< the pointer to the secondary buffer if using on-chip ram
|
||||
uint8_t*
|
||||
color_buffer; ///< the pointer to the color buffer if using on-chip ram
|
||||
uint8_t*
|
||||
black_buffer; ///< the pointer to the black buffer if using on-chip ram
|
||||
uint8_t *buffer1; ///< the pointer to the primary buffer if using on-chip ram
|
||||
uint8_t
|
||||
*buffer2; ///< the pointer to the secondary buffer if using on-chip ram
|
||||
uint8_t
|
||||
*color_buffer; ///< the pointer to the color buffer if using on-chip ram
|
||||
uint8_t
|
||||
*black_buffer; ///< the pointer to the black buffer if using on-chip ram
|
||||
uint16_t buffer1_addr; ///< The SRAM address offsets for the primary buffer
|
||||
uint16_t buffer2_addr; ///< The SRAM address offsets for the secondary buffer
|
||||
uint16_t colorbuffer_addr; ///< The SRAM address offsets for the color buffer
|
||||
uint16_t blackbuffer_addr; ///< The SRAM address offsets for the black buffer
|
||||
|
||||
void EPD_commandList(const uint8_t* init_code);
|
||||
void EPD_command(uint8_t c, const uint8_t* buf, uint16_t len);
|
||||
void EPD_commandList(const uint8_t *init_code);
|
||||
void EPD_command(uint8_t c, const uint8_t *buf, uint16_t len);
|
||||
uint8_t EPD_command(uint8_t c, bool end = true);
|
||||
void EPD_data(const uint8_t* buf, uint16_t len);
|
||||
void EPD_data(const uint8_t *buf, uint16_t len);
|
||||
void EPD_data(uint8_t data);
|
||||
|
||||
uint8_t SPItransfer(uint8_t c);
|
||||
|
|
@ -211,18 +207,13 @@ class Adafruit_EPD : public Adafruit_GFX {
|
|||
#include "drivers/Adafruit_IL0373.h"
|
||||
#include "drivers/Adafruit_IL0398.h"
|
||||
#include "drivers/Adafruit_IL91874.h"
|
||||
#include "drivers/Adafruit_JD79661.h"
|
||||
#include "drivers/Adafruit_JD79667.h"
|
||||
#include "drivers/Adafruit_SSD1608.h"
|
||||
#include "drivers/Adafruit_SSD1619.h"
|
||||
#include "drivers/Adafruit_SSD1675.h"
|
||||
#include "drivers/Adafruit_SSD1675B.h"
|
||||
#include "drivers/Adafruit_SSD1680.h"
|
||||
#include "drivers/Adafruit_SSD1681.h"
|
||||
#include "drivers/Adafruit_SSD1683.h"
|
||||
#include "drivers/Adafruit_UC8151D.h"
|
||||
#include "drivers/Adafruit_UC8179.h"
|
||||
#include "drivers/Adafruit_UC8253.h"
|
||||
#include "drivers/Adafruit_UC8276.h"
|
||||
|
||||
#endif /* _ADAFRUIT_EPD_H_ */
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "Adafruit_MCPSRAM.h"
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include <SPI.h>
|
||||
|
||||
/**************************************************************************/
|
||||
|
|
@ -28,7 +29,7 @@ Adafruit_MCPSRAM::Adafruit_MCPSRAM(int16_t mosi, int16_t miso, int16_t sck,
|
|||
@param spi the SPI bus to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_MCPSRAM::Adafruit_MCPSRAM(int16_t cs, SPIClass* spi) {
|
||||
Adafruit_MCPSRAM::Adafruit_MCPSRAM(int16_t cs, SPIClass *spi) {
|
||||
_cs = cs;
|
||||
_spi = spi;
|
||||
hwSPI = true;
|
||||
|
|
@ -105,7 +106,7 @@ void Adafruit_MCPSRAM::begin() {
|
|||
register, MCPSRAM_WRITE if you are writing data. Defaults to MCPSRAM_WRITE.
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_MCPSRAM::write(uint16_t addr, uint8_t* buf, uint16_t num,
|
||||
void Adafruit_MCPSRAM::write(uint16_t addr, uint8_t *buf, uint16_t num,
|
||||
uint8_t reg) {
|
||||
csLow();
|
||||
|
||||
|
|
@ -116,6 +117,7 @@ void Adafruit_MCPSRAM::write(uint16_t addr, uint8_t* buf, uint16_t num,
|
|||
cmdbuf[2] = addr & 0xFF;
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
|
||||
uint8_t d = cmdbuf[i];
|
||||
|
||||
if (hwSPI) {
|
||||
|
|
@ -145,6 +147,7 @@ void Adafruit_MCPSRAM::write(uint16_t addr, uint8_t* buf, uint16_t num,
|
|||
|
||||
// write buffer of data
|
||||
for (uint16_t i = 0; i < num; i++) {
|
||||
|
||||
uint8_t d = buf[i];
|
||||
|
||||
if (hwSPI) {
|
||||
|
|
@ -181,8 +184,9 @@ void Adafruit_MCPSRAM::write(uint16_t addr, uint8_t* buf, uint16_t num,
|
|||
register, MCPSRAM_READ if you are reading data. Defaults to MCPSRAM_READ.
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_MCPSRAM::read(uint16_t addr, uint8_t* buf, uint16_t num,
|
||||
void Adafruit_MCPSRAM::read(uint16_t addr, uint8_t *buf, uint16_t num,
|
||||
uint8_t reg) {
|
||||
|
||||
csLow();
|
||||
|
||||
// write command and address
|
||||
|
|
@ -191,6 +195,7 @@ void Adafruit_MCPSRAM::read(uint16_t addr, uint8_t* buf, uint16_t num,
|
|||
cmdbuf[1] = (addr >> 8);
|
||||
cmdbuf[2] = addr & 0xFF;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
|
||||
uint8_t d = cmdbuf[i];
|
||||
|
||||
if (hwSPI) {
|
||||
|
|
@ -220,6 +225,7 @@ void Adafruit_MCPSRAM::read(uint16_t addr, uint8_t* buf, uint16_t num,
|
|||
|
||||
// read data into buffer
|
||||
for (uint16_t i = 0; i < num; i++) {
|
||||
|
||||
if (hwSPI) {
|
||||
buf[i] = _spi->transfer(0x00);
|
||||
} else {
|
||||
|
|
@ -313,6 +319,7 @@ void Adafruit_MCPSRAM::erase(uint16_t addr, uint16_t length, uint8_t val) {
|
|||
cmdbuf[2] = addr & 0xFF;
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
|
||||
uint8_t d = cmdbuf[i];
|
||||
|
||||
if (hwSPI) {
|
||||
|
|
@ -340,6 +347,7 @@ void Adafruit_MCPSRAM::erase(uint16_t addr, uint16_t length, uint8_t val) {
|
|||
|
||||
// write buffer of data
|
||||
for (uint16_t i = 0; i < length; i++) {
|
||||
|
||||
uint8_t d = val;
|
||||
|
||||
if (hwSPI) {
|
||||
|
|
|
|||
|
|
@ -14,16 +14,16 @@
|
|||
*/
|
||||
/**************************************************************************/
|
||||
class Adafruit_MCPSRAM {
|
||||
public:
|
||||
public:
|
||||
Adafruit_MCPSRAM(int16_t mosi, int16_t miso, int16_t sck, int16_t cs);
|
||||
Adafruit_MCPSRAM(int16_t cs, SPIClass* spi = &SPI);
|
||||
Adafruit_MCPSRAM(int16_t cs, SPIClass *spi = &SPI);
|
||||
~Adafruit_MCPSRAM() {}
|
||||
|
||||
void begin();
|
||||
|
||||
void write(uint16_t addr, uint8_t* buf, uint16_t num,
|
||||
void write(uint16_t addr, uint8_t *buf, uint16_t num,
|
||||
uint8_t reg = MCPSRAM_WRITE);
|
||||
void read(uint16_t addr, uint8_t* buf, uint16_t num,
|
||||
void read(uint16_t addr, uint8_t *buf, uint16_t num,
|
||||
uint8_t reg = MCPSRAM_READ);
|
||||
void erase(uint16_t addr, uint16_t length, uint8_t val = 0x00);
|
||||
|
||||
|
|
@ -36,12 +36,12 @@ class Adafruit_MCPSRAM {
|
|||
void csHigh();
|
||||
void csLow();
|
||||
|
||||
private:
|
||||
private:
|
||||
boolean hwSPI; ///< true if using hardware SPI
|
||||
#ifdef HAVE_PORTREG
|
||||
PortReg *mosiport, *clkport, *csport, *misoport;
|
||||
PortMask mosipinmask, clkpinmask, cspinmask, misopinmask;
|
||||
#endif
|
||||
int16_t _cs, _mosi, _miso, _sck;
|
||||
SPIClass* _spi = NULL;
|
||||
SPIClass *_spi = NULL;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,51 +2,38 @@
|
|||
#define _ADAFRUIT_THINKINK_H_
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include "panels/ThinkInk_154_Grayscale4_M05.h"
|
||||
#include "panels/ThinkInk_154_Grayscale4_T8.h"
|
||||
#include "panels/ThinkInk_154_Mono_D27.h"
|
||||
#include "panels/ThinkInk_154_Mono_D67.h"
|
||||
#include "panels/ThinkInk_154_Mono_M10.h"
|
||||
|
||||
#include "panels/ThinkInk_154_Tricolor_RW.h"
|
||||
#include "panels/ThinkInk_154_Tricolor_Z17.h"
|
||||
#include "panels/ThinkInk_154_Tricolor_Z90.h"
|
||||
#include "panels/ThinkInk_213_Grayscale4_MFGN.h"
|
||||
#include "panels/ThinkInk_213_Grayscale4_T5.h"
|
||||
#include "panels/ThinkInk_213_Mono_B72.h"
|
||||
#include "panels/ThinkInk_213_Mono_B73.h"
|
||||
#include "panels/ThinkInk_213_Mono_BN.h"
|
||||
#include "panels/ThinkInk_213_Mono_GDEY0213B74.h"
|
||||
#include "panels/ThinkInk_213_Mono_M21.h"
|
||||
#include "panels/ThinkInk_213_Quadcolor_AJHE5.h"
|
||||
#include "panels/ThinkInk_213_Tricolor_MFGNR.h"
|
||||
#include "panels/ThinkInk_213_Tricolor_RW.h"
|
||||
#include "panels/ThinkInk_213_Tricolor_Z16.h"
|
||||
#include "panels/ThinkInk_266_Grayscale4_MFGN.h"
|
||||
#include "panels/ThinkInk_266_Tricolor_MFGNR.h"
|
||||
#include "panels/ThinkInk_270_Grayscale4_W3.h"
|
||||
#include "panels/ThinkInk_270_Tricolor_C44.h"
|
||||
#include "panels/ThinkInk_270_Tricolor_Z70.h"
|
||||
#include "panels/ThinkInk_290_Grayscale4_EAAMFGN.h"
|
||||
#include "panels/ThinkInk_290_Grayscale4_T5.h"
|
||||
#include "panels/ThinkInk_290_Mono_BN.h"
|
||||
#include "panels/ThinkInk_290_Mono_M06.h"
|
||||
#include "panels/ThinkInk_290_Tricolor_RH.h"
|
||||
#include "panels/ThinkInk_290_Tricolor_Z10.h"
|
||||
#include "panels/ThinkInk_290_Tricolor_Z13.h"
|
||||
#include "panels/ThinkInk_290_Tricolor_Z94.h"
|
||||
#include "panels/ThinkInk_352_Quadcolor_AJHE5.h"
|
||||
#include "panels/ThinkInk_370_Mono_BAAMFGN.h"
|
||||
#include "panels/ThinkInk_370_Tricolor_BABMFGNR.h"
|
||||
#include "panels/ThinkInk_420_Grayscale4_MFGN.h"
|
||||
#include "panels/ThinkInk_420_Grayscale4_T2.h"
|
||||
#include "panels/ThinkInk_420_Mono_BN.h"
|
||||
#include "panels/ThinkInk_420_Mono_M06.h"
|
||||
#include "panels/ThinkInk_420_Tricolor_MFGNR.h"
|
||||
#include "panels/ThinkInk_420_Tricolor_RW.h"
|
||||
#include "panels/ThinkInk_420_Tricolor_Z21.h"
|
||||
#include "panels/ThinkInk_583_Mono_AAAMFGN.h"
|
||||
#include "panels/ThinkInk_583_Tricolor_AABMFGNR.h"
|
||||
#include "panels/ThinkInk_750_Mono_AAAMFGN.h"
|
||||
#include "panels/ThinkInk_750_Tricolor_AABMFGNR.h"
|
||||
|
||||
#include "panels/ThinkInk_154_Grayscale4_T8.h"
|
||||
#include "panels/ThinkInk_213_Grayscale4_T5.h"
|
||||
#include "panels/ThinkInk_270_Grayscale4_W3.h"
|
||||
#include "panels/ThinkInk_290_Grayscale4_T5.h"
|
||||
#include "panels/ThinkInk_290_Grayscale4_T94.h"
|
||||
#include "panels/ThinkInk_420_Grayscale4_T2.h"
|
||||
|
||||
#include "panels/ThinkInk_154_Mono_D27.h"
|
||||
#include "panels/ThinkInk_154_Mono_D67.h"
|
||||
#include "panels/ThinkInk_154_Mono_M10.h"
|
||||
#include "panels/ThinkInk_213_Mono_B72.h"
|
||||
#include "panels/ThinkInk_213_Mono_B73.h"
|
||||
#include "panels/ThinkInk_213_Mono_BN.h"
|
||||
#include "panels/ThinkInk_213_Mono_M21.h"
|
||||
#include "panels/ThinkInk_290_Mono_BN.h"
|
||||
#include "panels/ThinkInk_290_Mono_M06.h"
|
||||
#include "panels/ThinkInk_420_Mono_BN.h"
|
||||
#include "panels/ThinkInk_420_Mono_M06.h"
|
||||
|
||||
#endif // _ADAFRUIT_THINKINK_H_
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
#include "Adafruit_ACeP.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define BUSY_WAIT 500
|
||||
|
|
@ -43,6 +42,7 @@ Adafruit_ACEP::Adafruit_ACEP(int width, int height, int16_t SID, int16_t SCLK,
|
|||
int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t MISO, int16_t BUSY)
|
||||
: Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
|
||||
|
||||
if ((width % 8) != 0) {
|
||||
width += 8 - (width % 8);
|
||||
}
|
||||
|
|
@ -54,7 +54,7 @@ Adafruit_ACEP::Adafruit_ACEP(int width, int height, int16_t SID, int16_t SCLK,
|
|||
buffer1_addr = 0;
|
||||
buffer2_addr = 0;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = NULL;
|
||||
}
|
||||
|
||||
|
|
@ -77,8 +77,9 @@ Adafruit_ACEP::Adafruit_ACEP(int width, int height, int16_t SID, int16_t SCLK,
|
|||
/**************************************************************************/
|
||||
Adafruit_ACEP::Adafruit_ACEP(int width, int height, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t BUSY,
|
||||
SPIClass* spi)
|
||||
SPIClass *spi)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
}
|
||||
|
|
@ -90,7 +91,7 @@ Adafruit_ACEP::Adafruit_ACEP(int width, int height, int16_t DC, int16_t RST,
|
|||
buffer1_addr = 0;
|
||||
buffer2_addr = 0;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = buffer1;
|
||||
}
|
||||
|
||||
|
|
@ -171,7 +172,7 @@ void Adafruit_ACEP::drawPixel(int16_t x, int16_t y, uint16_t color) {
|
|||
if ((x < 0) || (x >= width()) || (y < 0) || (y >= height()))
|
||||
return;
|
||||
|
||||
uint8_t* pBuf;
|
||||
uint8_t *pBuf;
|
||||
|
||||
// deal with non-8-bit heights
|
||||
uint16_t _HEIGHT = HEIGHT;
|
||||
|
|
@ -181,18 +182,18 @@ void Adafruit_ACEP::drawPixel(int16_t x, int16_t y, uint16_t color) {
|
|||
|
||||
// check rotation, move pixel around if necessary
|
||||
switch (getRotation()) {
|
||||
case 1:
|
||||
EPD_swap(x, y);
|
||||
x = WIDTH - x - 1;
|
||||
break;
|
||||
case 2:
|
||||
x = WIDTH - x - 1;
|
||||
y = _HEIGHT - y - 1;
|
||||
break;
|
||||
case 3:
|
||||
EPD_swap(x, y);
|
||||
y = _HEIGHT - y - 1;
|
||||
break;
|
||||
case 1:
|
||||
EPD_swap(x, y);
|
||||
x = WIDTH - x - 1;
|
||||
break;
|
||||
case 2:
|
||||
x = WIDTH - x - 1;
|
||||
y = _HEIGHT - y - 1;
|
||||
break;
|
||||
case 3:
|
||||
EPD_swap(x, y);
|
||||
y = _HEIGHT - y - 1;
|
||||
break;
|
||||
}
|
||||
uint32_t addr = ((uint32_t)x + (uint32_t)y * WIDTH) / 2;
|
||||
bool lower_nibble = x % 2;
|
||||
|
|
@ -324,7 +325,7 @@ void Adafruit_ACEP::powerUp() {
|
|||
hardwareReset();
|
||||
delay(200);
|
||||
busy_wait();
|
||||
const uint8_t* init_code = acep_default_init_code;
|
||||
const uint8_t *init_code = acep_default_init_code;
|
||||
|
||||
if (_epd_init_code != NULL) {
|
||||
init_code = _epd_init_code;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
#ifndef LIB_ADAFRUIT_ACEP
|
||||
#define LIB_ADAFRUIT_ACEP
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#define ACEP_PANEL_SETTING 0x00
|
||||
#define ACEP_POWER_SETTING 0x01
|
||||
|
|
@ -35,12 +34,12 @@
|
|||
*/
|
||||
/**************************************************************************/
|
||||
class Adafruit_ACEP : public Adafruit_EPD {
|
||||
public:
|
||||
public:
|
||||
Adafruit_ACEP(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1);
|
||||
Adafruit_ACEP(int width, int height, int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass* spi = &SPI);
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
|
|
@ -53,7 +52,7 @@ class Adafruit_ACEP : public Adafruit_EPD {
|
|||
void deGhost();
|
||||
void drawPixel(int16_t x, int16_t y, uint16_t color);
|
||||
|
||||
protected:
|
||||
protected:
|
||||
uint8_t writeRAMCommand(uint8_t index);
|
||||
void setRAMAddress(uint16_t x, uint16_t y);
|
||||
void busy_wait();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
#include "Adafruit_EK79686.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define BUSY_WAIT 500
|
||||
|
|
@ -47,6 +46,7 @@ Adafruit_EK79686::Adafruit_EK79686(int width, int height, int16_t SID,
|
|||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY)
|
||||
: Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
|
||||
|
||||
if ((width % 8) != 0) {
|
||||
width += 8 - (width % 8);
|
||||
}
|
||||
|
|
@ -59,8 +59,8 @@ Adafruit_EK79686::Adafruit_EK79686(int width, int height, int16_t SID,
|
|||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t *)malloc(buffer2_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -80,8 +80,9 @@ Adafruit_EK79686::Adafruit_EK79686(int width, int height, int16_t SID,
|
|||
/**************************************************************************/
|
||||
Adafruit_EK79686::Adafruit_EK79686(int width, int height, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY, SPIClass* spi)
|
||||
int16_t BUSY, SPIClass *spi)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
}
|
||||
|
|
@ -94,8 +95,8 @@ Adafruit_EK79686::Adafruit_EK79686(int width, int height, int16_t DC,
|
|||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t *)malloc(buffer2_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -105,11 +106,11 @@ Adafruit_EK79686::Adafruit_EK79686(int width, int height, int16_t DC,
|
|||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_EK79686::busy_wait(void) {
|
||||
if (_busy_pin >= 0) {
|
||||
if (_busy_pin >= 0 || _customBusyFunction != NULL) {
|
||||
do {
|
||||
EPD_command(EK79686_FLG);
|
||||
delay(10);
|
||||
} while (!digitalRead(_busy_pin));
|
||||
} while (!readBusyPin());
|
||||
} else {
|
||||
delay(BUSY_WAIT);
|
||||
}
|
||||
|
|
@ -150,7 +151,7 @@ void Adafruit_EK79686::powerUp() {
|
|||
hardwareReset();
|
||||
delay(10);
|
||||
|
||||
const uint8_t* init_code = ek79686_default_init_code;
|
||||
const uint8_t *init_code = ek79686_default_init_code;
|
||||
|
||||
if (_epd_init_code != NULL) {
|
||||
init_code = _epd_init_code;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
#ifndef LIB_ADAFRUIT_EK79686
|
||||
#define LIB_ADAFRUIT_EK79686
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#define EK79686_PSR 0x00
|
||||
#define EK79686_PWR 0x01
|
||||
|
|
@ -58,19 +57,19 @@
|
|||
*/
|
||||
/**************************************************************************/
|
||||
class Adafruit_EK79686 : public Adafruit_EPD {
|
||||
public:
|
||||
public:
|
||||
Adafruit_EK79686(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1);
|
||||
Adafruit_EK79686(int width, int height, int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass* spi = &SPI);
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
void powerDown();
|
||||
void update();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
uint8_t writeRAMCommand(uint8_t index);
|
||||
void setRAMAddress(uint16_t x, uint16_t y);
|
||||
void busy_wait();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
#include "Adafruit_IL0373.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW IL0373_DTM1
|
||||
|
|
@ -43,6 +42,7 @@ Adafruit_IL0373::Adafruit_IL0373(int width, int height, int16_t SID,
|
|||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY)
|
||||
: Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
|
||||
|
||||
buffer1_size = ((uint32_t)width * (uint32_t)height) / 8;
|
||||
buffer2_size = buffer1_size;
|
||||
|
||||
|
|
@ -52,8 +52,8 @@ Adafruit_IL0373::Adafruit_IL0373(int width, int height, int16_t SID,
|
|||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t *)malloc(buffer2_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ Adafruit_IL0373::Adafruit_IL0373(int width, int height, int16_t SID,
|
|||
/**************************************************************************/
|
||||
Adafruit_IL0373::Adafruit_IL0373(int width, int height, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t BUSY,
|
||||
SPIClass* spi)
|
||||
SPIClass *spi)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
buffer1_size = ((uint32_t)width * (uint32_t)height) / 8;
|
||||
buffer2_size = buffer1_size;
|
||||
|
|
@ -85,8 +85,8 @@ Adafruit_IL0373::Adafruit_IL0373(int width, int height, int16_t DC, int16_t RST,
|
|||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t *)malloc(buffer2_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -147,7 +147,7 @@ void Adafruit_IL0373::powerUp(void) {
|
|||
|
||||
hardwareReset();
|
||||
|
||||
const uint8_t* init_code = il0373_default_init_code;
|
||||
const uint8_t *init_code = il0373_default_init_code;
|
||||
|
||||
if (_epd_init_code != NULL) {
|
||||
init_code = _epd_init_code;
|
||||
|
|
@ -220,25 +220,25 @@ void Adafruit_IL0373::displayPartial(uint16_t x1, uint16_t y1, uint16_t x2,
|
|||
|
||||
// check rotation, move window around if necessary
|
||||
switch (getRotation()) {
|
||||
case 0:
|
||||
EPD_swap(x1, y1);
|
||||
EPD_swap(x2, y2);
|
||||
y1 = WIDTH - y1;
|
||||
y2 = WIDTH - y2;
|
||||
break;
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
EPD_swap(x1, y1);
|
||||
EPD_swap(x2, y2);
|
||||
x1 = HEIGHT - x1;
|
||||
x2 = HEIGHT - x2;
|
||||
break;
|
||||
case 3:
|
||||
y1 = WIDTH - y1;
|
||||
y2 = WIDTH - y2;
|
||||
x1 = HEIGHT - x1;
|
||||
x2 = HEIGHT - x2;
|
||||
case 0:
|
||||
EPD_swap(x1, y1);
|
||||
EPD_swap(x2, y2);
|
||||
y1 = WIDTH - y1;
|
||||
y2 = WIDTH - y2;
|
||||
break;
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
EPD_swap(x1, y1);
|
||||
EPD_swap(x2, y2);
|
||||
x1 = HEIGHT - x1;
|
||||
x2 = HEIGHT - x2;
|
||||
break;
|
||||
case 3:
|
||||
y1 = WIDTH - y1;
|
||||
y2 = WIDTH - y2;
|
||||
x1 = HEIGHT - x1;
|
||||
x2 = HEIGHT - x2;
|
||||
}
|
||||
if (x1 > x2)
|
||||
EPD_swap(x1, x2);
|
||||
|
|
@ -263,8 +263,8 @@ void Adafruit_IL0373::displayPartial(uint16_t x1, uint16_t y1, uint16_t x2,
|
|||
// Serial.println("Partial update!");
|
||||
|
||||
// backup & change init to the partial code
|
||||
const uint8_t* init_code_backup = _epd_init_code;
|
||||
const uint8_t* lut_code_backup = _epd_lut_code;
|
||||
const uint8_t *init_code_backup = _epd_init_code;
|
||||
const uint8_t *lut_code_backup = _epd_lut_code;
|
||||
_epd_init_code = _epd_partial_init_code;
|
||||
_epd_lut_code = _epd_partial_lut_code;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
#ifndef LIB_ADAFRUIT_IL0373
|
||||
#define LIB_ADAFRUIT_IL0373
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#define IL0373_PANEL_SETTING 0x00
|
||||
#define IL0373_POWER_SETTING 0x01
|
||||
|
|
@ -39,13 +38,13 @@
|
|||
*/
|
||||
/**************************************************************************/
|
||||
class Adafruit_IL0373 : public Adafruit_EPD {
|
||||
private:
|
||||
public:
|
||||
private:
|
||||
public:
|
||||
Adafruit_IL0373(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1);
|
||||
Adafruit_IL0373(int width, int height, int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass* spi = &SPI);
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
|
|
@ -53,7 +52,7 @@ class Adafruit_IL0373 : public Adafruit_EPD {
|
|||
void update();
|
||||
void displayPartial(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
|
||||
|
||||
protected:
|
||||
protected:
|
||||
uint8_t writeRAMCommand(uint8_t index);
|
||||
void setRAMAddress(uint16_t x, uint16_t y);
|
||||
void busy_wait();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
#include "Adafruit_IL0398.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
|
|
@ -40,6 +39,7 @@ Adafruit_IL0398::Adafruit_IL0398(int width, int height, int16_t SID,
|
|||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY)
|
||||
: Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
|
||||
|
||||
buffer1_size = ((uint32_t)width * (uint32_t)height) / 8;
|
||||
buffer2_size = buffer1_size;
|
||||
|
||||
|
|
@ -49,8 +49,8 @@ Adafruit_IL0398::Adafruit_IL0398(int width, int height, int16_t SID,
|
|||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t *)malloc(buffer2_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -69,8 +69,9 @@ Adafruit_IL0398::Adafruit_IL0398(int width, int height, int16_t SID,
|
|||
/**************************************************************************/
|
||||
Adafruit_IL0398::Adafruit_IL0398(int width, int height, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t BUSY,
|
||||
SPIClass* spi)
|
||||
SPIClass *spi)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
|
||||
buffer1_size = ((uint32_t)width * (uint32_t)height) / 8;
|
||||
buffer2_size = buffer1_size;
|
||||
|
||||
|
|
@ -80,8 +81,8 @@ Adafruit_IL0398::Adafruit_IL0398(int width, int height, int16_t DC, int16_t RST,
|
|||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t *)malloc(buffer2_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -142,7 +143,7 @@ void Adafruit_IL0398::powerUp() {
|
|||
|
||||
hardwareReset();
|
||||
|
||||
const uint8_t* init_code = il0398_default_init_code;
|
||||
const uint8_t *init_code = il0398_default_init_code;
|
||||
if (_epd_init_code != NULL) {
|
||||
init_code = _epd_init_code;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
#ifndef LIB_ADAFRUIT_IL0398
|
||||
#define LIB_ADAFRUIT_IL0398
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#define IL0398_PANEL_SETTING 0x00
|
||||
#define IL0398_POWER_SETTING 0x01
|
||||
|
|
@ -56,19 +55,19 @@
|
|||
*/
|
||||
/**************************************************************************/
|
||||
class Adafruit_IL0398 : public Adafruit_EPD {
|
||||
public:
|
||||
public:
|
||||
Adafruit_IL0398(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1);
|
||||
Adafruit_IL0398(int width, int height, int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass* spi = &SPI);
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
void update();
|
||||
void powerDown();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
uint8_t writeRAMCommand(uint8_t index);
|
||||
void setRAMAddress(uint16_t x, uint16_t y);
|
||||
void busy_wait();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
#include "Adafruit_IL91874.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
|
|
@ -77,6 +76,7 @@ Adafruit_IL91874::Adafruit_IL91874(int width, int height, int16_t SID,
|
|||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY)
|
||||
: Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
|
||||
|
||||
buffer1_size = ((uint32_t)width * (uint32_t)height) / 8;
|
||||
buffer2_size = buffer1_size;
|
||||
|
||||
|
|
@ -86,8 +86,8 @@ Adafruit_IL91874::Adafruit_IL91874(int width, int height, int16_t SID,
|
|||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t *)malloc(buffer2_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -106,8 +106,9 @@ Adafruit_IL91874::Adafruit_IL91874(int width, int height, int16_t SID,
|
|||
/**************************************************************************/
|
||||
Adafruit_IL91874::Adafruit_IL91874(int width, int height, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY, SPIClass* spi)
|
||||
int16_t BUSY, SPIClass *spi)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
|
||||
buffer1_size = ((uint32_t)width * (uint32_t)height) / 8;
|
||||
buffer2_size = buffer1_size;
|
||||
|
||||
|
|
@ -117,8 +118,8 @@ Adafruit_IL91874::Adafruit_IL91874(int width, int height, int16_t DC,
|
|||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t *)malloc(buffer2_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -177,7 +178,7 @@ void Adafruit_IL91874::powerUp() {
|
|||
|
||||
hardwareReset();
|
||||
delay(200);
|
||||
const uint8_t* init_code = il91874_default_init_code;
|
||||
const uint8_t *init_code = il91874_default_init_code;
|
||||
|
||||
if (_epd_init_code != NULL) {
|
||||
init_code = _epd_init_code;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
#ifndef LIB_ADAFRUIT_IL91874
|
||||
#define LIB_ADAFRUIT_IL91874
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#define IL91874_PANEL_SETTING 0x00
|
||||
#define IL91874_POWER_SETTING 0x01
|
||||
|
|
@ -35,19 +34,19 @@
|
|||
*/
|
||||
/**************************************************************************/
|
||||
class Adafruit_IL91874 : public Adafruit_EPD {
|
||||
public:
|
||||
public:
|
||||
Adafruit_IL91874(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1);
|
||||
Adafruit_IL91874(int width, int height, int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass* spi = &SPI);
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
void update();
|
||||
void powerDown();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
uint8_t writeRAMCommand(uint8_t index);
|
||||
void setRAMAddress(uint16_t x, uint16_t y);
|
||||
void busy_wait();
|
||||
|
|
|
|||
|
|
@ -1,316 +0,0 @@
|
|||
#include "Adafruit_JD79661.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
#define EPD_RAM_RED 0x13
|
||||
|
||||
#define BUSY_WAIT 500
|
||||
|
||||
// clang-format off
|
||||
|
||||
const uint8_t jd79661_default_init_code[] {
|
||||
0xFF, 10, // wait a lil bit
|
||||
0x4D, 1, 0x78,
|
||||
JD79661_PANEL_SETTING, 2, 0x8F, 0x29, // PSR, Display resolution is 128x250
|
||||
JD79661_POWER_SETTING, 2, 0x07, 0x00, // PWR
|
||||
0x03, 3, 0x10, 0x54, 0x44, // POFS
|
||||
JD79661_BOOSTER_SOFTSTART, 7, 0x05, 0x00, 0x3F, 0x0A, 0x25, 0x12, 0x1A,
|
||||
JD79661_CDI, 1, 0x37, // CDI
|
||||
0x60, 2, 0x02, 0x02, // TCON
|
||||
JD79661_RESOLUTION, 4, 0, 128, 0, 250, // TRES
|
||||
0xE7, 1, 0x1C,
|
||||
0xE3, 1, 0x22,
|
||||
0xB4, 1, 0xD0,
|
||||
0xB5, 1, 0x03,
|
||||
0xE9, 1, 0x01,
|
||||
JD79661_PLL_CONTROL, 1, 0x08,
|
||||
JD79661_POWER_ON, 0,
|
||||
0xFE};
|
||||
|
||||
// clang-format on
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief constructor if using external SRAM chip and software SPI
|
||||
@param width the width of the display in pixels
|
||||
@param height the height of the display in pixels
|
||||
@param SID the SID pin to use
|
||||
@param SCLK the SCLK pin to use
|
||||
@param DC the data/command pin to use
|
||||
@param RST the reset pin to use
|
||||
@param CS the chip select pin to use
|
||||
@param SRCS the SRAM chip select pin to use
|
||||
@param MISO the MISO pin to use
|
||||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_JD79661::Adafruit_JD79661(int width, int height, int16_t SID,
|
||||
int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY)
|
||||
: Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
|
||||
if ((width % 8) != 0) {
|
||||
width += 8 - (width % 8);
|
||||
}
|
||||
buffer1_size = width * height / 4;
|
||||
buffer2_size = 0;
|
||||
|
||||
if (SRCS >= 0) {
|
||||
use_sram = true;
|
||||
buffer1_addr = 0;
|
||||
buffer2_addr = 0;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = buffer1;
|
||||
}
|
||||
|
||||
singleByteTxns = true;
|
||||
}
|
||||
|
||||
// constructor for hardware SPI - we indicate DataCommand, ChipSelect, Reset
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief constructor if using on-chip RAM and hardware SPI
|
||||
@param width the width of the display in pixels
|
||||
@param height the height of the display in pixels
|
||||
@param DC the data/command pin to use
|
||||
@param RST the reset pin to use
|
||||
@param CS the chip select pin to use
|
||||
@param SRCS the SRAM chip select pin to use
|
||||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_JD79661::Adafruit_JD79661(int width, int height, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY, SPIClass* spi)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
if ((width % 8) != 0) {
|
||||
width += 8 - (width % 8);
|
||||
}
|
||||
buffer1_size = width * height / 4;
|
||||
buffer2_size = 0;
|
||||
|
||||
if (SRCS >= 0) {
|
||||
use_sram = true;
|
||||
buffer1_addr = 0;
|
||||
buffer2_addr = 0;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = buffer1;
|
||||
}
|
||||
|
||||
singleByteTxns = true;
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief clear all data buffers
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_JD79661::clearBuffer() {
|
||||
if (use_sram) {
|
||||
sram.erase(colorbuffer_addr, buffer1_size, 0x55);
|
||||
} else {
|
||||
memset(buffer1, 0x55, buffer1_size);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief draw a single pixel on the screen
|
||||
@param x the x axis position
|
||||
@param y the y axis position
|
||||
@param color the color of the pixel
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_JD79661::drawPixel(int16_t x, int16_t y, uint16_t color) {
|
||||
if ((x < 0) || (x >= width()) || (y < 0) || (y >= height()))
|
||||
return;
|
||||
|
||||
uint8_t* pBuf;
|
||||
|
||||
// deal with non-4-bit heights
|
||||
uint16_t _WIDTH = WIDTH;
|
||||
if (_WIDTH % 4 != 0) {
|
||||
_WIDTH += 4 - (_WIDTH % 4);
|
||||
}
|
||||
|
||||
// check rotation, move pixel around if necessary
|
||||
switch (getRotation()) {
|
||||
case 1:
|
||||
EPD_swap(x, y);
|
||||
x = _WIDTH - x - 1;
|
||||
// remove the offset
|
||||
x -= _WIDTH - WIDTH;
|
||||
break;
|
||||
case 2:
|
||||
x = _WIDTH - x - 1;
|
||||
y = HEIGHT - y - 1;
|
||||
// re-add the offset
|
||||
x += _WIDTH - WIDTH;
|
||||
break;
|
||||
case 3:
|
||||
EPD_swap(x, y);
|
||||
y = HEIGHT - y - 1;
|
||||
break;
|
||||
}
|
||||
uint32_t addr = ((uint32_t)x + (uint32_t)y * _WIDTH) / 4;
|
||||
uint8_t color_c;
|
||||
|
||||
if (use_sram) {
|
||||
color_c = sram.read8(colorbuffer_addr + addr);
|
||||
pBuf = &color_c;
|
||||
} else {
|
||||
pBuf = color_buffer + addr;
|
||||
}
|
||||
|
||||
if (color == EPD_BLACK) {
|
||||
color = JD79661_BLACK;
|
||||
} else if (color == EPD_RED) {
|
||||
color = JD79661_RED;
|
||||
} else if (color == EPD_YELLOW) {
|
||||
color = JD79661_YELLOW;
|
||||
} else if (color == EPD_WHITE) {
|
||||
color = JD79661_WHITE;
|
||||
}
|
||||
|
||||
uint8_t byte_offset_mask = 0x3 << (3 - (x % 4)) * 2;
|
||||
uint8_t byte_offset_value = (color & 0x3) << (3 - (x % 4)) * 2;
|
||||
|
||||
*pBuf &= ~byte_offset_mask; // save reverse mask
|
||||
*pBuf |= byte_offset_value; // now add in the new color
|
||||
|
||||
if (use_sram) {
|
||||
sram.write8(colorbuffer_addr + addr, *pBuf);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief wait for busy signal to end
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_JD79661::busy_wait(void) {
|
||||
if (_busy_pin >= 0) {
|
||||
while (!digitalRead(_busy_pin)) { // wait for busy HIGH!
|
||||
delay(10);
|
||||
}
|
||||
} else {
|
||||
delay(BUSY_WAIT);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief begin communication with and set up the display.
|
||||
@param reset if true the reset pin will be toggled.
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_JD79661::begin(bool reset) {
|
||||
Adafruit_EPD::begin(reset);
|
||||
delay(100);
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief signal the display to update
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_JD79661::update() {
|
||||
uint8_t buf[1];
|
||||
|
||||
// display update sequence
|
||||
buf[0] = 0x00;
|
||||
EPD_command(JD79661_DISPLAY_REFRESH, buf, 1);
|
||||
|
||||
busy_wait();
|
||||
|
||||
if (_busy_pin <= -1) {
|
||||
delay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
void Adafruit_JD79661::hardwareReset(void) {
|
||||
if (_reset_pin >= 0) {
|
||||
// Setup reset pin direction
|
||||
pinMode(_reset_pin, OUTPUT);
|
||||
// VDD (3.3V) goes high at start, lets just chill for a ms
|
||||
digitalWrite(_reset_pin, HIGH);
|
||||
delay(20);
|
||||
// bring reset low
|
||||
digitalWrite(_reset_pin, LOW);
|
||||
// wait 40ms
|
||||
delay(40);
|
||||
// bring out of reset
|
||||
digitalWrite(_reset_pin, HIGH);
|
||||
delay(50);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief start up the display
|
||||
*/
|
||||
/**************************************************************************/
|
||||
|
||||
void Adafruit_JD79661::powerUp() {
|
||||
hardwareReset();
|
||||
busy_wait();
|
||||
|
||||
const uint8_t* init_code = jd79661_default_init_code;
|
||||
if (_epd_init_code != NULL) {
|
||||
init_code = _epd_init_code;
|
||||
}
|
||||
EPD_commandList(init_code);
|
||||
|
||||
busy_wait();
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief wind down the display
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_JD79661::powerDown() {
|
||||
uint8_t buf[1];
|
||||
// Only deep sleep if we can get out of it
|
||||
if (_reset_pin >= 0) {
|
||||
// deep sleep
|
||||
buf[0] = 0x00;
|
||||
EPD_command(JD79661_POWER_OFF, buf, 1);
|
||||
busy_wait();
|
||||
|
||||
buf[0] = 0xA5;
|
||||
EPD_command(JD79661_DEEP_SLEEP, buf, 1);
|
||||
delay(100);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Send the specific command to start writing to EPD display RAM
|
||||
@param index The index for which buffer to write (0 or 1 or tri-color
|
||||
displays) Ignored for monochrome displays.
|
||||
@returns The byte that is read from SPI at the same time as sending the
|
||||
command
|
||||
*/
|
||||
/**************************************************************************/
|
||||
uint8_t Adafruit_JD79661::writeRAMCommand(uint8_t index) {
|
||||
(void)index;
|
||||
EPD_command(JD79661_DATA_START_XMIT);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Some displays require setting the RAM address pointer
|
||||
@param x X address counter value
|
||||
@param y Y address counter value
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_JD79661::setRAMAddress(uint16_t x, uint16_t y) {
|
||||
(void)x;
|
||||
(void)y;
|
||||
}
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
#ifndef LIB_ADAFRUIT_JD79661
|
||||
#define LIB_ADAFRUIT_JD79661
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define JD79661_PANEL_SETTING 0x00
|
||||
#define JD79661_POWER_SETTING 0x01
|
||||
#define JD79661_POWER_OFF 0x02
|
||||
#define JD79661_POWER_ON 0x04
|
||||
#define JD79661_BOOSTER_SOFTSTART 0x06
|
||||
#define JD79661_DATA_START_XMIT 0x10
|
||||
#define JD79661_DISPLAY_REFRESH 0x12
|
||||
#define JD79661_DEEP_SLEEP 0x07
|
||||
#define JD79661_PLL_CONTROL 0x30
|
||||
#define JD79661_CDI 0x50
|
||||
#define JD79661_RESOLUTION 0x61
|
||||
|
||||
#define JD79661_BLACK 0b00
|
||||
#define JD79661_WHITE 0b01
|
||||
#define JD79661_YELLOW 0b10
|
||||
#define JD79661_RED 0b11
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Class for interfacing with JD79661 EPD drivers
|
||||
*/
|
||||
/**************************************************************************/
|
||||
class Adafruit_JD79661 : public Adafruit_EPD {
|
||||
public:
|
||||
Adafruit_JD79661(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1);
|
||||
Adafruit_JD79661(int width, int height, int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass* spi = &SPI);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
void update(void);
|
||||
void powerDown();
|
||||
|
||||
void clearBuffer();
|
||||
void drawPixel(int16_t x, int16_t y, uint16_t color);
|
||||
void hardwareReset(void);
|
||||
|
||||
protected:
|
||||
void busy_wait();
|
||||
void setRAMAddress(uint16_t x, uint16_t y);
|
||||
uint8_t writeRAMCommand(uint8_t index);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,314 +0,0 @@
|
|||
#include "Adafruit_JD79667.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
#define EPD_RAM_RED 0x13
|
||||
|
||||
#define BUSY_WAIT 500
|
||||
|
||||
// clang-format off
|
||||
|
||||
const uint8_t jd79667_default_init_code[] {
|
||||
0xFF, 10, // wait a lil bit
|
||||
0x4D, 1, 0x78,
|
||||
JD79667_PANEL_SETTING, 2, 0x0F, 0x29, // PSR, Display resolution is 180x384
|
||||
JD79667_POWER_SETTING, 2, 0x07, 0x00, // PWR
|
||||
0x03, 3, 0x10, 0x54, 0x44, // POFS
|
||||
JD79667_BOOSTER_SOFTSTART, 7, 0x05, 0x00, 0x3F, 0x0A, 0x25, 0x12, 0x1A,
|
||||
JD79667_CDI, 1, 0x37, // CDI
|
||||
0x60, 2, 0x02, 0x02, // TCON
|
||||
JD79667_RESOLUTION, 4, 0, 180, 1, 128, // TRES 180x384
|
||||
0xE7, 1, 0x1C,
|
||||
0xE3, 1, 0x22,
|
||||
0xB4, 1, 0xD0,
|
||||
0xB5, 1, 0x03,
|
||||
0xE9, 1, 0x01,
|
||||
JD79667_PLL_CONTROL, 1, 0x08,
|
||||
JD79667_POWER_ON, 0,
|
||||
0xFE};
|
||||
|
||||
// clang-format on
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief constructor if using external SRAM chip and software SPI
|
||||
@param width the width of the display in pixels
|
||||
@param height the height of the display in pixels
|
||||
@param SID the SID pin to use
|
||||
@param SCLK the SCLK pin to use
|
||||
@param DC the data/command pin to use
|
||||
@param RST the reset pin to use
|
||||
@param CS the chip select pin to use
|
||||
@param SRCS the SRAM chip select pin to use
|
||||
@param MISO the MISO pin to use
|
||||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_JD79667::Adafruit_JD79667(int width, int height, int16_t SID,
|
||||
int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY)
|
||||
: Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
|
||||
if ((width % 8) != 0) {
|
||||
width += 8 - (width % 8);
|
||||
}
|
||||
buffer1_size = width * height / 4;
|
||||
buffer2_size = 0;
|
||||
|
||||
if (SRCS >= 0) {
|
||||
use_sram = true;
|
||||
buffer1_addr = 0;
|
||||
buffer2_addr = 0;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = buffer1;
|
||||
}
|
||||
singleByteTxns = true;
|
||||
}
|
||||
|
||||
// constructor for hardware SPI - we indicate DataCommand, ChipSelect, Reset
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief constructor if using on-chip RAM and hardware SPI
|
||||
@param width the width of the display in pixels
|
||||
@param height the height of the display in pixels
|
||||
@param DC the data/command pin to use
|
||||
@param RST the reset pin to use
|
||||
@param CS the chip select pin to use
|
||||
@param SRCS the SRAM chip select pin to use
|
||||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_JD79667::Adafruit_JD79667(int width, int height, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY, SPIClass* spi)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
if ((width % 8) != 0) {
|
||||
width += 8 - (width % 8);
|
||||
}
|
||||
buffer1_size = width * height / 4;
|
||||
buffer2_size = 0;
|
||||
|
||||
if (SRCS >= 0) {
|
||||
use_sram = true;
|
||||
buffer1_addr = 0;
|
||||
buffer2_addr = 0;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = buffer1;
|
||||
}
|
||||
|
||||
singleByteTxns = true;
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief clear all data buffers
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_JD79667::clearBuffer() {
|
||||
if (use_sram) {
|
||||
sram.erase(colorbuffer_addr, buffer1_size, 0x55);
|
||||
} else {
|
||||
memset(buffer1, 0x55, buffer1_size);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief draw a single pixel on the screen
|
||||
@param x the x axis position
|
||||
@param y the y axis position
|
||||
@param color the color of the pixel
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_JD79667::drawPixel(int16_t x, int16_t y, uint16_t color) {
|
||||
if ((x < 0) || (x >= width()) || (y < 0) || (y >= height()))
|
||||
return;
|
||||
|
||||
uint8_t* pBuf;
|
||||
|
||||
// deal with non-4-bit heights
|
||||
uint16_t _WIDTH = WIDTH;
|
||||
if (_WIDTH % 4 != 0) {
|
||||
_WIDTH += 4 - (_WIDTH % 4);
|
||||
}
|
||||
|
||||
// check rotation, move pixel around if necessary
|
||||
switch (getRotation()) {
|
||||
case 1:
|
||||
EPD_swap(x, y);
|
||||
x = _WIDTH - x - 1;
|
||||
// remove the offset
|
||||
x -= _WIDTH - WIDTH;
|
||||
break;
|
||||
case 2:
|
||||
x = _WIDTH - x - 1;
|
||||
y = HEIGHT - y - 1;
|
||||
// re-add the offset
|
||||
x += _WIDTH - WIDTH;
|
||||
break;
|
||||
case 3:
|
||||
EPD_swap(x, y);
|
||||
y = HEIGHT - y - 1;
|
||||
break;
|
||||
}
|
||||
uint32_t addr = ((uint32_t)x + (uint32_t)y * _WIDTH) / 4;
|
||||
uint8_t color_c;
|
||||
|
||||
if (use_sram) {
|
||||
color_c = sram.read8(colorbuffer_addr + addr);
|
||||
pBuf = &color_c;
|
||||
} else {
|
||||
pBuf = color_buffer + addr;
|
||||
}
|
||||
|
||||
if (color == EPD_BLACK) {
|
||||
color = JD79667_BLACK;
|
||||
} else if (color == EPD_RED) {
|
||||
color = JD79667_RED;
|
||||
} else if (color == EPD_YELLOW) {
|
||||
color = JD79667_YELLOW;
|
||||
} else if (color == EPD_WHITE) {
|
||||
color = JD79667_WHITE;
|
||||
}
|
||||
|
||||
uint8_t byte_offset_mask = 0x3 << (3 - (x % 4)) * 2;
|
||||
uint8_t byte_offset_value = (color & 0x3) << (3 - (x % 4)) * 2;
|
||||
|
||||
*pBuf &= ~byte_offset_mask; // save reverse mask
|
||||
*pBuf |= byte_offset_value; // now add in the new color
|
||||
|
||||
if (use_sram) {
|
||||
sram.write8(colorbuffer_addr + addr, *pBuf);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief wait for busy signal to end
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_JD79667::busy_wait(void) {
|
||||
if (_busy_pin >= 0) {
|
||||
while (!digitalRead(_busy_pin)) { // wait for busy HIGH!
|
||||
delay(10);
|
||||
}
|
||||
} else {
|
||||
delay(BUSY_WAIT);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief begin communication with and set up the display.
|
||||
@param reset if true the reset pin will be toggled.
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_JD79667::begin(bool reset) {
|
||||
Adafruit_EPD::begin(reset);
|
||||
delay(100);
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief signal the display to update
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_JD79667::update() {
|
||||
uint8_t buf[1];
|
||||
|
||||
// display update sequence
|
||||
buf[0] = 0x00;
|
||||
EPD_command(JD79667_DISPLAY_REFRESH, buf, 1);
|
||||
|
||||
busy_wait();
|
||||
|
||||
if (_busy_pin <= -1) {
|
||||
delay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
void Adafruit_JD79667::hardwareReset(void) {
|
||||
if (_reset_pin >= 0) {
|
||||
// Setup reset pin direction
|
||||
pinMode(_reset_pin, OUTPUT);
|
||||
// VDD (3.3V) goes high at start, lets just chill for a ms
|
||||
digitalWrite(_reset_pin, HIGH);
|
||||
delay(20);
|
||||
// bring reset low
|
||||
digitalWrite(_reset_pin, LOW);
|
||||
// wait 40ms
|
||||
delay(40);
|
||||
// bring out of reset
|
||||
digitalWrite(_reset_pin, HIGH);
|
||||
delay(50);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief start up the display
|
||||
*/
|
||||
/**************************************************************************/
|
||||
|
||||
void Adafruit_JD79667::powerUp() {
|
||||
hardwareReset();
|
||||
busy_wait();
|
||||
|
||||
const uint8_t* init_code = jd79667_default_init_code;
|
||||
if (_epd_init_code != NULL) {
|
||||
init_code = _epd_init_code;
|
||||
}
|
||||
EPD_commandList(init_code);
|
||||
|
||||
busy_wait();
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief wind down the display
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_JD79667::powerDown() {
|
||||
uint8_t buf[1];
|
||||
// Only deep sleep if we can get out of it
|
||||
if (_reset_pin >= 0) {
|
||||
// deep sleep
|
||||
buf[0] = 0x00;
|
||||
EPD_command(JD79667_POWER_OFF, buf, 1);
|
||||
busy_wait();
|
||||
delay(100);
|
||||
buf[0] = 0xA5;
|
||||
EPD_command(JD79667_DEEP_SLEEP, buf, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Send the specific command to start writing to EPD display RAM
|
||||
@param index The index for which buffer to write (0 or 1 or tri-color
|
||||
displays) Ignored for monochrome displays.
|
||||
@returns The byte that is read from SPI at the same time as sending the
|
||||
command
|
||||
*/
|
||||
/**************************************************************************/
|
||||
uint8_t Adafruit_JD79667::writeRAMCommand(uint8_t index) {
|
||||
(void)index;
|
||||
EPD_command(JD79667_DATA_START_XMIT);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Some displays require setting the RAM address pointer
|
||||
@param x X address counter value
|
||||
@param y Y address counter value
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_JD79667::setRAMAddress(uint16_t x, uint16_t y) {
|
||||
(void)x;
|
||||
(void)y;
|
||||
}
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
#ifndef LIB_ADAFRUIT_JD79667
|
||||
#define LIB_ADAFRUIT_JD79667
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define JD79667_PANEL_SETTING 0x00
|
||||
#define JD79667_POWER_SETTING 0x01
|
||||
#define JD79667_POWER_OFF 0x02
|
||||
#define JD79667_POWER_ON 0x04
|
||||
#define JD79667_BOOSTER_SOFTSTART 0x06
|
||||
#define JD79667_DATA_START_XMIT 0x10
|
||||
#define JD79667_DISPLAY_REFRESH 0x12
|
||||
#define JD79667_DEEP_SLEEP 0x07
|
||||
#define JD79667_PLL_CONTROL 0x30
|
||||
#define JD79667_CDI 0x50
|
||||
#define JD79667_RESOLUTION 0x61
|
||||
|
||||
#define JD79667_BLACK 0b00
|
||||
#define JD79667_WHITE 0b01
|
||||
#define JD79667_YELLOW 0b10
|
||||
#define JD79667_RED 0b11
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Class for interfacing with JD79667 EPD drivers
|
||||
*/
|
||||
/**************************************************************************/
|
||||
class Adafruit_JD79667 : public Adafruit_EPD {
|
||||
public:
|
||||
Adafruit_JD79667(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1);
|
||||
Adafruit_JD79667(int width, int height, int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass* spi = &SPI);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
void update(void);
|
||||
void powerDown();
|
||||
|
||||
void clearBuffer();
|
||||
void drawPixel(int16_t x, int16_t y, uint16_t color);
|
||||
void hardwareReset(void);
|
||||
|
||||
protected:
|
||||
void busy_wait();
|
||||
void setRAMAddress(uint16_t x, uint16_t y);
|
||||
uint8_t writeRAMCommand(uint8_t index);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
#include "Adafruit_SSD1608.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
|
|
@ -31,6 +30,7 @@ Adafruit_SSD1608::Adafruit_SSD1608(int width, int height, int16_t SID,
|
|||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY)
|
||||
: Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
|
||||
|
||||
if ((width % 8) != 0) {
|
||||
width += 8 - (width % 8);
|
||||
}
|
||||
|
|
@ -42,7 +42,7 @@ Adafruit_SSD1608::Adafruit_SSD1608(int width, int height, int16_t SID,
|
|||
buffer1_addr = 0;
|
||||
buffer2_addr = 0;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = NULL;
|
||||
}
|
||||
}
|
||||
|
|
@ -63,8 +63,9 @@ Adafruit_SSD1608::Adafruit_SSD1608(int width, int height, int16_t SID,
|
|||
/**************************************************************************/
|
||||
Adafruit_SSD1608::Adafruit_SSD1608(int width, int height, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY, SPIClass* spi)
|
||||
int16_t BUSY, SPIClass *spi)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
}
|
||||
|
|
@ -76,7 +77,7 @@ Adafruit_SSD1608::Adafruit_SSD1608(int width, int height, int16_t DC,
|
|||
buffer1_addr = 0;
|
||||
buffer2_addr = 0;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = buffer1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
#ifndef LIB_ADAFRUIT_SSD1608
|
||||
#define LIB_ADAFRUIT_SSD1608
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#define SSD1608_DRIVER_CONTROL 0x01
|
||||
#define SSD1608_GATE_VOLTAGE 0x03
|
||||
|
|
@ -44,19 +43,19 @@
|
|||
*/
|
||||
/**************************************************************************/
|
||||
class Adafruit_SSD1608 : public Adafruit_EPD {
|
||||
public:
|
||||
public:
|
||||
Adafruit_SSD1608(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1);
|
||||
Adafruit_SSD1608(int width, int height, int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass* spi = &SPI);
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
void powerDown();
|
||||
void update();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
uint8_t writeRAMCommand(uint8_t index);
|
||||
void setRAMAddress(uint16_t x, uint16_t y);
|
||||
void busy_wait();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
#include "Adafruit_SSD1619.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
|
|
@ -62,8 +61,8 @@ Adafruit_SSD1619::Adafruit_SSD1619(int width, int height, int16_t SID,
|
|||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t *)malloc(buffer2_size);
|
||||
}
|
||||
|
||||
singleByteTxns = true;
|
||||
|
|
@ -85,7 +84,7 @@ Adafruit_SSD1619::Adafruit_SSD1619(int width, int height, int16_t SID,
|
|||
/**************************************************************************/
|
||||
Adafruit_SSD1619::Adafruit_SSD1619(int width, int height, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY, SPIClass* spi)
|
||||
int16_t BUSY, SPIClass *spi)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
|
|
@ -100,8 +99,8 @@ Adafruit_SSD1619::Adafruit_SSD1619(int width, int height, int16_t DC,
|
|||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t *)malloc(buffer2_size);
|
||||
}
|
||||
|
||||
singleByteTxns = true;
|
||||
|
|
@ -169,7 +168,7 @@ void Adafruit_SSD1619::powerUp() {
|
|||
delay(100);
|
||||
busy_wait();
|
||||
|
||||
const uint8_t* init_code = ssd1619_default_init_code;
|
||||
const uint8_t *init_code = ssd1619_default_init_code;
|
||||
|
||||
if (_epd_init_code != NULL) {
|
||||
init_code = _epd_init_code;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
#ifndef LIB_ADAFRUIT_SSD1619
|
||||
#define LIB_ADAFRUIT_SSD1619
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#define SSD1619_DRIVER_CONTROL 0x01
|
||||
#define SSD1619_GATE_VOLTAGE 0x03
|
||||
|
|
@ -40,19 +39,19 @@
|
|||
*/
|
||||
/**************************************************************************/
|
||||
class Adafruit_SSD1619 : public Adafruit_EPD {
|
||||
public:
|
||||
public:
|
||||
Adafruit_SSD1619(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1);
|
||||
Adafruit_SSD1619(int width, int height, int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass* spi = &SPI);
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
void update(void);
|
||||
void powerDown();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
uint8_t writeRAMCommand(uint8_t index);
|
||||
void setRAMAddress(uint16_t x, uint16_t y);
|
||||
void setRAMWindow(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
#include "Adafruit_SSD1675.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
|
|
@ -58,8 +57,8 @@ Adafruit_SSD1675::Adafruit_SSD1675(int width, int height, int16_t SID,
|
|||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t *)malloc(buffer2_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -79,7 +78,7 @@ Adafruit_SSD1675::Adafruit_SSD1675(int width, int height, int16_t SID,
|
|||
/**************************************************************************/
|
||||
Adafruit_SSD1675::Adafruit_SSD1675(int width, int height, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY, SPIClass* spi)
|
||||
int16_t BUSY, SPIClass *spi)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
|
|
@ -94,8 +93,8 @@ Adafruit_SSD1675::Adafruit_SSD1675(int width, int height, int16_t DC,
|
|||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t *)malloc(buffer2_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
#ifndef LIB_ADAFRUIT_SSD1675
|
||||
#define LIB_ADAFRUIT_SSD1675
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#define SSD1675_DRIVER_CONTROL 0x01
|
||||
#define SSD1675_GATE_VOLTAGE 0x03
|
||||
|
|
@ -39,19 +38,19 @@
|
|||
*/
|
||||
/**************************************************************************/
|
||||
class Adafruit_SSD1675 : public Adafruit_EPD {
|
||||
public:
|
||||
public:
|
||||
Adafruit_SSD1675(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1);
|
||||
Adafruit_SSD1675(int width, int height, int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass* spi = &SPI);
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
void update();
|
||||
void powerDown();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
uint8_t writeRAMCommand(uint8_t index);
|
||||
void setRAMAddress(uint16_t x, uint16_t y);
|
||||
void busy_wait();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
#include "Adafruit_SSD1675B.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
|
|
@ -58,8 +57,8 @@ Adafruit_SSD1675B::Adafruit_SSD1675B(int width, int height, int16_t SID,
|
|||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t *)malloc(buffer2_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -79,7 +78,7 @@ Adafruit_SSD1675B::Adafruit_SSD1675B(int width, int height, int16_t SID,
|
|||
/**************************************************************************/
|
||||
Adafruit_SSD1675B::Adafruit_SSD1675B(int width, int height, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY, SPIClass* spi)
|
||||
int16_t BUSY, SPIClass *spi)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
|
|
@ -94,8 +93,8 @@ Adafruit_SSD1675B::Adafruit_SSD1675B(int width, int height, int16_t DC,
|
|||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t *)malloc(buffer2_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
#ifndef LIB_ADAFRUIT_SSD1675B
|
||||
#define LIB_ADAFRUIT_SSD1675B
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#define SSD1675B_DRIVER_CONTROL 0x01
|
||||
#define SSD1675B_GATE_VOLTAGE 0x03
|
||||
|
|
@ -39,19 +38,19 @@
|
|||
*/
|
||||
/**************************************************************************/
|
||||
class Adafruit_SSD1675B : public Adafruit_EPD {
|
||||
public:
|
||||
public:
|
||||
Adafruit_SSD1675B(int width, int height, int16_t SID, int16_t SCLK,
|
||||
int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t MISO, int16_t BUSY = -1);
|
||||
Adafruit_SSD1675B(int width, int height, int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass* spi = &SPI);
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
void update();
|
||||
void powerDown();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
uint8_t writeRAMCommand(uint8_t index);
|
||||
void setRAMAddress(uint16_t x, uint16_t y);
|
||||
void busy_wait();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
#include "Adafruit_SSD1680.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
|
|
@ -49,7 +48,7 @@ Adafruit_SSD1680::Adafruit_SSD1680(int width, int height, int16_t SID,
|
|||
height += 8 - (height % 8);
|
||||
}
|
||||
|
||||
buffer1_size = ((uint32_t)width * (uint32_t)height) / 8;
|
||||
buffer1_size = width * height / 8;
|
||||
buffer2_size = buffer1_size;
|
||||
|
||||
if (SRCS >= 0) {
|
||||
|
|
@ -58,8 +57,8 @@ Adafruit_SSD1680::Adafruit_SSD1680(int width, int height, int16_t SID,
|
|||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t *)malloc(buffer2_size);
|
||||
}
|
||||
|
||||
singleByteTxns = true;
|
||||
|
|
@ -81,13 +80,13 @@ Adafruit_SSD1680::Adafruit_SSD1680(int width, int height, int16_t SID,
|
|||
/**************************************************************************/
|
||||
Adafruit_SSD1680::Adafruit_SSD1680(int width, int height, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY, SPIClass* spi)
|
||||
int16_t BUSY, SPIClass *spi)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
}
|
||||
|
||||
buffer1_size = ((uint32_t)width * (uint32_t)height) / 8;
|
||||
buffer1_size = width * height / 8;
|
||||
buffer2_size = buffer1_size;
|
||||
|
||||
if (SRCS >= 0) {
|
||||
|
|
@ -96,8 +95,8 @@ Adafruit_SSD1680::Adafruit_SSD1680(int width, int height, int16_t DC,
|
|||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t *)malloc(buffer2_size);
|
||||
}
|
||||
|
||||
singleByteTxns = true;
|
||||
|
|
@ -139,8 +138,10 @@ void Adafruit_SSD1680::begin(bool reset) {
|
|||
void Adafruit_SSD1680::update() {
|
||||
uint8_t buf[1];
|
||||
|
||||
buf[0] = _display_update_val; // varies for mono vs gray4 mode
|
||||
// display update sequence
|
||||
buf[0] = 0xF4;
|
||||
EPD_command(SSD1680_DISP_CTRL2, buf, 1);
|
||||
|
||||
EPD_command(SSD1680_MASTER_ACTIVATE);
|
||||
busy_wait();
|
||||
|
||||
|
|
@ -161,7 +162,7 @@ void Adafruit_SSD1680::powerUp() {
|
|||
delay(100);
|
||||
busy_wait();
|
||||
|
||||
const uint8_t* init_code = ssd1680_default_init_code;
|
||||
const uint8_t *init_code = ssd1680_default_init_code;
|
||||
|
||||
if (_epd_init_code != NULL) {
|
||||
init_code = _epd_init_code;
|
||||
|
|
@ -185,10 +186,12 @@ void Adafruit_SSD1680::powerUp() {
|
|||
buf[3] = (WIDTH - 1) >> 8;
|
||||
EPD_command(SSD1680_SET_RAMYPOS, buf, 4);
|
||||
|
||||
// Set LUT (if we have one)
|
||||
if (_epd_lut_code) {
|
||||
EPD_commandList(_epd_lut_code);
|
||||
}
|
||||
// Set LUT
|
||||
/*
|
||||
buf[0] = LUT_DATA[74];
|
||||
EPD_command(SSD1680_WRITE_LUT, buf, 1);
|
||||
EPD_command(SSD1680_WRITE_LUT, LUT_DATA, 70);
|
||||
*/
|
||||
|
||||
// Set display size and driver output control
|
||||
buf[0] = (WIDTH - 1);
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
#ifndef LIB_ADAFRUIT_SSD1680
|
||||
#define LIB_ADAFRUIT_SSD1680
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#define SSD1680_DRIVER_CONTROL 0x01
|
||||
#define SSD1680_GATE_VOLTAGE 0x03
|
||||
|
|
@ -27,7 +26,6 @@
|
|||
#define SSD1680_READ_STATUS 0x2F
|
||||
#define SSD1680_WRITE_LUT 0x32
|
||||
#define SSD1680_WRITE_BORDER 0x3C
|
||||
#define SSD1680_END_OPTION 0x3F
|
||||
#define SSD1680_SET_RAMXPOS 0x44
|
||||
#define SSD1680_SET_RAMYPOS 0x45
|
||||
#define SSD1680_SET_RAMXCOUNT 0x4E
|
||||
|
|
@ -39,25 +37,24 @@
|
|||
*/
|
||||
/**************************************************************************/
|
||||
class Adafruit_SSD1680 : public Adafruit_EPD {
|
||||
public:
|
||||
public:
|
||||
Adafruit_SSD1680(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1);
|
||||
Adafruit_SSD1680(int width, int height, int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass* spi = &SPI);
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
void update();
|
||||
void powerDown();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
uint8_t writeRAMCommand(uint8_t index);
|
||||
void setRAMAddress(uint16_t x, uint16_t y);
|
||||
void busy_wait();
|
||||
|
||||
int8_t _xram_offset = 1;
|
||||
uint8_t _display_update_val = 0xF4;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
#include "Adafruit_SSD1681.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
|
|
@ -54,8 +53,8 @@ Adafruit_SSD1681::Adafruit_SSD1681(int width, int height, int16_t SID,
|
|||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t *)malloc(buffer2_size);
|
||||
}
|
||||
|
||||
singleByteTxns = true;
|
||||
|
|
@ -77,7 +76,7 @@ Adafruit_SSD1681::Adafruit_SSD1681(int width, int height, int16_t SID,
|
|||
/**************************************************************************/
|
||||
Adafruit_SSD1681::Adafruit_SSD1681(int width, int height, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY, SPIClass* spi)
|
||||
int16_t BUSY, SPIClass *spi)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
|
|
@ -92,8 +91,8 @@ Adafruit_SSD1681::Adafruit_SSD1681(int width, int height, int16_t DC,
|
|||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t *)malloc(buffer2_size);
|
||||
}
|
||||
|
||||
singleByteTxns = true;
|
||||
|
|
@ -136,7 +135,7 @@ void Adafruit_SSD1681::update() {
|
|||
uint8_t buf[1];
|
||||
|
||||
// display update sequence
|
||||
buf[0] = _display_update_val; // varies for mono vs gray4 mode
|
||||
buf[0] = 0xF7;
|
||||
EPD_command(SSD1681_DISP_CTRL2, buf, 1);
|
||||
|
||||
EPD_command(SSD1681_MASTER_ACTIVATE);
|
||||
|
|
@ -171,25 +170,25 @@ void Adafruit_SSD1681::displayPartial(uint16_t x1, uint16_t y1, uint16_t x2,
|
|||
uint16_t y2) {
|
||||
// check rotation, move window around if necessary
|
||||
switch (getRotation()) {
|
||||
case 0:
|
||||
EPD_swap(x1, y1);
|
||||
EPD_swap(x2, y2);
|
||||
y1 = WIDTH - y1;
|
||||
y2 = WIDTH - y2;
|
||||
break;
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
EPD_swap(x1, y1);
|
||||
EPD_swap(x2, y2);
|
||||
x1 = HEIGHT - x1;
|
||||
x2 = HEIGHT - x2;
|
||||
break;
|
||||
case 3:
|
||||
y1 = WIDTH - y1;
|
||||
y2 = WIDTH - y2;
|
||||
x1 = HEIGHT - x1;
|
||||
x2 = HEIGHT - x2;
|
||||
case 0:
|
||||
EPD_swap(x1, y1);
|
||||
EPD_swap(x2, y2);
|
||||
y1 = WIDTH - y1;
|
||||
y2 = WIDTH - y2;
|
||||
break;
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
EPD_swap(x1, y1);
|
||||
EPD_swap(x2, y2);
|
||||
x1 = HEIGHT - x1;
|
||||
x2 = HEIGHT - x2;
|
||||
break;
|
||||
case 3:
|
||||
y1 = WIDTH - y1;
|
||||
y2 = WIDTH - y2;
|
||||
x1 = HEIGHT - x1;
|
||||
x2 = HEIGHT - x2;
|
||||
}
|
||||
if (x1 > x2)
|
||||
EPD_swap(x1, x2);
|
||||
|
|
@ -260,25 +259,20 @@ void Adafruit_SSD1681::powerUp() {
|
|||
delay(100);
|
||||
busy_wait();
|
||||
|
||||
const uint8_t* init_code = ssd1681_default_init_code;
|
||||
const uint8_t *init_code = ssd1681_default_init_code;
|
||||
|
||||
if (_epd_init_code != NULL) {
|
||||
init_code = _epd_init_code;
|
||||
}
|
||||
EPD_commandList(init_code);
|
||||
|
||||
setRAMWindow(0, 0, (HEIGHT / 8) - 1, WIDTH - 1);
|
||||
|
||||
// Set LUT (if we have one)
|
||||
if (_epd_lut_code) {
|
||||
EPD_commandList(_epd_lut_code);
|
||||
}
|
||||
|
||||
// Set display size and driver output control
|
||||
buf[0] = (WIDTH - 1);
|
||||
buf[1] = (WIDTH - 1) >> 8;
|
||||
buf[2] = 0x00;
|
||||
EPD_command(SSD1681_DRIVER_CONTROL, buf, 3);
|
||||
|
||||
setRAMWindow(0, 0, (HEIGHT / 8) - 1, WIDTH - 1);
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
#ifndef LIB_ADAFRUIT_SSD1681
|
||||
#define LIB_ADAFRUIT_SSD1681
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#define SSD1681_DRIVER_CONTROL 0x01
|
||||
#define SSD1681_GATE_VOLTAGE 0x03
|
||||
|
|
@ -38,12 +37,12 @@
|
|||
*/
|
||||
/**************************************************************************/
|
||||
class Adafruit_SSD1681 : public Adafruit_EPD {
|
||||
public:
|
||||
public:
|
||||
Adafruit_SSD1681(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1);
|
||||
Adafruit_SSD1681(int width, int height, int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass* spi = &SPI);
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
|
|
@ -52,12 +51,11 @@ class Adafruit_SSD1681 : public Adafruit_EPD {
|
|||
void powerDown();
|
||||
void displayPartial(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
|
||||
|
||||
protected:
|
||||
protected:
|
||||
uint8_t writeRAMCommand(uint8_t index);
|
||||
void setRAMAddress(uint16_t x, uint16_t y);
|
||||
void setRAMWindow(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
|
||||
void busy_wait();
|
||||
uint8_t _display_update_val = 0xF7;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,272 +0,0 @@
|
|||
#include "Adafruit_SSD1683.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
#define EPD_RAM_RED 0x13
|
||||
|
||||
#define BUSY_WAIT 500
|
||||
|
||||
// clang-format off
|
||||
|
||||
const uint8_t ssd1683_default_init_code[] = {
|
||||
SSD1683_SW_RESET, 0, // 0x12 - Software reset
|
||||
0xFF, 50, // Wait for busy (20ms delay)
|
||||
|
||||
SSD1683_DISP_CTRL1, 2, // 0x21 - Display update control
|
||||
0x40, // Display update control 1
|
||||
0x00, // Display update control 2
|
||||
|
||||
SSD1683_WRITE_BORDER, 1, // 0x3C - Border waveform control
|
||||
0x05, // Border color/waveform
|
||||
|
||||
SSD1683_DATA_MODE, 1, // 0x11 - Data entry mode
|
||||
0x03, // Y decrement, X increment
|
||||
|
||||
SSD1683_TEMP_CONTROL, 1, 0x80, // Temp control
|
||||
|
||||
0xFE // End of initialization
|
||||
};
|
||||
|
||||
// clang-format on
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief constructor if using external SRAM chip and software SPI
|
||||
@param width the width of the display in pixels
|
||||
@param height the height of the display in pixels
|
||||
@param SID the SID pin to use
|
||||
@param SCLK the SCLK pin to use
|
||||
@param DC the data/command pin to use
|
||||
@param RST the reset pin to use
|
||||
@param CS the chip select pin to use
|
||||
@param SRCS the SRAM chip select pin to use
|
||||
@param MISO the MISO pin to use
|
||||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_SSD1683::Adafruit_SSD1683(int width, int height, int16_t SID,
|
||||
int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY)
|
||||
: Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
}
|
||||
|
||||
buffer1_size = ((uint32_t)width * (uint32_t)height) / 8;
|
||||
buffer2_size = buffer1_size;
|
||||
|
||||
if (SRCS >= 0) {
|
||||
use_sram = true;
|
||||
buffer1_addr = 0;
|
||||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
}
|
||||
|
||||
singleByteTxns = true;
|
||||
}
|
||||
|
||||
// constructor for hardware SPI - we indicate DataCommand, ChipSelect, Reset
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief constructor if using on-chip RAM and hardware SPI
|
||||
@param width the width of the display in pixels
|
||||
@param height the height of the display in pixels
|
||||
@param DC the data/command pin to use
|
||||
@param RST the reset pin to use
|
||||
@param CS the chip select pin to use
|
||||
@param SRCS the SRAM chip select pin to use
|
||||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_SSD1683::Adafruit_SSD1683(int width, int height, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY, SPIClass* spi)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
}
|
||||
|
||||
buffer1_size = ((uint32_t)width * (uint32_t)height) / 8;
|
||||
buffer2_size = buffer1_size;
|
||||
|
||||
if (SRCS >= 0) {
|
||||
use_sram = true;
|
||||
buffer1_addr = 0;
|
||||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
}
|
||||
|
||||
singleByteTxns = true;
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief wait for busy signal to end
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_SSD1683::busy_wait(void) {
|
||||
if (_busy_pin >= 0) {
|
||||
while (digitalRead(_busy_pin)) { // wait for busy low
|
||||
delay(10);
|
||||
}
|
||||
} else {
|
||||
delay(BUSY_WAIT);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief begin communication with and set up the display.
|
||||
@param reset if true the reset pin will be toggled.
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_SSD1683::begin(bool reset) {
|
||||
Adafruit_EPD::begin(reset);
|
||||
setBlackBuffer(0, true); // black defaults to inverted
|
||||
setColorBuffer(1, false); // red defaults to un inverted
|
||||
powerDown();
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief signal the display to update
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_SSD1683::update() {
|
||||
uint8_t buf[1];
|
||||
|
||||
// display update sequence
|
||||
buf[0] = _display_update_val; // varies for mono vs gray4 mode
|
||||
EPD_command(SSD1683_DISP_CTRL2, buf, 1);
|
||||
|
||||
EPD_command(SSD1683_MASTER_ACTIVATE);
|
||||
busy_wait();
|
||||
|
||||
if (_busy_pin <= -1) {
|
||||
delay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief start up the display
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_SSD1683::powerUp() {
|
||||
uint8_t buf[5];
|
||||
|
||||
hardwareReset();
|
||||
delay(100);
|
||||
busy_wait();
|
||||
|
||||
const uint8_t* init_code = ssd1683_default_init_code;
|
||||
|
||||
if (_epd_init_code != NULL) {
|
||||
init_code = _epd_init_code;
|
||||
}
|
||||
EPD_commandList(init_code);
|
||||
|
||||
setRAMWindow(0, 0, (HEIGHT / 8) - 1, WIDTH - 1);
|
||||
|
||||
// Set LUT (if we have one)
|
||||
if (_epd_lut_code) {
|
||||
EPD_commandList(_epd_lut_code);
|
||||
}
|
||||
|
||||
// Set display size and driver output control
|
||||
buf[0] = (WIDTH - 1);
|
||||
buf[1] = (WIDTH - 1) >> 8;
|
||||
buf[2] = 0x00;
|
||||
EPD_command(SSD1683_DRIVER_CONTROL, buf, 3);
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief wind down the display
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_SSD1683::powerDown() {
|
||||
uint8_t buf[1];
|
||||
// Only deep sleep if we can get out of it
|
||||
if (_reset_pin >= 0) {
|
||||
// deep sleep
|
||||
buf[0] = 0x01;
|
||||
EPD_command(SSD1683_DEEP_SLEEP, buf, 1);
|
||||
delay(100);
|
||||
} else {
|
||||
EPD_command(SSD1683_SW_RESET);
|
||||
busy_wait();
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Send the specific command to start writing to EPD display RAM
|
||||
@param index The index for which buffer to write (0 or 1 or tri-color
|
||||
displays) Ignored for monochrome displays.
|
||||
@returns The byte that is read from SPI at the same time as sending the
|
||||
command
|
||||
*/
|
||||
/**************************************************************************/
|
||||
uint8_t Adafruit_SSD1683::writeRAMCommand(uint8_t index) {
|
||||
if (index == 0) {
|
||||
return EPD_command(SSD1683_WRITE_RAM1, false);
|
||||
}
|
||||
if (index == 1) {
|
||||
return EPD_command(SSD1683_WRITE_RAM2, false);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Some displays require setting the RAM address pointer
|
||||
@param x X address counter value
|
||||
@param y Y address counter value
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_SSD1683::setRAMAddress(uint16_t x, uint16_t y) {
|
||||
uint8_t buf[2];
|
||||
|
||||
// set RAM x address count
|
||||
buf[0] = x;
|
||||
EPD_command(SSD1683_SET_RAMXCOUNT, buf, 1);
|
||||
|
||||
// set RAM y address count
|
||||
buf[0] = y;
|
||||
buf[1] = y >> 8;
|
||||
EPD_command(SSD1683_SET_RAMYCOUNT, buf, 2);
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Some displays require setting the RAM address pointer
|
||||
@param x X address counter value
|
||||
@param y Y address counter value
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_SSD1683::setRAMWindow(uint16_t x1, uint16_t y1, uint16_t x2,
|
||||
uint16_t y2) {
|
||||
uint8_t buf[5];
|
||||
|
||||
// Set ram X start/end postion
|
||||
buf[0] = x1;
|
||||
buf[1] = x2;
|
||||
EPD_command(SSD1683_SET_RAMXPOS, buf, 2);
|
||||
|
||||
// Set ram Y start/end postion
|
||||
buf[0] = y1;
|
||||
buf[1] = y1 >> 8;
|
||||
buf[2] = y2;
|
||||
buf[3] = y2 >> 8;
|
||||
EPD_command(SSD1683_SET_RAMYPOS, buf, 4);
|
||||
}
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
#ifndef LIB_ADAFRUIT_SSD1683
|
||||
#define LIB_ADAFRUIT_SSD1683
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define SSD1683_DRIVER_CONTROL 0x01
|
||||
#define SSD1683_GATE_VOLTAGE 0x03
|
||||
#define SSD1683_SOURCE_VOLTAGE 0x04
|
||||
#define SSD1683_PROGOTP_INITIAL 0x08
|
||||
#define SSD1683_PROGREG_INITIAL 0x09
|
||||
#define SSD1683_READREG_INITIAL 0x0A
|
||||
#define SSD1683_BOOST_SOFTSTART 0x0C
|
||||
#define SSD1683_DEEP_SLEEP 0x10
|
||||
#define SSD1683_DATA_MODE 0x11
|
||||
#define SSD1683_SW_RESET 0x12
|
||||
#define SSD1683_HV_READY 0x14
|
||||
#define SSD1683_VCI_DETECT 0x15
|
||||
#define SSD1683_PROGRAM_WSOTP 0x16
|
||||
#define SSD1683_PROGRAM_AUTO 0x17
|
||||
#define SSD1683_TEMP_CONTROL 0x18
|
||||
#define SSD1683_TEMP_WRITE 0x1A
|
||||
#define SSD1683_TEMP_READ 0x1B
|
||||
#define SSD1683_TEMP_CONTROLEXT 0x1C
|
||||
#define SSD1683_MASTER_ACTIVATE 0x20
|
||||
#define SSD1683_DISP_CTRL1 0x21
|
||||
#define SSD1683_DISP_CTRL2 0x22
|
||||
#define SSD1683_WRITE_RAM1 0x24
|
||||
#define SSD1683_WRITE_RAM2 0x26
|
||||
#define SSD1683_READ_RAM1 0x27
|
||||
#define SSD1683_SENSE_VCOM 0x28
|
||||
#define SSD1683_SENSEDUR_VCOM 0x29
|
||||
#define SSD1683_PROGOTP_VCOM 0x2A
|
||||
#define SSD1683_WRITE_VCOM 0x2C
|
||||
#define SSD1683_READ_OTP 0x2D
|
||||
#define SSD1683_READ_USERID 0x2E
|
||||
#define SSD1683_READ_STATUS 0x2F
|
||||
#define SSD1683_WRITE_LUT 0x32
|
||||
#define SSD1683_WRITE_BORDER 0x3C
|
||||
#define SSD1683_END_OPTION 0x3F
|
||||
#define SSD1683_SET_RAMXPOS 0x44
|
||||
#define SSD1683_SET_RAMYPOS 0x45
|
||||
#define SSD1683_SET_RAMXCOUNT 0x4E
|
||||
#define SSD1683_SET_RAMYCOUNT 0x4F
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Class for interfacing with SSD1683 EPD drivers
|
||||
*/
|
||||
/**************************************************************************/
|
||||
class Adafruit_SSD1683 : public Adafruit_EPD {
|
||||
public:
|
||||
Adafruit_SSD1683(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1);
|
||||
Adafruit_SSD1683(int width, int height, int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass* spi = &SPI);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
void update(void);
|
||||
void updatePartial(void);
|
||||
void powerDown();
|
||||
void displayPartial(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
|
||||
|
||||
protected:
|
||||
uint8_t writeRAMCommand(uint8_t index);
|
||||
void setRAMAddress(uint16_t x, uint16_t y);
|
||||
void setRAMWindow(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
|
||||
void busy_wait();
|
||||
uint8_t _display_update_val = 0xF7;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
#include "Adafruit_UC8151D.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
|
|
@ -26,6 +25,7 @@ Adafruit_UC8151D::Adafruit_UC8151D(int width, int height, int16_t SID,
|
|||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY)
|
||||
: Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
|
||||
|
||||
if ((width % 8) != 0) {
|
||||
width += 8 - (width % 8);
|
||||
}
|
||||
|
|
@ -38,8 +38,8 @@ Adafruit_UC8151D::Adafruit_UC8151D(int width, int height, int16_t SID,
|
|||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t *)malloc(buffer2_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -59,8 +59,9 @@ Adafruit_UC8151D::Adafruit_UC8151D(int width, int height, int16_t SID,
|
|||
/**************************************************************************/
|
||||
Adafruit_UC8151D::Adafruit_UC8151D(int width, int height, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY, SPIClass* spi)
|
||||
int16_t BUSY, SPIClass *spi)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
}
|
||||
|
|
@ -73,8 +74,8 @@ Adafruit_UC8151D::Adafruit_UC8151D(int width, int height, int16_t DC,
|
|||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t *)malloc(buffer2_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -131,7 +132,7 @@ void Adafruit_UC8151D::powerUp() {
|
|||
hardwareReset();
|
||||
delay(10);
|
||||
|
||||
const uint8_t* init_code = uc8151d_monofull_init_code;
|
||||
const uint8_t *init_code = uc8151d_monofull_init_code;
|
||||
|
||||
if (_epd_init_code != NULL) {
|
||||
init_code = _epd_init_code;
|
||||
|
|
@ -205,25 +206,25 @@ void Adafruit_UC8151D::displayPartial(uint16_t x1, uint16_t y1, uint16_t x2,
|
|||
|
||||
// check rotation, move window around if necessary
|
||||
switch (getRotation()) {
|
||||
case 0:
|
||||
EPD_swap(x1, y1);
|
||||
EPD_swap(x2, y2);
|
||||
y1 = WIDTH - y1 - 1;
|
||||
y2 = WIDTH - y2 - 1;
|
||||
break;
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
EPD_swap(x1, y1);
|
||||
EPD_swap(x2, y2);
|
||||
x1 = HEIGHT - x1 - 1;
|
||||
x2 = HEIGHT - x2 - 1;
|
||||
break;
|
||||
case 3:
|
||||
y1 = WIDTH - y1 - 1;
|
||||
y2 = WIDTH - y2 - 1;
|
||||
x1 = HEIGHT - x1 - 1;
|
||||
x2 = HEIGHT - x2 - 1;
|
||||
case 0:
|
||||
EPD_swap(x1, y1);
|
||||
EPD_swap(x2, y2);
|
||||
y1 = WIDTH - y1 - 1;
|
||||
y2 = WIDTH - y2 - 1;
|
||||
break;
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
EPD_swap(x1, y1);
|
||||
EPD_swap(x2, y2);
|
||||
x1 = HEIGHT - x1 - 1;
|
||||
x2 = HEIGHT - x2 - 1;
|
||||
break;
|
||||
case 3:
|
||||
y1 = WIDTH - y1 - 1;
|
||||
y2 = WIDTH - y2 - 1;
|
||||
x1 = HEIGHT - x1 - 1;
|
||||
x2 = HEIGHT - x2 - 1;
|
||||
}
|
||||
if (x1 > x2)
|
||||
EPD_swap(x1, x2);
|
||||
|
|
@ -242,8 +243,8 @@ void Adafruit_UC8151D::displayPartial(uint16_t x1, uint16_t y1, uint16_t x2,
|
|||
*/
|
||||
|
||||
// backup & change init to the partial code
|
||||
const uint8_t* init_code_backup = _epd_init_code;
|
||||
const uint8_t* lut_code_backup = _epd_lut_code;
|
||||
const uint8_t *init_code_backup = _epd_init_code;
|
||||
const uint8_t *lut_code_backup = _epd_lut_code;
|
||||
_epd_init_code = _epd_partial_init_code;
|
||||
_epd_lut_code = _epd_partial_lut_code;
|
||||
|
||||
|
|
@ -262,8 +263,8 @@ void Adafruit_UC8151D::displayPartial(uint16_t x1, uint16_t y1, uint16_t x2,
|
|||
buf[1] = x2;
|
||||
buf[2] = y1 >> 8;
|
||||
buf[3] = y1 & 0xFF;
|
||||
buf[4] = y2 >> 8;
|
||||
buf[5] = y2 & 0xFF;
|
||||
buf[4] = (y2) >> 8;
|
||||
buf[5] = (y2)&0xFF;
|
||||
buf[6] = 0x28;
|
||||
|
||||
EPD_command(UC8151D_PTL, buf, 7); // resolution setting
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
#ifndef LIB_ADAFRUIT_UC8151D
|
||||
#define LIB_ADAFRUIT_UC8151D
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#define UC8151D_PSR 0x00
|
||||
#define UC8151D_PWR 0x01
|
||||
|
|
@ -135,12 +134,12 @@ const uint8_t uc8151d_partialmono_lut[] = {
|
|||
*/
|
||||
/**************************************************************************/
|
||||
class Adafruit_UC8151D : public Adafruit_EPD {
|
||||
public:
|
||||
public:
|
||||
Adafruit_UC8151D(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1);
|
||||
Adafruit_UC8151D(int width, int height, int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass* spi = &SPI);
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
|
|
@ -149,7 +148,7 @@ class Adafruit_UC8151D : public Adafruit_EPD {
|
|||
|
||||
void displayPartial(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
|
||||
|
||||
protected:
|
||||
protected:
|
||||
uint8_t writeRAMCommand(uint8_t index);
|
||||
void setRAMAddress(uint16_t x, uint16_t y);
|
||||
void busy_wait();
|
||||
|
|
|
|||
|
|
@ -1,251 +0,0 @@
|
|||
#include "Adafruit_UC8179.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
#define EPD_RAM_RED 0x13
|
||||
|
||||
#define BUSY_WAIT 500
|
||||
|
||||
// clang-format off
|
||||
|
||||
const uint8_t uc8179_default_init_code[] {
|
||||
UC8179_POWERSETTING, 4,
|
||||
0x07, // VGH=20V
|
||||
0x07, // VGL=-20V
|
||||
0x3F, // VDH=15V
|
||||
0x3F, // VDL=-15V
|
||||
|
||||
UC8179_POWERON, 0,
|
||||
0xFF, 100, // busy wait
|
||||
|
||||
UC8179_PANELSETTING, 1,
|
||||
0b010111, // BW OTP LUT
|
||||
|
||||
UC8179_TRES, 4,
|
||||
0x02, 0x88, 0x01, 0xE0,
|
||||
|
||||
UC8179_DUALSPI, 1, 0x00,
|
||||
|
||||
UC8179_WRITE_VCOM, 2, 0x10, 0x07,
|
||||
UC8179_TCON, 1, 0x22,
|
||||
|
||||
0xFE};
|
||||
|
||||
// clang-format on
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief constructor if using external SRAM chip and software SPI
|
||||
@param width the width of the display in pixels
|
||||
@param height the height of the display in pixels
|
||||
@param SID the SID pin to use
|
||||
@param SCLK the SCLK pin to use
|
||||
@param DC the data/command pin to use
|
||||
@param RST the reset pin to use
|
||||
@param CS the chip select pin to use
|
||||
@param SRCS the SRAM chip select pin to use
|
||||
@param MISO the MISO pin to use
|
||||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_UC8179::Adafruit_UC8179(int width, int height, int16_t SID,
|
||||
int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY)
|
||||
: Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
}
|
||||
|
||||
buffer1_size = width * height / 8;
|
||||
buffer2_size = buffer1_size;
|
||||
|
||||
if (SRCS >= 0) {
|
||||
use_sram = true;
|
||||
buffer1_addr = 0;
|
||||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
}
|
||||
|
||||
singleByteTxns = true;
|
||||
}
|
||||
|
||||
// constructor for hardware SPI - we indicate DataCommand, ChipSelect, Reset
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief constructor if using on-chip RAM and hardware SPI
|
||||
@param width the width of the display in pixels
|
||||
@param height the height of the display in pixels
|
||||
@param DC the data/command pin to use
|
||||
@param RST the reset pin to use
|
||||
@param CS the chip select pin to use
|
||||
@param SRCS the SRAM chip select pin to use
|
||||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_UC8179::Adafruit_UC8179(int width, int height, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t BUSY,
|
||||
SPIClass* spi)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
}
|
||||
|
||||
buffer1_size = width * height / 8;
|
||||
buffer2_size = buffer1_size;
|
||||
|
||||
if (SRCS >= 0) {
|
||||
use_sram = true;
|
||||
buffer1_addr = 0;
|
||||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
}
|
||||
|
||||
singleByteTxns = true;
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief wait for busy signal to end
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_UC8179::busy_wait(void) {
|
||||
if (_busy_pin >= 0) {
|
||||
while (!digitalRead(_busy_pin)) { // wait for busy HIGH
|
||||
EPD_command(UC8179_GET_STATUS);
|
||||
delay(100);
|
||||
}
|
||||
} else {
|
||||
delay(BUSY_WAIT);
|
||||
}
|
||||
delay(200);
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief begin communication with and set up the display.
|
||||
@param reset if true the reset pin will be toggled.
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_UC8179::begin(bool reset) {
|
||||
// UUUUGH, SRAM is not organized the same way for this chip?
|
||||
_data_entry_mode = THINKINK_UC8179;
|
||||
|
||||
Adafruit_EPD::begin(reset);
|
||||
setBlackBuffer(0, true); // black defaults to inverted
|
||||
setColorBuffer(1, false); // red defaults to un inverted
|
||||
powerDown();
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief signal the display to update
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_UC8179::update() {
|
||||
EPD_command(UC8179_DISPLAYREFRESH);
|
||||
delay(100);
|
||||
busy_wait();
|
||||
|
||||
if (_busy_pin <= -1) {
|
||||
delay(default_refresh_delay);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief start up the display
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_UC8179::powerUp() {
|
||||
hardwareReset();
|
||||
|
||||
const uint8_t* init_code = uc8179_default_init_code;
|
||||
|
||||
if (_epd_init_code != NULL) {
|
||||
init_code = _epd_init_code;
|
||||
}
|
||||
EPD_commandList(init_code);
|
||||
|
||||
// Set display size
|
||||
uint8_t buf[4];
|
||||
buf[0] = WIDTH >> 8;
|
||||
buf[1] = WIDTH & 0xFF;
|
||||
buf[2] = HEIGHT >> 8;
|
||||
buf[3] = HEIGHT & 0xFF;
|
||||
EPD_command(UC8179_TRES, buf, 4);
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief wind down the display
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_UC8179::powerDown() {
|
||||
uint8_t buf[1];
|
||||
|
||||
EPD_command(UC8179_POWEROFF);
|
||||
busy_wait();
|
||||
|
||||
// Only deep sleep if we can get out of it
|
||||
if (_reset_pin >= 0) {
|
||||
buf[0] = 0x05;
|
||||
EPD_command(UC8179_DEEPSLEEP, buf, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Send the specific command to start writing to EPD display RAM
|
||||
@param index The index for which buffer to write (0 or 1 or tri-color
|
||||
displays) Ignored for monochrome displays.
|
||||
@returns The byte that is read from SPI at the same time as sending the
|
||||
command
|
||||
*/
|
||||
/**************************************************************************/
|
||||
uint8_t Adafruit_UC8179::writeRAMCommand(uint8_t index) {
|
||||
if (index == 0) {
|
||||
return EPD_command(UC8179_WRITE_RAM1, false);
|
||||
}
|
||||
if (index == 1) {
|
||||
return EPD_command(UC8179_WRITE_RAM2, false);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Some displays require setting the RAM address pointer
|
||||
@param x X address counter value
|
||||
@param y Y address counter value
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_UC8179::setRAMAddress(uint16_t x, uint16_t y) {
|
||||
// not used in this chip!
|
||||
(void)x;
|
||||
(void)y;
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Some displays require setting the RAM address pointer
|
||||
@param x X address counter value
|
||||
@param y Y address counter value
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_UC8179::setRAMWindow(uint16_t x1, uint16_t y1, uint16_t x2,
|
||||
uint16_t y2) {
|
||||
// not used in this chip!
|
||||
(void)x1;
|
||||
(void)y1;
|
||||
(void)x2;
|
||||
(void)y2;
|
||||
}
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
#ifndef LIB_ADAFRUIT_UC8179
|
||||
#define LIB_ADAFRUIT_UC8179
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define UC8179_PANELSETTING 0x00
|
||||
#define UC8179_POWERSETTING 0x01
|
||||
#define UC8179_POWEROFF 0x02
|
||||
#define UC8179_POWERON 0x04
|
||||
#define UC8179_DEEPSLEEP 0x07
|
||||
#define UC8179_WRITE_RAM1 0x10
|
||||
#define UC8179_DATASTOP 0x11
|
||||
#define UC8179_DISPLAYREFRESH 0x12
|
||||
#define UC8179_WRITE_RAM2 0x13
|
||||
#define UC8179_DUALSPI 0x15
|
||||
|
||||
#define UC8179_WRITE_VCOM 0x50
|
||||
#define UC8179_TCON 0x60
|
||||
#define UC8179_TRES 0x61
|
||||
#define UC8179_GET_STATUS 0x71
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Class for interfacing with UC8179 EPD drivers
|
||||
*/
|
||||
/**************************************************************************/
|
||||
class Adafruit_UC8179 : public Adafruit_EPD {
|
||||
public:
|
||||
Adafruit_UC8179(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1);
|
||||
Adafruit_UC8179(int width, int height, int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass* spi = &SPI);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
void update(void);
|
||||
void powerDown();
|
||||
|
||||
protected:
|
||||
uint8_t writeRAMCommand(uint8_t index);
|
||||
void setRAMAddress(uint16_t x, uint16_t y);
|
||||
void setRAMWindow(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
|
||||
void busy_wait();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,223 +0,0 @@
|
|||
#include "Adafruit_UC8253.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
#define EPD_RAM_RED 0x13
|
||||
|
||||
#define BUSY_WAIT 500
|
||||
|
||||
// clang-format off
|
||||
|
||||
const uint8_t uc8253_default_init_code[] {
|
||||
UC8253_POWERON, 0, // soft reset
|
||||
0xFF, 50, // busy wait
|
||||
UC8253_PANELSETTING, 2, 0b11001111, 0x8D,
|
||||
0xFE};
|
||||
|
||||
// clang-format on
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief constructor if using external SRAM chip and software SPI
|
||||
@param width the width of the display in pixels
|
||||
@param height the height of the display in pixels
|
||||
@param SID the SID pin to use
|
||||
@param SCLK the SCLK pin to use
|
||||
@param DC the data/command pin to use
|
||||
@param RST the reset pin to use
|
||||
@param CS the chip select pin to use
|
||||
@param SRCS the SRAM chip select pin to use
|
||||
@param MISO the MISO pin to use
|
||||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_UC8253::Adafruit_UC8253(int width, int height, int16_t SID,
|
||||
int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY)
|
||||
: Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
}
|
||||
|
||||
buffer1_size = width * height / 8;
|
||||
buffer2_size = buffer1_size;
|
||||
|
||||
if (SRCS >= 0) {
|
||||
use_sram = true;
|
||||
buffer1_addr = 0;
|
||||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
}
|
||||
|
||||
singleByteTxns = true;
|
||||
}
|
||||
|
||||
// constructor for hardware SPI - we indicate DataCommand, ChipSelect, Reset
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief constructor if using on-chip RAM and hardware SPI
|
||||
@param width the width of the display in pixels
|
||||
@param height the height of the display in pixels
|
||||
@param DC the data/command pin to use
|
||||
@param RST the reset pin to use
|
||||
@param CS the chip select pin to use
|
||||
@param SRCS the SRAM chip select pin to use
|
||||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_UC8253::Adafruit_UC8253(int width, int height, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t BUSY,
|
||||
SPIClass* spi)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
}
|
||||
|
||||
buffer1_size = width * height / 8;
|
||||
buffer2_size = buffer1_size;
|
||||
|
||||
if (SRCS >= 0) {
|
||||
use_sram = true;
|
||||
buffer1_addr = 0;
|
||||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
}
|
||||
|
||||
singleByteTxns = true;
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief wait for busy signal to end
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_UC8253::busy_wait(void) {
|
||||
if (_busy_pin >= 0) {
|
||||
while (!digitalRead(_busy_pin)) { // wait for busy HIGH
|
||||
EPD_command(UC8253_GET_STATUS);
|
||||
delay(50);
|
||||
}
|
||||
} else {
|
||||
delay(BUSY_WAIT);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief begin communication with and set up the display.
|
||||
@param reset if true the reset pin will be toggled.
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_UC8253::begin(bool reset) {
|
||||
Adafruit_EPD::begin(reset);
|
||||
setBlackBuffer(0, true); // black defaults to inverted
|
||||
setColorBuffer(1, false); // red defaults to inverted
|
||||
powerUp();
|
||||
powerDown();
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief signal the display to update
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_UC8253::update() {
|
||||
EPD_command(UC8253_DISPLAYREFRESH);
|
||||
delay(100);
|
||||
busy_wait();
|
||||
|
||||
if (_busy_pin <= -1) {
|
||||
delay(default_refresh_delay);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief start up the display
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_UC8253::powerUp() {
|
||||
hardwareReset();
|
||||
const uint8_t* init_code = uc8253_default_init_code;
|
||||
|
||||
if (_epd_init_code != NULL) {
|
||||
init_code = _epd_init_code;
|
||||
}
|
||||
EPD_commandList(init_code);
|
||||
busy_wait();
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief wind down the display
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_UC8253::powerDown() {
|
||||
uint8_t buf[1];
|
||||
EPD_command(UC8253_POWEROFF);
|
||||
busy_wait();
|
||||
|
||||
delay(1000); // required delay
|
||||
// Only deep sleep if we can get out of it
|
||||
if (_reset_pin >= 0) {
|
||||
buf[0] = 0xA5;
|
||||
EPD_command(UC8253_DEEPSLEEP, buf, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Send the specific command to start writing to EPD display RAM
|
||||
@param index The index for which buffer to write (0 or 1 or tri-color
|
||||
displays) Ignored for monochrome displays.
|
||||
@returns The byte that is read from SPI at the same time as sending the
|
||||
command
|
||||
*/
|
||||
/**************************************************************************/
|
||||
uint8_t Adafruit_UC8253::writeRAMCommand(uint8_t index) {
|
||||
if (index == 0) {
|
||||
return EPD_command(UC8253_WRITE_RAM1, false);
|
||||
}
|
||||
if (index == 1) {
|
||||
return EPD_command(UC8253_WRITE_RAM2, false);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Some displays require setting the RAM address pointer
|
||||
@param x X address counter value
|
||||
@param y Y address counter value
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_UC8253::setRAMAddress(uint16_t x, uint16_t y) {
|
||||
// not used in this chip!
|
||||
(void)x;
|
||||
(void)y;
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Some displays require setting the RAM address pointer
|
||||
@param x X address counter value
|
||||
@param y Y address counter value
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_UC8253::setRAMWindow(uint16_t x1, uint16_t y1, uint16_t x2,
|
||||
uint16_t y2) {
|
||||
// not used in this chip!
|
||||
(void)x1;
|
||||
(void)y1;
|
||||
(void)x2;
|
||||
(void)y2;
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
#ifndef LIB_ADAFRUIT_UC8253
|
||||
#define LIB_ADAFRUIT_UC8253
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define UC8253_PANELSETTING 0x00
|
||||
#define UC8253_POWEROFF 0x02
|
||||
#define UC8253_POWERON 0x04
|
||||
#define UC8253_DEEPSLEEP 0x07
|
||||
#define UC8253_DISPLAYREFRESH 0x12
|
||||
#define UC8253_WRITE_RAM1 0x10
|
||||
#define UC8253_WRITE_RAM2 0x13
|
||||
#define UC8253_VCOM_CDI 0x50
|
||||
#define UC8253_GET_STATUS 0x71
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Class for interfacing with UC8253 EPD drivers
|
||||
*/
|
||||
/**************************************************************************/
|
||||
class Adafruit_UC8253 : public Adafruit_EPD {
|
||||
public:
|
||||
Adafruit_UC8253(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1);
|
||||
Adafruit_UC8253(int width, int height, int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass* spi = &SPI);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
void update(void);
|
||||
void powerDown();
|
||||
|
||||
protected:
|
||||
uint8_t writeRAMCommand(uint8_t index);
|
||||
void setRAMAddress(uint16_t x, uint16_t y);
|
||||
void setRAMWindow(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
|
||||
void busy_wait();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
#include "Adafruit_UC8276.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
|
|
@ -51,8 +50,8 @@ Adafruit_UC8276::Adafruit_UC8276(int width, int height, int16_t SID,
|
|||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t *)malloc(buffer2_size);
|
||||
}
|
||||
|
||||
singleByteTxns = true;
|
||||
|
|
@ -74,7 +73,7 @@ Adafruit_UC8276::Adafruit_UC8276(int width, int height, int16_t SID,
|
|||
/**************************************************************************/
|
||||
Adafruit_UC8276::Adafruit_UC8276(int width, int height, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t BUSY,
|
||||
SPIClass* spi)
|
||||
SPIClass *spi)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
|
|
@ -89,8 +88,8 @@ Adafruit_UC8276::Adafruit_UC8276(int width, int height, int16_t DC, int16_t RST,
|
|||
buffer2_addr = buffer1_size;
|
||||
buffer1 = buffer2 = NULL;
|
||||
} else {
|
||||
buffer1 = (uint8_t*)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t*)malloc(buffer2_size);
|
||||
buffer1 = (uint8_t *)malloc(buffer1_size);
|
||||
buffer2 = (uint8_t *)malloc(buffer2_size);
|
||||
}
|
||||
|
||||
singleByteTxns = true;
|
||||
|
|
@ -149,7 +148,7 @@ void Adafruit_UC8276::update() {
|
|||
void Adafruit_UC8276::powerUp() {
|
||||
hardwareReset();
|
||||
|
||||
const uint8_t* init_code = uc8276_default_init_code;
|
||||
const uint8_t *init_code = uc8276_default_init_code;
|
||||
|
||||
if (_epd_init_code != NULL) {
|
||||
init_code = _epd_init_code;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
#ifndef LIB_ADAFRUIT_UC8276
|
||||
#define LIB_ADAFRUIT_UC8276
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#define UC8276_PANELSETTING 0x00
|
||||
#define UC8276_POWEROFF 0x02
|
||||
|
|
@ -21,19 +20,19 @@
|
|||
*/
|
||||
/**************************************************************************/
|
||||
class Adafruit_UC8276 : public Adafruit_EPD {
|
||||
public:
|
||||
public:
|
||||
Adafruit_UC8276(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1);
|
||||
Adafruit_UC8276(int width, int height, int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass* spi = &SPI);
|
||||
int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
void update(void);
|
||||
void powerDown();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
uint8_t writeRAMCommand(uint8_t index);
|
||||
void setRAMAddress(uint16_t x, uint16_t y);
|
||||
void setRAMWindow(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
|
||||
|
|
|
|||
|
|
@ -1,141 +0,0 @@
|
|||
#ifndef _THINKINK_154_GRAYSCALE4_M05_H
|
||||
#define _THINKINK_154_GRAYSCALE4_M05_H
|
||||
|
||||
// This file is #included by Adafruit_ThinkInk.h and does not need to
|
||||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
// clang-format off
|
||||
|
||||
static const uint8_t ti_154m05_gray4_init_code[] {
|
||||
SSD1681_SW_RESET, 0, // soft reset
|
||||
0xFF, 100, // busy wait
|
||||
SSD1681_DRIVER_CONTROL, 3, 0x27, 0x01, 0x00, // Driver output
|
||||
SSD1681_DATA_MODE, 1, 0x03, // Ram data entry mode
|
||||
SSD1681_WRITE_BORDER, 1, 0x04, // border color
|
||||
|
||||
SSD1681_SET_RAMXCOUNT, 1, 1,
|
||||
SSD1681_SET_RAMYCOUNT, 2, 0, 0,
|
||||
|
||||
0x3F, 1, 0x22, // End of LUT normal
|
||||
SSD1681_GATE_VOLTAGE, 1, 0x17, // Set gate voltage
|
||||
SSD1681_SOURCE_VOLTAGE, 3, 0x41, 0xAE, 0x32, // Set source voltage
|
||||
SSD1681_WRITE_VCOM, 1, 0x28, // Vcom Voltage
|
||||
|
||||
0xFE // EOM
|
||||
};
|
||||
|
||||
static const uint8_t ti_154m05_monofull_init_code[] {
|
||||
SSD1681_SW_RESET, 0, // soft reset
|
||||
0xFF, 20, // busy wait
|
||||
SSD1681_DATA_MODE, 1, 0x03, // Ram data entry mode
|
||||
SSD1681_WRITE_BORDER, 1, 0x05, // border color
|
||||
SSD1681_TEMP_CONTROL, 1, 0x80, // Temp control
|
||||
SSD1681_SET_RAMXCOUNT, 1, 0,
|
||||
SSD1681_SET_RAMYCOUNT, 2, 0, 0,
|
||||
SSD1681_DISP_CTRL2, 1, 0x20, // Load LUT from OTP (default mono)
|
||||
|
||||
0xFE
|
||||
};
|
||||
|
||||
|
||||
static const uint8_t ti_154m05_gray4_lut_code[] = {
|
||||
0x32, 233,
|
||||
0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x60, 0x10, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x60, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x2A, 0x60, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x05,
|
||||
0x14, 0x00, 0x00, 0x1E, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x05, 0x14, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x24, 0x22, 0x22, 0x22, 0x23, 0x32, 0x00, 0x00, 0x00,
|
||||
|
||||
0xFE // EOM
|
||||
};
|
||||
|
||||
|
||||
static const uint8_t ti_154m05_monofull_lut_code[] = {
|
||||
0x32, 153,
|
||||
0x80, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0,
|
||||
0x10, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0,
|
||||
0x80, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0,
|
||||
0x10, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x14, 0x8, 0x0, 0x0,
|
||||
0x0, 0x0, 0x1, 0xA, 0xA, 0x0, 0xA, 0xA,
|
||||
0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x14, 0x8, 0x0, 0x1,
|
||||
0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x0, 0x0, 0x0,
|
||||
0xFE
|
||||
};
|
||||
|
||||
// clang-format on
|
||||
|
||||
class ThinkInk_154_Grayscale4_M05 : public Adafruit_SSD1681 {
|
||||
public:
|
||||
ThinkInk_154_Grayscale4_M05(int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t MISO, int16_t BUSY = -1)
|
||||
: Adafruit_SSD1681(200, 200, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_154_Grayscale4_M05(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_SSD1681(200, 200, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_GRAYSCALE4) {
|
||||
Adafruit_SSD1681::begin(true);
|
||||
|
||||
inkmode = mode; // Preserve ink mode for ImageReader or others
|
||||
|
||||
if (mode == THINKINK_GRAYSCALE4) {
|
||||
setColorBuffer(1, false); // layer 0 inverted
|
||||
setBlackBuffer(0, false); // layer 1 inverted
|
||||
|
||||
_epd_init_code = ti_154m05_gray4_init_code;
|
||||
_epd_lut_code = ti_154m05_gray4_lut_code;
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b11;
|
||||
layer_colors[EPD_RED] = 0b01;
|
||||
layer_colors[EPD_GRAY] = 0b10;
|
||||
layer_colors[EPD_LIGHT] = 0b01;
|
||||
layer_colors[EPD_DARK] = 0b10;
|
||||
|
||||
_display_update_val = 0xC7;
|
||||
|
||||
} else if (mode == THINKINK_MONO) {
|
||||
setColorBuffer(0, true); // layer 0 uninverted
|
||||
setBlackBuffer(0, true); // only one buffer
|
||||
|
||||
_epd_init_code = ti_154m05_monofull_init_code;
|
||||
//_epd_lut_code = ti_154m05_monofull_lut_code;
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b01;
|
||||
layer_colors[EPD_RED] = 0b01;
|
||||
layer_colors[EPD_GRAY] = 0b01;
|
||||
layer_colors[EPD_LIGHT] = 0b00;
|
||||
layer_colors[EPD_DARK] = 0b01;
|
||||
|
||||
setRotation(3);
|
||||
}
|
||||
|
||||
default_refresh_delay = 1000;
|
||||
|
||||
powerDown();
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _THINKINK_154_GRAYSCALE4_M05_H
|
||||
|
|
@ -147,14 +147,14 @@ static const uint8_t ti_154t8_gray4_lut_code[] = {
|
|||
// clang-format on
|
||||
|
||||
class ThinkInk_154_Grayscale4_T8 : public Adafruit_IL0373 {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_154_Grayscale4_T8(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_IL0373(152, 152, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_154_Grayscale4_T8(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_IL0373(152, 152, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_GRAYSCALE4) {
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_154_Mono_D27 : public Adafruit_SSD1608 {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_154_Mono_D27(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_SSD1608(200, 200, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_154_Mono_D27(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_SSD1608(200, 200, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_154_Mono_D67 : public Adafruit_SSD1681 {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_154_Mono_D67(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_SSD1681(200, 200, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_154_Mono_D67(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_SSD1681(200, 200, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_154_Mono_M10 : public Adafruit_UC8151D {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_154_Mono_M10(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_UC8151D(152, 152, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_154_Mono_M10(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_UC8151D(152, 152, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_154_Tricolor_RW : public Adafruit_SSD1680 {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_154_Tricolor_RW(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_SSD1680(152, 152, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_154_Tricolor_RW(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_SSD1680(152, 152, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_154_Tricolor_Z17 : public Adafruit_IL0373 {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_154_Tricolor_Z17(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_IL0373(152, 152, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_154_Tricolor_Z17(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_IL0373(152, 152, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_154_Tricolor_Z90 : public Adafruit_SSD1681 {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_154_Tricolor_Z90(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_SSD1681(200, 200, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_154_Tricolor_Z90(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_SSD1681(200, 200, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -1,175 +0,0 @@
|
|||
#ifndef _THINKINK_213_GRAYSCALE4_MFGN_H
|
||||
#define _THINKINK_213_GRAYSCALE4_MFGN_H
|
||||
|
||||
// This file is #included by Adafruit_ThinkInk.h and does not need to
|
||||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
// clang-format off
|
||||
|
||||
static const uint8_t ti_213mfgn_gray4_init_code[] {
|
||||
SSD1680_SW_RESET, 0, // soft reset
|
||||
0xFF, 100, // busy wait
|
||||
SSD1680_DRIVER_CONTROL, 3, 0x27, 0x01, 0x00, // Driver output
|
||||
SSD1680_DATA_MODE, 1, 0x03, // Ram data entry mode
|
||||
SSD1680_WRITE_BORDER, 1, 0x04, // border color
|
||||
|
||||
SSD1680_SET_RAMXCOUNT, 1, 1,
|
||||
SSD1680_SET_RAMYCOUNT, 2, 0, 0,
|
||||
|
||||
0x3F, 1, 0x22, // ???
|
||||
SSD1680_GATE_VOLTAGE, 1, 0x17, // Set gate voltage
|
||||
SSD1680_SOURCE_VOLTAGE, 3, 0x41, 0xAE, 0x32, // Set source voltage
|
||||
SSD1680_WRITE_VCOM, 1, 0x28, // Vcom Voltage
|
||||
|
||||
0xFE // EOM
|
||||
};
|
||||
|
||||
static const uint8_t ti_213mfgn_monopart_init_code[] {
|
||||
SSD1680_SW_RESET, 0, // soft reset
|
||||
0xFF, 20, // busy wait
|
||||
SSD1680_DRIVER_CONTROL, 3, 0x27, 0x01, 0x00, // Driver output
|
||||
SSD1680_DATA_MODE, 1, 0x03, // Ram data entry mode
|
||||
SSD1680_DISP_CTRL1, 2, 0x00, 0x80, // Display update
|
||||
|
||||
SSD1680_SET_RAMXCOUNT, 1, 1,
|
||||
SSD1680_SET_RAMYCOUNT, 2, 0, 0,
|
||||
SSD1680_WRITE_BORDER, 1, 0x05, // border color
|
||||
|
||||
0x3F, 1, 0x22, // ???
|
||||
SSD1680_GATE_VOLTAGE, 1, 0x17, // Set gate voltage
|
||||
SSD1680_SOURCE_VOLTAGE, 3, 0x41, 0x00, 0x32, // Set source voltage
|
||||
SSD1680_WRITE_VCOM, 1, 0x36, // Vcom Voltage
|
||||
0xFE // EOM
|
||||
};
|
||||
|
||||
static const uint8_t ti_213mfgn_monofull_init_code[] {
|
||||
SSD1680_SW_RESET, 0, // soft reset
|
||||
0xFF, 20, // busy wait
|
||||
SSD1680_DRIVER_CONTROL, 3, 0x27, 0x01, 0x00, // Driver output
|
||||
SSD1680_DATA_MODE, 1, 0x03, // Ram data entry mode
|
||||
SSD1680_DISP_CTRL1, 2, 0x00, 0x80, // Display update
|
||||
|
||||
SSD1680_SET_RAMXCOUNT, 1, 1,
|
||||
SSD1680_SET_RAMYCOUNT, 2, 0, 0,
|
||||
SSD1680_WRITE_BORDER, 1, 0x05, // border color
|
||||
|
||||
//0x3F, 1, 0x22, // End of LUT normal
|
||||
//SSD1680_GATE_VOLTAGE, 1, 0x17, // Set gate voltage
|
||||
//SSD1680_SOURCE_VOLTAGE, 3, 0x41, 0x00, 0x32, // Set source voltage
|
||||
//SSD1680_WRITE_VCOM, 1, 0x36, // Vcom Voltage
|
||||
|
||||
SSD1680_DISP_CTRL2, 1, 0x20, // Load LUT from OTP (default mono)
|
||||
|
||||
0xFE
|
||||
};
|
||||
|
||||
|
||||
|
||||
static const uint8_t ti_213mfgn_monofull_lut_code[] = {
|
||||
0x32, 153,
|
||||
0x80, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0,
|
||||
0x10, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0,
|
||||
0x80, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0,
|
||||
0x10, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x14, 0x8, 0x0, 0x0,
|
||||
0x0, 0x0, 0x1, 0xA, 0xA, 0x0, 0xA, 0xA,
|
||||
0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x14, 0x8, 0x0, 0x1,
|
||||
0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x0, 0x0, 0x0,
|
||||
0xFE
|
||||
};
|
||||
|
||||
static const uint8_t ti_213mfgn_monopart_lut_code[] = {
|
||||
0xFE // EOM
|
||||
};
|
||||
|
||||
static const uint8_t ti_213mfgn_gray4_lut_code[] = {
|
||||
0x32, 233,
|
||||
0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x60, 0x10, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x60, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x2A, 0x60, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x05,
|
||||
0x14, 0x00, 0x00, 0x1E, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x05, 0x14, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x24, 0x22, 0x22, 0x22, 0x23, 0x32, 0x00, 0x00, 0x00,
|
||||
|
||||
0xFE // EOM
|
||||
};
|
||||
|
||||
// clang-format on
|
||||
|
||||
class ThinkInk_213_Grayscale4_MFGN : public Adafruit_SSD1680 {
|
||||
public:
|
||||
ThinkInk_213_Grayscale4_MFGN(int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t MISO, int16_t BUSY = -1)
|
||||
: Adafruit_SSD1680(250, 122, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_213_Grayscale4_MFGN(int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1,
|
||||
SPIClass* spi = &SPI)
|
||||
: Adafruit_SSD1680(250, 122, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_GRAYSCALE4) {
|
||||
Adafruit_SSD1680::begin(true);
|
||||
|
||||
inkmode = mode; // Preserve ink mode for ImageReader or others
|
||||
_xram_offset = 0;
|
||||
|
||||
if (mode == THINKINK_GRAYSCALE4) {
|
||||
setColorBuffer(1, false); // layer 0 inverted
|
||||
setBlackBuffer(0, false); // layer 1 inverted
|
||||
|
||||
_epd_init_code = ti_213mfgn_gray4_init_code;
|
||||
_epd_lut_code = ti_213mfgn_gray4_lut_code;
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b11;
|
||||
layer_colors[EPD_RED] = 0b01;
|
||||
layer_colors[EPD_GRAY] = 0b10;
|
||||
layer_colors[EPD_LIGHT] = 0b01;
|
||||
layer_colors[EPD_DARK] = 0b10;
|
||||
|
||||
_display_update_val = 0xC7;
|
||||
|
||||
} else if (mode == THINKINK_MONO) {
|
||||
_epd_init_code = ti_213mfgn_monofull_init_code;
|
||||
//_epd_lut_code = ti_213mfgn_monofull_lut_code;
|
||||
//_epd_partial_init_code = ti_213mfgn_monopart_init_code;
|
||||
//_epd_partial_lut_code = ti_213mfgn_monopart_lut_code;
|
||||
setColorBuffer(0, true); // layer 0 uninverted
|
||||
setBlackBuffer(0, true); // only one buffer
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b01;
|
||||
layer_colors[EPD_RED] = 0b01;
|
||||
layer_colors[EPD_GRAY] = 0b01;
|
||||
layer_colors[EPD_LIGHT] = 0b00;
|
||||
layer_colors[EPD_DARK] = 0b01;
|
||||
|
||||
setRotation(0);
|
||||
}
|
||||
|
||||
default_refresh_delay = 1000;
|
||||
|
||||
powerDown();
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _THINKINK_213_GRAYSCALE4_MFGN_H
|
||||
|
|
@ -147,14 +147,14 @@ static const uint8_t ti_213t5_gray4_lut_code[] = {
|
|||
// clang-format on
|
||||
|
||||
class ThinkInk_213_Grayscale4_T5 : public Adafruit_IL0373 {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_213_Grayscale4_T5(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_IL0373(212, 104, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_213_Grayscale4_T5(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_IL0373(212, 104, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_GRAYSCALE4) {
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_213_Mono_B72 : public Adafruit_SSD1675 {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_213_Mono_B72(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_SSD1675(250, 122, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_213_Mono_B72(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_SSD1675(250, 122, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_213_Mono_B73 : public Adafruit_SSD1675B {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_213_Mono_B73(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_SSD1675B(250, 122, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_213_Mono_B73(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_SSD1675B(250, 122, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_213_Mono_BN : public Adafruit_SSD1680 {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_213_Mono_BN(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_SSD1680(250, 122, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_213_Mono_BN(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_SSD1680(250, 122, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -1,41 +0,0 @@
|
|||
#ifndef _THINKINK_213_MONO_GDEY0213B74_H
|
||||
#define _THINKINK_213_MONO_GDEY0213B74_H
|
||||
|
||||
// This file is #included by Adafruit_ThinkInk.h and does not need to
|
||||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_213_Mono_GDEY0213B74 : public Adafruit_SSD1680 {
|
||||
public:
|
||||
ThinkInk_213_Mono_GDEY0213B74(int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t MISO, int16_t BUSY = -1)
|
||||
: Adafruit_SSD1680(250, 122, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_213_Mono_GDEY0213B74(int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1,
|
||||
SPIClass* spi = &SPI)
|
||||
: Adafruit_SSD1680(250, 122, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
_xram_offset = 0;
|
||||
|
||||
Adafruit_SSD1680::begin(true);
|
||||
setColorBuffer(0, true); // layer 0 uninverted
|
||||
setBlackBuffer(0, true); // only one buffer
|
||||
|
||||
inkmode = mode; // Preserve ink mode for ImageReader or others
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b01;
|
||||
layer_colors[EPD_RED] = 0b01;
|
||||
layer_colors[EPD_GRAY] = 0b01;
|
||||
layer_colors[EPD_LIGHT] = 0b00;
|
||||
layer_colors[EPD_DARK] = 0b01;
|
||||
|
||||
default_refresh_delay = 1000;
|
||||
setRotation(0);
|
||||
powerDown();
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _THINKINK_213_MONO_GDEY0213B74_H
|
||||
|
|
@ -5,14 +5,14 @@
|
|||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_213_Mono_M21 : public Adafruit_UC8151D {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_213_Mono_M21(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_UC8151D(212, 104, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_213_Mono_M21(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_UC8151D(212, 104, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
#ifndef _THINKINK_213_QUADCOLOR_AJHE5_H
|
||||
#define _THINKINK_213_QUADCOLOR_AJHE5_H
|
||||
|
||||
// This file is #included by Adafruit_ThinkInk.h and does not need to
|
||||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_213_Quadcolor_AJHE5 : public Adafruit_JD79661 {
|
||||
public:
|
||||
ThinkInk_213_Quadcolor_AJHE5(int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t MISO, int16_t BUSY = -1)
|
||||
: Adafruit_JD79661(122, 250, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_213_Quadcolor_AJHE5(int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1,
|
||||
SPIClass* spi = &SPI)
|
||||
: Adafruit_JD79661(122, 250, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_QUADCOLOR) {
|
||||
Adafruit_JD79661::begin(true);
|
||||
|
||||
inkmode = mode; // Preserve ink mode for ImageReader or others
|
||||
|
||||
default_refresh_delay = 13000;
|
||||
setRotation(1);
|
||||
powerDown();
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _THINKINK_213_Quad
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
#ifndef _THINKINK_213_TRICOLOR_MFGNR_H
|
||||
#define _THINKINK_213_TRICOLOR_MFGNR_H
|
||||
|
||||
// This file is #included by Adafruit_ThinkInk.h and does not need to
|
||||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_213_Tricolor_MFGNR : public Adafruit_SSD1680 {
|
||||
public:
|
||||
ThinkInk_213_Tricolor_MFGNR(int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t MISO, int16_t BUSY = -1)
|
||||
: Adafruit_SSD1680(250, 122, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_213_Tricolor_MFGNR(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_SSD1680(250, 122, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
_xram_offset = 0;
|
||||
Adafruit_SSD1680::begin(true);
|
||||
_xram_offset = 0;
|
||||
|
||||
setBlackBuffer(0, true);
|
||||
setColorBuffer(1, false);
|
||||
|
||||
inkmode = mode; // Preserve ink mode for ImageReader or others
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b01;
|
||||
layer_colors[EPD_RED] = 0b10;
|
||||
layer_colors[EPD_GRAY] = 0b10;
|
||||
layer_colors[EPD_LIGHT] = 0b00;
|
||||
layer_colors[EPD_DARK] = 0b01;
|
||||
|
||||
default_refresh_delay = 13000;
|
||||
setRotation(0);
|
||||
powerDown();
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _THINKINK_213_TRI
|
||||
|
|
@ -5,14 +5,14 @@
|
|||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_213_Tricolor_RW : public Adafruit_SSD1680 {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_213_Tricolor_RW(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_SSD1680(250, 122, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_213_Tricolor_RW(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_SSD1680(250, 122, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_213_Tricolor_Z16 : public Adafruit_IL0373 {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_213_Tricolor_Z16(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_IL0373(212, 104, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_213_Tricolor_Z16(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_IL0373(212, 104, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
|
|
|
|||
|
|
@ -1,172 +0,0 @@
|
|||
#ifndef _THINKINK_266_GRAYSCALE4_MFGN_H
|
||||
#define _THINKINK_266_GRAYSCALE4_MFGN_H
|
||||
|
||||
// This file is #included by Adafruit_ThinkInk.h and does not need to
|
||||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
// clang-format off
|
||||
|
||||
static const uint8_t ti_266mfgn_gray4_init_code[] {
|
||||
SSD1680_SW_RESET, 0, // soft reset
|
||||
0xFF, 100, // busy wait
|
||||
SSD1680_DRIVER_CONTROL, 3, 0x27, 0x01, 0x00, // Driver output
|
||||
SSD1680_DATA_MODE, 1, 0x03, // Ram data entry mode
|
||||
SSD1680_WRITE_BORDER, 1, 0x04, // border color
|
||||
|
||||
SSD1680_SET_RAMXCOUNT, 1, 1,
|
||||
SSD1680_SET_RAMYCOUNT, 2, 0, 0,
|
||||
|
||||
0x3F, 1, 0x22, // ???
|
||||
SSD1680_GATE_VOLTAGE, 1, 0x17, // Set gate voltage
|
||||
SSD1680_SOURCE_VOLTAGE, 3, 0x41, 0xAE, 0x32, // Set source voltage
|
||||
SSD1680_WRITE_VCOM, 1, 0x28, // Vcom Voltage
|
||||
|
||||
0xFE // EOM
|
||||
};
|
||||
|
||||
static const uint8_t ti_266mfgn_monopart_init_code[] {
|
||||
SSD1680_SW_RESET, 0, // soft reset
|
||||
0xFF, 20, // busy wait
|
||||
SSD1680_DRIVER_CONTROL, 3, 0x27, 0x01, 0x00, // Driver output
|
||||
SSD1680_DATA_MODE, 1, 0x03, // Ram data entry mode
|
||||
SSD1680_DISP_CTRL1, 2, 0x00, 0x80, // Display update
|
||||
|
||||
SSD1680_SET_RAMXCOUNT, 1, 1,
|
||||
SSD1680_SET_RAMYCOUNT, 2, 0, 0,
|
||||
SSD1680_WRITE_BORDER, 1, 0x05, // border color
|
||||
|
||||
0x3F, 1, 0x22, // ???
|
||||
SSD1680_GATE_VOLTAGE, 1, 0x17, // Set gate voltage
|
||||
SSD1680_SOURCE_VOLTAGE, 3, 0x41, 0x00, 0x32, // Set source voltage
|
||||
SSD1680_WRITE_VCOM, 1, 0x36, // Vcom Voltage
|
||||
0xFE // EOM
|
||||
};
|
||||
|
||||
static const uint8_t ti_266mfgn_monofull_init_code[] {
|
||||
SSD1680_SW_RESET, 0, // soft reset
|
||||
0xFF, 20, // busy wait
|
||||
SSD1680_DRIVER_CONTROL, 3, 0x27, 0x01, 0x00, // Driver output
|
||||
SSD1680_DATA_MODE, 1, 0x03, // Ram data entry mode
|
||||
SSD1680_DISP_CTRL1, 2, 0x00, 0x80, // Display update
|
||||
|
||||
SSD1680_SET_RAMXCOUNT, 1, 1,
|
||||
SSD1680_SET_RAMYCOUNT, 2, 0, 0,
|
||||
SSD1680_WRITE_BORDER, 1, 0x05, // border color
|
||||
|
||||
SSD1680_DISP_CTRL2, 1, 0x20, // read LUT?
|
||||
SSD1680_TEMP_CONTROL, 1, 0x80, // read temp
|
||||
|
||||
0xFE
|
||||
};
|
||||
|
||||
|
||||
|
||||
static const uint8_t ti_266mfgn_monofull_lut_code[] = {
|
||||
0x32, 153,
|
||||
0x80, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0,
|
||||
0x10, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0,
|
||||
0x80, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0,
|
||||
0x10, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x14, 0x8, 0x0, 0x0,
|
||||
0x0, 0x0, 0x1, 0xA, 0xA, 0x0, 0xA, 0xA,
|
||||
0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x14, 0x8, 0x0, 0x1,
|
||||
0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x0, 0x0, 0x0,
|
||||
0xFE
|
||||
};
|
||||
|
||||
static const uint8_t ti_266mfgn_monopart_lut_code[] = {
|
||||
0xFE // EOM
|
||||
};
|
||||
|
||||
static const uint8_t ti_266mfgn_gray4_lut_code[] = {
|
||||
0x32, 233,
|
||||
0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x60, 0x10, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x60, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x2A, 0x60, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x05,
|
||||
0x14, 0x00, 0x00, 0x1E, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x05, 0x14, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x24, 0x22, 0x22, 0x22, 0x23, 0x32, 0x00, 0x00, 0x00,
|
||||
|
||||
0xFE // EOM
|
||||
};
|
||||
|
||||
// clang-format on
|
||||
|
||||
class ThinkInk_266_Grayscale4_MFGN : public Adafruit_SSD1680 {
|
||||
public:
|
||||
ThinkInk_266_Grayscale4_MFGN(int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t MISO, int16_t BUSY = -1)
|
||||
: Adafruit_SSD1680(296, 152, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_266_Grayscale4_MFGN(int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1,
|
||||
SPIClass* spi = &SPI)
|
||||
: Adafruit_SSD1680(296, 152, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_GRAYSCALE4) {
|
||||
Adafruit_SSD1680::begin(true);
|
||||
|
||||
inkmode = mode; // Preserve ink mode for ImageReader or others
|
||||
_xram_offset = 0;
|
||||
|
||||
if (mode == THINKINK_GRAYSCALE4) {
|
||||
setColorBuffer(1, false); // layer 0 inverted
|
||||
setBlackBuffer(0, false); // layer 1 inverted
|
||||
|
||||
_epd_init_code = ti_266mfgn_gray4_init_code;
|
||||
_epd_lut_code = ti_266mfgn_gray4_lut_code;
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b11;
|
||||
layer_colors[EPD_RED] = 0b01;
|
||||
layer_colors[EPD_GRAY] = 0b10;
|
||||
layer_colors[EPD_LIGHT] = 0b01;
|
||||
layer_colors[EPD_DARK] = 0b10;
|
||||
|
||||
_display_update_val = 0xC7;
|
||||
default_refresh_delay = 3000;
|
||||
} else if (mode == THINKINK_MONO) {
|
||||
_epd_init_code = ti_266mfgn_monofull_init_code;
|
||||
//_epd_lut_code = ti_266mfgn_monofull_lut_code;
|
||||
//_epd_partial_init_code = ti_266mfgn_monopart_init_code;
|
||||
//_epd_partial_lut_code = ti_266mfgn_monopart_lut_code;
|
||||
setColorBuffer(0, true); // layer 0 uninverted
|
||||
setBlackBuffer(0, true); // only one buffer
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b01;
|
||||
layer_colors[EPD_RED] = 0b01;
|
||||
layer_colors[EPD_GRAY] = 0b01;
|
||||
layer_colors[EPD_LIGHT] = 0b00;
|
||||
layer_colors[EPD_DARK] = 0b01;
|
||||
|
||||
_display_update_val = 0xF4;
|
||||
default_refresh_delay = 1000;
|
||||
}
|
||||
|
||||
setRotation(0);
|
||||
|
||||
powerDown();
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _THINKINK_266_GRAYSCALE4_MFGN_H
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
#ifndef _THINKINK_266_TRICOLOR_MFGNR_H
|
||||
#define _THINKINK_266_TRICOLOR_MFGNR_H
|
||||
|
||||
// This file is #included by Adafruit_ThinkInk.h and does not need to
|
||||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_266_Tricolor_MFGNR : public Adafruit_SSD1680 {
|
||||
public:
|
||||
ThinkInk_266_Tricolor_MFGNR(int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t MISO, int16_t BUSY = -1)
|
||||
: Adafruit_SSD1680(296, 152, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_266_Tricolor_MFGNR(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_SSD1680(296, 152, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
_xram_offset = 0;
|
||||
Adafruit_SSD1680::begin(true);
|
||||
_xram_offset = 0;
|
||||
|
||||
setBlackBuffer(0, true);
|
||||
setColorBuffer(1, false);
|
||||
|
||||
inkmode = mode; // Preserve ink mode for ImageReader or others
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b01;
|
||||
layer_colors[EPD_RED] = 0b10;
|
||||
layer_colors[EPD_GRAY] = 0b10;
|
||||
layer_colors[EPD_LIGHT] = 0b00;
|
||||
layer_colors[EPD_DARK] = 0b01;
|
||||
|
||||
default_refresh_delay = 13000;
|
||||
setRotation(0);
|
||||
powerDown();
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _THINKINK_266_TRI
|
||||
|
|
@ -82,15 +82,15 @@ static const uint8_t ti_270w3_gray4_lut_code[] = {
|
|||
// clang-format on
|
||||
|
||||
class ThinkInk_270_Grayscale4_W3 : public Adafruit_IL91874 {
|
||||
private:
|
||||
public:
|
||||
private:
|
||||
public:
|
||||
ThinkInk_270_Grayscale4_W3(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_IL91874(264, 176, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_270_Grayscale4_W3(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_IL91874(264, 176, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -24,14 +24,14 @@ static const uint8_t ti_270c44_tri_init_code[] {
|
|||
// clang-format on
|
||||
|
||||
class ThinkInk_270_Tricolor_C44 : public Adafruit_IL91874 {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_270_Tricolor_C44(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_IL91874(264, 176, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_270_Tricolor_C44(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_IL91874(264, 176, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_270_Tricolor_Z70 : public Adafruit_EK79686 {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_270_Tricolor_Z70(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_EK79686(264, 176, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_270_Tricolor_Z70(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_EK79686(264, 176, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
|
|
|
|||
|
|
@ -1,156 +0,0 @@
|
|||
#ifndef _THINKINK_290_GRAYSCALE4_EAAMFGN_H
|
||||
#define _THINKINK_290_GRAYSCALE4_EAAMFGN_H
|
||||
|
||||
// This file is #included by Adafruit_ThinkInk.h and does not need to
|
||||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
// clang-format off
|
||||
|
||||
static const uint8_t ti_290mfgn_monofull_init_code[] {
|
||||
SSD1680_SW_RESET, 0, // 0x12 soft reset
|
||||
0xFF, 20, // busy wait
|
||||
SSD1680_DRIVER_CONTROL, 3, 0x27, 0x01, 0x00, // 0x01 Driver output
|
||||
SSD1680_DATA_MODE, 1, 0x03, // 0x11 Ram data entry mode
|
||||
SSD1680_DISP_CTRL1, 2, 0x00, 0x80, // Display update
|
||||
|
||||
SSD1680_SET_RAMXCOUNT, 1, 1,
|
||||
SSD1680_SET_RAMYCOUNT, 2, 0, 0,
|
||||
SSD1680_WRITE_BORDER, 1, 0x05, // border color
|
||||
|
||||
// SSD1680_DISP_CTRL2, 1, 0x20, // Load LUT from OTP (default mono)
|
||||
// load LUT into memory instead!
|
||||
SSD1680_END_OPTION, 1, 0x22,
|
||||
SSD1680_GATE_VOLTAGE, 1, 0x17,
|
||||
SSD1680_SOURCE_VOLTAGE, 3, 0x41, 0x0, 0x32,
|
||||
SSD1680_WRITE_VCOM, 1, 0x36,
|
||||
|
||||
0xFE
|
||||
};
|
||||
|
||||
static const uint8_t ti_290mfgn_gray4_init_code[] {
|
||||
SSD1680_SW_RESET, 0, // soft reset
|
||||
0xFF, 100, // busy wait
|
||||
SSD1680_DRIVER_CONTROL, 3, 0x27, 0x01, 0x00, // Driver output
|
||||
SSD1680_DATA_MODE, 1, 0x03, // Ram data entry mode
|
||||
SSD1680_WRITE_BORDER, 1, 0x04, // border color
|
||||
|
||||
SSD1680_SET_RAMXCOUNT, 1, 1,
|
||||
SSD1680_SET_RAMYCOUNT, 2, 0, 0,
|
||||
|
||||
SSD1680_END_OPTION, 1, 0x22,
|
||||
SSD1680_GATE_VOLTAGE, 1, 0x17,
|
||||
SSD1680_SOURCE_VOLTAGE, 3, 0x41, 0xAE, 0x32,
|
||||
SSD1680_WRITE_VCOM, 1, 0x28,
|
||||
|
||||
0xFE // EOM
|
||||
};
|
||||
|
||||
static const uint8_t ti_290mfgn_monofull_lut_code[] = {
|
||||
0x32, 153,
|
||||
0x80, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0,
|
||||
0x10, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0,
|
||||
0x80, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0,
|
||||
0x10, 0x66, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0,
|
||||
0x00, 0x00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x00, 0x0, 0x0, 0x0,
|
||||
0x14, 0x8, 0x0, 0x0, 0x0, 0x0, 0x1,
|
||||
0xA, 0xA, 0x0, 0xA, 0xA, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x14, 0x8, 0x0, 0x1, 0x0, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x0, 0x0, 0x0,
|
||||
0xFE
|
||||
};
|
||||
|
||||
|
||||
static const uint8_t ti_290mfgn_gray4_lut_code[] = {
|
||||
0x32, 153,
|
||||
0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //VS L0 //2.28s
|
||||
0x20, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //VS L1
|
||||
0x28, 0x60, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //VS L2
|
||||
0x2A, 0x60, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //VS L3
|
||||
0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //VS L4
|
||||
0x00, 0x02, 0x00, 0x05, 0x14, 0x00, 0x00, //TP, SR, RP of Group0
|
||||
0x1E, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x01, //TP, SR, RP of Group1
|
||||
0x00, 0x02, 0x00, 0x05, 0x14, 0x00, 0x00, //TP, SR, RP of Group2
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group3
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group4
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group5
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group6
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group7
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group8
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group9
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group10
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //TP, SR, RP of Group11
|
||||
0x24, 0x22, 0x22, 0x22, 0x23, 0x32, 0x00, 0x00, 0x00, //FR, XON
|
||||
|
||||
0xFE // EOM
|
||||
};
|
||||
|
||||
// clang-format on
|
||||
|
||||
class ThinkInk_290_Grayscale4_EAAMFGN : public Adafruit_SSD1680 {
|
||||
public:
|
||||
ThinkInk_290_Grayscale4_EAAMFGN(int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t MISO, int16_t BUSY = -1)
|
||||
: Adafruit_SSD1680(296, 128, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_290_Grayscale4_EAAMFGN(int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1,
|
||||
SPIClass* spi = &SPI)
|
||||
: Adafruit_SSD1680(296, 128, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_GRAYSCALE4) {
|
||||
Adafruit_SSD1680::begin(true);
|
||||
inkmode = mode; // Preserve ink mode for ImageReader or others
|
||||
_xram_offset = 0;
|
||||
|
||||
if (mode == THINKINK_GRAYSCALE4) {
|
||||
setColorBuffer(1, false); // layer 0 inverted
|
||||
setBlackBuffer(0, false); // layer 1 inverted
|
||||
|
||||
_epd_init_code = ti_290mfgn_gray4_init_code;
|
||||
_epd_lut_code = ti_290mfgn_gray4_lut_code;
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b11;
|
||||
layer_colors[EPD_RED] = 0b01;
|
||||
layer_colors[EPD_GRAY] = 0b10;
|
||||
layer_colors[EPD_LIGHT] = 0b01;
|
||||
layer_colors[EPD_DARK] = 0b10;
|
||||
|
||||
default_refresh_delay = 3000;
|
||||
_display_update_val = 0xC7;
|
||||
|
||||
} else if (mode == THINKINK_MONO) {
|
||||
setColorBuffer(0, true); // layer 0 uninverted
|
||||
setBlackBuffer(0, true); // only one
|
||||
|
||||
_epd_init_code = ti_290mfgn_monofull_init_code;
|
||||
_epd_lut_code = ti_290mfgn_monofull_lut_code;
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b01;
|
||||
layer_colors[EPD_RED] = 0b01;
|
||||
layer_colors[EPD_GRAY] = 0b01;
|
||||
layer_colors[EPD_LIGHT] = 0b00;
|
||||
layer_colors[EPD_DARK] = 0b01;
|
||||
|
||||
default_refresh_delay = 800;
|
||||
_display_update_val = 0xC7;
|
||||
}
|
||||
|
||||
setRotation(0);
|
||||
|
||||
powerDown();
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _THINKINK_290_GRAYSCALE4_EAAMFGN_H
|
||||
|
|
@ -147,14 +147,14 @@ const uint8_t ti_290t5_gray4_lut_code[] = {
|
|||
// clang-format on
|
||||
|
||||
class ThinkInk_290_Grayscale4_T5 : public Adafruit_IL0373 {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_290_Grayscale4_T5(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_IL0373(296, 128, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_290_Grayscale4_T5(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_IL0373(296, 128, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_GRAYSCALE4) {
|
||||
|
|
|
|||
199
src/panels/ThinkInk_290_Grayscale4_T94.h
Normal file
199
src/panels/ThinkInk_290_Grayscale4_T94.h
Normal file
|
|
@ -0,0 +1,199 @@
|
|||
#ifndef _THINKINK_290_GRAYSCALE4_T94_H
|
||||
#define _THINKINK_290_GRAYSCALE4_T94_H
|
||||
|
||||
// This file is #included by Adafruit_ThinkInk.h and does not need to
|
||||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
// clang-format off
|
||||
/*
|
||||
static const uint8_t ti_290t5_gray4_init_code[] {
|
||||
IL0373_POWER_SETTING, 5, 0x03, 0x00, 0x2b, 0x2b, 0x13,
|
||||
IL0373_BOOSTER_SOFT_START, 3, 0x17, 0x17, 0x17,
|
||||
IL0373_POWER_ON, 0,
|
||||
0xFF, 200,
|
||||
IL0373_PANEL_SETTING, 1, 0x3F,
|
||||
IL0373_PLL, 1, 0x3C,
|
||||
IL0373_VCM_DC_SETTING, 1, 0x12,
|
||||
IL0373_CDI, 1, 0x97,
|
||||
0xFE // EOM
|
||||
};
|
||||
|
||||
static const uint8_t ti_290t5_monopart_init_code[] {
|
||||
IL0373_POWER_SETTING, 5, 0x03, 0x00, 0x2b, 0x2b, 0x03,
|
||||
IL0373_BOOSTER_SOFT_START, 3, 0x17, 0x17, 0x17,
|
||||
IL0373_POWER_ON, 0,
|
||||
0xFF, 200,
|
||||
IL0373_PANEL_SETTING, 2, 0xbF, 0x0d,
|
||||
IL0373_PLL, 1, 0x3C,
|
||||
IL0373_VCM_DC_SETTING, 1, 0x12,
|
||||
IL0373_CDI, 1, 0x47,
|
||||
0xFE // EOM
|
||||
};
|
||||
|
||||
static const uint8_t ti_290t5_monofull_init_code[] {
|
||||
IL0373_BOOSTER_SOFT_START, 3, 0x17, 0x17, 0x17,
|
||||
IL0373_POWER_ON, 0,
|
||||
0xFF, 200,
|
||||
IL0373_PANEL_SETTING, 2, 0x1f, 0x0d,
|
||||
IL0373_CDI, 1, 0x97,
|
||||
0xFE // EOM
|
||||
};
|
||||
|
||||
static const uint8_t ti_290t5_monopart_lut_code[] = {
|
||||
// const unsigned char lut_vcom1[]
|
||||
0x20, 44,
|
||||
0x00, 0x01, 0x0E, 0x00, 0x00, 0x01,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
// const unsigned char lut_ww1[]
|
||||
0x21, 42,
|
||||
0x00, 0x01, 0x0E, 0x00, 0x00, 0x01,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// const unsigned char lut_bw1[]
|
||||
0x22, 42,
|
||||
0x20, 0x01, 0x0E, 0x00, 0x00, 0x01,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// const unsigned char lut_wb1[]
|
||||
0x23, 42,
|
||||
0x10, 0x01, 0x0E, 0x00, 0x00, 0x01,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// const unsigned char lut_bb1[]
|
||||
0x24, 42,
|
||||
0x00, 0x01, 0x0E, 0x00, 0x00, 0x01,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
0xFE // EOM
|
||||
};
|
||||
|
||||
const uint8_t ti_290t5_gray4_lut_code[] = {
|
||||
//const unsigned char lut_vcom[] =
|
||||
0x20, 42,
|
||||
0x00, 0x0A, 0x00, 0x00, 0x00, 0x01,
|
||||
0x60, 0x14, 0x14, 0x00, 0x00, 0x01,
|
||||
0x00, 0x14, 0x00, 0x00, 0x00, 0x01,
|
||||
0x00, 0x13, 0x0A, 0x01, 0x00, 0x01,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
//const unsigned char lut_ww[] ={
|
||||
0x21, 42,
|
||||
0x40, 0x0A, 0x00, 0x00, 0x00, 0x01,
|
||||
0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
|
||||
0x10, 0x14, 0x0A, 0x00, 0x00, 0x01,
|
||||
0xA0, 0x13, 0x01, 0x00, 0x00, 0x01,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
//const unsigned char lut_bw[] ={
|
||||
0x22, 42,
|
||||
0x40, 0x0A, 0x00, 0x00, 0x00, 0x01,
|
||||
0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
|
||||
0x00, 0x14, 0x0A, 0x00, 0x00, 0x01,
|
||||
0x99, 0x0C, 0x01, 0x03, 0x04, 0x01,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
//const unsigned char lut_wb[] ={
|
||||
0x23, 42,
|
||||
0x40, 0x0A, 0x00, 0x00, 0x00, 0x01,
|
||||
0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
|
||||
0x00, 0x14, 0x0A, 0x00, 0x00, 0x01,
|
||||
0x99, 0x0B, 0x04, 0x04, 0x01, 0x01,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
//const unsigned char lut_bb[] ={
|
||||
0x24, 42,
|
||||
0x80, 0x0A, 0x00, 0x00, 0x00, 0x01,
|
||||
0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
|
||||
0x20, 0x14, 0x0A, 0x00, 0x00, 0x01,
|
||||
0x50, 0x13, 0x01, 0x00, 0x00, 0x01,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
0xFE // EOM
|
||||
};
|
||||
*/
|
||||
|
||||
// clang-format on
|
||||
|
||||
class ThinkInk_290_Grayscale4_T94 : public Adafruit_SSD1680 {
|
||||
public:
|
||||
ThinkInk_290_Grayscale4_T94(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_SSD1680(296, 128, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_290_Grayscale4_T94(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_SSD1680(296, 128, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_GRAYSCALE4) {
|
||||
Adafruit_SSD1680::begin(true);
|
||||
setColorBuffer(0, true); // layer 0 uninverted
|
||||
setBlackBuffer(1, true); // layer 1 uninverted
|
||||
|
||||
inkmode = mode; // Preserve ink mode for ImageReader or others
|
||||
|
||||
/*
|
||||
if (mode == THINKINK_GRAYSCALE4) {
|
||||
_epd_init_code = ti_290t5_gray4_init_code;
|
||||
_epd_lut_code = ti_290t5_gray4_lut_code;
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b11;
|
||||
layer_colors[EPD_RED] = 0b01;
|
||||
layer_colors[EPD_GRAY] = 0b10;
|
||||
layer_colors[EPD_LIGHT] = 0b01;
|
||||
layer_colors[EPD_DARK] = 0b10;
|
||||
} else if (mode == THINKINK_MONO) {
|
||||
_epd_init_code = ti_290t5_monofull_init_code;
|
||||
_epd_partial_init_code = ti_290t5_monopart_init_code;
|
||||
_epd_partial_lut_code = ti_290t5_monopart_lut_code;
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b11;
|
||||
layer_colors[EPD_BLACK] = 0b01;
|
||||
layer_colors[EPD_RED] = 0b01;
|
||||
layer_colors[EPD_GRAY] = 0b01;
|
||||
layer_colors[EPD_LIGHT] = 0b10;
|
||||
layer_colors[EPD_DARK] = 0b01;
|
||||
}
|
||||
*/
|
||||
|
||||
default_refresh_delay = 800;
|
||||
|
||||
powerDown();
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _THINKINK_290_GRAYSCALE4_T94_H
|
||||
|
|
@ -5,14 +5,14 @@
|
|||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_290_Mono_BN : public Adafruit_SSD1680 {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_290_Mono_BN(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_SSD1680(296, 128, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_290_Mono_BN(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_SSD1680(296, 128, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_290_Mono_M06 : public Adafruit_UC8151D {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_290_Mono_M06(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_UC8151D(296, 128, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_290_Mono_M06(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_UC8151D(296, 128, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_290_Tricolor_RH : public Adafruit_SSD1680 {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_290_Tricolor_RH(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_SSD1680(296, 128, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_290_Tricolor_RH(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_SSD1680(296, 128, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_290_Tricolor_Z10 : public Adafruit_IL0373 {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_290_Tricolor_Z10(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_IL0373(296, 128, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_290_Tricolor_Z10(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_IL0373(296, 128, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_290_Tricolor_Z13 : public Adafruit_UC8151D {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_290_Tricolor_Z13(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_UC8151D(296, 128, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_290_Tricolor_Z13(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_UC8151D(296, 128, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
@ -32,7 +32,7 @@ class ThinkInk_290_Tricolor_Z13 : public Adafruit_UC8151D {
|
|||
layer_colors[EPD_LIGHT] = 0b00;
|
||||
layer_colors[EPD_DARK] = 0b01;
|
||||
|
||||
default_refresh_delay = 13000;
|
||||
default_refresh_delay = 1000;
|
||||
setRotation(0);
|
||||
powerDown();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_290_Tricolor_Z94 : public Adafruit_SSD1680 {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_290_Tricolor_Z94(int8_t SID, int8_t SCLK, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t SRCS, int8_t MISO,
|
||||
int8_t BUSY = -1)
|
||||
: Adafruit_SSD1680(296, 128, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_290_Tricolor_Z94(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_SSD1680(296, 128, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
#ifndef _THINKINK_352_QUADCOLOR_AJHE5_H
|
||||
#define _THINKINK_352_QUADCOLOR_AJHE5_H
|
||||
|
||||
// This file is #included by Adafruit_ThinkInk.h and does not need to
|
||||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_352_Quadcolor_AJHE5 : public Adafruit_JD79667 {
|
||||
public:
|
||||
ThinkInk_352_Quadcolor_AJHE5(int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t MISO, int16_t BUSY = -1)
|
||||
: Adafruit_JD79667(180, 384, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_352_Quadcolor_AJHE5(int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1,
|
||||
SPIClass* spi = &SPI)
|
||||
: Adafruit_JD79667(180, 384, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_QUADCOLOR) {
|
||||
Adafruit_JD79667::begin(true);
|
||||
|
||||
inkmode = mode; // Preserve ink mode for ImageReader or others
|
||||
|
||||
default_refresh_delay = 13000;
|
||||
setRotation(1);
|
||||
powerDown();
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _THINKINK_352_Quad
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
#ifndef _THINKINK_370_MONO_BAAMFGN_H
|
||||
#define _THINKINK_370_MONO_BAAMFGN_H
|
||||
|
||||
// This file is #included by Adafruit_ThinkInk.h and does not need to
|
||||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
const uint8_t uc8253_mono_init_code[]{UC8253_POWERON,
|
||||
0, // soft reset
|
||||
0xFF,
|
||||
50, // busy wait
|
||||
UC8253_VCOM_CDI,
|
||||
1,
|
||||
0x97,
|
||||
UC8253_PANELSETTING,
|
||||
2,
|
||||
0b11011111,
|
||||
0x8D,
|
||||
0xFE};
|
||||
|
||||
class ThinkInk_370_Mono_BAAMFGN : public Adafruit_UC8253 {
|
||||
public:
|
||||
ThinkInk_370_Mono_BAAMFGN(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_UC8253(416, 240, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_370_Mono_BAAMFGN(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_UC8253(416, 240, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
Adafruit_UC8253::begin(true);
|
||||
|
||||
setColorBuffer(1, true);
|
||||
setBlackBuffer(1, true);
|
||||
|
||||
inkmode = mode; // Preserve ink mode for ImageReader or others
|
||||
_epd_init_code = uc8253_mono_init_code;
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b01;
|
||||
layer_colors[EPD_RED] = 0b01;
|
||||
layer_colors[EPD_GRAY] = 0b01;
|
||||
layer_colors[EPD_LIGHT] = 0b00;
|
||||
layer_colors[EPD_DARK] = 0b01;
|
||||
|
||||
default_refresh_delay = 1000;
|
||||
setRotation(0);
|
||||
// DO NOT power down again!
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _THINKINK_370_MONO_BAAMFGN_H
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
#ifndef _THINKINK_370_TRI_BABMFGNR_H
|
||||
#define _THINKINK_370_TRI_BABMFGNR_H
|
||||
|
||||
// This file is #included by Adafruit_ThinkInk.h and does not need to
|
||||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
const uint8_t uc8253_tricolor_init_code[]{UC8253_POWERON,
|
||||
0, // soft reset
|
||||
0xFF,
|
||||
50, // busy wait
|
||||
UC8253_PANELSETTING,
|
||||
2,
|
||||
0b11001111,
|
||||
0x8D,
|
||||
0xFE};
|
||||
|
||||
class ThinkInk_370_Tricolor_BABMFGNR : public Adafruit_UC8253 {
|
||||
public:
|
||||
ThinkInk_370_Tricolor_BABMFGNR(int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t MISO, int16_t BUSY = -1)
|
||||
: Adafruit_UC8253(416, 240, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_370_Tricolor_BABMFGNR(int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1,
|
||||
SPIClass* spi = &SPI)
|
||||
: Adafruit_UC8253(416, 240, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
Adafruit_UC8253::begin(true);
|
||||
|
||||
setColorBuffer(0, true);
|
||||
setBlackBuffer(1, false);
|
||||
|
||||
inkmode = mode; // Preserve ink mode for ImageReader or others
|
||||
_epd_init_code = uc8253_tricolor_init_code;
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b10;
|
||||
layer_colors[EPD_RED] = 0b01;
|
||||
layer_colors[EPD_GRAY] = 0b01;
|
||||
layer_colors[EPD_LIGHT] = 0b00;
|
||||
layer_colors[EPD_DARK] = 0b01;
|
||||
|
||||
default_refresh_delay = 13000;
|
||||
setRotation(0);
|
||||
// DO NOT power down again!
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _THINKINK_370_TRI_BABMFGNR_H
|
||||
|
|
@ -1,149 +0,0 @@
|
|||
#ifndef _THINKINK_420_GRAY4_MFGN_H
|
||||
#define _THINKINK_420_GRAY4_MFGN_H
|
||||
|
||||
// This file is #included by Adafruit_ThinkInk.h and does not need to
|
||||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
static const uint8_t ti_420mfgn_monofull_init_code[]{
|
||||
SSD1683_SW_RESET,
|
||||
0, // 0x12 - Software reset
|
||||
0xFF,
|
||||
50, // Wait for busy (20ms delay)
|
||||
|
||||
SSD1683_DISP_CTRL1,
|
||||
2, // 0x21 - Display update control
|
||||
0x40, // Display update control 1
|
||||
0x00, // Display update control 2
|
||||
|
||||
SSD1683_WRITE_BORDER,
|
||||
1, // 0x3C - Border waveform control
|
||||
0x05, // Border color/waveform
|
||||
|
||||
SSD1683_DATA_MODE,
|
||||
1, // 0x11 - Data entry mode
|
||||
0x03, // Y decrement, X increment
|
||||
|
||||
0xFE // End of initialization
|
||||
};
|
||||
|
||||
static const uint8_t ti_420mfgn_gray4_init_code[]{
|
||||
SSD1683_SW_RESET,
|
||||
0, // 0x12 - Software reset
|
||||
0xFF,
|
||||
50, // Wait for busy (20ms delay)
|
||||
|
||||
SSD1683_DISP_CTRL1,
|
||||
2, // 0x21 - Display update control
|
||||
0x00, // Display update control 1
|
||||
0x00, // Display update control 2
|
||||
|
||||
SSD1683_WRITE_BORDER,
|
||||
1, // 0x3C - Border waveform control
|
||||
0x03, // Border color/waveform
|
||||
|
||||
SSD1683_BOOST_SOFTSTART,
|
||||
4,
|
||||
0x8B,
|
||||
0x9C,
|
||||
0xA4,
|
||||
0x0F,
|
||||
|
||||
SSD1683_DATA_MODE,
|
||||
1, // 0x11 - Data entry mode
|
||||
0x03, // Y decrement, X increment
|
||||
|
||||
SSD1683_END_OPTION,
|
||||
1,
|
||||
0x07, // LUT[227]
|
||||
SSD1683_GATE_VOLTAGE,
|
||||
1,
|
||||
0x17,
|
||||
SSD1683_SOURCE_VOLTAGE,
|
||||
3,
|
||||
0x41,
|
||||
0xA8,
|
||||
0x32, // LUT[229~231]
|
||||
SSD1683_WRITE_VCOM,
|
||||
1,
|
||||
0x30, // LUT[232]
|
||||
0xFE // End of initialization
|
||||
};
|
||||
|
||||
static const uint8_t ti_420mfgn_gray4_lut_code[] = {
|
||||
0x32, 227, 0x01, 0x0A, 0x1B, 0x0F, 0x03, 0x01, 0x01, 0x05, 0x0A, 0x01,
|
||||
0x0A, 0x01, 0x01, 0x01, 0x05, 0x08, 0x03, 0x02, 0x04, 0x01, 0x01, 0x01,
|
||||
0x04, 0x04, 0x02, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
|
||||
0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x0A, 0x1B, 0x0F,
|
||||
0x03, 0x01, 0x01, 0x05, 0x4A, 0x01, 0x8A, 0x01, 0x01, 0x01, 0x05, 0x48,
|
||||
0x03, 0x82, 0x84, 0x01, 0x01, 0x01, 0x84, 0x84, 0x82, 0x00, 0x01, 0x01,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x01, 0x01, 0x0A, 0x1B, 0x8F, 0x03, 0x01, 0x01, 0x05, 0x4A, 0x01,
|
||||
0x8A, 0x01, 0x01, 0x01, 0x05, 0x48, 0x83, 0x82, 0x04, 0x01, 0x01, 0x01,
|
||||
0x04, 0x04, 0x02, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
|
||||
0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x8A, 0x1B, 0x8F,
|
||||
0x03, 0x01, 0x01, 0x05, 0x4A, 0x01, 0x8A, 0x01, 0x01, 0x01, 0x05, 0x48,
|
||||
0x83, 0x02, 0x04, 0x01, 0x01, 0x01, 0x04, 0x04, 0x02, 0x00, 0x01, 0x01,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x01, 0x01, 0x8A, 0x9B, 0x8F, 0x03, 0x01, 0x01, 0x05, 0x4A, 0x01,
|
||||
0x8A, 0x01, 0x01, 0x01, 0x05, 0x48, 0x03, 0x42, 0x04, 0x01, 0x01, 0x01,
|
||||
0x04, 0x04, 0x42, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
|
||||
0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
|
||||
0x00,
|
||||
0xFE // EOM
|
||||
};
|
||||
|
||||
class ThinkInk_420_Grayscale4_MFGN : public Adafruit_SSD1683 {
|
||||
public:
|
||||
ThinkInk_420_Grayscale4_MFGN(int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t MISO, int16_t BUSY = -1)
|
||||
: Adafruit_SSD1683(300, 400, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_420_Grayscale4_MFGN(int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1,
|
||||
SPIClass* spi = &SPI)
|
||||
: Adafruit_SSD1683(300, 400, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
Adafruit_SSD1683::begin(true);
|
||||
inkmode = mode; // Preserve ink mode for ImageReader or others
|
||||
|
||||
if (mode == THINKINK_GRAYSCALE4) {
|
||||
setColorBuffer(1, true); // layer 0 iunnverted
|
||||
setBlackBuffer(0, true); // layer 1 uninverted
|
||||
|
||||
_epd_init_code = ti_420mfgn_gray4_init_code;
|
||||
_epd_lut_code = ti_420mfgn_gray4_lut_code;
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b11;
|
||||
layer_colors[EPD_RED] = 0b01;
|
||||
layer_colors[EPD_GRAY] = 0b10;
|
||||
layer_colors[EPD_LIGHT] = 0b01;
|
||||
layer_colors[EPD_DARK] = 0b10;
|
||||
|
||||
_display_update_val = 0xCF;
|
||||
|
||||
} else if (mode == THINKINK_MONO) {
|
||||
_epd_init_code = ti_420mfgn_monofull_init_code;
|
||||
setColorBuffer(0, true); // layer 0 uninverted
|
||||
setBlackBuffer(0, true); // only one buffer
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b01;
|
||||
layer_colors[EPD_RED] = 0b01;
|
||||
layer_colors[EPD_GRAY] = 0b01;
|
||||
layer_colors[EPD_LIGHT] = 0b00;
|
||||
layer_colors[EPD_DARK] = 0b01;
|
||||
|
||||
_display_update_val = 0xF7;
|
||||
}
|
||||
setRotation(1);
|
||||
default_refresh_delay = 1000;
|
||||
|
||||
powerDown();
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _THINKINK_420_GRAY4_MFGN_H
|
||||
|
|
@ -72,15 +72,15 @@ static const uint8_t ti_420t2_gray4_lut_code[] = {
|
|||
// clang-format on
|
||||
|
||||
class ThinkInk_420_Grayscale4_T2 : public Adafruit_IL0398 {
|
||||
private:
|
||||
public:
|
||||
private:
|
||||
public:
|
||||
ThinkInk_420_Grayscale4_T2(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_IL0398(300, 400, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_420_Grayscale4_T2(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_IL0398(300, 400, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_420_Mono_BN : public Adafruit_SSD1619 {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_420_Mono_BN(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_SSD1619(300, 400, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_420_Mono_BN(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_SSD1619(300, 400, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -4,15 +4,15 @@
|
|||
#include "Adafruit_EPD.h"
|
||||
|
||||
class ThinkInk_420_Mono_M06 : public Adafruit_UC8276 {
|
||||
private:
|
||||
public:
|
||||
private:
|
||||
public:
|
||||
ThinkInk_420_Mono_M06(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_UC8276(300, 400, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_420_Mono_M06(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_UC8276(300, 400, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -1,148 +0,0 @@
|
|||
#ifndef _THINKINK_420_TRICOLOR_MFGNR_H
|
||||
#define _THINKINK_420_TRICOLOR_MFGNR_H
|
||||
|
||||
// This file is #included by Adafruit_ThinkInk.h and does not need to
|
||||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
static const uint8_t ti_420mfgnr_tri_init_code[]{
|
||||
SSD1683_SW_RESET,
|
||||
0, // 0x12 - Software reset
|
||||
0xFF,
|
||||
50, // Wait for busy (20ms delay)
|
||||
|
||||
SSD1683_WRITE_BORDER,
|
||||
1, // 0x3C - Border waveform control
|
||||
0x05, // Border color/waveform
|
||||
|
||||
SSD1683_TEMP_CONTROL,
|
||||
1,
|
||||
0x80, // 0x18 read temp
|
||||
|
||||
SSD1683_DATA_MODE,
|
||||
1, // 0x11 - Data entry mode
|
||||
0x03, // Y decrement, X increment
|
||||
|
||||
0xFE // End of initialization
|
||||
};
|
||||
|
||||
static const uint8_t ti_420mfgnr_gray4_init_code[]{
|
||||
SSD1683_SW_RESET,
|
||||
0, // 0x12 - Software reset
|
||||
0xFF,
|
||||
50, // Wait for busy (20ms delay)
|
||||
|
||||
SSD1683_DISP_CTRL1,
|
||||
2, // 0x21 - Display update control
|
||||
0x00, // Display update control 1
|
||||
0x00, // Display update control 2
|
||||
|
||||
SSD1683_WRITE_BORDER,
|
||||
1, // 0x3C - Border waveform control
|
||||
0x03, // Border color/waveform
|
||||
|
||||
SSD1683_BOOST_SOFTSTART,
|
||||
4,
|
||||
0x8B,
|
||||
0x9C,
|
||||
0xA4,
|
||||
0x0F,
|
||||
|
||||
SSD1683_DATA_MODE,
|
||||
1, // 0x11 - Data entry mode
|
||||
0x03, // Y decrement, X increment
|
||||
|
||||
SSD1683_END_OPTION,
|
||||
1,
|
||||
0x07, // LUT[227]
|
||||
SSD1683_GATE_VOLTAGE,
|
||||
1,
|
||||
0x17,
|
||||
SSD1683_SOURCE_VOLTAGE,
|
||||
3,
|
||||
0x41,
|
||||
0xA8,
|
||||
0x32, // LUT[229~231]
|
||||
SSD1683_WRITE_VCOM,
|
||||
1,
|
||||
0x30, // LUT[232]
|
||||
0xFE // End of initialization
|
||||
};
|
||||
|
||||
static const uint8_t ti_420mfgnr_gray4_lut_code[] = {
|
||||
0x32, 227, 0x01, 0x0A, 0x1B, 0x0F, 0x03, 0x01, 0x01, 0x05, 0x0A, 0x01,
|
||||
0x0A, 0x01, 0x01, 0x01, 0x05, 0x08, 0x03, 0x02, 0x04, 0x01, 0x01, 0x01,
|
||||
0x04, 0x04, 0x02, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
|
||||
0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x0A, 0x1B, 0x0F,
|
||||
0x03, 0x01, 0x01, 0x05, 0x4A, 0x01, 0x8A, 0x01, 0x01, 0x01, 0x05, 0x48,
|
||||
0x03, 0x82, 0x84, 0x01, 0x01, 0x01, 0x84, 0x84, 0x82, 0x00, 0x01, 0x01,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x01, 0x01, 0x0A, 0x1B, 0x8F, 0x03, 0x01, 0x01, 0x05, 0x4A, 0x01,
|
||||
0x8A, 0x01, 0x01, 0x01, 0x05, 0x48, 0x83, 0x82, 0x04, 0x01, 0x01, 0x01,
|
||||
0x04, 0x04, 0x02, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
|
||||
0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x8A, 0x1B, 0x8F,
|
||||
0x03, 0x01, 0x01, 0x05, 0x4A, 0x01, 0x8A, 0x01, 0x01, 0x01, 0x05, 0x48,
|
||||
0x83, 0x02, 0x04, 0x01, 0x01, 0x01, 0x04, 0x04, 0x02, 0x00, 0x01, 0x01,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x01, 0x01, 0x8A, 0x9B, 0x8F, 0x03, 0x01, 0x01, 0x05, 0x4A, 0x01,
|
||||
0x8A, 0x01, 0x01, 0x01, 0x05, 0x48, 0x03, 0x42, 0x04, 0x01, 0x01, 0x01,
|
||||
0x04, 0x04, 0x42, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
|
||||
0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
|
||||
0x00,
|
||||
0xFE // EOM
|
||||
};
|
||||
|
||||
class ThinkInk_420_Tricolor_MFGNR : public Adafruit_SSD1683 {
|
||||
public:
|
||||
ThinkInk_420_Tricolor_MFGNR(int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t MISO, int16_t BUSY = -1)
|
||||
: Adafruit_SSD1683(300, 400, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_420_Tricolor_MFGNR(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_SSD1683(300, 400, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
Adafruit_SSD1683::begin(true);
|
||||
inkmode = mode; // Preserve ink mode for ImageReader or others
|
||||
|
||||
if (mode == THINKINK_GRAYSCALE4) {
|
||||
setColorBuffer(1, true); // layer 0 iunnverted
|
||||
setBlackBuffer(0, true); // layer 1 uninverted
|
||||
|
||||
_epd_init_code = ti_420mfgnr_gray4_init_code;
|
||||
_epd_lut_code = ti_420mfgnr_gray4_lut_code;
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b11;
|
||||
layer_colors[EPD_RED] = 0b01;
|
||||
layer_colors[EPD_GRAY] = 0b10;
|
||||
layer_colors[EPD_LIGHT] = 0b01;
|
||||
layer_colors[EPD_DARK] = 0b10;
|
||||
|
||||
_display_update_val = 0xCF;
|
||||
default_refresh_delay = 3000;
|
||||
} else if (mode == THINKINK_TRICOLOR) {
|
||||
setBlackBuffer(0, true);
|
||||
setColorBuffer(1, false);
|
||||
|
||||
_epd_init_code = ti_420mfgnr_tri_init_code;
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b01;
|
||||
layer_colors[EPD_RED] = 0b10;
|
||||
layer_colors[EPD_GRAY] = 0b10;
|
||||
layer_colors[EPD_LIGHT] = 0b00;
|
||||
layer_colors[EPD_DARK] = 0b01;
|
||||
|
||||
_display_update_val = 0xF7;
|
||||
default_refresh_delay = 13000;
|
||||
}
|
||||
setRotation(1);
|
||||
|
||||
powerDown();
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _THINKINK_420_TRICOLOR_MFGNR_H
|
||||
|
|
@ -5,14 +5,14 @@
|
|||
// #include anything else to pick up the EPD header or ink mode enum.
|
||||
|
||||
class ThinkInk_420_Tricolor_RW : public Adafruit_SSD1619 {
|
||||
public:
|
||||
public:
|
||||
ThinkInk_420_Tricolor_RW(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_SSD1619(300, 400, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_420_Tricolor_RW(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_SSD1619(300, 400, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
|
|
|
|||
|
|
@ -4,15 +4,15 @@
|
|||
#include "Adafruit_EPD.h"
|
||||
|
||||
class ThinkInk_420_Tricolor_Z21 : public Adafruit_UC8276 {
|
||||
private:
|
||||
public:
|
||||
private:
|
||||
public:
|
||||
ThinkInk_420_Tricolor_Z21(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_UC8276(300, 400, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_420_Tricolor_Z21(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
int16_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
: Adafruit_UC8276(300, 400, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
|
|
|
|||
|
|
@ -1,75 +0,0 @@
|
|||
#ifndef _THINKINK_583_MONO_AAAMFGN_H
|
||||
#define _THINKINK_583_MONO_AAAMFGN_H
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
const uint8_t uc8179_mono_init_code[]{UC8179_POWERSETTING,
|
||||
4,
|
||||
0x07, // VGH=20V
|
||||
0x07, // VGL=-20V
|
||||
0x3F, // VDH=15V
|
||||
0x3F, // VDL=-15V
|
||||
|
||||
UC8179_POWERON,
|
||||
0,
|
||||
0xFF,
|
||||
100, // busy wait
|
||||
|
||||
UC8179_PANELSETTING,
|
||||
1,
|
||||
0b010111, // BW OTP LUT
|
||||
|
||||
UC8179_TRES,
|
||||
4,
|
||||
0x02,
|
||||
0x88,
|
||||
0x01,
|
||||
0xE0,
|
||||
|
||||
UC8179_DUALSPI,
|
||||
1,
|
||||
0x00,
|
||||
|
||||
UC8179_WRITE_VCOM,
|
||||
2,
|
||||
0x10,
|
||||
0x07,
|
||||
UC8179_TCON,
|
||||
1,
|
||||
0x22,
|
||||
|
||||
0xFE};
|
||||
|
||||
class ThinkInk_583_Mono_AAAMFGN : public Adafruit_UC8179 {
|
||||
private:
|
||||
public:
|
||||
ThinkInk_583_Mono_AAAMFGN(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_UC8179(648, 480, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_583_Mono_AAAMFGN(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_UC8179(648, 480, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
Adafruit_UC8179::begin(true);
|
||||
setColorBuffer(1, false); // layer 1 uninverted
|
||||
setBlackBuffer(1, false); // only one buffer
|
||||
|
||||
_epd_init_code = uc8179_mono_init_code;
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b01;
|
||||
layer_colors[EPD_RED] = 0b10;
|
||||
layer_colors[EPD_GRAY] = 0b10;
|
||||
layer_colors[EPD_LIGHT] = 0b00;
|
||||
layer_colors[EPD_DARK] = 0b01;
|
||||
|
||||
default_refresh_delay = 3000;
|
||||
setRotation(0);
|
||||
powerDown();
|
||||
};
|
||||
};
|
||||
|
||||
#endif // _THINKINK_583_MONO_AAAMFGN
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
#ifndef _THINKINK_583_TRI_AABMFGNR_H
|
||||
#define _THINKINK_583_TRI_AABMFGNR_H
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
// clang-format off
|
||||
|
||||
const uint8_t uc8179_tricolor_init_code[] {
|
||||
UC8179_POWERSETTING, 4,
|
||||
0x07, // VGH=20V
|
||||
0x07, // VGL=-20V
|
||||
0x3F, // VDH=15V
|
||||
0x3F, // VDL=-15V
|
||||
|
||||
UC8179_POWERON, 0,
|
||||
0xFF, 100, // busy wait
|
||||
|
||||
UC8179_PANELSETTING, 1,
|
||||
0b000111, // Tricolor OTP LUT
|
||||
|
||||
UC8179_TRES, 4,
|
||||
0x02, 0x88, 0x01, 0xE0,
|
||||
|
||||
UC8179_DUALSPI, 1, 0x00,
|
||||
|
||||
UC8179_WRITE_VCOM, 2, 0x90, 0x07,
|
||||
UC8179_TCON, 1, 0x22,
|
||||
|
||||
0xFE};
|
||||
|
||||
// clang-format on
|
||||
|
||||
class ThinkInk_583_Tricolor_AABMFGNR : public Adafruit_UC8179 {
|
||||
private:
|
||||
public:
|
||||
ThinkInk_583_Tricolor_AABMFGNR(int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t MISO, int16_t BUSY = -1)
|
||||
: Adafruit_UC8179(648, 480, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_583_Tricolor_AABMFGNR(int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1,
|
||||
SPIClass* spi = &SPI)
|
||||
: Adafruit_UC8179(648, 480, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
Adafruit_EPD::begin(true);
|
||||
|
||||
setBlackBuffer(0, false);
|
||||
setColorBuffer(1, false);
|
||||
|
||||
_epd_init_code = uc8179_tricolor_init_code;
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b01;
|
||||
layer_colors[EPD_RED] = 0b10;
|
||||
layer_colors[EPD_GRAY] = 0b10;
|
||||
layer_colors[EPD_LIGHT] = 0b00;
|
||||
layer_colors[EPD_DARK] = 0b01;
|
||||
|
||||
default_refresh_delay = 13000;
|
||||
setRotation(0);
|
||||
// DO NOT power down again!
|
||||
};
|
||||
};
|
||||
|
||||
#endif // _THINKINK_583_TRI_AAAMFGNR
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
#ifndef _THINKINK_750_MONO_AAAMFGN_H
|
||||
#define _THINKINK_750_MONO_AAAMFGN_H
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
const uint8_t uc8179_750_mono_init_code[]{UC8179_POWERSETTING,
|
||||
4,
|
||||
0x07, // VGH=20V
|
||||
0x07, // VGL=-20V
|
||||
0x3F, // VDH=15V
|
||||
0x3F, // VDL=-15V
|
||||
|
||||
UC8179_POWERON,
|
||||
0,
|
||||
0xFF,
|
||||
100, // busy wait
|
||||
|
||||
UC8179_PANELSETTING,
|
||||
1,
|
||||
0b010111, // BW OTP LUT
|
||||
|
||||
UC8179_TRES,
|
||||
4,
|
||||
0x03,
|
||||
0x20,
|
||||
0x01,
|
||||
0xE0,
|
||||
|
||||
UC8179_DUALSPI,
|
||||
1,
|
||||
0x00,
|
||||
|
||||
UC8179_WRITE_VCOM,
|
||||
2,
|
||||
0x10,
|
||||
0x07,
|
||||
UC8179_TCON,
|
||||
1,
|
||||
0x22,
|
||||
|
||||
0xFE};
|
||||
|
||||
class ThinkInk_750_Mono_AAAMFGN : public Adafruit_UC8179 {
|
||||
private:
|
||||
public:
|
||||
ThinkInk_750_Mono_AAAMFGN(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_UC8179(800, 480, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_750_Mono_AAAMFGN(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_UC8179(800, 480, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
Adafruit_UC8179::begin(true);
|
||||
setColorBuffer(1, false); // layer 1 uninverted
|
||||
setBlackBuffer(1, false); // only one buffer
|
||||
|
||||
_epd_init_code = uc8179_750_mono_init_code;
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b01;
|
||||
layer_colors[EPD_RED] = 0b10;
|
||||
layer_colors[EPD_GRAY] = 0b10;
|
||||
layer_colors[EPD_LIGHT] = 0b00;
|
||||
layer_colors[EPD_DARK] = 0b01;
|
||||
|
||||
default_refresh_delay = 3000;
|
||||
setRotation(0);
|
||||
// DO NOT power down again!
|
||||
};
|
||||
};
|
||||
|
||||
#endif // _THINKINK_750_MONO_AAAMFGN
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
#ifndef _THINKINK_750_TRI_AABMFGNR_H
|
||||
#define _THINKINK_750_TRI_AABMFGNR_H
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
// clang-format off
|
||||
|
||||
const uint8_t uc8179_750_tricolor_init_code[] {
|
||||
UC8179_POWERSETTING, 4,
|
||||
0x07, // VGH=20V
|
||||
0x07, // VGL=-20V
|
||||
0x3F, // VDH=15V
|
||||
0x3F, // VDL=-15V
|
||||
|
||||
UC8179_POWERON, 0,
|
||||
0xFF, 100, // busy wait
|
||||
|
||||
UC8179_PANELSETTING, 1,
|
||||
0b000111, // Tricolor OTP LUT
|
||||
|
||||
UC8179_TRES, 4,
|
||||
0x03, 0x20, 0x01, 0xE0,
|
||||
|
||||
UC8179_DUALSPI, 1, 0x00,
|
||||
|
||||
UC8179_WRITE_VCOM, 2, 0x90, 0x07,
|
||||
UC8179_TCON, 1, 0x22,
|
||||
|
||||
0xFE};
|
||||
|
||||
// clang-format on
|
||||
|
||||
class ThinkInk_750_Tricolor_AABMFGNR : public Adafruit_UC8179 {
|
||||
private:
|
||||
public:
|
||||
ThinkInk_750_Tricolor_AABMFGNR(int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t MISO, int16_t BUSY = -1)
|
||||
: Adafruit_UC8179(800, 480, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_750_Tricolor_AABMFGNR(int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1,
|
||||
SPIClass* spi = &SPI)
|
||||
: Adafruit_UC8179(800, 480, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
Adafruit_UC8179::begin(true);
|
||||
|
||||
setBlackBuffer(0, false);
|
||||
setColorBuffer(1, false);
|
||||
|
||||
_epd_init_code = uc8179_750_tricolor_init_code;
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b01;
|
||||
layer_colors[EPD_RED] = 0b10;
|
||||
layer_colors[EPD_GRAY] = 0b10;
|
||||
layer_colors[EPD_LIGHT] = 0b00;
|
||||
layer_colors[EPD_DARK] = 0b01;
|
||||
|
||||
default_refresh_delay = 13000;
|
||||
setRotation(0);
|
||||
// DO NOT power down again!
|
||||
};
|
||||
};
|
||||
|
||||
#endif // _THINKINK_750_TRI_AABMFGNR
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
#include "Adafruit_IL0371.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define BUSY_WAIT 500
|
||||
|
|
@ -41,8 +40,8 @@ Adafruit_IL0371::Adafruit_IL0371(int width, int height, int8_t SID, int8_t SCLK,
|
|||
Adafruit_IL0371::Adafruit_IL0371(int width, int height, int8_t SID, int8_t SCLK,
|
||||
int8_t DC, int8_t RST, int8_t CS, int8_t BUSY)
|
||||
: Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, BUSY) {
|
||||
bw_buf = (uint8_t*)malloc(width * height / 8);
|
||||
red_buf = (uint8_t*)malloc(width * height / 8);
|
||||
bw_buf = (uint8_t *)malloc(width * height / 8);
|
||||
red_buf = (uint8_t *)malloc(width * height / 8);
|
||||
#endif
|
||||
bw_bufsize = width * height / 8;
|
||||
red_bufsize = bw_bufsize;
|
||||
|
|
@ -80,8 +79,8 @@ Adafruit_IL0371::Adafruit_IL0371(int width, int height, int8_t DC, int8_t RST,
|
|||
Adafruit_IL0371::Adafruit_IL0371(int width, int height, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t BUSY)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, BUSY) {
|
||||
bw_buf = (uint8_t*)malloc(width * height / 8);
|
||||
red_buf = (uint8_t*)malloc(width * height / 8);
|
||||
bw_buf = (uint8_t *)malloc(width * height / 8);
|
||||
red_buf = (uint8_t *)malloc(width * height / 8);
|
||||
#endif
|
||||
bw_bufsize = width * height / 8;
|
||||
red_bufsize = bw_bufsize;
|
||||
|
|
@ -270,22 +269,22 @@ void Adafruit_IL0371::drawPixel(int16_t x, int16_t y, uint16_t color) {
|
|||
if ((x < 0) || (x >= width()) || (y < 0) || (y >= height()))
|
||||
return;
|
||||
|
||||
uint8_t* pBuf;
|
||||
uint8_t *pBuf;
|
||||
|
||||
// check rotation, move pixel around if necessary
|
||||
switch (getRotation()) {
|
||||
case 1:
|
||||
EPD_swap(x, y);
|
||||
x = WIDTH - x - 1;
|
||||
break;
|
||||
case 2:
|
||||
x = WIDTH - x - 1;
|
||||
y = HEIGHT - y - 1;
|
||||
break;
|
||||
case 3:
|
||||
EPD_swap(x, y);
|
||||
y = HEIGHT - y - 1;
|
||||
break;
|
||||
case 1:
|
||||
EPD_swap(x, y);
|
||||
x = WIDTH - x - 1;
|
||||
break;
|
||||
case 2:
|
||||
x = WIDTH - x - 1;
|
||||
y = HEIGHT - y - 1;
|
||||
break;
|
||||
case 3:
|
||||
EPD_swap(x, y);
|
||||
y = HEIGHT - y - 1;
|
||||
break;
|
||||
}
|
||||
// make our buffer happy
|
||||
x = (x == 0 ? 1 : x);
|
||||
|
|
@ -308,16 +307,16 @@ void Adafruit_IL0371::drawPixel(int16_t x, int16_t y, uint16_t color) {
|
|||
#endif
|
||||
// x is which column
|
||||
switch (color) {
|
||||
case EPD_WHITE:
|
||||
*pBuf |= (1 << (7 - y % 8));
|
||||
break;
|
||||
case EPD_RED:
|
||||
case EPD_BLACK:
|
||||
*pBuf &= ~(1 << (7 - y % 8));
|
||||
break;
|
||||
case EPD_INVERSE:
|
||||
*pBuf ^= (1 << (7 - y % 8));
|
||||
break;
|
||||
case EPD_WHITE:
|
||||
*pBuf |= (1 << (7 - y % 8));
|
||||
break;
|
||||
case EPD_RED:
|
||||
case EPD_BLACK:
|
||||
*pBuf &= ~(1 << (7 - y % 8));
|
||||
break;
|
||||
case EPD_INVERSE:
|
||||
*pBuf ^= (1 << (7 - y % 8));
|
||||
break;
|
||||
}
|
||||
#ifdef USE_EXTERNAL_SRAM
|
||||
sram.write8(addr, *pBuf);
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue