Compare commits
84 commits
fix-warnin
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cc4fd3dfb4 | ||
|
|
3f8b7ea8d9 | ||
|
|
80643d5b0c | ||
|
|
37fe47ea51 | ||
|
|
c46477cda2 | ||
|
|
79da22fb66 | ||
|
|
5d0833603e | ||
|
|
801165f33f | ||
|
|
5b096fab87 | ||
|
|
d488075fb4 | ||
|
|
a612173810 | ||
|
|
4d4e502227 | ||
|
|
083a70958c | ||
|
|
df4063d9dc | ||
|
|
308619ed00 | ||
|
|
69f02e7933 | ||
|
|
95c2d6fbf5 | ||
|
|
a44b60d8f4 | ||
|
|
f7e8ca45e7 | ||
|
|
cd1d48f3fd | ||
|
|
f418a1dcf7 | ||
|
|
d4312885ae | ||
|
|
be5a27cb39 | ||
|
|
963343b280 | ||
|
|
bb035c969b | ||
|
|
4edb6e088b | ||
|
|
9765aeb7ac | ||
|
|
6efdf4291b | ||
|
|
dfa6cff692 | ||
|
|
13b24818d6 | ||
|
|
47ff649e73 | ||
|
|
a8ca6fc749 | ||
|
|
7230e706ad | ||
|
|
8277f296c0 | ||
|
|
da099393d6 | ||
|
|
ea58ebcd65 | ||
|
|
d3932bb27f | ||
|
|
2fd13d4f15 | ||
|
|
011353ac59 | ||
|
|
6338104729 | ||
|
|
12a2e2ad05 | ||
|
|
bc5ae39a7c | ||
|
|
53d1eccaa1 | ||
|
|
683d1fff0d | ||
|
|
523894116d | ||
|
|
157135b7a7 | ||
|
|
f378c46988 | ||
|
|
db5ae5e7ec | ||
|
|
4f6edb6cf5 | ||
|
|
8eb9d661d1 | ||
|
|
47a0a7e514 | ||
|
|
ceefa7c19d | ||
|
|
7f1d737a74 | ||
|
|
3ae6cc4459 | ||
|
|
6c7aff424a | ||
|
|
a3b0330fbf | ||
|
|
75b1046247 | ||
|
|
0663fb9483 | ||
|
|
b42e71db9e | ||
|
|
7a01f4b9cd | ||
|
|
08571489fb | ||
|
|
86189b4e64 | ||
|
|
f8ba1652f2 | ||
|
|
b0e23af441 | ||
|
|
4047f5a91f | ||
|
|
9ae987b6fc | ||
|
|
924fc56581 | ||
|
|
a0e709b828 | ||
|
|
677349f899 | ||
|
|
d53eec3f17 | ||
|
|
ce568ece50 | ||
|
|
7a20f8057a | ||
|
|
d7079afe01 | ||
|
|
490bd39f80 | ||
|
|
57c7555b58 | ||
|
|
15932dac39 | ||
|
|
c5a5b187c8 | ||
|
|
0fd656ebc2 | ||
|
|
43a47c0130 | ||
|
|
129f1d0625 | ||
|
|
95438c0331 | ||
|
|
f6ba6a42ff | ||
|
|
66601e986a | ||
|
|
d2ddc3c74a |
110 changed files with 4778 additions and 1058 deletions
13
.clang-format
Normal file
13
.clang-format
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
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
|
||||
6
.github/workflows/githubci.yml
vendored
6
.github/workflows/githubci.yml
vendored
|
|
@ -21,11 +21,11 @@ jobs:
|
|||
- 'metro_m4_tinyusb'
|
||||
|
||||
steps:
|
||||
- uses: actions/setup-python@v1
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.8'
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: adafruit/ci-arduino
|
||||
path: ci
|
||||
|
|
|
|||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -5,3 +5,4 @@ Doxyfile*
|
|||
doxygen_sqlite3.db
|
||||
html
|
||||
.DS_STORE
|
||||
*~
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# Adafruit EPD Library [](https://travis-ci.com/adafruit/Adafruit_EPD)[](http://adafruit.github.io/Adafruit_EPD/html/index.html)
|
||||
# Adafruit EPD Library [](https://github.com/adafruit/Adafruit_EPD/actions)[](http://adafruit.github.io/Adafruit_EPD/html/index.html)
|
||||
|
||||
<img src="https://cdn-shop.adafruit.com/970x728/3625-03.jpg" height="300"/>
|
||||
|
||||
|
|
|
|||
|
|
@ -9,64 +9,83 @@
|
|||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
|
||||
#define EPD_CS 10
|
||||
#define EPD_DC 9
|
||||
#define SRAM_CS 11
|
||||
#define EPD_RESET 5 // can set to -1 and share with microcontroller Reset!
|
||||
#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
|
||||
|
||||
// Uncomment the following line if you are using 1.54" EPD with IL0373
|
||||
//Adafruit_IL0373 display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// Adafruit_IL0373 display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
// Uncomment the following line if you are using 1.54" EPD with SSD1680
|
||||
//Adafruit_SSD1680 display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// Adafruit_SSD1680 display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
// Uncomment the following line if you are using 1.54" EPD with SSD1608
|
||||
//Adafruit_SSD1608 display(200, 200, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// Adafruit_SSD1608 display(200, 200, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
// Uncomment the following line if you are using 1.54" EPD with SSD1681
|
||||
//Adafruit_SSD1681 display(200, 200, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// Adafruit_SSD1681 display(200, 200, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
// Uncomment the following line if you are using 1.54" EPD with UC8151D
|
||||
//Adafruit_UC8151D display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
|
||||
// Adafruit_UC8151D display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// Uncomment the following line if you are using 2.13" EPD with SSD1680
|
||||
//Adafruit_SSD1680 display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// Adafruit_SSD1680 display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// Uncomment the following line if you are using 2.13" EPD with SSD1675
|
||||
//Adafruit_SSD1675 display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// Adafruit_SSD1675 display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// Uncomment the following line if you are using 2.13" EPD with SSD1675B
|
||||
//Adafruit_SSD1675B display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// Adafruit_SSD1675B display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// Uncomment the following line if you are using 2.13" EPD with UC8151D
|
||||
//Adafruit_UC8151D display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// Adafruit_UC8151D display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// Uncomment the following line if you are using 2.13" EPD with IL0373
|
||||
Adafruit_IL0373 display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
Adafruit_IL0373 display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY,
|
||||
EPD_SPI);
|
||||
//#define FLEXIBLE_213
|
||||
|
||||
|
||||
// Uncomment the following line if you are using 2.7" EPD with IL91874
|
||||
//Adafruit_IL91874 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS);
|
||||
// Adafruit_IL91874 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// Uncomment the following line if you are using 2.7" EPD with EK79686
|
||||
//Adafruit_EK79686 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
|
||||
// Adafruit_EK79686 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// Uncomment the following line if you are using 2.9" EPD with IL0373
|
||||
//Adafruit_IL0373 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
//#define FLEXIBLE_290
|
||||
// Adafruit_IL0373 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI); #define FLEXIBLE_290
|
||||
|
||||
// Uncomment the following line if you are using 2.9" EPD with SSD1680
|
||||
//Adafruit_SSD1680 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// Adafruit_SSD1680 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// Uncomment the following line if you are using 2.9" EPD with UC8151D
|
||||
//Adafruit_UC8151D display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
|
||||
// Adafruit_UC8151D display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
#define COLOR1 EPD_BLACK
|
||||
#define COLOR2 EPD_RED
|
||||
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
// while (!Serial) { delay(10); }
|
||||
|
|
@ -82,7 +101,14 @@ void setup() {
|
|||
|
||||
// large block of text
|
||||
display.clearBuffer();
|
||||
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. ", COLOR1);
|
||||
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. ",
|
||||
COLOR1);
|
||||
display.display();
|
||||
|
||||
delay(5000);
|
||||
|
|
@ -93,7 +119,8 @@ void setup() {
|
|||
}
|
||||
|
||||
for (int16_t i = 0; i < display.height(); i += 4) {
|
||||
display.drawLine(display.width()-1, 0, 0, i, COLOR2); // on grayscale this will be mid-gray
|
||||
display.drawLine(display.width() - 1, 0, 0, i,
|
||||
COLOR2); // on grayscale this will be mid-gray
|
||||
}
|
||||
display.display();
|
||||
}
|
||||
|
|
@ -102,7 +129,6 @@ void loop() {
|
|||
// don't do anything!
|
||||
}
|
||||
|
||||
|
||||
void testdrawtext(const char *text, uint16_t color) {
|
||||
display.setCursor(0, 0);
|
||||
display.setTextColor(color);
|
||||
|
|
|
|||
|
|
@ -39,6 +39,11 @@
|
|||
#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
|
||||
#endif
|
||||
|
||||
#define EPD_RESET -1 // can set to -1 and share with microcontroller Reset!
|
||||
#define EPD_BUSY -1 // can set to -1 to not use a pin (will wait a fixed delay)
|
||||
|
|
|
|||
|
|
@ -9,19 +9,51 @@
|
|||
|
||||
#include "Adafruit_ThinkInk.h"
|
||||
|
||||
#define EPD_DC 10 // can be any pin, but required!
|
||||
#define EPD_CS 9 // can be any pin, but required!
|
||||
#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 // can set to -1 to not use a pin (uses a lot of RAM!)
|
||||
#define EPD_RESET 8 // can set to -1 and share with chip Reset (can't deep sleep)
|
||||
#define SRAM_CS 6
|
||||
#define EPD_RESET 8 // can set to -1 and share with microcontroller Reset!
|
||||
#define EPD_SPI &SPI // primary SPI
|
||||
#endif
|
||||
|
||||
//ThinkInk_154_Grayscale4_T8 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
//ThinkInk_213_Grayscale4_T5 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// ThinkInk_154_Grayscale4_T8 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);
|
||||
// 4.2" Grayscale display
|
||||
//ThinkInk_420_Grayscale4_T2 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
|
||||
// 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);
|
||||
|
||||
#define COLOR1 EPD_BLACK
|
||||
#define COLOR2 EPD_LIGHT
|
||||
|
|
@ -50,23 +82,32 @@ void loop() {
|
|||
display.clearBuffer();
|
||||
display.setTextSize(3);
|
||||
display.setTextColor(EPD_BLACK);
|
||||
display.setCursor(20, 40);
|
||||
display.setCursor((display.width() - 180) / 2, (display.height() - 24) / 2);
|
||||
if (gray) {
|
||||
display.print("Grayscale");
|
||||
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));
|
||||
}
|
||||
} else {
|
||||
display.print("Monochrome");
|
||||
}
|
||||
|
||||
|
||||
gray = !gray;
|
||||
|
||||
display.display();
|
||||
delay(1000);
|
||||
delay(2000);
|
||||
|
||||
display.clearBuffer();
|
||||
display.fillRect(display.width() / 4, 0, display.width() / 4, display.height(), EPD_LIGHT);
|
||||
display.fillRect((display.width() * 2) / 4, 0, display.width() / 4, display.height(), EPD_DARK);
|
||||
display.fillRect((display.width() * 3) / 4, 0, display.width() / 4, display.height(), EPD_BLACK);
|
||||
display.fillRect(display.width() / 4, 0, display.width() / 4,
|
||||
display.height(), EPD_LIGHT);
|
||||
display.fillRect((display.width() * 2) / 4, 0, display.width() / 4,
|
||||
display.height(), EPD_DARK);
|
||||
display.fillRect((display.width() * 3) / 4, 0, display.width() / 4,
|
||||
display.height(), EPD_BLACK);
|
||||
display.display();
|
||||
delay(2000);
|
||||
|
||||
|
|
@ -74,7 +115,14 @@ void loop() {
|
|||
// 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. ", COLOR1);
|
||||
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. ",
|
||||
COLOR1);
|
||||
display.display();
|
||||
delay(2000);
|
||||
|
||||
|
|
@ -84,13 +132,13 @@ void loop() {
|
|||
}
|
||||
|
||||
for (int16_t i = 0; i < display.height(); i += 4) {
|
||||
display.drawLine(display.width() - 1, 0, 0, i, COLOR2); // on grayscale this will be mid-gray
|
||||
display.drawLine(display.width() - 1, 0, 0, i,
|
||||
COLOR2); // on grayscale this will be mid-gray
|
||||
}
|
||||
display.display();
|
||||
delay(2000);
|
||||
}
|
||||
|
||||
|
||||
void testdrawtext(const char *text, uint16_t color) {
|
||||
display.setCursor(0, 0);
|
||||
display.setTextColor(color);
|
||||
|
|
|
|||
|
|
@ -9,53 +9,86 @@
|
|||
|
||||
#include "Adafruit_ThinkInk.h"
|
||||
|
||||
#define EPD_CS 9
|
||||
#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_BUSY 7 // can set to -1 to not use a pin (will wait a fixed delay)
|
||||
#define EPD_SPI &SPI // primary SPI
|
||||
#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);
|
||||
// ThinkInk_154_Mono_D67 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 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);
|
||||
// ThinkInk_154_Mono_D27 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 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);
|
||||
|
||||
// ThinkInk_154_Mono_M10 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 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);
|
||||
ThinkInk_213_Mono_B72 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 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);
|
||||
// ThinkInk_213_Mono_B73 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 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);
|
||||
//ThinkInk_213_Mono_B74 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// 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);
|
||||
|
||||
// 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);
|
||||
// ThinkInk_213_Mono_M21 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" 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
|
||||
//ThinkInk_290_Grayscale4_T5 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// ThinkInk_290_Grayscale4_T5 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 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);
|
||||
// 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);
|
||||
|
||||
// 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);
|
||||
// ThinkInk_420_Mono_BN display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 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);
|
||||
// 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);
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
while (!Serial) { delay(10); }
|
||||
while (!Serial) {
|
||||
delay(10);
|
||||
}
|
||||
Serial.println("Adafruit EPD full update test in mono");
|
||||
display.begin(THINKINK_MONO);
|
||||
}
|
||||
|
|
@ -73,7 +106,8 @@ void loop() {
|
|||
|
||||
Serial.println("B/W rectangle demo");
|
||||
display.clearBuffer();
|
||||
display.fillRect(display.width()/2, 0, display.width()/2, display.height(), EPD_BLACK);
|
||||
display.fillRect(display.width() / 2, 0, display.width() / 2,
|
||||
display.height(), EPD_BLACK);
|
||||
display.display();
|
||||
|
||||
delay(2000);
|
||||
|
|
@ -82,7 +116,14 @@ void loop() {
|
|||
// 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);
|
||||
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(2000);
|
||||
|
|
@ -100,7 +141,6 @@ void loop() {
|
|||
delay(2000);
|
||||
}
|
||||
|
||||
|
||||
void testdrawtext(const char *text, uint16_t color) {
|
||||
display.setCursor(0, 0);
|
||||
display.setTextColor(color);
|
||||
|
|
|
|||
|
|
@ -9,18 +9,33 @@
|
|||
|
||||
#include "Adafruit_ThinkInk.h"
|
||||
|
||||
#define EPD_CS 9
|
||||
#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_BUSY 7 // can set to -1 to not use a pin (will wait a fixed delay)
|
||||
#define EPD_SPI &SPI // primary SPI
|
||||
#endif
|
||||
|
||||
//ThinkInk_290_Grayscale4_T5 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
ThinkInk_154_Mono_D67 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// ThinkInk_290_Grayscale4_T5 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,
|
||||
EPD_SPI);
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
while (!Serial) { delay(10); }
|
||||
while (!Serial) {
|
||||
delay(10);
|
||||
}
|
||||
Serial.println("Adafruit counter");
|
||||
display.begin(THINKINK_MONO);
|
||||
display.setRotation(0);
|
||||
|
|
|
|||
114
examples/ThinkInk_quadcolor/ThinkInk_quadcolor.ino
Normal file
114
examples/ThinkInk_quadcolor/ThinkInk_quadcolor.ino
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
/***************************************************
|
||||
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);
|
||||
}
|
||||
|
|
@ -9,45 +9,101 @@
|
|||
|
||||
#include "Adafruit_ThinkInk.h"
|
||||
|
||||
#define EPD_DC 10 // can be any pin, but required!
|
||||
#define EPD_CS 9 // can be any pin, but required!
|
||||
#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 // can set to -1 to not use a pin (uses a lot of RAM!)
|
||||
#define EPD_RESET 8 // can set to -1 and share with chip Reset (can't deep sleep)
|
||||
#define SRAM_CS 6
|
||||
#define EPD_RESET 8 // can set to -1 and share with microcontroller Reset!
|
||||
#define EPD_SPI &SPI // primary SPI
|
||||
#endif
|
||||
|
||||
// 1.54" 152x152 Tricolor EPD with ILI0373 chipset
|
||||
//ThinkInk_154_Tricolor_Z17 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// ThinkInk_154_Tricolor_Z17 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 1.54" 152x152 Tricolor EPD with SSD1680 chipset
|
||||
//ThinkInk_154_Tricolor_RW display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// ThinkInk_154_Tricolor_RW display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 1.54" 200x200 Tricolor EPD with SSD1681 chipset
|
||||
//ThinkInk_154_Tricolor_Z90 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// ThinkInk_154_Tricolor_Z90 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 2.13" Tricolor EPD with SSD1680 chipset
|
||||
//ThinkInk_213_Tricolor_RW display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
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);
|
||||
// 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);
|
||||
// ThinkInk_270_Tricolor_C44 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 2.7" Tricolor Featherwing or Breakout with EK79686 chipset
|
||||
//ThinkInk_270_Tricolor_Z70 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);
|
||||
// 2.9" Tricolor Featherwing or Breakout with UC8151D chipset
|
||||
//ThinkInk_290_Tricolor_Z13 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// ThinkInk_290_Tricolor_Z10 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);
|
||||
//ThinkInk_420_Tricolor_Z21 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// 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_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) { delay(10); }
|
||||
while (!Serial) {
|
||||
delay(10);
|
||||
}
|
||||
Serial.println("Adafruit EPD full update test in red/black/white");
|
||||
display.begin(THINKINK_TRICOLOR);
|
||||
}
|
||||
|
|
@ -67,8 +123,10 @@ void loop() {
|
|||
|
||||
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.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();
|
||||
|
||||
delay(15000);
|
||||
|
|
@ -77,7 +135,14 @@ void loop() {
|
|||
// 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);
|
||||
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);
|
||||
|
|
@ -95,7 +160,6 @@ void loop() {
|
|||
delay(15000);
|
||||
}
|
||||
|
||||
|
||||
void testdrawtext(const char *text, uint16_t color) {
|
||||
display.setCursor(0, 0);
|
||||
display.setTextColor(color);
|
||||
|
|
|
|||
|
|
@ -7,21 +7,31 @@
|
|||
MIT license, all text above must be included in any redistribution
|
||||
****************************************************/
|
||||
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Adafruit_SPIFlash.h>
|
||||
#include <SPI.h>
|
||||
#include <SdFat.h>
|
||||
#include <Adafruit_SPIFlash.h>
|
||||
#include "Adafruit_EPD.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_CS 9
|
||||
#define EPD_DC 10
|
||||
#define SRAM_CS -1 // Use the build in memory, we need 133KB!
|
||||
#define EPD_RESET 6 // can set to -1 and share with microcontroller Reset!
|
||||
#define EPD_BUSY 5 // can set to -1 to not use a pin (will wait a fixed delay)
|
||||
#define EPD_SPI &SPI // primary SPI
|
||||
#endif
|
||||
|
||||
// Uncomment the following line if you are using ACeP 7 color 5.65"
|
||||
Adafruit_ACEP display(600, 448, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
Adafruit_ACEP display(600, 448, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY,
|
||||
EPD_SPI);
|
||||
|
||||
Adafruit_FlashTransport_QSPI flashTransport;
|
||||
Adafruit_SPIFlash flash(&flashTransport);
|
||||
|
|
@ -29,21 +39,27 @@ FatFileSystem fatfs;
|
|||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
while (!Serial) { delay(10); }
|
||||
while (!Serial) {
|
||||
delay(10);
|
||||
}
|
||||
|
||||
Serial.println("Adafruit ACeP EPD test");
|
||||
|
||||
if (!flash.begin()) {
|
||||
Serial.println("Error, failed to initialize flash chip!");
|
||||
while(1) delay(1);
|
||||
while (1)
|
||||
delay(1);
|
||||
}
|
||||
Serial.print("Flash chip JEDEC ID: 0x"); Serial.println(flash.getJEDECID(), HEX);
|
||||
Serial.print("Flash chip JEDEC ID: 0x");
|
||||
Serial.println(flash.getJEDECID(), HEX);
|
||||
// First call begin to mount the filesystem. Check that it returns true
|
||||
// to make sure the filesystem was mounted.
|
||||
if (!fatfs.begin(&flash)) {
|
||||
Serial.println("Error, failed to mount newly formatted filesystem!");
|
||||
Serial.println("Was the flash chip formatted with the fatfs_format example?");
|
||||
while(1) delay(1);
|
||||
Serial.println(
|
||||
"Was the flash chip formatted with the fatfs_format example?");
|
||||
while (1)
|
||||
delay(1);
|
||||
}
|
||||
Serial.println("Mounted filesystem!");
|
||||
File root = fatfs.open("/");
|
||||
|
|
@ -54,7 +70,8 @@ void setup() {
|
|||
display.clearBuffer();
|
||||
// draw 7 color bars
|
||||
for (uint8_t color = ACEP_COLOR_BLACK; color <= ACEP_COLOR_ORANGE; color++) {
|
||||
display.fillRect(display.width()*color/7, 0, display.width()/7, display.height(), color);
|
||||
display.fillRect(display.width() * color / 7, 0, display.width() / 7,
|
||||
display.height(), color);
|
||||
}
|
||||
display.display();
|
||||
}
|
||||
|
|
@ -62,15 +79,8 @@ void setup() {
|
|||
void loop() {
|
||||
bmpDraw("adafruit_characters.bmp", 0, 0);
|
||||
bmpDraw("adabot.bmp", 0, 0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// This function opens a Windows Bitmap (BMP) file and
|
||||
// displays it at the given coordinates. It's sped up
|
||||
// by reading many pixels worth of data at a time
|
||||
|
|
@ -95,7 +105,8 @@ bool bmpDraw(const char *filename, int16_t x, int16_t y) {
|
|||
uint8_t r, g, b;
|
||||
uint32_t pos = 0, startTime = millis();
|
||||
|
||||
if((x >= display.width()) || (y >= display.height())) return false;
|
||||
if ((x >= display.width()) || (y >= display.height()))
|
||||
return false;
|
||||
|
||||
Serial.println();
|
||||
Serial.print(F("Loading image '"));
|
||||
|
|
@ -110,17 +121,21 @@ bool bmpDraw(const char *filename, int16_t x, int16_t y) {
|
|||
|
||||
// Parse BMP header
|
||||
if (read16(bmpFile) == 0x4D42) { // BMP signature
|
||||
Serial.print(F("File size: ")); Serial.println(read32(bmpFile));
|
||||
Serial.print(F("File size: "));
|
||||
Serial.println(read32(bmpFile));
|
||||
(void)read32(bmpFile); // Read & ignore creator bytes
|
||||
bmpImageoffset = read32(bmpFile); // Start of image data
|
||||
Serial.print(F("Image Offset: ")); Serial.println(bmpImageoffset, DEC);
|
||||
Serial.print(F("Image Offset: "));
|
||||
Serial.println(bmpImageoffset, DEC);
|
||||
// Read DIB header
|
||||
Serial.print(F("Header size: ")); Serial.println(read32(bmpFile));
|
||||
Serial.print(F("Header size: "));
|
||||
Serial.println(read32(bmpFile));
|
||||
bmpWidth = read32(bmpFile);
|
||||
bmpHeight = read32(bmpFile);
|
||||
if (read16(bmpFile) == 1) { // # planes -- must be '1'
|
||||
bmpDepth = read16(bmpFile); // bits per pixel
|
||||
Serial.print(F("Bit Depth: ")); Serial.println(bmpDepth);
|
||||
Serial.print(F("Bit Depth: "));
|
||||
Serial.println(bmpDepth);
|
||||
if ((bmpDepth == 24) && (read32(bmpFile) == 0)) { // 0 = uncompressed
|
||||
|
||||
goodBmp = true; // Supported BMP format -- proceed!
|
||||
|
|
@ -182,13 +197,27 @@ bool bmpDraw(const char *filename, int16_t x, int16_t y) {
|
|||
|
||||
uint8_t c;
|
||||
switch (color) {
|
||||
case 0x000000: c = ACEP_COLOR_BLACK; break;
|
||||
case 0xFFFFFF: c = ACEP_COLOR_WHITE; break;
|
||||
case 0x00FF00: c = ACEP_COLOR_GREEN; break;
|
||||
case 0x0000FF: c = ACEP_COLOR_BLUE; break;
|
||||
case 0xFF0000: c = ACEP_COLOR_RED; break;
|
||||
case 0xFFFF00: c = ACEP_COLOR_YELLOW; break;
|
||||
case 0xFF8000: c = ACEP_COLOR_ORANGE; break;
|
||||
case 0x000000:
|
||||
c = ACEP_COLOR_BLACK;
|
||||
break;
|
||||
case 0xFFFFFF:
|
||||
c = ACEP_COLOR_WHITE;
|
||||
break;
|
||||
case 0x00FF00:
|
||||
c = ACEP_COLOR_GREEN;
|
||||
break;
|
||||
case 0x0000FF:
|
||||
c = ACEP_COLOR_BLUE;
|
||||
break;
|
||||
case 0xFF0000:
|
||||
c = ACEP_COLOR_RED;
|
||||
break;
|
||||
case 0xFFFF00:
|
||||
c = ACEP_COLOR_YELLOW;
|
||||
break;
|
||||
case 0xFF8000:
|
||||
c = ACEP_COLOR_ORANGE;
|
||||
break;
|
||||
default: {
|
||||
Serial.print("Unknown color 0x");
|
||||
Serial.println(color, HEX);
|
||||
|
|
@ -235,7 +264,6 @@ uint32_t read32(File &f) {
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
void printDirectory(File dir, int numTabs) {
|
||||
char filename[80];
|
||||
|
||||
|
|
|
|||
|
|
@ -7,38 +7,55 @@
|
|||
MIT license, all text above must be included in any redistribution
|
||||
****************************************************/
|
||||
|
||||
#include <Adafruit_GFX.h> // Core graphics library
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Adafruit_GFX.h> // Core graphics library
|
||||
|
||||
#define EPD_CS 10
|
||||
#define EPD_DC 9
|
||||
#define SRAM_CS 8
|
||||
#define EPD_RESET 5 // can set to -1 and share with microcontroller Reset!
|
||||
#define EPD_BUSY 3 // can set to -1 to not use a pin (will wait a fixed delay)
|
||||
#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
|
||||
|
||||
/* Uncomment the following line if you are using 1.54" tricolor EPD */
|
||||
//Adafruit_IL0373 display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// Adafruit_IL0373 display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
/* Uncomment the following line if you are using 1.54" monochrome EPD */
|
||||
//Adafruit_SSD1608 display(200, 200, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// Adafruit_SSD1608 display(200, 200, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
/* Uncomment the following line if you are using 2.13" tricolor EPD */
|
||||
Adafruit_IL0373 display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
Adafruit_IL0373 display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY,
|
||||
EPD_SPI);
|
||||
//#define FLEXIBLE_213
|
||||
|
||||
/* Uncomment the following line if you are using 2.13" monochrome 250*122 EPD */
|
||||
//Adafruit_SSD1675 display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// Adafruit_SSD1675 display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
/* Uncomment the following line if you are using 2.7" tricolor or grayscale EPD */
|
||||
//Adafruit_IL91874 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS);
|
||||
/* Uncomment the following line if you are using 2.7" tricolor or grayscale EPD
|
||||
*/
|
||||
// Adafruit_IL91874 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
/* Uncomment the following line if you are using 2.9" EPD */
|
||||
//Adafruit_IL0373 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
//#define FLEXIBLE_290
|
||||
// Adafruit_IL0373 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI); #define FLEXIBLE_290
|
||||
|
||||
/* Uncomment the following line if you are using 4.2" tricolor EPD */
|
||||
//Adafruit_IL0398 display(300, 400, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
|
||||
// Adafruit_IL0398 display(300, 400, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
float p = 3.1415926;
|
||||
|
||||
|
|
@ -57,8 +74,10 @@ void setup(void) {
|
|||
Serial.println("Initialized");
|
||||
|
||||
display.clearBuffer();
|
||||
display.fillRect(display.width()/3, 0, display.width()/3, display.height(), EPD_RED);
|
||||
display.fillRect((display.width()*2)/3, 0, display.width()/3, display.height(), EPD_BLACK);
|
||||
display.fillRect(display.width() / 3, 0, display.width() / 3,
|
||||
display.height(), EPD_RED);
|
||||
display.fillRect((display.width() * 2) / 3, 0, display.width() / 3,
|
||||
display.height(), EPD_BLACK);
|
||||
display.display();
|
||||
|
||||
delay(15 * 1000);
|
||||
|
|
@ -66,7 +85,14 @@ void setup(void) {
|
|||
// large block of text
|
||||
display.clearBuffer();
|
||||
display.fillScreen(EPD_WHITE);
|
||||
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);
|
||||
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);
|
||||
|
||||
delay(15 * 1000);
|
||||
|
||||
|
|
@ -118,9 +144,7 @@ void setup(void) {
|
|||
Serial.println("done");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
delay(500);
|
||||
}
|
||||
void loop() { delay(500); }
|
||||
|
||||
void testlines(uint16_t color) {
|
||||
display.clearBuffer();
|
||||
|
|
@ -183,7 +207,8 @@ void testdrawrects(uint16_t color) {
|
|||
display.clearBuffer();
|
||||
display.fillScreen(EPD_WHITE);
|
||||
for (int16_t x = 0; x < display.width(); x += 6) {
|
||||
display.drawRect(display.width()/2 -x/2, display.height()/2 -x/2 , x, x, color);
|
||||
display.drawRect(display.width() / 2 - x / 2, display.height() / 2 - x / 2,
|
||||
x, x, color);
|
||||
}
|
||||
display.display();
|
||||
}
|
||||
|
|
@ -192,8 +217,10 @@ void testfillrects(uint16_t color1, uint16_t color2) {
|
|||
display.clearBuffer();
|
||||
display.fillScreen(EPD_WHITE);
|
||||
for (int16_t x = display.width() - 1; x > 6; x -= 6) {
|
||||
display.fillRect(display.width()/2 -x/2, display.height()/2 -x/2 , x, x, color1);
|
||||
display.drawRect(display.width()/2 -x/2, display.height()/2 -x/2 , x, x, color2);
|
||||
display.fillRect(display.width() / 2 - x / 2, display.height() / 2 - x / 2,
|
||||
x, x, color1);
|
||||
display.drawRect(display.width() / 2 - x / 2, display.height() / 2 - x / 2,
|
||||
x, x, color2);
|
||||
}
|
||||
display.display();
|
||||
}
|
||||
|
|
@ -232,7 +259,8 @@ void testtriangles() {
|
|||
x -= 4;
|
||||
y += 4;
|
||||
z -= 4;
|
||||
if(t == 8) color = EPD_RED;
|
||||
if (t == 8)
|
||||
color = EPD_RED;
|
||||
}
|
||||
display.display();
|
||||
}
|
||||
|
|
@ -254,7 +282,8 @@ void testroundrects() {
|
|||
y += 3;
|
||||
w -= 4;
|
||||
h -= 6;
|
||||
if(i == 7) color = EPD_RED;
|
||||
if (i == 7)
|
||||
color = EPD_RED;
|
||||
}
|
||||
color = EPD_BLACK;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,40 +7,57 @@
|
|||
MIT license, all text above must be included in any redistribution
|
||||
****************************************************/
|
||||
|
||||
#include <Adafruit_GFX.h> // Core graphics library
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Adafruit_GFX.h> // Core graphics library
|
||||
|
||||
// Default is FeatherWing pinouts
|
||||
|
||||
#define EPD_CS 10
|
||||
#define EPD_DC 9
|
||||
#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 4 // can set to -1 and share with microcontroller Reset!
|
||||
#define EPD_BUSY -1 // can set to -1 to not use a pin (will wait a fixed delay)
|
||||
#define EPD_RESET 8 // can set to -1 and share with microcontroller Reset!
|
||||
#define EPD_SPI &SPI // primary SPI
|
||||
#endif
|
||||
|
||||
/* Uncomment the following line if you are using 1.54" tricolor EPD */
|
||||
//Adafruit_IL0373 display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// Adafruit_IL0373 display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
/* Uncomment the following line if you are using 1.54" monochrome EPD */
|
||||
//Adafruit_SSD1608 display(200, 200, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// Adafruit_SSD1608 display(200, 200, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
/* Uncomment the following line if you are using 2.13" tricolor EPD */
|
||||
Adafruit_IL0373 display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
Adafruit_IL0373 display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY,
|
||||
EPD_SPI);
|
||||
//#define FLEXIBLE_213
|
||||
|
||||
/* Uncomment the following line if you are using 2.13" monochrome 250*122 EPD */
|
||||
//Adafruit_SSD1675 display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// Adafruit_SSD1675 display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
/* Uncomment the following line if you are using 2.7" tricolor or grayscale EPD */
|
||||
//Adafruit_IL91874 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS);
|
||||
/* Uncomment the following line if you are using 2.7" tricolor or grayscale EPD
|
||||
*/
|
||||
// Adafruit_IL91874 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
/* Uncomment the following line if you are using 2.9" EPD */
|
||||
//Adafruit_IL0373 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
//#define FLEXIBLE_290
|
||||
// Adafruit_IL0373 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI); #define FLEXIBLE_290
|
||||
|
||||
/* Uncomment the following line if you are using 4.2" tricolor EPD */
|
||||
//Adafruit_IL0398 display(300, 400, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
|
||||
// Adafruit_IL0398 display(300, 400, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
void setup(void) {
|
||||
Serial.begin(115200);
|
||||
|
|
|
|||
|
|
@ -7,37 +7,55 @@
|
|||
MIT license, all text above must be included in any redistribution
|
||||
****************************************************/
|
||||
|
||||
#include <Adafruit_GFX.h> // Core graphics library
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Adafruit_GFX.h> // Core graphics library
|
||||
|
||||
#define EPD_CS 10
|
||||
#define EPD_DC 9
|
||||
#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 5 // can set to -1 and share with microcontroller Reset!
|
||||
#define EPD_BUSY -1 // can set to -1 to not use a pin (will wait a fixed delay)
|
||||
#define EPD_RESET 8 // can set to -1 and share with microcontroller Reset!
|
||||
#define EPD_SPI &SPI // primary SPI
|
||||
#endif
|
||||
|
||||
/* Uncomment the following line if you are using 1.54" tricolor EPD */
|
||||
//Adafruit_IL0373 display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// Adafruit_IL0373 display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
/* Uncomment the following line if you are using 1.54" monochrome EPD */
|
||||
//Adafruit_SSD1608 display(200, 200, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// Adafruit_SSD1608 display(200, 200, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
/* Uncomment the following line if you are using 2.13" tricolor EPD */
|
||||
Adafruit_IL0373 display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
Adafruit_IL0373 display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY,
|
||||
EPD_SPI);
|
||||
//#define FLEXIBLE_213
|
||||
|
||||
/* Uncomment the following line if you are using 2.13" monochrome 250*122 EPD */
|
||||
//Adafruit_SSD1675 display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// Adafruit_SSD1675 display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
/* Uncomment the following line if you are using 2.7" tricolor or grayscale EPD */
|
||||
//Adafruit_IL91874 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS);
|
||||
/* Uncomment the following line if you are using 2.7" tricolor or grayscale EPD
|
||||
*/
|
||||
// Adafruit_IL91874 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
/* Uncomment the following line if you are using 2.9" EPD */
|
||||
//Adafruit_IL0373 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
//#define FLEXIBLE_290
|
||||
// Adafruit_IL0373 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI); #define FLEXIBLE_290
|
||||
|
||||
/* Uncomment the following line if you are using 4.2" tricolor EPD */
|
||||
//Adafruit_IL0398 display(300, 400, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
|
||||
// Adafruit_IL0398 display(300, 400, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
void setup(void) {
|
||||
Serial.begin(115200);
|
||||
|
|
@ -61,7 +79,8 @@ void setup(void) {
|
|||
display.setCursor(10, 10);
|
||||
display.setTextSize(1);
|
||||
display.setTextColor(EPD_BLACK);
|
||||
display.print("Get as much education as you can. Nobody can take that away from you");
|
||||
display.print(
|
||||
"Get as much education as you can. Nobody can take that away from you");
|
||||
|
||||
display.setCursor(50, 70);
|
||||
display.setTextColor(EPD_RED);
|
||||
|
|
@ -70,6 +89,4 @@ void setup(void) {
|
|||
display.display();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
delay(500);
|
||||
}
|
||||
void loop() { delay(500); }
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
name=Adafruit EPD
|
||||
version=4.4.4
|
||||
version=4.6.4
|
||||
author=Adafruit
|
||||
maintainer=Adafruit <info@adafruit.com>
|
||||
sentence=ePaper display driver
|
||||
|
|
|
|||
21
license.txt
Normal file
21
license.txt
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
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,6 +34,7 @@
|
|||
*/
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
bool Adafruit_EPD::_isInTransaction = false;
|
||||
|
|
@ -53,9 +54,10 @@ bool Adafruit_EPD::_isInTransaction = false;
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_EPD::Adafruit_EPD(int width, int height, int8_t spi_mosi,
|
||||
int8_t spi_clock, int8_t DC, int8_t RST, int8_t CS,
|
||||
int8_t SRCS, int8_t spi_miso, int8_t BUSY)
|
||||
Adafruit_EPD::Adafruit_EPD(int width, int height, int16_t spi_mosi,
|
||||
int16_t spi_clock, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t spi_miso,
|
||||
int16_t BUSY)
|
||||
: Adafruit_GFX(width, height), sram(spi_mosi, spi_miso, spi_clock, SRCS) {
|
||||
_cs_pin = CS;
|
||||
_reset_pin = RST;
|
||||
|
|
@ -94,8 +96,9 @@ Adafruit_EPD::Adafruit_EPD(int width, int height, int8_t spi_mosi,
|
|||
@param spi the SPI bus to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_EPD::Adafruit_EPD(int width, int height, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t SRCS, int8_t BUSY, SPIClass *spi)
|
||||
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)
|
||||
: Adafruit_GFX(width, height), sram(SRCS) {
|
||||
_cs_pin = CS;
|
||||
_reset_pin = RST;
|
||||
|
|
@ -223,6 +226,7 @@ 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()) {
|
||||
|
|
@ -245,8 +249,16 @@ void Adafruit_EPD::drawPixel(int16_t x, int16_t y, uint16_t color) {
|
|||
if (_HEIGHT % 8 != 0) {
|
||||
_HEIGHT += 8 - (_HEIGHT % 8);
|
||||
}
|
||||
uint16_t addr = ((uint32_t)(WIDTH - 1 - x) * (uint32_t)_HEIGHT + y) / 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;
|
||||
}
|
||||
uint8_t black_c, color_c;
|
||||
// Serial.printf("0x%0x\n\r",addr);
|
||||
|
||||
if (use_sram) {
|
||||
black_c = sram.read8(blackbuffer_addr + addr);
|
||||
|
|
@ -263,16 +275,23 @@ 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 - y % 8));
|
||||
*color_pBuf &= ~(1 << (7 - bit_idx % 8));
|
||||
} else {
|
||||
*color_pBuf |= (1 << (7 - y % 8));
|
||||
*color_pBuf |= (1 << (7 - bit_idx % 8));
|
||||
}
|
||||
|
||||
if ((black_bit && blackInverted) || (!black_bit && !blackInverted)) {
|
||||
*black_pBuf &= ~(1 << (7 - y % 8));
|
||||
*black_pBuf &= ~(1 << (7 - bit_idx % 8));
|
||||
} else {
|
||||
*black_pBuf |= (1 << (7 - y % 8));
|
||||
*black_pBuf |= (1 << (7 - bit_idx % 8));
|
||||
}
|
||||
|
||||
if (use_sram) {
|
||||
|
|
@ -506,7 +525,7 @@ void Adafruit_EPD::clearDisplay() {
|
|||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_EPD::EPD_commandList(const uint8_t* init_code) {
|
||||
uint8_t buf[64];
|
||||
uint8_t buf[250];
|
||||
|
||||
while (init_code[0] != 0xFE) {
|
||||
uint8_t cmd = init_code[0];
|
||||
|
|
@ -519,7 +538,7 @@ void Adafruit_EPD::EPD_commandList(const uint8_t *init_code) {
|
|||
continue;
|
||||
}
|
||||
if (num_args > sizeof(buf)) {
|
||||
Serial.println("ERROR - buf not large enough!");
|
||||
Serial.println(F("ERROR - buf not large enough!"));
|
||||
while (1)
|
||||
delay(10);
|
||||
}
|
||||
|
|
@ -562,7 +581,7 @@ uint8_t Adafruit_EPD::EPD_command(uint8_t c, bool end) {
|
|||
|
||||
uint8_t data = SPItransfer(c);
|
||||
#ifdef EPD_DEBUG
|
||||
Serial.print("\tCommand: 0x");
|
||||
Serial.print(F("\tCommand: 0x"));
|
||||
Serial.println(c, HEX);
|
||||
#endif
|
||||
|
||||
|
|
@ -652,9 +671,8 @@ uint8_t Adafruit_EPD::SPItransfer(uint8_t d) {
|
|||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_EPD::csHigh() {
|
||||
|
||||
#ifdef BUSIO_USE_FAST_PINIO
|
||||
*csPort |= csPinMask;
|
||||
*csPort = *csPort | csPinMask;
|
||||
#else
|
||||
digitalWrite(_cs_pin, HIGH);
|
||||
#endif
|
||||
|
|
@ -671,14 +689,13 @@ void Adafruit_EPD::csHigh() {
|
|||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_EPD::csLow() {
|
||||
|
||||
if (!_isInTransaction) {
|
||||
spi_dev->beginTransaction();
|
||||
_isInTransaction = true;
|
||||
}
|
||||
|
||||
#ifdef BUSIO_USE_FAST_PINIO
|
||||
*csPort &= ~csPinMask;
|
||||
*csPort = *csPort & ~csPinMask;
|
||||
#else
|
||||
digitalWrite(_cs_pin, LOW);
|
||||
#endif
|
||||
|
|
@ -691,7 +708,7 @@ void Adafruit_EPD::csLow() {
|
|||
/**************************************************************************/
|
||||
void Adafruit_EPD::dcHigh() {
|
||||
#ifdef BUSIO_USE_FAST_PINIO
|
||||
*dcPort |= dcPinMask;
|
||||
*dcPort = *dcPort | dcPinMask;
|
||||
#else
|
||||
digitalWrite(_dc_pin, HIGH);
|
||||
#endif
|
||||
|
|
@ -704,7 +721,7 @@ void Adafruit_EPD::dcHigh() {
|
|||
/**************************************************************************/
|
||||
void Adafruit_EPD::dcLow() {
|
||||
#ifdef BUSIO_USE_FAST_PINIO
|
||||
*dcPort &= ~dcPinMask;
|
||||
*dcPort = *dcPort & ~dcPinMask;
|
||||
#else
|
||||
digitalWrite(_dc_pin, LOW);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -24,10 +24,11 @@
|
|||
|
||||
#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
|
||||
|
|
@ -40,14 +41,21 @@ enum {
|
|||
EPD_GRAY, ///< gray color ('red' on grayscale)
|
||||
EPD_DARK, ///< darker color
|
||||
EPD_LIGHT, ///< lighter color
|
||||
EPD_YELLOW, ///< fourth color on some displays
|
||||
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) \
|
||||
|
|
@ -64,11 +72,11 @@ typedef enum {
|
|||
/**************************************************************************/
|
||||
class Adafruit_EPD : public Adafruit_GFX {
|
||||
public:
|
||||
Adafruit_EPD(int width, int height, 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_EPD(int width, int height, int8_t DC, int8_t RST, int8_t CS,
|
||||
int8_t SRCS, int8_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
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);
|
||||
~Adafruit_EPD();
|
||||
|
||||
void begin(bool reset = true);
|
||||
|
|
@ -79,9 +87,13 @@ public:
|
|||
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;
|
||||
|
||||
void writeRAMFramebufferToEPD(uint8_t* buffer, uint32_t buffer_size,
|
||||
uint8_t EPDlocation, bool invertdata = false);
|
||||
void writeSRAMFramebufferToEPD(uint16_t SRAM_buffer_addr,
|
||||
|
|
@ -132,7 +144,7 @@ protected:
|
|||
virtual void powerDown(void) = 0;
|
||||
void hardwareReset(void);
|
||||
|
||||
int8_t _dc_pin, ///< data/command pin
|
||||
int16_t _dc_pin, ///< data/command pin
|
||||
_reset_pin, ///< reset pin
|
||||
_cs_pin, ///< chip select pin
|
||||
_busy_pin; ///< busy pin
|
||||
|
|
@ -158,12 +170,12 @@ protected:
|
|||
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*
|
||||
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
|
||||
|
|
@ -199,13 +211,18 @@ protected:
|
|||
#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,7 +1,6 @@
|
|||
#include "Adafruit_MCPSRAM.h"
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include <SPI.h>
|
||||
|
||||
/**************************************************************************/
|
||||
|
|
@ -13,8 +12,8 @@
|
|||
@param cs chip select pin
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_MCPSRAM::Adafruit_MCPSRAM(int8_t mosi, int8_t miso, int8_t sck,
|
||||
int8_t cs) {
|
||||
Adafruit_MCPSRAM::Adafruit_MCPSRAM(int16_t mosi, int16_t miso, int16_t sck,
|
||||
int16_t cs) {
|
||||
_mosi = mosi;
|
||||
_miso = miso;
|
||||
_sck = sck;
|
||||
|
|
@ -29,7 +28,7 @@ Adafruit_MCPSRAM::Adafruit_MCPSRAM(int8_t mosi, int8_t miso, int8_t sck,
|
|||
@param spi the SPI bus to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_MCPSRAM::Adafruit_MCPSRAM(int8_t cs, SPIClass *spi) {
|
||||
Adafruit_MCPSRAM::Adafruit_MCPSRAM(int16_t cs, SPIClass* spi) {
|
||||
_cs = cs;
|
||||
_spi = spi;
|
||||
hwSPI = true;
|
||||
|
|
@ -117,7 +116,6 @@ 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) {
|
||||
|
|
@ -147,7 +145,6 @@ 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) {
|
||||
|
|
@ -186,7 +183,6 @@ void Adafruit_MCPSRAM::write(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
|
||||
|
|
@ -195,7 +191,6 @@ 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) {
|
||||
|
|
@ -225,7 +220,6 @@ 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 {
|
||||
|
|
@ -319,7 +313,6 @@ 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) {
|
||||
|
|
@ -347,7 +340,6 @@ 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) {
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@
|
|||
/**************************************************************************/
|
||||
class Adafruit_MCPSRAM {
|
||||
public:
|
||||
Adafruit_MCPSRAM(int8_t mosi, int8_t miso, int8_t sck, int8_t cs);
|
||||
Adafruit_MCPSRAM(int8_t cs, SPIClass *spi = &SPI);
|
||||
Adafruit_MCPSRAM(int16_t mosi, int16_t miso, int16_t sck, int16_t cs);
|
||||
Adafruit_MCPSRAM(int16_t cs, SPIClass* spi = &SPI);
|
||||
~Adafruit_MCPSRAM() {}
|
||||
|
||||
void begin();
|
||||
|
|
@ -42,6 +42,6 @@ private:
|
|||
PortReg *mosiport, *clkport, *csport, *misoport;
|
||||
PortMask mosipinmask, clkpinmask, cspinmask, misopinmask;
|
||||
#endif
|
||||
int8_t _cs, _mosi, _miso, _sck;
|
||||
int16_t _cs, _mosi, _miso, _sck;
|
||||
SPIClass* _spi = NULL;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,36 +2,51 @@
|
|||
#define _ADAFRUIT_THINKINK_H_
|
||||
|
||||
#include "Adafruit_EPD.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_Tricolor_RW.h"
|
||||
#include "panels/ThinkInk_213_Tricolor_Z16.h"
|
||||
#include "panels/ThinkInk_270_Tricolor_C44.h"
|
||||
#include "panels/ThinkInk_270_Tricolor_Z70.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_420_Tricolor_RW.h"
|
||||
#include "panels/ThinkInk_420_Tricolor_Z21.h"
|
||||
|
||||
#include "panels/ThinkInk_154_Grayscale4_M05.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_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_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"
|
||||
|
||||
#endif // _ADAFRUIT_THINKINK_H_
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include "Adafruit_ACeP.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define BUSY_WAIT 500
|
||||
|
|
@ -38,11 +39,10 @@ const uint8_t acep_default_init_code[] {
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_ACEP::Adafruit_ACEP(int width, int height, int8_t SID, int8_t SCLK,
|
||||
int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t MISO, int8_t BUSY)
|
||||
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);
|
||||
}
|
||||
|
|
@ -75,10 +75,10 @@ Adafruit_ACEP::Adafruit_ACEP(int width, int height, int8_t SID, int8_t SCLK,
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_ACEP::Adafruit_ACEP(int width, int height, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t SRCS, int8_t BUSY, SPIClass *spi)
|
||||
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)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
}
|
||||
|
|
@ -128,7 +128,7 @@ void Adafruit_ACEP::deGhost() {
|
|||
uint32_t remaining = (600UL * 448UL / 2);
|
||||
while (remaining) {
|
||||
uint8_t block[256];
|
||||
uint32_t numbytes = min(remaining, sizeof(block));
|
||||
uint32_t numbytes = min(remaining, (uint32_t)sizeof(block));
|
||||
memset(block, 0x77, numbytes);
|
||||
EPD_data(block, numbytes);
|
||||
remaining -= numbytes;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
#ifndef LIB_ADAFRUIT_ACEP
|
||||
#define LIB_ADAFRUIT_ACEP
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define ACEP_PANEL_SETTING 0x00
|
||||
#define ACEP_POWER_SETTING 0x01
|
||||
#define ACEP_POWER_OFF 0x02
|
||||
|
|
@ -35,11 +36,11 @@
|
|||
/**************************************************************************/
|
||||
class Adafruit_ACEP : public Adafruit_EPD {
|
||||
public:
|
||||
Adafruit_ACEP(int width, int height, 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_ACEP(int width, int height, int8_t DC, int8_t RST, int8_t CS,
|
||||
int8_t SRCS, int8_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
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);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include "Adafruit_EK79686.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define BUSY_WAIT 500
|
||||
|
|
@ -41,12 +42,11 @@ const uint8_t ek79686_default_init_code[] {
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_EK79686::Adafruit_EK79686(int width, int height, int8_t SID,
|
||||
int8_t SCLK, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t SRCS, int8_t MISO,
|
||||
int8_t BUSY)
|
||||
Adafruit_EK79686::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)
|
||||
: Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
|
||||
|
||||
if ((width % 8) != 0) {
|
||||
width += 8 - (width % 8);
|
||||
}
|
||||
|
|
@ -78,11 +78,10 @@ Adafruit_EK79686::Adafruit_EK79686(int width, int height, int8_t SID,
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_EK79686::Adafruit_EK79686(int width, int height, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t SRCS, int8_t BUSY,
|
||||
SPIClass *spi)
|
||||
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)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
#ifndef LIB_ADAFRUIT_EK79686
|
||||
#define LIB_ADAFRUIT_EK79686
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EK79686_PSR 0x00
|
||||
#define EK79686_PWR 0x01
|
||||
#define EK79686_POF 0x02
|
||||
|
|
@ -58,11 +59,11 @@
|
|||
/**************************************************************************/
|
||||
class Adafruit_EK79686 : public Adafruit_EPD {
|
||||
public:
|
||||
Adafruit_EK79686(int width, int height, 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_EK79686(int width, int height, int8_t DC, int8_t RST, int8_t CS,
|
||||
int8_t SRCS, int8_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
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);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include "Adafruit_IL0373.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW IL0373_DTM1
|
||||
|
|
@ -37,11 +38,11 @@ const uint8_t il0373_default_init_code[] {
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_IL0373::Adafruit_IL0373(int width, int height, int8_t SID, int8_t SCLK,
|
||||
int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t MISO, int8_t BUSY)
|
||||
Adafruit_IL0373::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)
|
||||
: 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;
|
||||
|
||||
|
|
@ -71,8 +72,8 @@ Adafruit_IL0373::Adafruit_IL0373(int width, int height, int8_t SID, int8_t SCLK,
|
|||
@param spi the SPI bus to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_IL0373::Adafruit_IL0373(int width, int height, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t SRCS, int8_t BUSY,
|
||||
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)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
buffer1_size = ((uint32_t)width * (uint32_t)height) / 8;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
#ifndef LIB_ADAFRUIT_IL0373
|
||||
#define LIB_ADAFRUIT_IL0373
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define IL0373_PANEL_SETTING 0x00
|
||||
#define IL0373_POWER_SETTING 0x01
|
||||
#define IL0373_POWER_OFF 0x02
|
||||
|
|
@ -40,11 +41,11 @@
|
|||
class Adafruit_IL0373 : public Adafruit_EPD {
|
||||
private:
|
||||
public:
|
||||
Adafruit_IL0373(int width, int height, 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_IL0373(int width, int height, int8_t DC, int8_t RST, int8_t CS,
|
||||
int8_t SRCS, int8_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
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);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include "Adafruit_IL0398.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
|
|
@ -34,11 +35,11 @@ const uint8_t il0398_default_init_code[] {
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_IL0398::Adafruit_IL0398(int width, int height, int8_t SID, int8_t SCLK,
|
||||
int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t MISO, int8_t BUSY)
|
||||
Adafruit_IL0398::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)
|
||||
: 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;
|
||||
|
||||
|
|
@ -66,11 +67,10 @@ Adafruit_IL0398::Adafruit_IL0398(int width, int height, int8_t SID, int8_t SCLK,
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_IL0398::Adafruit_IL0398(int width, int height, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t SRCS, int8_t BUSY,
|
||||
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)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
|
||||
buffer1_size = ((uint32_t)width * (uint32_t)height) / 8;
|
||||
buffer2_size = buffer1_size;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
#ifndef LIB_ADAFRUIT_IL0398
|
||||
#define LIB_ADAFRUIT_IL0398
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define IL0398_PANEL_SETTING 0x00
|
||||
#define IL0398_POWER_SETTING 0x01
|
||||
#define IL0398_POWER_OFF 0x02
|
||||
|
|
@ -56,11 +57,11 @@
|
|||
/**************************************************************************/
|
||||
class Adafruit_IL0398 : public Adafruit_EPD {
|
||||
public:
|
||||
Adafruit_IL0398(int width, int height, 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_IL0398(int width, int height, int8_t DC, int8_t RST, int8_t CS,
|
||||
int8_t SRCS, int8_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
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);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include "Adafruit_IL91874.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
|
|
@ -71,12 +72,11 @@ const unsigned char lut_wb[] = {
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_IL91874::Adafruit_IL91874(int width, int height, int8_t SID,
|
||||
int8_t SCLK, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t SRCS, int8_t MISO,
|
||||
int8_t BUSY)
|
||||
Adafruit_IL91874::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)
|
||||
: 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;
|
||||
|
||||
|
|
@ -104,11 +104,10 @@ Adafruit_IL91874::Adafruit_IL91874(int width, int height, int8_t SID,
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_IL91874::Adafruit_IL91874(int width, int height, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t SRCS, int8_t BUSY,
|
||||
SPIClass *spi)
|
||||
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)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
|
||||
buffer1_size = ((uint32_t)width * (uint32_t)height) / 8;
|
||||
buffer2_size = buffer1_size;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
#ifndef LIB_ADAFRUIT_IL91874
|
||||
#define LIB_ADAFRUIT_IL91874
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define IL91874_PANEL_SETTING 0x00
|
||||
#define IL91874_POWER_SETTING 0x01
|
||||
#define IL91874_POWER_OFF 0x02
|
||||
|
|
@ -35,11 +36,11 @@
|
|||
/**************************************************************************/
|
||||
class Adafruit_IL91874 : public Adafruit_EPD {
|
||||
public:
|
||||
Adafruit_IL91874(int width, int height, 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_IL91874(int width, int height, int8_t DC, int8_t RST, int8_t CS,
|
||||
int8_t SRCS, int8_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
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);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
|
|
|
|||
316
src/drivers/Adafruit_JD79661.cpp
Normal file
316
src/drivers/Adafruit_JD79661.cpp
Normal file
|
|
@ -0,0 +1,316 @@
|
|||
#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;
|
||||
}
|
||||
53
src/drivers/Adafruit_JD79661.h
Normal file
53
src/drivers/Adafruit_JD79661.h
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
#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
|
||||
314
src/drivers/Adafruit_JD79667.cpp
Normal file
314
src/drivers/Adafruit_JD79667.cpp
Normal file
|
|
@ -0,0 +1,314 @@
|
|||
#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;
|
||||
}
|
||||
53
src/drivers/Adafruit_JD79667.h
Normal file
53
src/drivers/Adafruit_JD79667.h
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
#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,4 +1,5 @@
|
|||
#include "Adafruit_SSD1608.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
|
|
@ -25,12 +26,11 @@ const unsigned char LUT_DATA[30] = {
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_SSD1608::Adafruit_SSD1608(int width, int height, int8_t SID,
|
||||
int8_t SCLK, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t SRCS, int8_t MISO,
|
||||
int8_t BUSY)
|
||||
Adafruit_SSD1608::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)
|
||||
: Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
|
||||
|
||||
if ((width % 8) != 0) {
|
||||
width += 8 - (width % 8);
|
||||
}
|
||||
|
|
@ -61,11 +61,10 @@ Adafruit_SSD1608::Adafruit_SSD1608(int width, int height, int8_t SID,
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_SSD1608::Adafruit_SSD1608(int width, int height, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t SRCS, int8_t BUSY,
|
||||
SPIClass *spi)
|
||||
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)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
#ifndef LIB_ADAFRUIT_SSD1608
|
||||
#define LIB_ADAFRUIT_SSD1608
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define SSD1608_DRIVER_CONTROL 0x01
|
||||
#define SSD1608_GATE_VOLTAGE 0x03
|
||||
#define SSD1608_SOURCE_VOLTAGE 0x04
|
||||
|
|
@ -44,11 +45,11 @@
|
|||
/**************************************************************************/
|
||||
class Adafruit_SSD1608 : public Adafruit_EPD {
|
||||
public:
|
||||
Adafruit_SSD1608(int width, int height, 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_SSD1608(int width, int height, int8_t DC, int8_t RST, int8_t CS,
|
||||
int8_t SRCS, int8_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
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);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include "Adafruit_SSD1619.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
|
|
@ -43,10 +44,10 @@ const uint8_t ssd1619_default_init_code[] {
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_SSD1619::Adafruit_SSD1619(int width, int height, int8_t SID,
|
||||
int8_t SCLK, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t SRCS, int8_t MISO,
|
||||
int8_t BUSY)
|
||||
Adafruit_SSD1619::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)
|
||||
: Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
|
|
@ -82,9 +83,9 @@ Adafruit_SSD1619::Adafruit_SSD1619(int width, int height, int8_t SID,
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_SSD1619::Adafruit_SSD1619(int width, int height, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t SRCS, int8_t BUSY,
|
||||
SPIClass *spi)
|
||||
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)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
#ifndef LIB_ADAFRUIT_SSD1619
|
||||
#define LIB_ADAFRUIT_SSD1619
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define SSD1619_DRIVER_CONTROL 0x01
|
||||
#define SSD1619_GATE_VOLTAGE 0x03
|
||||
#define SSD1619_SOURCE_VOLTAGE 0x04
|
||||
|
|
@ -40,11 +41,11 @@
|
|||
/**************************************************************************/
|
||||
class Adafruit_SSD1619 : public Adafruit_EPD {
|
||||
public:
|
||||
Adafruit_SSD1619(int width, int height, 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_SSD1619(int width, int height, int8_t DC, int8_t RST, int8_t CS,
|
||||
int8_t SRCS, int8_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
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);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include "Adafruit_SSD1675.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
|
|
@ -39,10 +40,10 @@ const unsigned char LUT_DATA[] = {
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_SSD1675::Adafruit_SSD1675(int width, int height, int8_t SID,
|
||||
int8_t SCLK, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t SRCS, int8_t MISO,
|
||||
int8_t BUSY)
|
||||
Adafruit_SSD1675::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)
|
||||
: Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
|
|
@ -76,9 +77,9 @@ Adafruit_SSD1675::Adafruit_SSD1675(int width, int height, int8_t SID,
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_SSD1675::Adafruit_SSD1675(int width, int height, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t SRCS, int8_t BUSY,
|
||||
SPIClass *spi)
|
||||
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)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
#ifndef LIB_ADAFRUIT_SSD1675
|
||||
#define LIB_ADAFRUIT_SSD1675
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define SSD1675_DRIVER_CONTROL 0x01
|
||||
#define SSD1675_GATE_VOLTAGE 0x03
|
||||
#define SSD1675_SOURCE_VOLTAGE 0x04
|
||||
|
|
@ -39,11 +40,11 @@
|
|||
/**************************************************************************/
|
||||
class Adafruit_SSD1675 : public Adafruit_EPD {
|
||||
public:
|
||||
Adafruit_SSD1675(int width, int height, 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_SSD1675(int width, int height, int8_t DC, int8_t RST, int8_t CS,
|
||||
int8_t SRCS, int8_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
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);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include "Adafruit_SSD1675B.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
|
|
@ -39,10 +40,10 @@ const unsigned char LUT_DATA[] = {
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_SSD1675B::Adafruit_SSD1675B(int width, int height, int8_t SID,
|
||||
int8_t SCLK, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t SRCS, int8_t MISO,
|
||||
int8_t BUSY)
|
||||
Adafruit_SSD1675B::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)
|
||||
: Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
|
|
@ -76,9 +77,9 @@ Adafruit_SSD1675B::Adafruit_SSD1675B(int width, int height, int8_t SID,
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_SSD1675B::Adafruit_SSD1675B(int width, int height, int8_t DC,
|
||||
int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY, SPIClass *spi)
|
||||
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)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
#ifndef LIB_ADAFRUIT_SSD1675B
|
||||
#define LIB_ADAFRUIT_SSD1675B
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define SSD1675B_DRIVER_CONTROL 0x01
|
||||
#define SSD1675B_GATE_VOLTAGE 0x03
|
||||
#define SSD1675B_SOURCE_VOLTAGE 0x04
|
||||
|
|
@ -39,11 +40,11 @@
|
|||
/**************************************************************************/
|
||||
class Adafruit_SSD1675B : public Adafruit_EPD {
|
||||
public:
|
||||
Adafruit_SSD1675B(int width, int height, 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_SSD1675B(int width, int height, int8_t DC, int8_t RST, int8_t CS,
|
||||
int8_t SRCS, int8_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
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);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include "Adafruit_SSD1680.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
|
|
@ -39,16 +40,16 @@ const uint8_t ssd1680_default_init_code[] {
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_SSD1680::Adafruit_SSD1680(int width, int height, int8_t SID,
|
||||
int8_t SCLK, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t SRCS, int8_t MISO,
|
||||
int8_t BUSY)
|
||||
Adafruit_SSD1680::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)
|
||||
: 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;
|
||||
buffer1_size = ((uint32_t)width * (uint32_t)height) / 8;
|
||||
buffer2_size = buffer1_size;
|
||||
|
||||
if (SRCS >= 0) {
|
||||
|
|
@ -78,15 +79,15 @@ Adafruit_SSD1680::Adafruit_SSD1680(int width, int height, int8_t SID,
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_SSD1680::Adafruit_SSD1680(int width, int height, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t SRCS, int8_t BUSY,
|
||||
SPIClass *spi)
|
||||
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)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
}
|
||||
|
||||
buffer1_size = width * height / 8;
|
||||
buffer1_size = ((uint32_t)width * (uint32_t)height) / 8;
|
||||
buffer2_size = buffer1_size;
|
||||
|
||||
if (SRCS >= 0) {
|
||||
|
|
@ -138,10 +139,8 @@ void Adafruit_SSD1680::begin(bool reset) {
|
|||
void Adafruit_SSD1680::update() {
|
||||
uint8_t buf[1];
|
||||
|
||||
// display update sequence
|
||||
buf[0] = 0xF4;
|
||||
buf[0] = _display_update_val; // varies for mono vs gray4 mode
|
||||
EPD_command(SSD1680_DISP_CTRL2, buf, 1);
|
||||
|
||||
EPD_command(SSD1680_MASTER_ACTIVATE);
|
||||
busy_wait();
|
||||
|
||||
|
|
@ -175,8 +174,8 @@ void Adafruit_SSD1680::powerUp() {
|
|||
}
|
||||
|
||||
// Set ram X start/end postion
|
||||
buf[0] = 0x01;
|
||||
buf[1] = height / 8;
|
||||
buf[0] = _xram_offset;
|
||||
buf[1] = height / 8 - 1 + _xram_offset;
|
||||
EPD_command(SSD1680_SET_RAMXPOS, buf, 2);
|
||||
|
||||
// Set ram Y start/end postion
|
||||
|
|
@ -186,12 +185,10 @@ void Adafruit_SSD1680::powerUp() {
|
|||
buf[3] = (WIDTH - 1) >> 8;
|
||||
EPD_command(SSD1680_SET_RAMYPOS, buf, 4);
|
||||
|
||||
// Set LUT
|
||||
/*
|
||||
buf[0] = LUT_DATA[74];
|
||||
EPD_command(SSD1680_WRITE_LUT, buf, 1);
|
||||
EPD_command(SSD1680_WRITE_LUT, LUT_DATA, 70);
|
||||
*/
|
||||
// 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);
|
||||
|
|
@ -252,7 +249,7 @@ void Adafruit_SSD1680::setRAMAddress(uint16_t x, uint16_t y) {
|
|||
uint8_t buf[2];
|
||||
|
||||
// set RAM x address count
|
||||
buf[0] = 1;
|
||||
buf[0] = _xram_offset;
|
||||
EPD_command(SSD1680_SET_RAMXCOUNT, buf, 1);
|
||||
|
||||
// set RAM y address count
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
#ifndef LIB_ADAFRUIT_SSD1680
|
||||
#define LIB_ADAFRUIT_SSD1680
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define SSD1680_DRIVER_CONTROL 0x01
|
||||
#define SSD1680_GATE_VOLTAGE 0x03
|
||||
#define SSD1680_SOURCE_VOLTAGE 0x04
|
||||
|
|
@ -26,6 +27,7 @@
|
|||
#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
|
||||
|
|
@ -38,11 +40,11 @@
|
|||
/**************************************************************************/
|
||||
class Adafruit_SSD1680 : public Adafruit_EPD {
|
||||
public:
|
||||
Adafruit_SSD1680(int width, int height, 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(int width, int height, int8_t DC, int8_t RST, int8_t CS,
|
||||
int8_t SRCS, int8_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
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);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
|
|
@ -53,6 +55,9 @@ 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,4 +1,5 @@
|
|||
#include "Adafruit_SSD1681.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
|
|
@ -35,10 +36,10 @@ const uint8_t ssd1681_default_init_code[] {
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_SSD1681::Adafruit_SSD1681(int width, int height, int8_t SID,
|
||||
int8_t SCLK, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t SRCS, int8_t MISO,
|
||||
int8_t BUSY)
|
||||
Adafruit_SSD1681::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)
|
||||
: Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
|
|
@ -74,9 +75,9 @@ Adafruit_SSD1681::Adafruit_SSD1681(int width, int height, int8_t SID,
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_SSD1681::Adafruit_SSD1681(int width, int height, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t SRCS, int8_t BUSY,
|
||||
SPIClass *spi)
|
||||
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)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
|
|
@ -135,7 +136,7 @@ void Adafruit_SSD1681::update() {
|
|||
uint8_t buf[1];
|
||||
|
||||
// display update sequence
|
||||
buf[0] = 0xF7;
|
||||
buf[0] = _display_update_val; // varies for mono vs gray4 mode
|
||||
EPD_command(SSD1681_DISP_CTRL2, buf, 1);
|
||||
|
||||
EPD_command(SSD1681_MASTER_ACTIVATE);
|
||||
|
|
@ -266,13 +267,18 @@ void Adafruit_SSD1681::powerUp() {
|
|||
}
|
||||
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,10 @@
|
|||
#ifndef LIB_ADAFRUIT_SSD1681
|
||||
#define LIB_ADAFRUIT_SSD1681
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define SSD1681_DRIVER_CONTROL 0x01
|
||||
#define SSD1681_GATE_VOLTAGE 0x03
|
||||
#define SSD1681_SOURCE_VOLTAGE 0x04
|
||||
|
|
@ -38,11 +39,11 @@
|
|||
/**************************************************************************/
|
||||
class Adafruit_SSD1681 : public Adafruit_EPD {
|
||||
public:
|
||||
Adafruit_SSD1681(int width, int height, 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_SSD1681(int width, int height, int8_t DC, int8_t RST, int8_t CS,
|
||||
int8_t SRCS, int8_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
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);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
|
|
@ -56,6 +57,7 @@ protected:
|
|||
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
|
||||
|
|
|
|||
272
src/drivers/Adafruit_SSD1683.cpp
Normal file
272
src/drivers/Adafruit_SSD1683.cpp
Normal file
|
|
@ -0,0 +1,272 @@
|
|||
#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);
|
||||
}
|
||||
75
src/drivers/Adafruit_SSD1683.h
Normal file
75
src/drivers/Adafruit_SSD1683.h
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
#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,4 +1,5 @@
|
|||
#include "Adafruit_UC8151D.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
|
|
@ -20,12 +21,11 @@
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_UC8151D::Adafruit_UC8151D(int width, int height, int8_t SID,
|
||||
int8_t SCLK, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t SRCS, int8_t MISO,
|
||||
int8_t BUSY)
|
||||
Adafruit_UC8151D::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)
|
||||
: Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
|
||||
|
||||
if ((width % 8) != 0) {
|
||||
width += 8 - (width % 8);
|
||||
}
|
||||
|
|
@ -57,11 +57,10 @@ Adafruit_UC8151D::Adafruit_UC8151D(int width, int height, int8_t SID,
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_UC8151D::Adafruit_UC8151D(int width, int height, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t SRCS, int8_t BUSY,
|
||||
SPIClass *spi)
|
||||
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)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
}
|
||||
|
|
@ -263,8 +262,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
|
||||
|
|
@ -305,7 +304,7 @@ void Adafruit_UC8151D::displayPartial(uint16_t x1, uint16_t y1, uint16_t x2,
|
|||
uint32_t offset = 0;
|
||||
uint8_t mcp_buf[16];
|
||||
while (remaining) {
|
||||
uint8_t to_xfer = min(sizeof(mcp_buf), remaining);
|
||||
uint8_t to_xfer = min((uint32_t)sizeof(mcp_buf), remaining);
|
||||
|
||||
sram.read(buffer2_addr + offset, mcp_buf, to_xfer);
|
||||
sram.write(buffer1_addr + offset, mcp_buf, to_xfer);
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
#ifndef LIB_ADAFRUIT_UC8151D
|
||||
#define LIB_ADAFRUIT_UC8151D
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define UC8151D_PSR 0x00
|
||||
#define UC8151D_PWR 0x01
|
||||
#define UC8151D_POF 0x02
|
||||
|
|
@ -135,11 +136,11 @@ const uint8_t uc8151d_partialmono_lut[] = {
|
|||
/**************************************************************************/
|
||||
class Adafruit_UC8151D : public Adafruit_EPD {
|
||||
public:
|
||||
Adafruit_UC8151D(int width, int height, 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_UC8151D(int width, int height, int8_t DC, int8_t RST, int8_t CS,
|
||||
int8_t SRCS, int8_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
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);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
|
|
|
|||
251
src/drivers/Adafruit_UC8179.cpp
Normal file
251
src/drivers/Adafruit_UC8179.cpp
Normal file
|
|
@ -0,0 +1,251 @@
|
|||
#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;
|
||||
}
|
||||
49
src/drivers/Adafruit_UC8179.h
Normal file
49
src/drivers/Adafruit_UC8179.h
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
#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
|
||||
223
src/drivers/Adafruit_UC8253.cpp
Normal file
223
src/drivers/Adafruit_UC8253.cpp
Normal file
|
|
@ -0,0 +1,223 @@
|
|||
#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;
|
||||
}
|
||||
43
src/drivers/Adafruit_UC8253.h
Normal file
43
src/drivers/Adafruit_UC8253.h
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#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,4 +1,5 @@
|
|||
#include "Adafruit_UC8276.h"
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define EPD_RAM_BW 0x10
|
||||
|
|
@ -32,9 +33,10 @@ const uint8_t uc8276_default_init_code[] {
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_UC8276::Adafruit_UC8276(int width, int height, int8_t SID, int8_t SCLK,
|
||||
int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t MISO, int8_t BUSY)
|
||||
Adafruit_UC8276::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)
|
||||
: Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
|
||||
if ((height % 8) != 0) {
|
||||
height += 8 - (height % 8);
|
||||
|
|
@ -70,8 +72,8 @@ Adafruit_UC8276::Adafruit_UC8276(int width, int height, int8_t SID, int8_t SCLK,
|
|||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
Adafruit_UC8276::Adafruit_UC8276(int width, int height, int8_t DC, int8_t RST,
|
||||
int8_t CS, int8_t SRCS, int8_t BUSY,
|
||||
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)
|
||||
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
|
||||
if ((height % 8) != 0) {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
#ifndef LIB_ADAFRUIT_UC8276
|
||||
#define LIB_ADAFRUIT_UC8276
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
#define UC8276_PANELSETTING 0x00
|
||||
#define UC8276_POWEROFF 0x02
|
||||
#define UC8276_POWERON 0x04
|
||||
|
|
@ -21,11 +22,11 @@
|
|||
/**************************************************************************/
|
||||
class Adafruit_UC8276 : public Adafruit_EPD {
|
||||
public:
|
||||
Adafruit_UC8276(int width, int height, 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_UC8276(int width, int height, int8_t DC, int8_t RST, int8_t CS,
|
||||
int8_t SRCS, int8_t BUSY = -1, SPIClass *spi = &SPI);
|
||||
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);
|
||||
|
||||
void begin(bool reset = true);
|
||||
void powerUp();
|
||||
|
|
|
|||
141
src/panels/ThinkInk_154_Grayscale4_M05.h
Normal file
141
src/panels/ThinkInk_154_Grayscale4_M05.h
Normal file
|
|
@ -0,0 +1,141 @@
|
|||
#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
|
||||
|
|
@ -148,13 +148,13 @@ static const uint8_t ti_154t8_gray4_lut_code[] = {
|
|||
|
||||
class ThinkInk_154_Grayscale4_T8 : public Adafruit_IL0373 {
|
||||
public:
|
||||
ThinkInk_154_Grayscale4_T8(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_154_Grayscale4_T8(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_IL0373(152, 152, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_GRAYSCALE4) {
|
||||
|
|
|
|||
|
|
@ -6,12 +6,13 @@
|
|||
|
||||
class ThinkInk_154_Mono_D27 : public Adafruit_SSD1608 {
|
||||
public:
|
||||
ThinkInk_154_Mono_D27(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_154_Mono_D27(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_SSD1608(200, 200, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -6,12 +6,13 @@
|
|||
|
||||
class ThinkInk_154_Mono_D67 : public Adafruit_SSD1681 {
|
||||
public:
|
||||
ThinkInk_154_Mono_D67(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_154_Mono_D67(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_MONO) {
|
||||
|
|
|
|||
|
|
@ -6,12 +6,13 @@
|
|||
|
||||
class ThinkInk_154_Mono_M10 : public Adafruit_UC8151D {
|
||||
public:
|
||||
ThinkInk_154_Mono_M10(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_154_Mono_M10(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_UC8151D(152, 152, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@
|
|||
|
||||
class ThinkInk_154_Tricolor_RW : public Adafruit_SSD1680 {
|
||||
public:
|
||||
ThinkInk_154_Tricolor_RW(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_154_Tricolor_RW(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_SSD1680(152, 152, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@
|
|||
|
||||
class ThinkInk_154_Tricolor_Z17 : public Adafruit_IL0373 {
|
||||
public:
|
||||
ThinkInk_154_Tricolor_Z17(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_154_Tricolor_Z17(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_IL0373(152, 152, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@
|
|||
|
||||
class ThinkInk_154_Tricolor_Z90 : public Adafruit_SSD1681 {
|
||||
public:
|
||||
ThinkInk_154_Tricolor_Z90(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_154_Tricolor_Z90(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_MONO) {
|
||||
|
|
|
|||
175
src/panels/ThinkInk_213_Grayscale4_MFGN.h
Normal file
175
src/panels/ThinkInk_213_Grayscale4_MFGN.h
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
#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
|
||||
|
|
@ -148,13 +148,13 @@ static const uint8_t ti_213t5_gray4_lut_code[] = {
|
|||
|
||||
class ThinkInk_213_Grayscale4_T5 : public Adafruit_IL0373 {
|
||||
public:
|
||||
ThinkInk_213_Grayscale4_T5(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_213_Grayscale4_T5(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_IL0373(212, 104, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_GRAYSCALE4) {
|
||||
|
|
|
|||
|
|
@ -6,12 +6,13 @@
|
|||
|
||||
class ThinkInk_213_Mono_B72 : public Adafruit_SSD1675 {
|
||||
public:
|
||||
ThinkInk_213_Mono_B72(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_213_Mono_B72(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_SSD1675(250, 122, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -6,12 +6,13 @@
|
|||
|
||||
class ThinkInk_213_Mono_B73 : public Adafruit_SSD1675B {
|
||||
public:
|
||||
ThinkInk_213_Mono_B73(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_213_Mono_B73(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_SSD1675B(250, 122, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -6,12 +6,13 @@
|
|||
|
||||
class ThinkInk_213_Mono_BN : public Adafruit_SSD1680 {
|
||||
public:
|
||||
ThinkInk_213_Mono_BN(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_213_Mono_BN(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) {
|
||||
|
|
|
|||
41
src/panels/ThinkInk_213_Mono_GDEY0213B74.h
Normal file
41
src/panels/ThinkInk_213_Mono_GDEY0213B74.h
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#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
|
||||
|
|
@ -6,12 +6,13 @@
|
|||
|
||||
class ThinkInk_213_Mono_M21 : public Adafruit_UC8151D {
|
||||
public:
|
||||
ThinkInk_213_Mono_M21(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_213_Mono_M21(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_UC8151D(212, 104, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
30
src/panels/ThinkInk_213_Quadcolor_AJHE5.h
Normal file
30
src/panels/ThinkInk_213_Quadcolor_AJHE5.h
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#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
|
||||
41
src/panels/ThinkInk_213_Tricolor_MFGNR.h
Normal file
41
src/panels/ThinkInk_213_Tricolor_MFGNR.h
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#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
|
||||
|
|
@ -6,13 +6,13 @@
|
|||
|
||||
class ThinkInk_213_Tricolor_RW : public Adafruit_SSD1680 {
|
||||
public:
|
||||
ThinkInk_213_Tricolor_RW(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_213_Tricolor_RW(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) {
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@
|
|||
|
||||
class ThinkInk_213_Tricolor_Z16 : public Adafruit_IL0373 {
|
||||
public:
|
||||
ThinkInk_213_Tricolor_Z16(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_213_Tricolor_Z16(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_IL0373(212, 104, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
|
|
|
|||
172
src/panels/ThinkInk_266_Grayscale4_MFGN.h
Normal file
172
src/panels/ThinkInk_266_Grayscale4_MFGN.h
Normal file
|
|
@ -0,0 +1,172 @@
|
|||
#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
|
||||
41
src/panels/ThinkInk_266_Tricolor_MFGNR.h
Normal file
41
src/panels/ThinkInk_266_Tricolor_MFGNR.h
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#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
|
||||
|
|
@ -84,13 +84,13 @@ static const uint8_t ti_270w3_gray4_lut_code[] = {
|
|||
class ThinkInk_270_Grayscale4_W3 : public Adafruit_IL91874 {
|
||||
private:
|
||||
public:
|
||||
ThinkInk_270_Grayscale4_W3(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_270_Grayscale4_W3(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_IL91874(264, 176, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -25,13 +25,13 @@ static const uint8_t ti_270c44_tri_init_code[] {
|
|||
|
||||
class ThinkInk_270_Tricolor_C44 : public Adafruit_IL91874 {
|
||||
public:
|
||||
ThinkInk_270_Tricolor_C44(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_270_Tricolor_C44(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_IL91874(264, 176, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@
|
|||
|
||||
class ThinkInk_270_Tricolor_Z70 : public Adafruit_EK79686 {
|
||||
public:
|
||||
ThinkInk_270_Tricolor_Z70(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_270_Tricolor_Z70(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_EK79686(264, 176, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
|
|
|
|||
156
src/panels/ThinkInk_290_Grayscale4_EAAMFGN.h
Normal file
156
src/panels/ThinkInk_290_Grayscale4_EAAMFGN.h
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
#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
|
||||
|
|
@ -148,13 +148,13 @@ const uint8_t ti_290t5_gray4_lut_code[] = {
|
|||
|
||||
class ThinkInk_290_Grayscale4_T5 : public Adafruit_IL0373 {
|
||||
public:
|
||||
ThinkInk_290_Grayscale4_T5(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_290_Grayscale4_T5(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_IL0373(296, 128, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_GRAYSCALE4) {
|
||||
|
|
|
|||
|
|
@ -6,12 +6,13 @@
|
|||
|
||||
class ThinkInk_290_Mono_BN : public Adafruit_SSD1680 {
|
||||
public:
|
||||
ThinkInk_290_Mono_BN(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_290_Mono_BN(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_MONO) {
|
||||
|
|
|
|||
|
|
@ -6,12 +6,13 @@
|
|||
|
||||
class ThinkInk_290_Mono_M06 : public Adafruit_UC8151D {
|
||||
public:
|
||||
ThinkInk_290_Mono_M06(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_290_Mono_M06(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_UC8151D(296, 128, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@
|
|||
|
||||
class ThinkInk_290_Tricolor_RH : public Adafruit_SSD1680 {
|
||||
public:
|
||||
ThinkInk_290_Tricolor_RH(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_290_Tricolor_RH(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_TRICOLOR) {
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@
|
|||
|
||||
class ThinkInk_290_Tricolor_Z10 : public Adafruit_IL0373 {
|
||||
public:
|
||||
ThinkInk_290_Tricolor_Z10(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_290_Tricolor_Z10(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_IL0373(296, 128, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@
|
|||
|
||||
class ThinkInk_290_Tricolor_Z13 : public Adafruit_UC8151D {
|
||||
public:
|
||||
ThinkInk_290_Tricolor_Z13(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_290_Tricolor_Z13(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
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 @@ public:
|
|||
layer_colors[EPD_LIGHT] = 0b00;
|
||||
layer_colors[EPD_DARK] = 0b01;
|
||||
|
||||
default_refresh_delay = 1000;
|
||||
default_refresh_delay = 13000;
|
||||
setRotation(0);
|
||||
powerDown();
|
||||
}
|
||||
|
|
|
|||
40
src/panels/ThinkInk_290_Tricolor_Z94.h
Normal file
40
src/panels/ThinkInk_290_Tricolor_Z94.h
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#ifndef _THINKINK_290_TRICOLOR_Z94_H
|
||||
#define _THINKINK_290_TRICOLOR_Z94_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_290_Tricolor_Z94 : public Adafruit_SSD1680 {
|
||||
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)
|
||||
: Adafruit_SSD1680(296, 128, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
_xram_offset = 0;
|
||||
|
||||
Adafruit_SSD1680::begin(true);
|
||||
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_290 Z94
|
||||
30
src/panels/ThinkInk_352_Quadcolor_AJHE5.h
Normal file
30
src/panels/ThinkInk_352_Quadcolor_AJHE5.h
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#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
|
||||
53
src/panels/ThinkInk_370_Mono_BAAMFGN.h
Normal file
53
src/panels/ThinkInk_370_Mono_BAAMFGN.h
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
#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
|
||||
51
src/panels/ThinkInk_370_Tricolor_BABMFGNR.h
Normal file
51
src/panels/ThinkInk_370_Tricolor_BABMFGNR.h
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
#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
|
||||
149
src/panels/ThinkInk_420_Grayscale4_MFGN.h
Normal file
149
src/panels/ThinkInk_420_Grayscale4_MFGN.h
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
#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
|
||||
|
|
@ -74,13 +74,13 @@ static const uint8_t ti_420t2_gray4_lut_code[] = {
|
|||
class ThinkInk_420_Grayscale4_T2 : public Adafruit_IL0398 {
|
||||
private:
|
||||
public:
|
||||
ThinkInk_420_Grayscale4_T2(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_420_Grayscale4_T2(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_IL0398(300, 400, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -6,12 +6,13 @@
|
|||
|
||||
class ThinkInk_420_Mono_BN : public Adafruit_SSD1619 {
|
||||
public:
|
||||
ThinkInk_420_Mono_BN(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_420_Mono_BN(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_SSD1619(300, 400, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
|
|
@ -6,12 +6,13 @@
|
|||
class ThinkInk_420_Mono_M06 : public Adafruit_UC8276 {
|
||||
private:
|
||||
public:
|
||||
ThinkInk_420_Mono_M06(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_420_Mono_M06(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_UC8276(300, 400, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
|
|
|
|||
148
src/panels/ThinkInk_420_Tricolor_MFGNR.h
Normal file
148
src/panels/ThinkInk_420_Tricolor_MFGNR.h
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
#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
|
||||
|
|
@ -6,13 +6,13 @@
|
|||
|
||||
class ThinkInk_420_Tricolor_RW : public Adafruit_SSD1619 {
|
||||
public:
|
||||
ThinkInk_420_Tricolor_RW(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_420_Tricolor_RW(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_SSD1619(300, 400, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@
|
|||
class ThinkInk_420_Tricolor_Z21 : public Adafruit_UC8276 {
|
||||
private:
|
||||
public:
|
||||
ThinkInk_420_Tricolor_Z21(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)
|
||||
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(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
|
||||
int8_t BUSY = -1, SPIClass *spi = &SPI)
|
||||
ThinkInk_420_Tricolor_Z21(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_UC8276(300, 400, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue