| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare.
- // Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines!
- //
- // based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html
- // Controller: UC8151 (IL0373) : https://www.good-display.com/public/html/pdfjs/viewer/viewernew.html?file=https://v4.cecdn.yun300.cn/100001_1909185148/UC8151D.pdf
- // Controller: IL0373 (UC8151) : http://www.e-paper-display.com/download_detail/downloadsId=535.html
- //
- // Author: Jean-Marc Zingg
- //
- // Version: see library.properties
- //
- // Library: https://github.com/ZinggJM/GxEPD2
- #ifndef _GxEPD2_260_M01_H_
- #define _GxEPD2_260_M01_H_
- #include "../GxEPD2_EPD.h"
- class GxEPD2_260_M01 : public GxEPD2_EPD
- {
- public:
- // attributes
- static const uint16_t WIDTH = 152;
- static const uint16_t HEIGHT = 296;
- static const GxEPD2::Panel panel = GxEPD2::GDEW026M01;
- static const bool hasColor = false;
- static const bool hasPartialUpdate = true;
- static const bool hasFastPartialUpdate = true; // set false for extended temperature range
- static const uint16_t power_on_time = 100; // ms, e.g. 60981us
- static const uint16_t power_off_time = 50; // ms, e.g. 39736us
- static const uint16_t full_refresh_time = 3400; // ms, e.g. 3308455us
- static const uint16_t partial_refresh_time = 1000; // ms, e.g. 938384us
- // constructor
- GxEPD2_260_M01(int8_t cs, int8_t dc, int8_t rst, int8_t busy);
- // methods (virtual)
- // Support for Bitmaps (Sprites) to Controller Buffer and to Screen
- void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white)
- void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white)
- // write to controller memory, without screen refresh; x and w should be multiple of 8
- void writeImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
- void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
- int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
- void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
- void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
- int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
- // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8
- void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
- // write to controller memory, with screen refresh; x and w should be multiple of 8
- void drawImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
- void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
- int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
- void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
- void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
- int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
- // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8
- void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false);
- void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen
- void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen
- void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time
- void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0)
- private:
- void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h);
- void _PowerOn();
- void _PowerOff();
- void _InitDisplay();
- void _Init_Full();
- void _Init_Part();
- void _Update_Full();
- void _Update_Part();
- private:
- static const unsigned char lut_20_vcomDC_partial[];
- static const unsigned char lut_21_ww_partial[];
- static const unsigned char lut_22_bw_partial[];
- static const unsigned char lut_23_wb_partial[];
- static const unsigned char lut_24_bb_partial[];
- };
- #endif
|