diff --git a/examples/EPDTest/EPDTest.ino b/examples/EPDTest/EPDTest.ino index 80abf9c..e5d7449 100644 --- a/examples/EPDTest/EPDTest.ino +++ b/examples/EPDTest/EPDTest.ino @@ -25,7 +25,7 @@ // Uncomment the following line if you are using 1.54" EPD with SSD1681 //Adafruit_SSD1681 display(200, 200, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY); // Uncomment the following line if you are using 1.54" EPD with UC8151D -Adafruit_UC8151D display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY); +//Adafruit_UC8151D display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY); //Uncomment the following line if you are using 2.13" EPD with SSD1680 @@ -41,22 +41,26 @@ Adafruit_UC8151D display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY) //Adafruit_UC8151D display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY); //Uncomment the following line if you are using 2.13" EPD with IL0373 -//Adafruit_IL0373 display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY); +Adafruit_IL0373 display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY); //#define FLEXIBLE_213 -/* Uncomment the following line if you are using 2.7" tricolor or grayscale EPD */ +//Uncomment the following line if you are using 2.7" EPD with IL91874 //Adafruit_IL91874 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS); -// 2.7" tricolor with Adafruit_EK79686 -//Adafruit_EK79686 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS); +// Uncomment the following line if you are using 2.7" EPD with EK79686 +//Adafruit_EK79686 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY); -/* Uncomment the following line if you are using 2.9" EPD */ + +// Uncomment the following line if you are using 2.9" EPD with IL0373 //Adafruit_IL0373 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY); //#define FLEXIBLE_290 -/* Uncomment the following line if you are using 4.2" tricolor EPD */ -//Adafruit_IL0398 display(300, 400, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY); +// Uncomment the following line if you are using 2.9" EPD with SSD1680 +//Adafruit_SSD1680 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY); + +// Uncomment the following line if you are using 2.9" EPD with UC8151D +//Adafruit_UC8151D display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY); #define COLOR1 EPD_BLACK diff --git a/src/Adafruit_EPD.h b/src/Adafruit_EPD.h index 4aa2c3c..fa10186 100644 --- a/src/Adafruit_EPD.h +++ b/src/Adafruit_EPD.h @@ -194,6 +194,7 @@ protected: void dcLow(); }; +#include "drivers/Adafruit_ACeP.h" #include "drivers/Adafruit_EK79686.h" #include "drivers/Adafruit_IL0373.h" #include "drivers/Adafruit_IL0398.h" @@ -204,8 +205,7 @@ protected: #include "drivers/Adafruit_SSD1675B.h" #include "drivers/Adafruit_SSD1680.h" #include "drivers/Adafruit_SSD1681.h" -#include "drivers/Adafruit_UC8276.h" #include "drivers/Adafruit_UC8151D.h" -#include "drivers/Adafruit_ACeP.h" +#include "drivers/Adafruit_UC8276.h" #endif /* _ADAFRUIT_EPD_H_ */ diff --git a/src/drivers/Adafruit_ACeP.cpp b/src/drivers/Adafruit_ACeP.cpp index 2481278..62a86ab 100644 --- a/src/drivers/Adafruit_ACeP.cpp +++ b/src/drivers/Adafruit_ACeP.cpp @@ -3,7 +3,6 @@ #define BUSY_WAIT 500 - // clang-format off const uint8_t acep_default_init_code[] { @@ -21,7 +20,6 @@ const uint8_t acep_default_init_code[] { // clang-format on - /**************************************************************************/ /*! @brief constructor if using external SRAM chip and software SPI @@ -37,10 +35,9 @@ const uint8_t acep_default_init_code[] { @param BUSY the busy pin to use */ /**************************************************************************/ -Adafruit_ACEP::Adafruit_ACEP(int width, int height, int8_t SID, - int8_t SCLK, int8_t DC, int8_t RST, - int8_t CS, int8_t SRCS, int8_t MISO, - int8_t BUSY) +Adafruit_ACEP::Adafruit_ACEP(int width, int height, int8_t SID, int8_t SCLK, + int8_t DC, int8_t RST, int8_t CS, int8_t SRCS, + int8_t MISO, int8_t BUSY) : Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) { if ((width % 8) != 0) { @@ -59,7 +56,6 @@ Adafruit_ACEP::Adafruit_ACEP(int width, int height, int8_t SID, } singleByteTxns = true; - } // constructor for hardware SPI - we indicate DataCommand, ChipSelect, Reset @@ -77,8 +73,7 @@ Adafruit_ACEP::Adafruit_ACEP(int width, int height, int8_t SID, */ /**************************************************************************/ Adafruit_ACEP::Adafruit_ACEP(int width, int height, int8_t DC, int8_t RST, - int8_t CS, int8_t SRCS, int8_t BUSY, - SPIClass *spi) + int8_t CS, int8_t SRCS, int8_t BUSY, SPIClass *spi) : Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) { if ((height % 8) != 0) { @@ -106,7 +101,7 @@ Adafruit_ACEP::Adafruit_ACEP(int width, int height, int8_t DC, int8_t RST, /**************************************************************************/ void Adafruit_ACEP::busy_wait(void) { if (_busy_pin >= 0) { - while (! digitalRead(_busy_pin)) { // wait for busy high + while (!digitalRead(_busy_pin)) { // wait for busy high delay(10); } } else { @@ -169,9 +164,9 @@ void Adafruit_ACEP::update() { buf[3] = 0xC0; EPD_command(ACEP_RESOLUTION, buf, 4); EPD_command(ACEP_DTM); - for (int i=0; i< 134400/256; i++) { + for (int i = 0; i < 134400 / 256; i++) { uint8_t block[256]; - memset(block, ((i % 6) << 4) | (i %6), 256); + memset(block, ((i % 6) << 4) | (i % 6), 256); EPD_data(block, 256); } EPD_command(ACEP_POWER_ON); @@ -241,6 +236,4 @@ uint8_t Adafruit_ACEP::writeRAMCommand(uint8_t index) { @param y Y address counter value */ /**************************************************************************/ -void Adafruit_ACEP::setRAMAddress(uint16_t x, uint16_t y) { - -} +void Adafruit_ACEP::setRAMAddress(uint16_t x, uint16_t y) {} diff --git a/src/drivers/Adafruit_ACeP.h b/src/drivers/Adafruit_ACeP.h index cdd94d8..991d100 100644 --- a/src/drivers/Adafruit_ACeP.h +++ b/src/drivers/Adafruit_ACeP.h @@ -4,7 +4,6 @@ #include "Adafruit_EPD.h" #include - #define ACEP_PANEL_SETTING 0x00 #define ACEP_POWER_SETTING 0x01 #define ACEP_POWER_OFF 0x02 @@ -29,10 +28,10 @@ class Adafruit_ACEP : public Adafruit_EPD { public: Adafruit_ACEP(int width, int height, int8_t SID, int8_t SCLK, int8_t DC, - int8_t RST, int8_t CS, int8_t SRCS, int8_t MISO, - int8_t BUSY = -1); + int8_t RST, int8_t CS, int8_t SRCS, int8_t MISO, + int8_t BUSY = -1); Adafruit_ACEP(int width, int height, int8_t DC, int8_t RST, int8_t CS, - int8_t SRCS, int8_t BUSY = -1, SPIClass *spi = &SPI); + int8_t SRCS, int8_t BUSY = -1, SPIClass *spi = &SPI); void begin(bool reset = true); void powerUp();