Skip to content

Commit

Permalink
add new ssd1680 panel without offset 🤷‍
Browse files Browse the repository at this point in the history
  • Loading branch information
ladyada committed Jun 17, 2024
1 parent 6c7aff4 commit 3ae6cc4
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Adafruit_ThinkInk.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@
#include "panels/ThinkInk_154_Mono_D27.h"
#include "panels/ThinkInk_154_Mono_D67.h"
#include "panels/ThinkInk_154_Mono_M10.h"

#include "panels/ThinkInk_213_Mono_B72.h"
#include "panels/ThinkInk_213_Mono_B73.h"
#include "panels/ThinkInk_213_Mono_BN.h"
#include "panels/ThinkInk_213_Mono_M21.h"
#include "panels/ThinkInk_213_Mono_GDEY0213B74.h"

#include "panels/ThinkInk_290_Mono_BN.h"
#include "panels/ThinkInk_290_Mono_M06.h"
#include "panels/ThinkInk_420_Mono_BN.h"
Expand Down
40 changes: 40 additions & 0 deletions src/panels/ThinkInk_213_Mono_GDEY0213B74.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#ifndef _THINKINK_213_MONO_GDEY0213B74_H
#define _THINKINK_213_MONO_GDEY0213B74_H

// This file is #included by Adafruit_ThinkInk.h and does not need to
// #include anything else to pick up the EPD header or ink mode enum.

class ThinkInk_213_Mono_GDEY0213B74 : public Adafruit_SSD1680 {
public:
ThinkInk_213_Mono_GDEY0213B74(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
int16_t CS, int16_t SRCS, int16_t MISO,
int16_t BUSY = -1)
: Adafruit_SSD1680(250, 122, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};

ThinkInk_213_Mono_GDEY0213B74(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
int16_t BUSY = -1, SPIClass *spi = &SPI)
: Adafruit_SSD1680(250, 122, DC, RST, CS, SRCS, BUSY, spi){};

void begin(thinkinkmode_t mode = THINKINK_MONO) {
_xram_offset = 0;

Adafruit_SSD1680::begin(true);
setColorBuffer(0, true); // layer 0 uninverted
setBlackBuffer(0, true); // only one buffer

inkmode = mode; // Preserve ink mode for ImageReader or others

layer_colors[EPD_WHITE] = 0b00;
layer_colors[EPD_BLACK] = 0b01;
layer_colors[EPD_RED] = 0b01;
layer_colors[EPD_GRAY] = 0b01;
layer_colors[EPD_LIGHT] = 0b00;
layer_colors[EPD_DARK] = 0b01;

default_refresh_delay = 1000;
setRotation(0);
powerDown();
}
};

#endif // _THINKINK_213_MONO_GDEY0213B74_H

0 comments on commit 3ae6cc4

Please sign in to comment.