add 1.54" epd ssd1681 grayscale support
This commit is contained in:
parent
011353ac59
commit
2fd13d4f15
7 changed files with 18 additions and 6 deletions
|
|
@ -30,6 +30,10 @@
|
|||
// EPD_BUSY, EPD_SPI); ThinkInk_213_Grayscale4_T5 display(EPD_DC, EPD_RESET,
|
||||
// EPD_CS, SRAM_CS, EPD_BUSY, EPD_SPI);
|
||||
|
||||
// 1.54" Grayscale Breakout (SSD1681)
|
||||
//ThinkInk_154_Grayscale4_M05 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY,
|
||||
// EPD_SPI);
|
||||
|
||||
// 2.13" Grayscale Featherwing or Breakout (SSD1680Z)
|
||||
ThinkInk_213_Grayscale4_MFGN display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY,
|
||||
EPD_SPI);
|
||||
|
|
|
|||
|
|
@ -509,7 +509,7 @@ void Adafruit_EPD::clearDisplay() {
|
|||
*/
|
||||
/**************************************************************************/
|
||||
void Adafruit_EPD::EPD_commandList(const uint8_t* init_code) {
|
||||
uint8_t buf[255];
|
||||
uint8_t buf[250];
|
||||
|
||||
while (init_code[0] != 0xFE) {
|
||||
uint8_t cmd = init_code[0];
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#include "panels/ThinkInk_154_Mono_D27.h"
|
||||
#include "panels/ThinkInk_154_Mono_D67.h"
|
||||
#include "panels/ThinkInk_154_Mono_M10.h"
|
||||
#include "panels/ThinkInk_154_Grayscale4_M05.h"
|
||||
#include "panels/ThinkInk_154_Tricolor_RW.h"
|
||||
#include "panels/ThinkInk_154_Tricolor_Z17.h"
|
||||
#include "panels/ThinkInk_154_Tricolor_Z90.h"
|
||||
|
|
|
|||
|
|
@ -256,7 +256,6 @@ void Adafruit_JD79661::hardwareReset(void) {
|
|||
/**************************************************************************/
|
||||
|
||||
void Adafruit_JD79661::powerUp() {
|
||||
uint8_t buf[5];
|
||||
hardwareReset();
|
||||
busy_wait();
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ Adafruit_SSD1680::Adafruit_SSD1680(int width, int height, int16_t SID,
|
|||
height += 8 - (height % 8);
|
||||
}
|
||||
|
||||
buffer1_size = width * height / 8;
|
||||
buffer1_size = ((uint32_t)width * (uint32_t)height) / 8;
|
||||
buffer2_size = buffer1_size;
|
||||
|
||||
if (SRCS >= 0) {
|
||||
|
|
@ -87,7 +87,7 @@ Adafruit_SSD1680::Adafruit_SSD1680(int width, int height, int16_t DC,
|
|||
height += 8 - (height % 8);
|
||||
}
|
||||
|
||||
buffer1_size = width * height / 8;
|
||||
buffer1_size = ((uint32_t)width * (uint32_t)height) / 8;
|
||||
buffer2_size = buffer1_size;
|
||||
|
||||
if (SRCS >= 0) {
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ void Adafruit_SSD1681::update() {
|
|||
uint8_t buf[1];
|
||||
|
||||
// display update sequence
|
||||
buf[0] = 0xF7;
|
||||
buf[0] = _display_update_val; // varies for mono vs gray4 mode
|
||||
EPD_command(SSD1681_DISP_CTRL2, buf, 1);
|
||||
|
||||
EPD_command(SSD1681_MASTER_ACTIVATE);
|
||||
|
|
@ -267,13 +267,20 @@ void Adafruit_SSD1681::powerUp() {
|
|||
}
|
||||
EPD_commandList(init_code);
|
||||
|
||||
setRAMWindow(0, 0, (HEIGHT / 8) - 1, WIDTH - 1);
|
||||
|
||||
// Set LUT (if we have one)
|
||||
if (_epd_lut_code) {
|
||||
EPD_commandList(_epd_lut_code);
|
||||
}
|
||||
|
||||
// Set display size and driver output control
|
||||
buf[0] = (WIDTH - 1);
|
||||
buf[1] = (WIDTH - 1) >> 8;
|
||||
buf[2] = 0x00;
|
||||
EPD_command(SSD1681_DRIVER_CONTROL, buf, 3);
|
||||
|
||||
setRAMWindow(0, 0, (HEIGHT / 8) - 1, WIDTH - 1);
|
||||
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ class Adafruit_SSD1681 : public Adafruit_EPD {
|
|||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue