add tested working 2.66" tricolor SSD1680

This commit is contained in:
ladyada 2025-07-08 11:04:59 -04:00
parent a8ca6fc749
commit 47ff649e73
10 changed files with 543 additions and 13 deletions

View file

@ -50,6 +50,12 @@ ThinkInk_213_Tricolor_RW 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, EPD_SPI);
@ -58,19 +64,25 @@ 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);
// 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);
void setup() {

View file

@ -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,11 @@ 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 = ((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);

View file

@ -213,6 +213,7 @@ class Adafruit_EPD : public Adafruit_GFX {
#include "drivers/Adafruit_SSD1681.h"
#include "drivers/Adafruit_SSD1683.h"
#include "drivers/Adafruit_UC8151D.h"
#include "drivers/Adafruit_UC8179.h"
#include "drivers/Adafruit_UC8276.h"
#endif /* _ADAFRUIT_EPD_H_ */

View file

@ -21,6 +21,7 @@
#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_Tricolor_MFGNR.h"
#include "panels/ThinkInk_270_Grayscale4_W3.h"
#include "panels/ThinkInk_270_Tricolor_C44.h"
#include "panels/ThinkInk_270_Tricolor_Z70.h"
@ -34,8 +35,10 @@
#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_Mono_MFGN.h"
#include "panels/ThinkInk_420_Grayscale4_MFGN.h"
#include "panels/ThinkInk_420_Tricolor_RW.h"
#include "panels/ThinkInk_420_Tricolor_Z21.h"
#include "panels/ThinkInk_420_Tricolor_MFGNR.h"
#include "panels/ThinkInk_583_Mono_MFGN.h"
#endif // _ADAFRUIT_THINKINK_H_

View file

@ -0,0 +1,249 @@
#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,
0x1F, // 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) {
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] = HEIGHT >> 8;
buf[1] = HEIGHT & 0xFF;
buf[2] = WIDTH >> 8;
buf[3] = WIDTH & 0xFF;
Serial.printf("W %d H %d\n\r", WIDTH, HEIGHT);
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;
}

View 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

View 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

View file

@ -1,5 +1,5 @@
#ifndef _THINKINK_420_MONO_MFGN_H
#define _THINKINK_420_MONO_MFGN_H
#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.
@ -18,10 +18,6 @@ static const uint8_t ti_420mfgn_monofull_init_code[] {
SSD1683_DATA_MODE, 1, // 0x11 - Data entry mode
0x03, // Y decrement, X increment
SSD1683_TEMP_CONTROL, 1, 0x80, // Temp control
SSD1680_DISP_CTRL2, 1, 0x20, // Load LUT from OTP (default mono)
0xFE // End of initialization
};
@ -88,14 +84,14 @@ static const uint8_t ti_420mfgn_gray4_lut_code[] = {
};
class ThinkInk_420_Mono_MFGN : public Adafruit_SSD1683 {
class ThinkInk_420_Grayscale4_MFGN : public Adafruit_SSD1683 {
public:
ThinkInk_420_Mono_MFGN(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
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_Mono_MFGN(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
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){};
@ -141,4 +137,4 @@ class ThinkInk_420_Mono_MFGN : public Adafruit_SSD1683 {
}
};
#endif // _THINKINK_420_MONO_MFGN_H
#endif // _THINKINK_420_GRAY4_MFGN_H

View file

@ -0,0 +1,139 @@
#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

View file

@ -0,0 +1,36 @@
#ifndef _THINKINK_583_MONO_MFGN_H
#define _THINKINK_583_MONO_MFGN_H
#include "Adafruit_EPD.h"
class ThinkInk_583_Mono_MFGN : public Adafruit_UC8179 {
private:
public:
ThinkInk_583_Mono_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_UC8179(480, 648, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
ThinkInk_583_Mono_MFGN(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
int16_t BUSY = -1, SPIClass* spi = &SPI)
: Adafruit_UC8179(480, 648, 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
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_MONOMFGN