commit
95c2d6fbf5
27 changed files with 2018 additions and 17 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -5,3 +5,4 @@ Doxyfile*
|
|||
doxygen_sqlite3.db
|
||||
html
|
||||
.DS_STORE
|
||||
*~
|
||||
|
|
|
|||
|
|
@ -38,13 +38,19 @@
|
|||
ThinkInk_213_Grayscale4_MFGN display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY,
|
||||
EPD_SPI);
|
||||
|
||||
// 2.9" Grayscale Featherwing or Breakout:
|
||||
//ThinkInk_290_Grayscale4_T5 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY,
|
||||
// EPD_SPI);
|
||||
// 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);
|
||||
|
||||
// 4.2" Grayscale display
|
||||
// ThinkInk_420_Grayscale4_T2 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
|
||||
|
|
|
|||
|
|
@ -44,26 +44,43 @@ ThinkInk_213_Mono_B72 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_
|
|||
// 2.13" Monochrome displays with 250x122 pixels and SSD1680 chipset
|
||||
// ThinkInk_213_Mono_BN display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
// ThinkInk_213_Mono_B74 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
// The GDEY0213B74 is like the B74 above but is not 'shifted down' by 8 pixels
|
||||
// ThinkInk_213_Mono_GDEY0213B74 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 2.13" Monochrome displays with 212x104 pixels and UC8151D chipset
|
||||
// ThinkInk_213_Mono_M21 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 2.9" 4-level Grayscale (use mono) displays with 296x128 pixels and IL0373
|
||||
// chipset
|
||||
// 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, 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, 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, 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, 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);
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
while (!Serial) {
|
||||
|
|
|
|||
|
|
@ -43,13 +43,19 @@ 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);
|
||||
// ThinkInk_213_Tricolor_MFGNR display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 2.13" Tricolor EPD with IL0373 chipset
|
||||
// ThinkInk_213_Tricolor_Z16 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
|
||||
// 2.66" Tricolor EPD with SSD1680Z chipset
|
||||
// ThinkInk_266_Tricolor_MFGNR display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
|
||||
// 2.7" Tricolor Featherwing or Breakout with IL91874 chipset
|
||||
// ThinkInk_270_Tricolor_C44 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
|
@ -58,21 +64,41 @@ ThinkInk_213_Tricolor_RW display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY,
|
|||
// ThinkInk_270_Tricolor_Z70 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
|
||||
// 2.9" Tricolor Featherwing or Breakout with IL0373 chipset
|
||||
// ThinkInk_290_Tricolor_Z10 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 2.9" Tricolor Featherwing or Breakout with UC8151D chipset
|
||||
// ThinkInk_290_Tricolor_Z13 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 2.9" Tricolor Featherwing or Breakout with SSD1680 chipset and negative
|
||||
// offset
|
||||
// ThinkInk_290_Tricolor_Z94 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 3.7" Tricolor Display with 420x240 pixels and UC8253 chipset
|
||||
// ThinkInk_370_Tricolor_BABMFGNR display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// ThinkInk_420_Tricolor_RW display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI); ThinkInk_420_Tricolor_Z21 display(EPD_DC, EPD_RESET,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// ThinkInk_420_Tricolor_Z21 display(EPD_DC, EPD_RESET,
|
||||
// EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 4.2" Tricolor EPD with SSD1683 chipset
|
||||
// ThinkInk_420_Tricolor_MFGNR display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
|
||||
// EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 5.83 Tricolor displays with 648x480 pixels and UC8179 chipset
|
||||
// ThinkInk_583_Tricolor_AABMFGNR display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 7.5" Tricolor displays with 800x480 pixels and UC8179 chipset
|
||||
// ThinkInk_750_Tricolor_AABMFGNR display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
while (!Serial) {
|
||||
|
|
|
|||
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.
|
||||
|
|
@ -226,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()) {
|
||||
|
|
@ -248,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 == THINKING_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);
|
||||
|
|
@ -266,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 == THINKING_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) {
|
||||
|
|
|
|||
|
|
@ -45,6 +45,11 @@ enum {
|
|||
EPD_NUM_COLORS
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
THINKINK_STANDARD, // 99% of panels use this setup!
|
||||
THINKING_UC8179, // .... except for UC8179?
|
||||
} thinkink_sramentrymode_t;
|
||||
|
||||
typedef enum {
|
||||
THINKINK_MONO,
|
||||
THINKINK_TRICOLOR,
|
||||
|
|
@ -87,6 +92,8 @@ class Adafruit_EPD : public Adafruit_GFX {
|
|||
}
|
||||
|
||||
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,
|
||||
|
|
@ -211,7 +218,10 @@ class Adafruit_EPD : public Adafruit_GFX {
|
|||
#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_ */
|
||||
|
|
|
|||
|
|
@ -21,9 +21,12 @@
|
|||
#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"
|
||||
|
|
@ -31,10 +34,17 @@
|
|||
#include "panels/ThinkInk_290_Tricolor_Z10.h"
|
||||
#include "panels/ThinkInk_290_Tricolor_Z13.h"
|
||||
#include "panels/ThinkInk_290_Tricolor_Z94.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_Tricolor_AABMFGNR.h"
|
||||
|
||||
#endif // _ADAFRUIT_THINKINK_H_
|
||||
|
|
|
|||
|
|
@ -298,6 +298,7 @@ void Adafruit_JD79661::powerDown() {
|
|||
*/
|
||||
/**************************************************************************/
|
||||
uint8_t Adafruit_JD79661::writeRAMCommand(uint8_t index) {
|
||||
(void)index;
|
||||
EPD_command(JD79661_DATA_START_XMIT);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,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
|
||||
|
|
|
|||
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
|
||||
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 = THINKING_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
|
||||
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
|
||||
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
|
||||
|
|
@ -32,7 +32,7 @@ class ThinkInk_290_Tricolor_Z13 : public Adafruit_UC8151D {
|
|||
layer_colors[EPD_LIGHT] = 0b00;
|
||||
layer_colors[EPD_DARK] = 0b01;
|
||||
|
||||
default_refresh_delay = 1000;
|
||||
default_refresh_delay = 13000;
|
||||
setRotation(0);
|
||||
powerDown();
|
||||
}
|
||||
|
|
|
|||
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
|
||||
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_MONO_MFGNR_H
|
||||
#define _THINKINK_420_MONO_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_Mono_MFGNR : public Adafruit_SSD1683 {
|
||||
public:
|
||||
ThinkInk_420_Mono_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_Mono_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_MONO_MFGNR_H
|
||||
75
src/panels/ThinkInk_583_Mono_AAAMFGN.h
Normal file
75
src/panels/ThinkInk_583_Mono_AAAMFGN.h
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
#ifndef _THINKINK_583_MONO_AAAMFGN_H
|
||||
#define _THINKINK_583_MONO_AAAMFGN_H
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
const uint8_t uc8179_mono_init_code[]{UC8179_POWERSETTING,
|
||||
4,
|
||||
0x07, // VGH=20V
|
||||
0x07, // VGL=-20V
|
||||
0x3F, // VDH=15V
|
||||
0x3F, // VDL=-15V
|
||||
|
||||
UC8179_POWERON,
|
||||
0,
|
||||
0xFF,
|
||||
100, // busy wait
|
||||
|
||||
UC8179_PANELSETTING,
|
||||
1,
|
||||
0b010111, // BW OTP LUT
|
||||
|
||||
UC8179_TRES,
|
||||
4,
|
||||
0x02,
|
||||
0x88,
|
||||
0x01,
|
||||
0xE0,
|
||||
|
||||
UC8179_DUALSPI,
|
||||
1,
|
||||
0x00,
|
||||
|
||||
UC8179_WRITE_VCOM,
|
||||
2,
|
||||
0x10,
|
||||
0x07,
|
||||
UC8179_TCON,
|
||||
1,
|
||||
0x22,
|
||||
|
||||
0xFE};
|
||||
|
||||
class ThinkInk_583_Mono_AAAMFGN : public Adafruit_UC8179 {
|
||||
private:
|
||||
public:
|
||||
ThinkInk_583_Mono_AAAMFGN(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
|
||||
int16_t CS, int16_t SRCS, int16_t MISO,
|
||||
int16_t BUSY = -1)
|
||||
: Adafruit_UC8179(648, 480, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_583_Mono_AAAMFGN(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t BUSY = -1, SPIClass* spi = &SPI)
|
||||
: Adafruit_UC8179(648, 480, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_MONO) {
|
||||
Adafruit_EPD::begin(true);
|
||||
setColorBuffer(1, false); // layer 1 uninverted
|
||||
setBlackBuffer(1, false); // only one buffer
|
||||
|
||||
_epd_init_code = uc8179_mono_init_code;
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b01;
|
||||
layer_colors[EPD_RED] = 0b10;
|
||||
layer_colors[EPD_GRAY] = 0b10;
|
||||
layer_colors[EPD_LIGHT] = 0b00;
|
||||
layer_colors[EPD_DARK] = 0b01;
|
||||
|
||||
default_refresh_delay = 3000;
|
||||
setRotation(0);
|
||||
powerDown();
|
||||
};
|
||||
};
|
||||
|
||||
#endif // _THINKINK_583_MONO_AAAMFGN
|
||||
67
src/panels/ThinkInk_583_Tricolor_AABMFGNR.h
Normal file
67
src/panels/ThinkInk_583_Tricolor_AABMFGNR.h
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
#ifndef _THINKINK_583_TRI_AABMFGNR_H
|
||||
#define _THINKINK_583_TRI_AABMFGNR_H
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
// clang-format off
|
||||
|
||||
const uint8_t uc8179_tricolor_init_code[] {
|
||||
UC8179_POWERSETTING, 4,
|
||||
0x07, // VGH=20V
|
||||
0x07, // VGL=-20V
|
||||
0x3F, // VDH=15V
|
||||
0x3F, // VDL=-15V
|
||||
|
||||
UC8179_POWERON, 0,
|
||||
0xFF, 100, // busy wait
|
||||
|
||||
UC8179_PANELSETTING, 1,
|
||||
0b000111, // Tricolor OTP LUT
|
||||
|
||||
UC8179_TRES, 4,
|
||||
0x02, 0x88, 0x01, 0xE0,
|
||||
|
||||
UC8179_DUALSPI, 1, 0x00,
|
||||
|
||||
UC8179_WRITE_VCOM, 2, 0x90, 0x07,
|
||||
UC8179_TCON, 1, 0x22,
|
||||
|
||||
0xFE};
|
||||
|
||||
// clang-format on
|
||||
|
||||
class ThinkInk_583_Tricolor_AABMFGNR : public Adafruit_UC8179 {
|
||||
private:
|
||||
public:
|
||||
ThinkInk_583_Tricolor_AABMFGNR(int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t MISO, int16_t BUSY = -1)
|
||||
: Adafruit_UC8179(648, 480, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_583_Tricolor_AABMFGNR(int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1,
|
||||
SPIClass* spi = &SPI)
|
||||
: Adafruit_UC8179(648, 480, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
Adafruit_EPD::begin(true);
|
||||
|
||||
setBlackBuffer(0, false);
|
||||
setColorBuffer(1, false);
|
||||
|
||||
_epd_init_code = uc8179_tricolor_init_code;
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b01;
|
||||
layer_colors[EPD_RED] = 0b10;
|
||||
layer_colors[EPD_GRAY] = 0b10;
|
||||
layer_colors[EPD_LIGHT] = 0b00;
|
||||
layer_colors[EPD_DARK] = 0b01;
|
||||
|
||||
default_refresh_delay = 13000;
|
||||
setRotation(0);
|
||||
// DO NOT power down again!
|
||||
};
|
||||
};
|
||||
|
||||
#endif // _THINKINK_583_TRI_AAAMFGNR
|
||||
67
src/panels/ThinkInk_750_Tricolor_AABMFGNR.h
Normal file
67
src/panels/ThinkInk_750_Tricolor_AABMFGNR.h
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
#ifndef _THINKINK_750_TRI_AABMFGNR_H
|
||||
#define _THINKINK_750_TRI_AABMFGNR_H
|
||||
|
||||
#include "Adafruit_EPD.h"
|
||||
|
||||
// clang-format off
|
||||
|
||||
const uint8_t uc8179_750_tricolor_init_code[] {
|
||||
UC8179_POWERSETTING, 4,
|
||||
0x07, // VGH=20V
|
||||
0x07, // VGL=-20V
|
||||
0x3F, // VDH=15V
|
||||
0x3F, // VDL=-15V
|
||||
|
||||
UC8179_POWERON, 0,
|
||||
0xFF, 100, // busy wait
|
||||
|
||||
UC8179_PANELSETTING, 1,
|
||||
0b000111, // Tricolor OTP LUT
|
||||
|
||||
UC8179_TRES, 4,
|
||||
0x03, 0x20, 0x01, 0xE0,
|
||||
|
||||
UC8179_DUALSPI, 1, 0x00,
|
||||
|
||||
UC8179_WRITE_VCOM, 2, 0x90, 0x07,
|
||||
UC8179_TCON, 1, 0x22,
|
||||
|
||||
0xFE};
|
||||
|
||||
// clang-format on
|
||||
|
||||
class ThinkInk_750_Tricolor_AABMFGNR : public Adafruit_UC8179 {
|
||||
private:
|
||||
public:
|
||||
ThinkInk_750_Tricolor_AABMFGNR(int16_t SID, int16_t SCLK, int16_t DC,
|
||||
int16_t RST, int16_t CS, int16_t SRCS,
|
||||
int16_t MISO, int16_t BUSY = -1)
|
||||
: Adafruit_UC8179(800, 480, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
|
||||
|
||||
ThinkInk_750_Tricolor_AABMFGNR(int16_t DC, int16_t RST, int16_t CS,
|
||||
int16_t SRCS, int16_t BUSY = -1,
|
||||
SPIClass* spi = &SPI)
|
||||
: Adafruit_UC8179(800, 480, DC, RST, CS, SRCS, BUSY, spi){};
|
||||
|
||||
void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
|
||||
Adafruit_EPD::begin(true);
|
||||
|
||||
setBlackBuffer(0, false);
|
||||
setColorBuffer(1, false);
|
||||
|
||||
_epd_init_code = uc8179_750_tricolor_init_code;
|
||||
|
||||
layer_colors[EPD_WHITE] = 0b00;
|
||||
layer_colors[EPD_BLACK] = 0b01;
|
||||
layer_colors[EPD_RED] = 0b10;
|
||||
layer_colors[EPD_GRAY] = 0b10;
|
||||
layer_colors[EPD_LIGHT] = 0b00;
|
||||
layer_colors[EPD_DARK] = 0b01;
|
||||
|
||||
default_refresh_delay = 13000;
|
||||
setRotation(0);
|
||||
// DO NOT power down again!
|
||||
};
|
||||
};
|
||||
|
||||
#endif // _THINKINK_750_TRI_AABMFGNR
|
||||
Loading…
Reference in a new issue