ソースを参照

Added 4.26 and 2.66G programs; Add 7.5V2 local brush, quick brush code; Add 2.9V2 quick brush code

shhds 1 年間 前
コミット
e4bb8924d4
100 ファイル変更6783 行追加271 行削除
  1. 248 0
      Arduino/epd2in66g/epd2in66g.cpp
  2. 74 0
      Arduino/epd2in66g/epd2in66g.h
  3. 60 0
      Arduino/epd2in66g/epd2in66g.ino
  4. 64 0
      Arduino/epd2in66g/epdif.cpp
  5. 51 0
      Arduino/epd2in66g/epdif.h
  6. 474 0
      Arduino/epd2in66g/imagedata.cpp
  7. 30 0
      Arduino/epd2in66g/imagedata.h
  8. 212 0
      Arduino/epd2in9_V2/epd2in9_V2.cpp
  9. 4 1
      Arduino/epd2in9_V2/epd2in9_V2.h
  10. 66 17
      Arduino/epd2in9_V2/epd2in9_V2.ino
  11. 369 0
      Arduino/epd2in9b_V4/epd2in9b_V4.cpp
  12. 71 0
      Arduino/epd2in9b_V4/epd2in9b_V4.h
  13. 64 0
      Arduino/epd2in9b_V4/epd2in9b_V4.ino
  14. 68 0
      Arduino/epd2in9b_V4/epdif.cpp
  15. 52 0
      Arduino/epd2in9b_V4/epdif.h
  16. 325 0
      Arduino/epd2in9b_V4/imagedata.cpp
  17. 28 0
      Arduino/epd2in9b_V4/imagedata.h
  18. 434 0
      Arduino/epd4in26/epd4in26.cpp
  19. 76 0
      Arduino/epd4in26/epd4in26.h
  20. 56 0
      Arduino/epd4in26/epd4in26.ino
  21. 68 0
      Arduino/epd4in26/epdif.cpp
  22. 52 0
      Arduino/epd4in26/epdif.h
  23. 223 0
      Arduino/epd4in26/imagedata.cpp
  24. 30 0
      Arduino/epd4in26/imagedata.h
  25. 16 1
      RaspberryPi_JetsonNano/c/Makefile
  26. 142 0
      RaspberryPi_JetsonNano/c/examples/EPD_2in66g_test.c
  27. 4 3
      RaspberryPi_JetsonNano/c/examples/EPD_2in9_V2_test.c
  28. 201 0
      RaspberryPi_JetsonNano/c/examples/EPD_2in9b_V4_test.c
  29. 215 0
      RaspberryPi_JetsonNano/c/examples/EPD_4in26_test.c
  30. 46 4
      RaspberryPi_JetsonNano/c/examples/EPD_7in5_V2_test.c
  31. 175 0
      RaspberryPi_JetsonNano/c/examples/EPD_7in5_V2_test_old.c
  32. 6 0
      RaspberryPi_JetsonNano/c/examples/EPD_Test.h
  33. 11 0
      RaspberryPi_JetsonNano/c/examples/main.c
  34. 65 1
      RaspberryPi_JetsonNano/c/lib/Config/DEV_Config.c
  35. 4 0
      RaspberryPi_JetsonNano/c/lib/Config/DEV_Config.h
  36. 219 0
      RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_2in66g.c
  37. 51 0
      RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_2in66g.h
  38. 81 17
      RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_2in9_V2.c
  39. 4 2
      RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_2in9_V2.h
  40. 465 0
      RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_2in9b_V4.c
  41. 52 0
      RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_2in9b_V4.h
  42. 541 0
      RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_4in26.c
  43. 52 0
      RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_4in26.h
  44. 153 143
      RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_7in5_V2.c
  45. 6 3
      RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_7in5_V2.h
  46. 601 0
      RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_7in5_V2_old.c
  47. 52 0
      RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_7in5_V2_old.h
  48. BIN
      RaspberryPi_JetsonNano/c/pic/2in66g.bmp
  49. BIN
      RaspberryPi_JetsonNano/c/pic/4in26_Scale.bmp
  50. 3 3
      RaspberryPi_JetsonNano/c/readme_CN.txt
  51. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_13in3k_test.py
  52. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_1in02_test.py
  53. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_1in54_V2_test.py
  54. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_1in54_test.py
  55. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_1in54b_V2_test.py
  56. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_1in54b_test.py
  57. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_1in54c_test.py
  58. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_1in64g_test.py
  59. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_2in13_V2_test.py
  60. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_2in13_V3_test.py
  61. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_2in13_V4_test.py
  62. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_2in13_test.py
  63. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_2in13b_V3_test.py
  64. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_2in13b_V4_test.py
  65. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_2in13bc_test.py
  66. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_2in13d_test.py
  67. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_2in13g_test.py
  68. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_2in36g_test.py
  69. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_2in66_test.py
  70. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_2in66b_test.py
  71. 69 0
      RaspberryPi_JetsonNano/python/examples/epd_2in66g_test.py
  72. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_2in7_V2_test.py
  73. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_2in7_test.py
  74. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_2in7b_V2_test.py
  75. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_2in7b_test.py
  76. 3 2
      RaspberryPi_JetsonNano/python/examples/epd_2in9_V2_test.py
  77. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_2in9_test.py
  78. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_2in9b_V3_test.py
  79. 118 0
      RaspberryPi_JetsonNano/python/examples/epd_2in9b_V4_test.py
  80. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_2in9bc_test.py
  81. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_2in9d_test.py
  82. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_3in0g_test.py
  83. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_3in52_test.py
  84. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_3in7_test.py
  85. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_4in01f_test.py
  86. 135 0
      RaspberryPi_JetsonNano/python/examples/epd_4in26_test.py
  87. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_4in2_V2_test.py
  88. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_4in2_test.py
  89. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_4in2b_V2_test.py
  90. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_4in2bc_test.py
  91. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_4in37g_test.py
  92. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_5in65f_test.py
  93. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_5in83_V2_test.py
  94. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_5in83_test.py
  95. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_5in83b_V2_test.py
  96. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_5in83bc_test.py
  97. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_7in3f_test.py
  98. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_7in3g_test.py
  99. 1 1
      RaspberryPi_JetsonNano/python/examples/epd_7in5_HD_test.py
  100. 49 29
      RaspberryPi_JetsonNano/python/examples/epd_7in5_V2_test.py

+ 248 - 0
Arduino/epd2in66g/epd2in66g.cpp

@@ -0,0 +1,248 @@
+/**
+ *  @filename   :   epd2in66g.cpp
+ *  @brief      :   Implements for e-paper library
+ *  @author     :   Waveshare
+ *
+ *  Copyright (C) Waveshare     2022/08/17
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include "epd2in66g.h"
+
+Epd::~Epd() {
+};
+
+Epd::Epd() {
+    reset_pin = RST_PIN;
+    dc_pin = DC_PIN;
+    cs_pin = CS_PIN;
+    busy_pin = BUSY_PIN;
+    WIDTH = EPD_WIDTH;
+    HEIGHT = EPD_HEIGHT;
+};
+
+int Epd::Init() {
+    /* this calls the peripheral hardware interface, see epdif */
+    if (IfInit() != 0) {
+        return -1;
+    }
+    Reset();
+    ReadBusyH();
+
+    SendCommand(0x4D);
+    SendData(0x78);
+
+    SendCommand(0x00);	//PSR
+    SendData(0x0F);
+    SendData(0x29);
+
+    SendCommand(0x01);	//PWRR
+    SendData(0x07);
+    SendData(0x00);
+
+    SendCommand(0x03);	//POFS
+    SendData(0x10);
+    SendData(0x54);
+    SendData(0x44);
+
+    SendCommand(0x06);	//BTST_P
+    SendData(0x05);
+    SendData(0x00);
+    SendData(0x3F);
+    SendData(0x0A);
+    SendData(0x25);
+    SendData(0x12);
+    SendData(0x1A); 
+
+    SendCommand(0x50);	//CDI
+    SendData(0x37);
+
+    SendCommand(0x60);	//TCON
+    SendData(0x02);
+    SendData(0x02);
+
+    SendCommand(0x61); //TRES
+    SendData(WIDTH/256);		// Source_BITS_H
+    SendData(WIDTH%256);		// Source_BITS_L
+    SendData(HEIGHT/256);			// Gate_BITS_H
+    SendData(HEIGHT%256); 		// Gate_BITS_L	
+
+    SendCommand(0xE7);
+    SendData(0x1C);
+
+    SendCommand(0xE3);	
+    SendData(0x22);
+
+    SendCommand(0xB4);
+    SendData(0xD0);
+    SendCommand(0xB5);
+    SendData(0x03);
+
+    SendCommand(0xE9);
+    SendData(0x01); 
+
+    SendCommand(0x30);
+    SendData(0x08);  
+
+    SendCommand(0x04);
+    ReadBusyH();
+    return 0;
+}
+
+/**
+ *  @brief: basic function for sending commands
+ */
+void Epd::SendCommand(unsigned char command) {
+    DigitalWrite(dc_pin, LOW);
+    SpiTransfer(command);
+}
+
+/**
+ *  @brief: basic function for sending data
+ */
+void Epd::SendData(unsigned char data) {
+    DigitalWrite(dc_pin, HIGH);
+    SpiTransfer(data);
+}
+
+/**
+ *  @brief: Wait until the busy_pin goes LOW
+ */
+void Epd::ReadBusyH(void) {
+    Serial.print("e-Paper busy H\r\n ");
+    while(DigitalRead(busy_pin) == LOW) {      //LOW: busy, HIGH: idle
+        DelayMs(5);
+    } 
+    Serial.print("e-Paper busy release H\r\n ");    
+}
+
+void Epd::ReadBusyL(void) {
+    Serial.print("e-Paper busy L\r\n ");
+    while(DigitalRead(busy_pin) == HIGH) {      //LOW: idle, HIGH: busy
+        DelayMs(5);
+    }      
+    Serial.print("e-Paper busy release L\r\n ");
+}
+
+/**
+ *  @brief: module reset.
+ *          often used to awaken the module in deep sleep,
+ *          see Epd::Sleep();
+ */
+void Epd::Reset(void) {
+    DigitalWrite(reset_pin, HIGH);
+    DelayMs(20);    
+    DigitalWrite(reset_pin, LOW);                //module reset    
+    DelayMs(2);
+    DigitalWrite(reset_pin, HIGH);
+    DelayMs(20);     
+}
+
+/******************************************************************************
+function :	Turn On Display
+parameter:
+******************************************************************************/
+void Epd::TurnOnDisplay(void)
+{
+    SendCommand(0x12); // DISPLAY_REFRESH
+    SendData(0x00);
+    ReadBusyH();
+}
+
+/******************************************************************************
+function :	Clear screen
+parameter:
+******************************************************************************/
+void Epd::Clear(UBYTE color)
+{
+    UWORD Width, Height;
+    Width = (WIDTH % 4 == 0)? (WIDTH / 4 ): (WIDTH / 4 + 1);
+    Height = HEIGHT;
+
+    SendCommand(0x10);
+    for (UWORD j = 0; j < Height; j++) {
+        for (UWORD i = 0; i < Width; i++) {
+            SendData((color<<6) | (color<<4) | (color<<2) | color);
+        }
+    }
+
+    TurnOnDisplay();
+}
+
+/******************************************************************************
+function :	Sends the image buffer in RAM to e-Paper and displays
+parameter:
+******************************************************************************/
+void Epd::Display(UBYTE *Image)
+{
+    UWORD Width, Height;
+    Width = (WIDTH % 4 == 0)? (WIDTH / 4 ): (WIDTH / 4 + 1);
+    Height = HEIGHT;
+
+    SendCommand(0x10);
+    for (UWORD j = 0; j < Height; j++) {
+        for (UWORD i = 0; i < Width; i++) {
+            SendData(pgm_read_byte(&Image[i + j * Width]));
+        }
+    }
+
+    TurnOnDisplay();
+}
+
+void Epd::Display_part(UBYTE *Image, UWORD xstart, UWORD ystart, UWORD image_width, UWORD image_height)
+{
+    UWORD Width, Height, i, j;
+    Width = (WIDTH % 4 == 0)? (WIDTH / 4 ): (WIDTH / 4 + 1);
+    Height = HEIGHT;
+
+    SendCommand(0x10);
+    for(i=0; i<Height; i++) {
+        for(j=0; j< Width; j++) {
+            if(i<image_height+ystart && i>=ystart && j<(image_width+xstart)/4 && j>=xstart/4) {
+              SendData(pgm_read_byte(&Image[(j-xstart/4) + (image_width/4*(i-ystart))]));
+            }
+			else {
+				SendData(0x55);
+			}
+		}
+    }
+
+
+    TurnOnDisplay();
+}
+
+/******************************************************************************
+function :	Enter sleep mode
+parameter:
+******************************************************************************/
+void Epd::Sleep(void)
+{
+    SendCommand(0x02); // POWER_OFF
+    SendData(0X00);
+    ReadBusyH();
+    
+    SendCommand(0x07); // DEEP_SLEEP
+    SendData(0XA5);
+}
+
+/* END OF FILE */
+
+

+ 74 - 0
Arduino/epd2in66g/epd2in66g.h

@@ -0,0 +1,74 @@
+/**
+ *  @filename   :   epd2in66g.h
+ *  @brief      :   Header file for e-paper display library epd4in37g.cpp
+ *  @author     :   Waveshare
+ *  
+ *  Copyright (C) Waveshare     2022/08/17
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef EPD2IN66G_H
+#define EPD2IN66G_H
+
+#include "epdif.h"
+
+// Display resolution
+#define EPD_WIDTH       184
+#define EPD_HEIGHT      360
+
+// Color
+#define  black   0x0
+#define  white   0x1
+#define  yellow  0x2
+#define  red     0x3
+
+#define UWORD   unsigned int
+#define UBYTE   unsigned char
+#define UDOUBLE unsigned long
+
+class Epd : EpdIf {
+public:
+    unsigned long WIDTH;
+    unsigned long HEIGHT;
+
+    Epd();
+    ~Epd();
+    int  Init();
+    void SendCommand(unsigned char command);
+    void SendData(unsigned char data);
+    void Reset(void);
+    void ReadBusyH(void);
+    void ReadBusyL(void);
+    void TurnOnDisplay(void);
+    void Clear(UBYTE color);
+    void Display(UBYTE *Image);
+    void Display_part(UBYTE *Image, UWORD xstart, UWORD ystart, UWORD image_width, UWORD image_height);
+    void Sleep(void);
+
+private:
+    unsigned int reset_pin;
+    unsigned int dc_pin;
+    unsigned int cs_pin;
+    unsigned int busy_pin;
+};
+
+#endif /* EPD4IN37_H */
+
+/* END OF FILE */

+ 60 - 0
Arduino/epd2in66g/epd2in66g.ino

@@ -0,0 +1,60 @@
+/**
+ *  @filename   :   epd2in66g-demo.ino
+ *  @brief      :   2.66inch e-Paper (G) display demo
+ *  @author     :   Waveshare
+ *
+ *  Copyright (C) Waveshare     2022/08/17
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include <SPI.h>
+#include "epd2in66g.h"
+#include "imagedata.h"
+
+Epd epd;
+
+void setup() {
+  // put your setup code here, to run once:
+  Serial.begin(115200);
+  Serial.print("e-Paper init  \r\n");
+  if (epd.Init() != 0) {
+      Serial.print("e-Paper init failed");
+      return;
+  }
+
+  Serial.print("White \r\n");
+  epd.Clear(white);
+  delay(2000);
+
+  Serial.print("Small Image \r\n");
+  epd.Display_part(Image4color, 10, 96, 168, 168);
+  delay(2000);
+
+  Serial.print("Clear...\r\n");
+  epd.Clear(white);
+  delay(2000);
+
+  Serial.print("Goto Sleep...\r\n");
+  epd.Sleep();
+}
+
+void loop() {
+
+}

+ 64 - 0
Arduino/epd2in66g/epdif.cpp

@@ -0,0 +1,64 @@
+/**
+ *  @filename   :   epdif.cpp
+ *  @brief      :   Implements EPD interface functions
+ *                  Users have to implement all the functions in epdif.cpp
+ *  @author     :   Yehui from Waveshare
+ *
+ *  Copyright (C) Waveshare     August 10 2017
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include "epdif.h"
+#include <SPI.h>
+
+EpdIf::EpdIf() {
+};
+
+EpdIf::~EpdIf() {
+};
+
+void EpdIf::DigitalWrite(int pin, int value) {
+    digitalWrite(pin, value);
+}
+
+int EpdIf::DigitalRead(int pin) {
+    return digitalRead(pin);
+}
+
+void EpdIf::DelayMs(unsigned int delaytime) {
+    delay(delaytime);
+}
+
+void EpdIf::SpiTransfer(unsigned char data) {
+    digitalWrite(CS_PIN, LOW);
+    SPI.transfer(data);
+    digitalWrite(CS_PIN, HIGH);
+}
+
+int EpdIf::IfInit(void) {
+    pinMode(CS_PIN, OUTPUT);
+    pinMode(RST_PIN, OUTPUT);
+    pinMode(DC_PIN, OUTPUT);
+    pinMode(BUSY_PIN, INPUT); 
+
+    SPI.begin();
+    SPI.beginTransaction(SPISettings(2000000, MSBFIRST, SPI_MODE0));
+    return 0;
+}

+ 51 - 0
Arduino/epd2in66g/epdif.h

@@ -0,0 +1,51 @@
+/**
+ *  @filename   :   epdif.h
+ *  @brief      :   Header file of epdif.cpp providing EPD interface functions
+ *                  Users have to implement all the functions in epdif.cpp
+ *  @author     :   Yehui from Waveshare
+ *
+ *  Copyright (C) Waveshare     August 10 2017
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef EPDIF_H
+#define EPDIF_H
+
+#include <Arduino.h>
+
+// Pin definition
+#define RST_PIN         8
+#define DC_PIN          9
+#define CS_PIN          10
+#define BUSY_PIN        7
+
+class EpdIf {
+public:
+    EpdIf(void);
+    ~EpdIf(void);
+
+    static int  IfInit(void);
+    static void DigitalWrite(int pin, int value); 
+    static int  DigitalRead(int pin);
+    static void DelayMs(unsigned int delaytime);
+    static void SpiTransfer(unsigned char data);
+};
+
+#endif

+ 474 - 0
Arduino/epd2in66g/imagedata.cpp

@@ -0,0 +1,474 @@
+/**
+ *  @filename   :   imagedata.cpp
+ *  @brief      :   data file for epd demo
+ *
+ *  Copyright (C) Waveshare     2022/08/16
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include "imagedata.h"
+#include <avr/pgmspace.h>
+
+// 4 Color Image Data 168*168 
+const unsigned char Image4color[7056] PROGMEM = {
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x57,0xFF,0xFF,0xFF,
+0xFF,0xD5,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0xFF,0xFF,
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+0xFF,0xFF,0xFF,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x5F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF5,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+0xFF,0xFF,0xFF,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x5F,0xFF,0xFF,0xFF,
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF5,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x57,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,
+0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xD5,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x7F,
+0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,
+0xFF,0xFF,0xFD,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,0xFF,0xFF,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x5F,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x03,0xFF,0xFF,0xFF,0xFF,0xF5,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0xFF,0xFF,0xFF,0xFF,
+0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,
+0xFF,0xFF,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x57,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xD5,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x7F,
+0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x03,0xFF,0xFF,0xFF,0xFD,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0xFF,0xFF,0xFF,0xFC,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,
+0xFF,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x5F,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0xAA,0x80,0x00,
+0xA8,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,0xF5,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x7F,0xFF,0xFF,0xFC,
+0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0xAA,0x80,0x0A,0xAA,0x80,0x00,0x00,0x00,0x00,
+0x00,0x00,0x3F,0xFF,0xFF,0xFD,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0xFF,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,
+0x0A,0xAA,0x80,0x0A,0xAA,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x57,
+0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0xAA,0x80,0x0A,0xAA,0xA0,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xD5,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x7F,0xFF,0xFF,0xFC,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x02,0xAA,0x80,0x02,0x8A,0xA8,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x3F,0xFF,0xFF,0xFD,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2A,
+0x80,0x00,0x02,0xA8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x57,0xFF,0xFF,0xFF,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2A,0x80,0x00,0x0A,0xA8,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xD5,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x5F,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x2A,0x80,0x00,0x3A,0xA8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x0F,0xFF,0xFF,0xF5,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x7F,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x2A,0x80,0x00,
+0x2A,0xA0,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFD,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0xFF,0xFF,0xFF,0x00,0x00,0x00,
+0x01,0x50,0x00,0x00,0x00,0x00,0x00,0x2A,0x80,0x00,0xAA,0x80,0x00,0x00,0x00,0x00,
+0x15,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x57,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x15,0x54,0x00,0x00,0x00,0x00,
+0x00,0x2A,0x80,0x02,0xAA,0x00,0x00,0x00,0x00,0x00,0x55,0x50,0x00,0x00,0x00,0x3F,
+0xFF,0xFF,0xD5,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x5F,0xFF,0xFF,
+0xF0,0x00,0x00,0x00,0x55,0x54,0x00,0x00,0x00,0x00,0x00,0x2A,0x80,0x0A,0xAB,0x00,
+0x00,0x00,0x00,0x00,0x55,0x54,0x00,0x00,0x00,0x0F,0xFF,0xFF,0xF5,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x7F,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x15,0x55,
+0x00,0x00,0x00,0x00,0x00,0x2A,0x80,0x2A,0xA8,0x00,0x00,0x00,0x00,0x01,0x55,0x50,
+0x00,0x00,0x00,0x03,0xFF,0xFF,0xFD,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x7F,0xFF,0xFC,0x00,0x00,0x00,0x00,0x15,0x55,0x00,0x00,0x00,0x00,0x00,0x2A,
+0x80,0x2A,0xAA,0xA8,0x00,0x00,0x00,0x01,0x55,0x50,0x00,0x00,0x00,0x00,0x3F,0xFF,
+0xFD,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0xFF,0xFF,0xF0,0x00,0x00,
+0x00,0x00,0x05,0x55,0x40,0x00,0x00,0x00,0x00,0x2A,0x80,0x2A,0xAA,0xA8,0x00,0x00,
+0x00,0x05,0x55,0x40,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x57,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x01,0x55,0x50,0x00,
+0x00,0x00,0x00,0x2A,0x80,0x2A,0xAA,0xA8,0x00,0x00,0x00,0x15,0x55,0x00,0x00,0x00,
+0x00,0x00,0x0F,0xFF,0xFF,0xD5,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x5F,0xFF,
+0xFF,0xC0,0x00,0x00,0x00,0x00,0x01,0x55,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x2A,
+0xAA,0xA8,0x00,0x00,0x00,0x15,0x55,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xF5,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x7F,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,
+0x00,0x55,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x55,
+0x54,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFD,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x7F,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x55,0x54,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x55,0x54,0x00,0x00,0x00,0x00,0x00,
+0x00,0x3F,0xFF,0xFD,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0xFF,0xFF,0xF0,0x00,
+0x00,0x00,0x00,0x00,0x00,0x15,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x01,0x55,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x57,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x15,
+0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x55,0x50,0x00,
+0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xD5,0x55,0x55,0x55,0x55,0x55,0x55,0x57,
+0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x55,0x40,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x55,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0xFF,0xFF,0xD5,0x55,0x55,0x55,0x55,0x55,0x55,0x5F,0xFF,0xFF,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x01,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x01,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xF5,0x55,0x55,0x55,
+0x55,0x55,0x55,0x7F,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x50,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x3F,0xFF,0xFD,0x55,0x55,0x55,0x55,0x55,0x55,0x7F,0xFF,0xF0,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,
+0xFD,0x55,0x55,0x55,0x55,0x55,0x55,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0x55,0x55,0x55,0x55,0x55,
+0x55,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x03,0xFF,0xFF,0x55,0x55,0x55,0x55,0x55,0x57,0xFF,0xFF,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xD5,
+0x55,0x55,0x55,0x55,0x5F,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xF5,0x55,0x55,0x55,0x55,0x5F,0xFF,
+0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x3F,0xFF,0xF5,0x55,0x55,0x55,0x55,0x7F,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x40,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFD,0x55,0x55,
+0x55,0x55,0x7F,0xFF,0xF0,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x01,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x04,0x00,0x00,0x0F,0xFF,0xFD,0x55,0x55,0x55,0x55,0x7F,0xFF,0xC0,0x00,
+0x01,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x40,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x55,0x00,0x00,0x03,
+0xFF,0xFD,0x55,0x55,0x55,0x55,0xFF,0xFF,0xC0,0x00,0x01,0x55,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x01,0x55,0x00,0x00,0x03,0xFF,0xFF,0x55,0x55,0x55,0x55,
+0xFF,0xFF,0x00,0x00,0x05,0x55,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x05,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,
+0x55,0x40,0x00,0x00,0xFF,0xFF,0x55,0x55,0x55,0x57,0xFF,0xFF,0x00,0x00,0x15,0x55,
+0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x50,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x55,0x55,0x50,0x00,0x00,0xFF,0xFF,
+0xD5,0x55,0x55,0x57,0xFF,0xFF,0x00,0x00,0x05,0x55,0x55,0x50,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x15,0x55,0x55,0x40,0x00,0x00,0xFF,0xFF,0xD5,0x55,0x55,0x5F,0xFF,0xFC,
+0x00,0x00,0x01,0x55,0x55,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x05,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x55,0x55,0x55,0x00,
+0x00,0x00,0x3F,0xFF,0xF5,0x55,0x55,0x5F,0xFF,0xFC,0x00,0x00,0x00,0x15,0x55,0x55,
+0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x54,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x05,0x55,0x55,0x50,0x00,0x00,0x00,0x3F,0xFF,0xF5,0x55,
+0x55,0x5F,0xFF,0xF0,0x00,0x00,0x00,0x01,0x55,0x55,0x50,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x15,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,
+0x55,0x55,0x00,0x00,0x00,0x00,0x0F,0xFF,0xF5,0x55,0x55,0x7F,0xFF,0xF0,0x00,0x00,
+0x00,0x00,0x55,0x55,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x54,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x55,0x54,0x00,0x00,0x00,0x00,
+0x0F,0xFF,0xFD,0x55,0x55,0x7F,0xFF,0xC0,0x00,0x00,0x00,0x00,0x05,0x55,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x54,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x01,0x55,0x40,0x00,0x00,0x00,0x00,0x03,0xFF,0xFD,0x55,0x55,0x7F,
+0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x55,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x54,0x00,
+0x00,0x00,0x00,0x00,0x03,0xFF,0xFD,0x55,0x55,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,
+0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x55,0x55,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,
+0xFF,0x55,0x55,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x55,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x55,0x55,0xFF,0xFF,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x55,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0xFF,0xFF,0x55,0x55,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x55,0x55,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x55,
+0x57,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x01,0x55,0x55,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xD5,0x57,0xFF,0xFC,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x55,0x55,
+0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x3F,0xFF,0xD5,0x57,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x55,0x55,0x40,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xD5,0x57,0xFF,
+0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x01,0x55,0x55,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xD5,0x5F,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x55,0x55,0x50,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,
+0xFF,0xF5,0x5F,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x35,0x55,0x55,0x5C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xF5,0x5F,0xFF,0xF0,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xF5,
+0x55,0x55,0x5F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x0F,0xFF,0xF5,0x5F,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xF5,0x55,0x55,0x5F,0xF0,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xF5,
+0x5F,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x3F,0xF5,0x55,0x55,0x5F,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xF5,0x5F,0xFF,0xF0,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xD5,0x55,0x55,
+0x57,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x0F,0xFF,0xF5,0x5F,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xD5,0x55,0x55,0x57,0xFF,0xC0,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xF5,0x7F,0xFF,
+0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
+0xFF,0xD5,0x55,0x55,0x57,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFD,0x7F,0xFF,0xC0,0x00,0x00,0x00,0xAA,0x80,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xD5,0x55,0x55,0x57,0xFF,
+0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0xA8,0x00,0x00,0x00,0x03,
+0xFF,0xFD,0x7F,0xFF,0xC0,0x00,0x00,0x02,0xAA,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x3F,0xFF,0x55,0x55,0x55,0x55,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x2A,0xAA,0x80,0x00,0x00,0x03,0xFF,0xFD,0x7F,0xFF,0xC0,0x00,
+0x00,0x0A,0xAA,0xA8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0x55,
+0x55,0x55,0x55,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0xAA,
+0xA0,0x00,0x00,0x03,0xFF,0xFD,0x7F,0xFF,0xC0,0x00,0x00,0x0A,0xA0,0xA8,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFD,0x55,0x55,0x55,0x55,0x7F,0xFC,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0xAA,0xA0,0x00,0x00,0x03,0xFF,0xFD,
+0x7F,0xFF,0xC0,0x00,0x00,0x0A,0x80,0xAB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0xFF,0xFD,0x55,0x55,0x55,0x55,0x7F,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x02,0x0A,0xA0,0x00,0x00,0x03,0xFF,0xFD,0x7F,0xFF,0xC0,0x00,0x00,0x0A,
+0x80,0xAA,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xF5,0x55,0x55,0x55,
+0x55,0x5F,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0xA0,0x00,
+0x00,0x03,0xFF,0xFD,0x7F,0xFF,0xC0,0x00,0x00,0x0A,0x80,0xAA,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0xFF,0xF5,0x55,0x55,0x55,0x55,0x5F,0xFF,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x02,0xAA,0xA0,0x00,0x00,0x03,0xFF,0xFD,0x7F,0xFF,
+0xC0,0x00,0x00,0x0A,0xA2,0xAA,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,
+0xF5,0x55,0x55,0x55,0x55,0x5F,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x02,0xAA,0xA0,0x00,0x00,0x03,0xFF,0xFD,0x7F,0xFF,0xC0,0x00,0x00,0x0A,0xAA,0xAA,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xF5,0x55,0x55,0x55,0x55,0x5F,
+0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0xAA,0x80,0x00,0x00,0x03,
+0xFF,0xFD,0x7F,0xFF,0xC0,0x00,0x00,0x02,0xAA,0xAB,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0xFF,0xF5,0x55,0x55,0x55,0x55,0x5B,0xFF,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x02,0xAA,0xA0,0x00,0x00,0x03,0xFF,0xFD,0x7F,0xFF,0xC0,0x00,
+0x00,0x00,0xAA,0xA8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xF5,0x55,
+0x55,0x55,0x55,0x55,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0xAA,
+0xA0,0x00,0x00,0x03,0xFF,0xFD,0x7F,0xFF,0xC0,0x00,0x00,0x00,0x02,0xA8,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFD,0x55,0x55,0x55,0x55,0x55,0x7F,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0xA0,0x00,0x00,0x03,0xFF,0xFD,
+0x7F,0xFF,0xC0,0x00,0x00,0x00,0x0E,0xA8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x3F,0xFD,0x55,0x55,0x55,0x55,0x55,0x5C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x02,0x0A,0xA0,0x00,0x00,0x03,0xFF,0xFD,0x7F,0xFF,0xC0,0x00,0x00,0x00,
+0xAA,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xF5,0x55,0x55,0x55,
+0x55,0x55,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0xAA,0xA0,0x00,
+0x00,0x03,0xFF,0xFD,0x7F,0xFF,0xC0,0x00,0x00,0x00,0xAA,0x80,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x3F,0xD5,0x55,0x55,0x55,0x55,0x55,0x55,0x40,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0xAA,0xA0,0x00,0x00,0x03,0xFF,0xFD,0x7F,0xFF,
+0xC0,0x00,0x00,0x00,0xAA,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0D,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x2A,0xAA,0x80,0x00,0x00,0x03,0xFF,0xFD,0x7F,0xFF,0xF0,0x00,0x00,0x00,0x80,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0xAA,0x00,0x00,0x00,0x0F,
+0xFF,0xFD,0x5F,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x15,0x55,0x57,0xD5,0x57,0xF5,0x55,0x55,0x55,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xF5,0x5F,0xFF,0xF0,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x55,0x55,0x5F,
+0xFF,0xFF,0xFF,0x55,0x55,0x55,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x0F,0xFF,0xF5,0x5F,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x55,0x55,0x7F,0xFF,0xFF,0xFF,0xF5,0x55,0x55,
+0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xF5,
+0x5F,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x05,0x55,0x57,0xFF,0xFF,0xFF,0xFF,0xF1,0x55,0x55,0x55,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xF5,0x5F,0xFF,0xF0,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x55,0x53,0xFF,0xFF,0xFF,
+0xFF,0xC0,0x15,0x55,0x55,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x0F,0xFF,0xF5,0x5F,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x55,0x55,0x40,0x3F,0xFF,0xFF,0xFC,0x00,0x01,0x55,0x55,0x50,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xF5,0x5F,0xFF,
+0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x55,0x54,
+0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x15,0x55,0x54,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xF5,0x57,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x55,0x50,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x01,0x55,0x55,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,
+0xFF,0xD5,0x57,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x15,0x55,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x55,0x55,0x50,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xD5,0x57,0xFF,0xFC,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x55,0x54,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x55,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x3F,0xFF,0xD5,0x57,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x05,0x55,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x55,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xD5,
+0x55,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x55,
+0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x55,0x40,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x55,0x55,0xFF,0xFF,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x55,0x54,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x55,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0xFF,0xFF,0x55,0x55,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,
+0x00,0x01,0x55,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x05,0x54,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x55,0x55,0xFF,
+0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x55,0x00,0x00,0x00,0x05,0x55,0x40,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x55,0x40,0x01,0x54,0x00,
+0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0x55,0x55,0x7F,0xFF,0xC0,0x00,0x00,0x00,0x00,
+0x05,0x55,0x00,0x00,0x00,0x15,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x05,0x50,0x01,0x55,0x40,0x00,0x00,0x00,0x00,0x03,0xFF,
+0xFD,0x55,0x55,0x7F,0xFF,0xC0,0x00,0x00,0x00,0x00,0x55,0x55,0x40,0x00,0x00,0x55,
+0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+0x54,0x05,0x55,0x54,0x00,0x00,0x00,0x00,0x03,0xFF,0xFD,0x55,0x55,0x7F,0xFF,0xF0,
+0x00,0x00,0x00,0x01,0x55,0x55,0x50,0x00,0x01,0x55,0x40,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x15,0x55,0x55,0x00,0x00,
+0x00,0x00,0x0F,0xFF,0xFD,0x55,0x55,0x5F,0xFF,0xF0,0x00,0x00,0x00,0x15,0x55,0x55,
+0x40,0x00,0x05,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x01,0x45,0x55,0x55,0x50,0x00,0x00,0x00,0x0F,0xFF,0xF5,0x55,
+0x55,0x5F,0xFF,0xFC,0x00,0x00,0x01,0x55,0x55,0x54,0x00,0x00,0x15,0x50,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,
+0x55,0x55,0x55,0x00,0x00,0x00,0x3F,0xFF,0xF5,0x55,0x55,0x5F,0xFF,0xFC,0x00,0x00,
+0x05,0x55,0x55,0x50,0x00,0x00,0x55,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x55,0x55,0x40,0x00,0x00,
+0x3F,0xFF,0xF5,0x55,0x55,0x57,0xFF,0xFF,0x00,0x00,0x15,0x55,0x55,0x00,0x00,0x01,
+0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x01,0x55,0x55,0x50,0x00,0x00,0xFF,0xFF,0xD5,0x55,0x55,0x57,
+0xFF,0xFF,0x00,0x00,0x05,0x55,0x50,0x00,0x00,0x15,0x50,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,
+0x55,0x40,0x00,0x00,0xFF,0xFF,0xD5,0x55,0x55,0x55,0xFF,0xFF,0x00,0x00,0x01,0x55,
+0x00,0x00,0x00,0x55,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x55,0x00,0x00,0x00,0xFF,0xFF,
+0x55,0x55,0x55,0x55,0xFF,0xFF,0xC0,0x00,0x01,0x54,0x00,0x00,0x01,0x54,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x55,0x00,0x00,0x03,0xFF,0xFF,0x55,0x55,0x55,0x55,0x7F,0xFF,
+0xC0,0x00,0x00,0x40,0x00,0x00,0x05,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,
+0x00,0x03,0xFF,0xFD,0x55,0x55,0x55,0x55,0x7F,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,
+0x15,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFD,0x55,0x55,
+0x55,0x55,0x7F,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x54,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFD,0x55,0x55,0x55,0x55,0x5F,0xFF,0xFC,0x00,
+0x00,0x00,0x00,0x01,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,
+0xFF,0xF5,0x55,0x55,0x55,0x55,0x5F,0xFF,0xFF,0x00,0x00,0x00,0x00,0x05,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xF5,0x55,0x55,0x55,0x55,
+0x57,0xFF,0xFF,0x00,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0xFF,0xFF,0xD5,0x55,0x55,0x55,0x55,0x55,0xFF,0xFF,0xC0,0x00,0x00,
+0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0x55,
+0x55,0x55,0x55,0x55,0x55,0xFF,0xFF,0xF0,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,
+0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0x55,0x55,0x55,0x55,0x55,0x55,0x7F,
+0xFF,0xF0,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x01,0x50,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x0F,0xFF,0xFD,0x55,0x55,0x55,0x55,0x55,0x55,0x7F,0xFF,0xFC,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x01,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x01,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFD,0x55,0x55,0x55,
+0x55,0x55,0x55,0x5F,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x55,0x40,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x55,0x40,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0xFF,0xFF,0xF5,0x55,0x55,0x55,0x55,0x55,0x55,0x57,0xFF,0xFF,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x01,0x55,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,
+0xD5,0x55,0x55,0x55,0x55,0x55,0x55,0x57,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,
+0x00,0x15,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x55,
+0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xD5,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x55,0x54,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x55,0x54,0x00,0x00,0x00,0x00,0x00,
+0x00,0x0F,0xFF,0xFF,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x7F,0xFF,0xFC,0x00,
+0x00,0x00,0x00,0x00,0x00,0x55,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x55,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFD,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x7F,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x01,0x55,
+0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x55,0x00,
+0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFD,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x5F,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x01,0x55,0x50,0x00,0x00,0x00,0x00,0x00,
+0x02,0xA8,0x00,0x00,0x00,0x00,0x00,0x15,0x55,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,
+0xFF,0xF5,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x57,0xFF,0xFF,0xF0,0x00,0x00,
+0x00,0x00,0x05,0x55,0x40,0x00,0x00,0x00,0x00,0x00,0x2A,0xA8,0x00,0x00,0x00,0x00,
+0x00,0x05,0x55,0x40,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0xD5,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x15,0x55,0x00,0x00,
+0x00,0x00,0x00,0x00,0xAA,0xA8,0x00,0x00,0x00,0x00,0x00,0x01,0x55,0x50,0x00,0x00,
+0x00,0x00,0x0F,0xFF,0xFF,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x7F,
+0xFF,0xFC,0x00,0x00,0x00,0x00,0x15,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0xAA,0xA0,
+0x00,0x00,0x00,0x00,0x00,0x01,0x55,0x50,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFD,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x7F,0xFF,0xFF,0xC0,0x00,0x00,0x00,
+0x55,0x54,0x00,0x00,0x00,0x00,0x00,0x02,0xAA,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x55,0x54,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFD,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x5F,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x15,0x54,0x00,0x00,0x00,0x00,
+0x00,0x02,0xAA,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x55,0x50,0x00,0x00,0x00,0x0F,
+0xFF,0xFF,0xF5,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x57,0xFF,0xFF,
+0xFC,0x00,0x00,0x00,0x01,0x50,0x00,0x00,0x00,0x00,0x00,0x02,0xAA,0xA8,0x00,0x00,
+0x00,0x00,0x00,0x00,0x15,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0xD5,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x40,
+0x00,0x00,0x00,0x00,0x00,0x02,0xAA,0xAA,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,
+0x00,0x00,0x00,0xFF,0xFF,0xFF,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x7F,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,
+0xAA,0xAA,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFD,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x5F,0xFF,0xFF,0xF0,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0xAA,0xAA,0x80,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0xF5,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x57,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x02,0xA8,0x2A,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0xFF,0xFF,0xFF,0xD5,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0xA8,0x2A,
+0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x7F,0xFF,0xFF,0xFC,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0xA8,0xAA,0x80,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x3F,0xFF,0xFF,0xFD,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x57,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x02,0xAA,0xAA,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,
+0xD5,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0xFF,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0xAA,0xAA,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x7F,0xFF,0xFF,0xFC,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0xAA,0xA8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x3F,0xFF,0xFF,0xFD,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x5F,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x0A,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,0xF5,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0xFF,
+0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x7F,0xFF,0xFF,0xFF,0xC0,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,
+0xFD,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x57,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xD5,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0xFF,0xFF,
+0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,
+0xFF,0xFF,0xFF,0xFF,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x5F,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,0xFF,0xF5,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x03,0xFF,0xFF,0xFF,0xFF,0xFF,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x7F,0xFF,0xFF,
+0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,0xFF,0xFF,
+0xFD,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x57,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,
+0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xD5,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x5F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+0xFF,0xFF,0xFF,0xF5,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0xFF,0xFF,0xFF,
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x5F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF5,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0xFF,0xFF,0xFF,
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+0xFF,0xFF,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x57,0xFF,
+0xFF,0xFF,0xFF,0xD5,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
+};
+
+

+ 30 - 0
Arduino/epd2in66g/imagedata.h

@@ -0,0 +1,30 @@
+/**
+ *  @filename   :   imagedata.h
+ *  @brief      :   head file for imagedata.cpp
+ *
+ *  Copyright (C) Waveshare     2022/08/16
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+extern const unsigned char Image4color[];
+
+/* FILE END */
+
+

+ 212 - 0
Arduino/epd2in9_V2/epd2in9_V2.cpp

@@ -73,6 +73,52 @@ unsigned char WS_20_30[159] =
 0x22,	0x17,	0x41,	0x0,	0x32,	0x36
 };	
 
+unsigned char Gray4[159] =			
+{											
+0x00,	0x60,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L0	 //2.28s			
+0x20,	0x60,	0x10,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L1				
+0x28,	0x60,	0x14,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L2				
+0x2A,	0x60,	0x15,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L3 				
+0x00,	0x90,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L4 				
+0x00,	0x02,	0x00,	0x05,	0x14,	0x00,	0x00,						//TP, SR, RP of Group0				
+0x1E,	0x1E,	0x00,	0x00,	0x00,	0x00,	0x01,						//TP, SR, RP of Group1				
+0x00,	0x02,	0x00,	0x05,	0x14,	0x00,	0x00,						//TP, SR, RP of Group2				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group3				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group4				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group5				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group6				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group7				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group8				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group9				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group10				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group11				
+0x24,	0x22,	0x22,	0x22,	0x23,	0x32,	0x00,	0x00,	0x00,				//FR, XON				
+0x22,	0x17,	0x41,	0xAE,	0x32,	0x28,							//EOPT VGH VSH1 VSH2 VSL VCOM				
+};
+
+unsigned char WF_FULL[159] =
+{											
+0x90,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L0	1.00S			
+0x60,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L1				
+0x90,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L2				
+0x60,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L3 				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L4 				
+0x19,	0x19,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group0				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group1				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group2				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group3				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group4				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group5				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group6				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group7				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group8				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group9				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group10				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group11				
+0x24,	0x42,	0x22,	0x22,	0x23,	0x32,	0x00,	0x00,	0x00,				//FR, XON				
+0x22,	0x17,	0x41,	0xAE,	0x32,	0x38,							//EOPT VGH VSH1 VSH2 VSL VCOM				
+};
+
 Epd::~Epd() {
 };
 
@@ -120,6 +166,78 @@ int Epd::Init() {
     return 0;
 }
 
+int Epd::Init_Fast() {
+    /* this calls the peripheral hardware interface, see epdif */
+    if (IfInit() != 0) {
+        return -1;
+    }
+	
+	Reset();
+	
+    /* EPD hardware init start */
+	WaitUntilIdle();   
+	SendCommand(0x12);  //SWRESET
+	WaitUntilIdle();   
+	
+	SendCommand(0x01); //Driver output control      
+	SendData(0x27);
+	SendData(0x01);
+	SendData(0x00);
+	
+	SendCommand(0x11); //data entry mode       
+	SendData(0x03);
+
+	SetMemoryArea(0, 0, width-1, height-1);
+
+    SendCommand(0x3C);       
+	SendData(0x05);
+
+	SendCommand(0x21); //  Display update control
+	SendData(0x00);
+	SendData(0x80);	
+
+	SetMemoryPointer(0, 0);
+	WaitUntilIdle();
+
+    SetLut_by_host(WF_FULL);
+    /* EPD hardware init end */
+    return 0;
+}
+
+int Epd::Init_4Gray() {
+    /* this calls the peripheral hardware interface, see epdif */
+    if (IfInit() != 0) {
+        return -1;
+    }
+	
+	Reset();
+	
+    /* EPD hardware init start */
+	WaitUntilIdle();   
+	SendCommand(0x12);  //SWRESET
+	WaitUntilIdle();   
+	
+	SendCommand(0x01); //Driver output control      
+	SendData(0x27);
+	SendData(0x01);
+	SendData(0x00);
+	
+	SendCommand(0x11); //data entry mode       
+	SendData(0x03);
+
+	SetMemoryArea(8, 0, width, height-1);
+
+	SendCommand(0x3C); 
+	SendData(0x04);
+
+	SetMemoryPointer(8, 0);
+	WaitUntilIdle();
+
+  SetLut_by_host(Gray4);
+  /* EPD hardware init end */
+  return 0;
+}
+
 /**
  *  @brief: basic function for sending commands
  */
@@ -331,6 +449,100 @@ void Epd::ClearFrameMemory(unsigned char color) {
     for (int i = 0; i < this->width / 8 * this->height; i++) {
         SendData(color);
     }
+
+    SendCommand(0x26);
+    /* send the color data */
+    for (int i = 0; i < this->width / 8 * this->height; i++) {
+        SendData(color);
+    }
+}
+
+void Epd::Display4Gray(const unsigned char *Image)
+{
+    int i,j,k;
+    unsigned char temp1,temp2,temp3;
+
+    SendCommand(0x24);	       
+    for(i=0;i<4736;i++)	     
+    {
+        temp3=0;
+        for(j=0;j<2;j++)	
+        {
+            temp1 = pgm_read_byte(&Image[i*2+j]);
+            for(k=0;k<2;k++)	
+            {
+                temp2 = temp1&0xC0 ;
+                if(temp2 == 0xC0)
+                    temp3 |= 0x00;//white
+                else if(temp2 == 0x00)
+                    temp3 |= 0x01;  //black
+                else if(temp2 == 0x80) 
+                    temp3 |= 0x01;  //gray1
+                else //0x40
+                    temp3 |= 0x00; //gray2
+                temp3 <<= 1;	
+                
+                temp1 <<= 2;
+                temp2 = temp1&0xC0 ;
+                if(temp2 == 0xC0)  //white
+                    temp3 |= 0x00;
+                else if(temp2 == 0x00) //black
+                    temp3 |= 0x01;
+                else if(temp2 == 0x80)
+                    temp3 |= 0x01; //gray1
+                else    //0x40
+                        temp3 |= 0x00;	//gray2	
+                if(j!=1 || k!=1)				
+                    temp3 <<= 1;
+                
+                temp1 <<= 2;
+            }
+            
+         }
+        SendData(temp3);			
+    }
+    // new  data
+    SendCommand(0x26);	       
+    for(i=0;i<4736;i++)	  
+    {
+        temp3=0;
+        for(j=0;j<2;j++)	
+        {
+            temp1 = pgm_read_byte(&Image[i*2+j]);
+            for(k=0;k<2;k++)	
+            {
+                temp2 = temp1&0xC0 ;
+                if(temp2 == 0xC0)
+                    temp3 |= 0x00;//white
+                else if(temp2 == 0x00)
+                    temp3 |= 0x01;  //black
+                else if(temp2 == 0x80) 
+                    temp3 |= 0x00;  //gray1
+                else //0x40
+                    temp3 |= 0x01; //gray2
+                temp3 <<= 1;	
+                
+                temp1 <<= 2;
+                temp2 = temp1&0xC0 ;
+                if(temp2 == 0xC0)  //white
+                    temp3 |= 0x00;
+                else if(temp2 == 0x00) //black
+                    temp3 |= 0x01;
+                else if(temp2 == 0x80)
+                    temp3 |= 0x00; //gray1
+                else    //0x40
+                    temp3 |= 0x01;	//gray2
+                if(j!=1 || k!=1)					
+                    temp3 <<= 1;
+                
+                temp1 <<= 2;
+            }
+            
+         }
+        SendData(temp3);	
+    }
+
+    DisplayFrame();
 }
 
 /**

+ 4 - 1
Arduino/epd2in9_V2/epd2in9_V2.h

@@ -41,6 +41,8 @@ public:
     Epd();
     ~Epd();
     int  Init();
+    int  Init_Fast();
+    int  Init_4Gray(void);
     void SendCommand(unsigned char command);
     void SendData(unsigned char data);
     void WaitUntilIdle(void);
@@ -63,7 +65,8 @@ public:
     void SetFrameMemory_Base(const unsigned char* image_buffer);
     void ClearFrameMemory(unsigned char color);
     void DisplayFrame(void);
-	void DisplayFrame_Partial(void);
+	  void DisplayFrame_Partial(void);
+    void Display4Gray(const unsigned char *Image);
     void Sleep(void);
 
 private:

+ 66 - 17
Arduino/epd2in9_V2/epd2in9_V2.ino

@@ -1,4 +1,4 @@
-/**
+  /**
  *  @filename   :   epd2in9_V2-demo.ino
  *  @brief      :   2.9inch e-paper V2 display demo
  *  @author     :   Yehui from Waveshare
@@ -43,6 +43,7 @@ Paint paint(image, 0, 0);    // width should be the multiple of 8
 Epd epd;
 unsigned long time_start_ms;
 unsigned long time_now_s;
+char time_string[] = {'0', '0', ':', '0', '0', '\0'};
 
 void setup() {
   // put your setup code here, to run once:
@@ -51,7 +52,8 @@ void setup() {
       Serial.print("e-Paper init failed");
       return;
   }
-  
+
+#if 1
   epd.ClearFrameMemory(0xFF);   // bit set = white, bit reset = black
   epd.DisplayFrame();
   
@@ -91,7 +93,9 @@ void setup() {
   epd.DisplayFrame();
 
   delay(2000);
+#endif
 
+#if 1
   if (epd.Init() != 0) {
       Serial.print("e-Paper init failed ");
       return;
@@ -105,27 +109,72 @@ void setup() {
    */
   epd.SetFrameMemory_Base(IMAGE_DATA);
   epd.DisplayFrame();
+#endif
+
+#if 0
+  // Quick brush demo
+  if (epd.Init_Fast() != 0) {
+      Serial.print("e-Paper init failed ");
+      return;
+  }
+
+  /** 
+   *  there are 2 memory areas embedded in the e-paper display
+   *  and once the display is refreshed, the memory area will be auto-toggled,
+   *  i.e. the next action of SetFrameMemory will set the other memory area
+   *  therefore you have to set the frame memory and refresh the display twice.
+   */
+  epd.SetFrameMemory_Base(IMAGE_DATA);
+  epd.DisplayFrame();
+#endif
+
+#if 0
+  Serial.print("show 4-gray image\r\n");
+  if (epd.Init_4Gray() != 0) {
+      Serial.print("e-Paper init failed ");
+      return;
+  }
+  epd.Display4Gray(IMAGE_DATA_4Gray);
+#endif
+
+#if 0
+  if (epd.Init() != 0) {
+      Serial.print("e-Paper init failed");
+      return;
+  }
 
+  epd.ClearFrameMemory(0xFF);   // bit set = white, bit reset = black
+  epd.DisplayFrame();
+  
   time_start_ms = millis();
+  
+  // put your main code here, to run repeatedly:
+
+  for(;;){
+    time_now_s = (millis() - time_start_ms) / 1000;
+    time_string[0] = time_now_s / 60 / 10 + '0';
+    time_string[1] = time_now_s / 60 % 10 + '0';
+    time_string[3] = time_now_s % 60 / 10 + '0';
+    time_string[4] = time_now_s % 60 % 10 + '0';
+
+    paint.SetWidth(32);
+    paint.SetHeight(96);
+    paint.SetRotate(ROTATE_90);
+  
+    paint.Clear(UNCOLORED);
+    paint.DrawStringAt(0, 4, time_string, &Font24, COLORED);
+    epd.SetFrameMemory_Partial(paint.GetImage(), 80, 72, paint.GetWidth(), paint.GetHeight());
+    epd.DisplayFrame_Partial();
+  }
+#endif
+
+  /* Deep sleep */
+  Serial.print("sleep...");
+  epd.Sleep();
 }
 
 void loop() {
-  // put your main code here, to run repeatedly:
-  time_now_s = (millis() - time_start_ms) / 1000;
-  char time_string[] = {'0', '0', ':', '0', '0', '\0'};
-  time_string[0] = time_now_s / 60 / 10 + '0';
-  time_string[1] = time_now_s / 60 % 10 + '0';
-  time_string[3] = time_now_s % 60 / 10 + '0';
-  time_string[4] = time_now_s % 60 % 10 + '0';
 
-  paint.SetWidth(32);
-  paint.SetHeight(96);
-  paint.SetRotate(ROTATE_90);
-
-  paint.Clear(UNCOLORED);
-  paint.DrawStringAt(0, 4, time_string, &Font24, COLORED);
-  epd.SetFrameMemory_Partial(paint.GetImage(), 80, 72, paint.GetWidth(), paint.GetHeight());
-  epd.DisplayFrame_Partial();
 
   // delay(300);
 }

+ 369 - 0
Arduino/epd2in9b_V4/epd2in9b_V4.cpp

@@ -0,0 +1,369 @@
+/**
+ *  @filename   :   epd2in9b_V4.cpp
+ *  @brief      :   Implements for e-paper library
+ *  @author     :   Waveshare
+ *
+ *  Copyright (C) Waveshare     2023-12-20
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include "epd2in9b_V4.h"
+#include "imagedata.h"
+
+Epd::~Epd() {
+};
+
+Epd::Epd() {
+    reset_pin = RST_PIN;
+    dc_pin = DC_PIN;
+    cs_pin = CS_PIN;
+    busy_pin = BUSY_PIN;
+    width = EPD_WIDTH;
+    height = EPD_HEIGHT;
+};
+
+int Epd::Init(void) {
+    if (IfInit() != 0) {
+        return -1;
+    }
+    Reset();
+
+    ReadBusy();
+    SendCommand(0x12);
+    ReadBusy();
+
+    SendCommand(0x01); //Driver output control      
+    SendData((height-1)%256);    
+    SendData((height-1)/256);
+    SendData(0x00);
+
+    SendCommand(0x11); //data entry mode       
+    SendData(0x03);
+
+    SendCommand(0x44); //set Ram-X address start/end position   
+    SendData(0x00);
+    SendData(width/8-1);   
+
+    SendCommand(0x45); //set Ram-Y address start/end position          
+    SendData(0x00);
+    SendData(0x00); 
+    SendData((height-1)%256);    
+    SendData((height-1)/256);
+
+    SendCommand(0x3C); //BorderWavefrom
+    SendData(0x05);	
+
+    SendCommand(0x21); //  Display update control
+    SendData(0x00);		
+    SendData(0x80);	
+
+    SendCommand(0x18); //Read built-in temperature sensor
+    SendData(0x80);	
+
+    SendCommand(0x4E);   // set RAM x address count to 0;
+    SendData(0x00);
+    SendCommand(0x4F);   // set RAM y address count to 0X199;    
+    SendData(0x00);    
+    SendData(0x00);
+    ReadBusy();
+
+    return 0;
+}
+
+int Epd::Init_Fast(void) {
+    if (IfInit() != 0) {
+        return -1;
+    }
+    Reset();
+
+    ReadBusy();   
+    SendCommand(0x12);  //SWRESET
+    ReadBusy();   	
+
+    SendCommand(0x18); //Read built-in temperature sensor
+    SendData(0x80);
+
+    SendCommand(0x22); // Load temperature value
+    SendData(0xB1);		
+    SendCommand(0x20);	
+    ReadBusy();   
+
+    SendCommand(0x1A); // Write to temperature register
+    SendData(0x5a);		// 90		
+    SendData(0x00);	
+                
+    SendCommand(0x22); // Load temperature value
+    SendData(0x91);		
+    SendCommand(0x20);	
+    ReadBusy();  
+
+    SendCommand(0x01); //Driver output control      
+    SendData((height-1)%256);    
+    SendData((height-1)/256);
+    SendData(0x00);
+
+    SendCommand(0x11); //data entry mode       
+    SendData(0x03);
+
+    SendCommand(0x44); //set Ram-X address start/end position   
+    SendData(0x00);
+    SendData(width/8-1);   
+
+    SendCommand(0x45); //set Ram-Y address start/end position          
+    SendData(0x00);
+    SendData(0x00); 
+    SendData((height-1)%256);    
+    SendData((height-1)/256);	
+
+    SendCommand(0x4E);   // set RAM x address count to 0;
+    SendData(0x00);
+    SendCommand(0x4F);   // set RAM y address count to 0X199;    
+    SendData(0x00);    
+    SendData(0x00);
+    ReadBusy();	
+
+    return 0;
+}
+
+/**
+ *  @brief: basic function for sending commands
+ */
+void Epd::SendCommand(unsigned char command) {
+    DigitalWrite(dc_pin, LOW);
+    SpiTransfer(command);
+}
+
+/**
+ *  @brief: basic function for sending data
+ */
+void Epd::SendData(unsigned char data) {
+    DigitalWrite(dc_pin, HIGH);
+    SpiTransfer(data);
+}
+
+/**
+ *  @brief: Wait until the busy_pin goes HIGH
+ */
+void Epd::ReadBusy(void) {
+  unsigned char busy;
+  Serial.print("e-Paper busy \r\n ");
+  while(1)
+  {
+    if(DigitalRead(busy_pin) == 0)
+      break;
+    DelayMs(50);
+  }
+  Serial.print("e-Paper busy release \r\n ");
+  DelayMs(200);
+}
+
+/**
+ *  @brief: module reset.
+ *          often used to awaken the module in deep sleep,
+ *          see Epd::Sleep();
+ */
+void Epd::Reset(void) {
+    DigitalWrite(reset_pin, HIGH);
+    DelayMs(200);   
+    DigitalWrite(reset_pin, LOW);                //module reset    
+    DelayMs(5);
+    DigitalWrite(reset_pin, HIGH);
+    DelayMs(200);    
+}
+
+/******************************************************************************
+function :	Turn On Display
+parameter:
+******************************************************************************/
+void Epd::TurnOnDisplay(void)
+{
+	SendCommand(0x22); //Display Update Control
+	SendData(0xF7);
+	SendCommand(0x20); //Activate Display Update Sequence
+	ReadBusy();
+}
+
+void Epd::TurnOnDisplay_Base(void)
+{
+	SendCommand(0x22); //Display Update Control
+	SendData(0xF4);
+	SendCommand(0x20); //Activate Display Update Sequence
+	ReadBusy();
+}
+
+void Epd::TurnOnDisplay_Partial(void)
+{
+	SendCommand(0x22); //Display Update Control
+	SendData(0x1C);
+	SendCommand(0x20); //Activate Display Update Sequence
+	ReadBusy();
+}
+
+void Epd::TurnOnDisplay_Fast(void)
+{
+	SendCommand(0x22); //Display Update Control
+	SendData(0xC7);
+	SendCommand(0x20); //Activate Display Update Sequence
+	ReadBusy();
+}
+
+void Epd::Display(const UBYTE *blackimage, const UBYTE *ryimage) {
+    UBYTE k;
+    SendCommand(0x24);
+    for (UWORD j = 0; j < height; j++) {
+        for (UWORD i = 0; i < width/8; i++) {
+          SendData(pgm_read_byte(&blackimage[i + (j*width/8)]));
+        }
+    }
+    
+    SendCommand(0x26);
+    for (UWORD j = 0; j < height; j++) {
+        for (UWORD i = 0; i < width/8; i++) {
+          k = pgm_read_byte(&ryimage[i + (j*width/8)]);
+          SendData(~k);
+        }
+    }
+    TurnOnDisplay();
+}
+
+void Epd::Display_Fast(const UBYTE *blackimage, const UBYTE *ryimage) {
+    UBYTE k;
+    SendCommand(0x24);
+    for (UWORD j = 0; j < height; j++) {
+        for (UWORD i = 0; i < width/8; i++) {
+          SendData(pgm_read_byte(&blackimage[i + (j*width/8)]));
+        }
+    }
+    
+    SendCommand(0x26);
+    for (UWORD j = 0; j < height; j++) {
+        for (UWORD i = 0; i < width/8; i++) {
+          k = pgm_read_byte(&ryimage[i + (j*width/8)]);
+          SendData(~k);
+        }
+    }
+    TurnOnDisplay_Fast();
+}
+
+
+
+void Epd::Clear() {
+    //send black data
+    SendCommand(0x24);
+    for (UWORD j = 0; j < height; j++) {
+        for (UWORD i = 0; i < width/8; i++) {
+            SendData(0xff);
+        }
+    }
+    //send red data
+    SendCommand(0x26);
+    for (UWORD j = 0; j < height; j++) {
+        for (UWORD i = 0; i < width/8; i++) {
+            SendData(0x00);
+        }
+    }
+    TurnOnDisplay_Base();
+    SendCommand(0x26);
+    for (UWORD j = 0; j < height; j++) {
+        for (UWORD i = 0; i < width/8; i++) {
+            SendData(0xff);
+        }
+    }
+}
+
+void Epd::Clear_Base() {
+    //send black data
+    SendCommand(0x10);
+    for (UWORD j = 0; j < height; j++) {
+        for (UWORD i = 0; i < width/8; i++) {
+            SendData(0xff);
+        }
+    }
+    //send red data
+    SendCommand(0x26);
+    for (UWORD j = 0; j < height; j++) {
+        for (UWORD i = 0; i < width/8; i++) {
+            SendData(0x00);
+        }
+    }
+    TurnOnDisplay();
+}
+
+//Partial refresh display
+void Epd::Partial(const UBYTE *Image, UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend)
+{
+    if((Xstart % 8 + Xend % 8 == 8 && Xstart % 8 > Xend % 8) || Xstart % 8 + Xend % 8 == 0 || (Xend - Xstart)%8 == 0)
+    {
+        Xstart = Xstart / 8 ;
+        Xend = Xend / 8;
+    }
+    else
+    {
+        Xstart = Xstart / 8 ;
+        Xend = Xend % 8 == 0 ? Xend / 8 : Xend / 8 + 1;
+    }
+    
+
+    UWORD i, Width;
+	Width = Xend -  Xstart;
+	UWORD IMAGE_COUNTER = Width * (Yend-Ystart);
+
+	Xend -= 1;
+	Yend -= 1;	
+
+    SendCommand(0x44);       // set RAM x address start/end, in page 35
+    SendData(Xstart & 0xff);    // RAM x address start at 00h;
+    SendData(Xend & 0xff);    // RAM x address end at 0fh(15+1)*8->128 
+    SendCommand(0x45);       // set RAM y address start/end, in page 35
+    SendData(Ystart & 0xff);    // RAM y address start at 0127h;
+    SendData((Ystart>>8) & 0x01);    // RAM y address start at 0127h;
+    SendData(Yend & 0xff);    // RAM y address end at 00h;
+    SendData((Yend>>8) & 0x01); 
+
+    SendCommand(0x4E);   // set RAM x address count to 0;
+    SendData(Xstart & 0xff); 
+    SendCommand(0x4F);   // set RAM y address count to 0X127;    
+    SendData(Ystart & 0xff);
+    SendData((Ystart>>8) & 0x01);
+
+
+    SendCommand(0x24);   //Write Black and White image to RAM
+    for (i = 0; i < IMAGE_COUNTER; i++) {
+	    SendData(pgm_read_byte(&Image[i]));
+	}
+	TurnOnDisplay_Partial();
+
+}
+/**
+ *  @brief: After this command is transmitted, the chip would enter the 
+ *          deep-sleep mode to save power. 
+ *          The deep sleep mode would return to standby by hardware reset. 
+ *          The only one parameter is a check code, the command would be
+ *          You can use EPD_Reset() to awaken
+ */
+void Epd::Sleep(void) {
+    SendCommand(0x10); // DEEP_SLEEP
+    SendData(0x01); // check code
+}
+
+
+
+/* END OF FILE */

+ 71 - 0
Arduino/epd2in9b_V4/epd2in9b_V4.h

@@ -0,0 +1,71 @@
+/**
+ *  @filename   :   epd2in9b_V4.h
+ *  @brief      :   Header file for e-paper library epd2in9b_V4.cpp
+ *  @author     :   Waveshare
+ *  
+ *  Copyright (C) Waveshare     2023-12-20
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef EPD2IN9B_V4_H
+#define EPD2IN9B_V4_H
+
+#include "epdif.h"
+
+// Display resolution
+#define EPD_WIDTH       128
+#define EPD_HEIGHT      296
+
+#define UWORD  unsigned int
+#define UBYTE  unsigned char
+
+class Epd : EpdIf {
+public:
+    Epd();
+    ~Epd();
+    int  Init(void);
+    int Init_Fast(void);
+    void ReadBusy(void);
+    void Reset(void);
+    void TurnOnDisplay(void);
+    void TurnOnDisplay_Base(void);
+    void TurnOnDisplay_Partial(void);
+    void TurnOnDisplay_Fast(void);
+    void Display(const UBYTE *blackimage, const UBYTE *ryimage);
+    void Display_Fast(const UBYTE *blackimage, const UBYTE *ryimage);
+    void Partial(const UBYTE *Image, UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend);
+    void Clear_Base();
+    void SendCommand(unsigned char command);
+    void SendData(unsigned char data);
+    void Sleep(void);
+    void Clear(void);
+    
+private:
+    unsigned int reset_pin;
+    unsigned int dc_pin;
+    unsigned int cs_pin;
+    unsigned int busy_pin;
+    unsigned long width;
+    unsigned long height;
+};
+
+#endif
+
+/* END OF FILE */

+ 64 - 0
Arduino/epd2in9b_V4/epd2in9b_V4.ino

@@ -0,0 +1,64 @@
+/**
+ *  @filename   :   epd2in9b_V4-demo.ino
+ *  @brief      :   2.9inch e-paper display demo
+ *  @author     :   Waveshare
+ *
+ *  Copyright (C) Waveshare     2023-12-20
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include <SPI.h>
+#include "epd2in9b_V4.h"
+#include "imagedata.h"
+
+Epd epd;
+
+void setup() {
+  // put your setup code here, to run once:
+  Serial.begin(115200);
+  Serial.print("2.9inch b V4 e-Paper init \r\n ");
+  if (epd.Init() != 0) {
+      Serial.print("e-Paper init failed\r\n ");
+      return;
+  }
+  Serial.print("e-Paper Clear\r\n ");
+  epd.Clear();
+
+#if 0
+  Serial.print("draw image\r\n ");
+  epd.Display(IMAGE_DATA, IMAGE_DATA);
+#else
+  epd.Init_Fast();
+  Serial.print("draw image\r\n ");
+  epd.Display_Fast(IMAGE_DATA, IMAGE_DATA);
+#endif
+
+  delay(2000);
+  Serial.print("e-Paper Clear\r\n ");
+  epd.Init();
+  epd.Clear();
+
+  Serial.print("Goto Sleep...\r\n");
+  epd.Sleep();
+}
+
+void loop() {
+  // put your main code here, to run repeatedly:
+}

+ 68 - 0
Arduino/epd2in9b_V4/epdif.cpp

@@ -0,0 +1,68 @@
+/**
+ *  @filename   :   epdif.cpp
+ *  @brief      :   Implements EPD interface functions
+ *                  Users have to implement all the functions in epdif.cpp
+ *  @author     :   Yehui from Waveshare
+ *
+ *  Copyright (C) Waveshare     August 10 2017
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include "epdif.h"
+#include <SPI.h>
+
+EpdIf::EpdIf() {
+};
+
+EpdIf::~EpdIf() {
+};
+
+void EpdIf::DigitalWrite(int pin, int value) {
+    digitalWrite(pin, value);
+}
+
+int EpdIf::DigitalRead(int pin) {
+    return digitalRead(pin);
+}
+
+void EpdIf::DelayMs(unsigned int delaytime) {
+    delay(delaytime);
+}
+
+void EpdIf::SpiTransfer(unsigned char data) {
+    digitalWrite(CS_PIN, LOW);
+    SPI.transfer(data);
+    digitalWrite(CS_PIN, HIGH);
+}
+
+int EpdIf::IfInit(void) {
+    pinMode(CS_PIN, OUTPUT);
+    pinMode(RST_PIN, OUTPUT);
+    pinMode(DC_PIN, OUTPUT);
+    pinMode(BUSY_PIN, INPUT); 
+
+    pinMode(PWR_PIN, OUTPUT);
+    DigitalWrite(PWR_PIN, 1);
+
+    SPI.begin();
+    SPI.beginTransaction(SPISettings(2000000, MSBFIRST, SPI_MODE0));
+    return 0;
+}
+

+ 52 - 0
Arduino/epd2in9b_V4/epdif.h

@@ -0,0 +1,52 @@
+/**
+ *  @filename   :   epdif.h
+ *  @brief      :   Header file of epdif.cpp providing EPD interface functions
+ *                  Users have to implement all the functions in epdif.cpp
+ *  @author     :   Yehui from Waveshare
+ *
+ *  Copyright (C) Waveshare     August 10 2017
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef EPDIF_H
+#define EPDIF_H
+
+#include <Arduino.h>
+
+// Pin definition
+#define RST_PIN         8
+#define DC_PIN          9
+#define CS_PIN          10
+#define BUSY_PIN        7
+#define PWR_PIN         6
+
+class EpdIf {
+public:
+    EpdIf(void);
+    ~EpdIf(void);
+
+    static int  IfInit(void);
+    static void DigitalWrite(int pin, int value); 
+    static int  DigitalRead(int pin);
+    static void DelayMs(unsigned int delaytime);
+    static void SpiTransfer(unsigned char data);
+};
+
+#endif

+ 325 - 0
Arduino/epd2in9b_V4/imagedata.cpp

@@ -0,0 +1,325 @@
+/**
+ *  @filename   :   imagedata.cpp
+ *  @brief      :   data file for epd demo
+ *
+ *  Copyright (C) Waveshare     July 3 2020
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION O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FF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF};

+ 28 - 0
Arduino/epd2in9b_V4/imagedata.h

@@ -0,0 +1,28 @@
+/**
+ *  @filename   :   imagedata.h
+ *  @brief      :   head file for imagedata.cpp
+ *
+ *  Copyright (C) Waveshare     July 3 2020
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+extern const unsigned char IMAGE_DATA[];
+
+/* FILE END */

+ 434 - 0
Arduino/epd4in26/epd4in26.cpp

@@ -0,0 +1,434 @@
+/**
+ *  @filename   :   epd4in26.cpp
+ *  @brief      :   Implements for e-paper library
+ *  @author     :   Yehui from Waveshare
+ *
+ *  Copyright (C) Waveshare     23-12-20
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include "epd4in26.h"
+
+const unsigned char LUT_DATA_4Gray[112] =    //112bytes
+{											
+0x80,	0x48,	0x4A,	0x22,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	
+0x0A,	0x48,	0x68,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	
+0x88,	0x48,	0x60,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	
+0xA8,	0x48,	0x45,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	
+0x07,	0x1E,	0x1C,	0x02,	0x00,						
+0x05,	0x01,	0x05,	0x01,	0x02,						
+0x08,	0x01,	0x01,	0x04,	0x04,						
+0x00,	0x02,	0x00,	0x02,	0x01,						
+0x00,	0x00,	0x00,	0x00,	0x00,						
+0x00,	0x00,	0x00,	0x00,	0x00,						
+0x00,	0x00,	0x00,	0x00,	0x00,						
+0x00,	0x00,	0x00,	0x00,	0x00,						
+0x00,	0x00,	0x00,	0x00,	0x00,						
+0x00,	0x00,	0x00,	0x00,	0x01,						
+0x22,	0x22,	0x22,	0x22,	0x22,						
+0x17,	0x41,	0xA8,	0x32,	0x30,						
+0x00,	0x00,	
+};	
+
+Epd::~Epd() {
+};
+
+Epd::Epd() {
+    reset_pin = RST_PIN;
+    dc_pin = DC_PIN;
+    cs_pin = CS_PIN;
+    busy_pin = BUSY_PIN;
+    WIDTH = EPD_WIDTH;
+    HEIGHT = EPD_HEIGHT;
+};
+
+int Epd::Init(void) {
+    if (IfInit() != 0) {
+        return -1;
+    }
+    Reset();
+    DelayMs(100);
+
+    ReadBusy();   
+    SendCommand(0x12);  //SWRESET
+    ReadBusy();   
+    
+    SendCommand(0x18); // use the internal temperature sensor
+    SendData(0x80);
+
+    SendCommand(0x0C); //set soft start     
+    SendData(0xAE);
+    SendData(0xC7);
+    SendData(0xC3);
+    SendData(0xC0);
+    SendData(0x80);
+
+    SendCommand(0x01);   //      drive output control    
+    SendData((HEIGHT-1)%256); //  Y  
+    SendData((HEIGHT-1)/256); //  Y 
+    SendData(0x02);
+
+    SendCommand(0x3C);        // Border       Border setting 
+    SendData(0x01);
+
+    SendCommand(0x11);        //    data  entry  mode
+    SendData(0x01);           //       X-mode  x+ y-    
+
+    SetWindows(0, HEIGHT-1, WIDTH-1, 0);
+
+    SetCursor(0, 0);
+
+    ReadBusy();
+
+    return 0;
+}
+
+int Epd::Init_Fast(void) {
+    if (IfInit() != 0) {
+        return -1;
+    }
+    Reset();
+	DelayMs(100);
+
+	ReadBusy();   
+	SendCommand(0x12);  //SWRESET
+	ReadBusy();   
+	
+	SendCommand(0x18); // use the internal temperature sensor
+	SendData(0x80);
+
+	SendCommand(0x0C); //set soft start     
+	SendData(0xAE);
+	SendData(0xC7);
+	SendData(0xC3);
+	SendData(0xC0);
+	SendData(0x80);
+
+	SendCommand(0x01);   //      drive output control    
+	SendData((HEIGHT-1)%256); //  Y  
+	SendData((HEIGHT-1)/256); //  Y 
+	SendData(0x02);
+
+	SendCommand(0x3C);        // Border       Border setting 
+	SendData(0x01);
+
+	SendCommand(0x11);        //    data  entry  mode
+	SendData(0x01);           //       X-mode  x+ y-    
+
+	SetWindows(0, HEIGHT-1, WIDTH-1, 0);
+
+	SetCursor(0, 0);
+
+	ReadBusy();
+
+	//TEMP (1.5s)
+	SendCommand(0x1A);  
+    SendData(0x5A); 
+
+    SendCommand(0x22);  
+    SendData(0x91); 
+    SendCommand(0x20); 
+	
+	ReadBusy();
+
+    return 0;
+}
+
+int Epd::Init_4GRAY(void) {
+    if (IfInit() != 0) {
+        return -1;
+    }
+    Reset();
+	DelayMs(100);
+
+	ReadBusy();   
+	SendCommand(0x12);  //SWRESET
+	ReadBusy();   
+	
+	SendCommand(0x18); // use the internal temperature sensor
+	SendData(0x80);
+
+	SendCommand(0x0C); //set soft start     
+	SendData(0xAE);
+	SendData(0xC7);
+	SendData(0xC3);
+	SendData(0xC0);
+	SendData(0x80);
+
+	SendCommand(0x01);   //      drive output control    
+	SendData((WIDTH-1)%256); //  Y  
+	SendData((WIDTH-1)/256); //  Y 
+	SendData(0x02);
+
+	SendCommand(0x3C);        // Border       Border setting 
+	SendData(0x01);
+
+	SendCommand(0x11);        //    data  entry  mode
+	SendData(0x01);           //       X-mode  x+ y-    
+
+	SetWindows(0, HEIGHT-1, WIDTH-1, 0);
+
+	SetCursor(0, 0);
+
+	ReadBusy();
+
+    SetLut();
+
+    return 0;
+}
+
+/******************************************************************************
+function :	Setting the display window
+parameter:
+******************************************************************************/
+void Epd::SetWindows(unsigned long Xstart, unsigned long Ystart, unsigned long Xend, unsigned long Yend)
+{
+    SendCommand(0x44); // SET_RAM_X_ADDRESS_START_END_POSITION
+    SendData(Xstart & 0xFF);
+    SendData((Xstart>>8) & 0x03);
+    SendData(Xend & 0xFF);
+    SendData((Xend>>8) & 0x03);
+	
+    SendCommand(0x45); // SET_RAM_Y_ADDRESS_START_END_POSITION
+    SendData(Ystart & 0xFF);
+    SendData((Ystart>>8) & 0x03);
+    SendData(Yend & 0xFF);
+    SendData((Yend>>8) & 0x03);
+}
+
+/******************************************************************************
+function :	Set Cursor
+parameter:
+******************************************************************************/
+void Epd::SetCursor(unsigned long Xstart, unsigned long Ystart)
+{
+    SendCommand(0x4E); // SET_RAM_X_ADDRESS_COUNTER
+    SendData(Xstart & 0xFF);
+    SendData((Xstart>>8) & 0x03);
+
+    SendCommand(0x4F); // SET_RAM_Y_ADDRESS_COUNTER
+    SendData(Ystart & 0xFF);
+    SendData((Ystart>>8) & 0x03);
+}
+
+/**
+ *  @brief: basic function for sending commands
+ */
+void Epd::SendCommand(unsigned char command) {
+    DigitalWrite(dc_pin, LOW);
+    SpiTransfer(command);
+}
+
+/**
+ *  @brief: basic function for sending data
+ */
+void Epd::SendData(unsigned char data) {
+    DigitalWrite(dc_pin, HIGH);
+    SpiTransfer(data);
+}
+
+/**
+ *  @brief: Wait until the busy_pin goes HIGH
+ */
+void Epd::ReadBusy(void) {
+    unsigned char busy;
+    Serial.print("e-Paper Busy\r\n ");
+    while(1)
+    {	 //=1 BUSY
+      if(DigitalRead(busy_pin)==0) 
+        break;
+      DelayMs(20);
+    }
+    Serial.print("e-Paper Busy Release\r\n ");
+    DelayMs(20);
+}
+
+/**
+ *  @brief: module reset.
+ *          often used to awaken the module in deep sleep,
+ *          see Epd::Sleep();
+ */
+void Epd::Reset(void) {
+    DigitalWrite(reset_pin, HIGH);
+    DelayMs(20); 
+    DigitalWrite(reset_pin, LOW);                //module reset    
+    DelayMs(4);
+    DigitalWrite(reset_pin, HIGH);
+    DelayMs(20);    
+}
+
+/******************************************************************************
+function :	Turn On Display
+parameter:
+******************************************************************************/
+void Epd::TurnOnDisplay(void)
+{
+	SendCommand(0x22); //Display Update Control
+	SendData(0xF7);
+	SendCommand(0x20); //Activate Display Update Sequence
+	ReadBusy();
+}
+
+void Epd::TurnOnDisplay_Fast(void)
+{
+	SendCommand(0x22); //Display Update Control
+	SendData(0xC7);
+	SendCommand(0x20); //Activate Display Update Sequence
+	ReadBusy();
+}
+
+void Epd::TurnOnDisplay_Part(void)
+{
+	SendCommand(0x22); //Display Update Control
+	SendData(0xFF);
+	SendCommand(0x20); //Activate Display Update Sequence
+	ReadBusy();
+}
+
+void Epd::TurnOnDisplay_4GRAY(void)
+{
+    SendCommand(0x22);
+    SendData(0xC7);
+	SendCommand(0x20);
+    ReadBusy();
+}
+
+void Epd::Display(const unsigned char* frame_buffer) {
+    
+    SendCommand(0x24);
+    for (unsigned long j = 0; j < HEIGHT; j++) {
+        for (unsigned long i = 0; i < WIDTH/8; i++) {
+            SendData(frame_buffer[i + j * WIDTH/8]);
+        }
+    }
+
+    TurnOnDisplay();
+}
+
+void Epd::Displaypart(const unsigned char* pbuffer, unsigned long xStart, unsigned long yStart,unsigned long Picture_Width,unsigned long Picture_Height) {
+    SendCommand(0x24);
+    // xStart = xStart/8;
+    // xStart = xStart*8;
+    for (unsigned long j = 0; j < HEIGHT; j++) {
+        for (unsigned long i = 0; i < WIDTH/8; i++) {
+            if( (j>=yStart) && (j<yStart+Picture_Height) && (i*8>=xStart) && (i*8<xStart+Picture_Width)){
+                SendData(pgm_read_byte(&(pbuffer[i-xStart/8 + (Picture_Width)/8*(j-yStart)])) );
+                // SendData(0xff);
+            }else {
+                SendData(0xFF);
+            }
+        }
+    }
+    TurnOnDisplay();
+}
+
+void Epd::Display_Base(const unsigned char* frame_buffer) {
+    
+    SendCommand(0x24);
+    for (unsigned long j = 0; j < HEIGHT; j++) {
+        for (unsigned long i = 0; i < WIDTH/8; i++) {
+            SendData(frame_buffer[i + j * WIDTH/8]);
+        }
+    }
+
+    SendCommand(0x26);
+    for (unsigned long j = 0; j < HEIGHT; j++) {
+        for (unsigned long i = 0; i < WIDTH/8; i++) {
+            SendData(frame_buffer[i + j * WIDTH/8]);
+        }
+    }
+
+    TurnOnDisplay();
+}
+
+void Epd::Display_Fast(const unsigned char* frame_buffer) {
+    
+    SendCommand(0x24);
+    for (unsigned long j = 0; j < HEIGHT; j++) {
+        for (unsigned long i = 0; i < WIDTH/8; i++) {
+            SendData(frame_buffer[i + j * WIDTH/8]);
+        }
+    }
+
+    TurnOnDisplay_Fast();
+}
+
+void Epd::Display_Part(unsigned char *Image, unsigned long x, unsigned long y, unsigned long w, unsigned long l)
+{
+	unsigned long i;
+	unsigned long height = l;
+	unsigned long width =  (w % 8 == 0)? (w / 8 ): (w / 8 + 1);
+
+    Reset();
+
+	SendCommand(0x18); // use the internal temperature sensor
+	SendData(0x80);
+
+	SendCommand(0x3C);        // Border       Border setting 
+	SendData(0x80);
+
+	SetWindows(x, y, x+w-1, y+l-1);
+
+	SetCursor(x, y);
+
+	SendCommand(0x24);   //write RAM for black(0)/white (1)
+	for (unsigned long j = 0; j < height; j++) {
+        for (unsigned long i = 0; i < width; i++) {
+            SendData(Image[i + j * width]);
+        }
+    }
+	TurnOnDisplay_Part();	
+}
+
+
+/**
+ *  @brief: After this command is transmitted, the chip would enter the 
+ *          deep-sleep mode to save power. 
+ *          The deep sleep mode would return to standby by hardware reset. 
+ *          The only one parameter is a check code, the command would be
+ *          executed if check code = 0xA5. 
+ *          You can use EPD_Reset() to awaken
+ */
+void Epd::Sleep(void) {
+    SendCommand(0X02);
+    ReadBusy();
+    SendCommand(0X07);
+    SendData(0xA5);
+}
+
+void Epd::Clear(void) {
+    
+    SendCommand(0x24);
+    for(unsigned long i=0; i<HEIGHT*WIDTH; i++) {
+        SendData(0xff);
+    }
+    // SendCommand(0x26);
+    // for(unsigned long i=0; i<HEIGHT*WIDTH; i++)	{
+    //     SendData(0xff);
+    // }
+    TurnOnDisplay();
+}
+
+
+/* END OF FILE */
+
+

+ 76 - 0
Arduino/epd4in26/epd4in26.h

@@ -0,0 +1,76 @@
+/**
+ *  @filename   :   epd4in26.h
+ *  @brief      :   Header file for e-paper library epd4in26.cpp
+ *  @author     :   Yehui from Waveshare
+ *  
+ *  Copyright (C) Waveshare     23-12-20
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef EPD4IN26_H
+#define EPD4IN26_H
+
+#include "epdif.h"
+
+// Display resolution
+#define EPD_WIDTH       800
+#define EPD_HEIGHT      480
+
+class Epd : EpdIf {
+public:
+    Epd();
+    ~Epd();
+    int  Init(void);
+    int Init_Fast(void);
+    int Init_4GRAY(void);
+    void SetWindows(unsigned long Xstart, unsigned long Ystart, unsigned long Xend, unsigned long Yend);
+    void SetCursor(unsigned long Xstart, unsigned long Ystart);
+    void ReadBusy(void);
+    void Reset(void);
+    void SetLut(void);
+    void TurnOnDisplay(void);
+    void TurnOnDisplay_Fast(void);
+    void TurnOnDisplay_Part(void);
+    void TurnOnDisplay_4GRAY(void);
+    void Display(const unsigned char* frame_buffer);
+    void Display_Base(const unsigned char* frame_buffer);
+    void Display_Fast(const unsigned char* frame_buffer);
+    void Display_Part(unsigned char *Image, unsigned long x, unsigned long y, unsigned long w, unsigned long l);
+    void SendCommand(unsigned char command);
+    void SendData(unsigned char data);
+    void Sleep(void);
+    void Clear(void);
+    void Displaypart(const unsigned char* pbuffer, unsigned long Start_X, unsigned long Start_Y,unsigned long END_X,unsigned long END_Y);
+ 
+private:
+    unsigned int reset_pin;
+    unsigned int dc_pin;
+    unsigned int cs_pin;
+    unsigned int busy_pin;
+    unsigned long WIDTH;
+    unsigned long HEIGHT;
+
+	void SetLut(unsigned char *lut);
+    void SetLut_by_host(unsigned char *lut_vcom, unsigned char *lut_ww, unsigned char *lut_bw, unsigned char *lut_wb, unsigned char *lut_bb);
+};
+
+#endif /* EPD7IN5_H */
+
+/* END OF FILE */

+ 56 - 0
Arduino/epd4in26/epd4in26.ino

@@ -0,0 +1,56 @@
+/**
+ *  @filename   :   epd4in26-demo.ino
+ *  @brief      :   4.26inch e-paper display demo
+ *  @author     :   Yehui from Waveshare
+ *
+ *  Copyright (C) Waveshare     23-12-20
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include <SPI.h>
+#include "epd4in26.h"
+#include "imagedata.h"
+
+void setup() {
+  // put your setup code here, to run once:
+    Serial.begin(115200);
+    Epd epd;
+    Serial.print("e-Paper init \r\n ");
+    if (epd.Init() != 0) {
+        Serial.print("e-Paper init failed\r\n ");
+        return;
+    }
+
+    Serial.print("e-Paper Clear\r\n ");
+    epd.Clear();
+    
+    Serial.print("e-Paper Display\r\n ");
+    epd.Displaypart(IMAGE_DATA,250, 200,240,103);
+
+    Serial.print("e-Paper Clear\r\n ");
+    epd.Clear();
+
+    epd.Sleep();
+}
+
+void loop() {
+  // put your main code here, to run repeatedly:
+
+}

+ 68 - 0
Arduino/epd4in26/epdif.cpp

@@ -0,0 +1,68 @@
+/**
+ *  @filename   :   epdif.cpp
+ *  @brief      :   Implements EPD interface functions
+ *                  Users have to implement all the functions in epdif.cpp
+ *  @author     :   Yehui from Waveshare
+ *
+ *  Copyright (C) Waveshare     August 10 2017
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include "epdif.h"
+#include <SPI.h>
+
+EpdIf::EpdIf() {
+};
+
+EpdIf::~EpdIf() {
+};
+
+void EpdIf::DigitalWrite(int pin, int value) {
+    digitalWrite(pin, value);
+}
+
+int EpdIf::DigitalRead(int pin) {
+    return digitalRead(pin);
+}
+
+void EpdIf::DelayMs(unsigned int delaytime) {
+    delay(delaytime);
+}
+
+void EpdIf::SpiTransfer(unsigned char data) {
+    digitalWrite(CS_PIN, LOW);
+    SPI.transfer(data);
+    digitalWrite(CS_PIN, HIGH);
+}
+
+int EpdIf::IfInit(void) {
+    pinMode(CS_PIN, OUTPUT);
+    pinMode(RST_PIN, OUTPUT);
+    pinMode(DC_PIN, OUTPUT);
+    pinMode(BUSY_PIN, INPUT); 
+
+    pinMode(PWR_PIN, OUTPUT);
+    DigitalWrite(PWR_PIN, 1);
+
+    SPI.begin();
+    SPI.beginTransaction(SPISettings(2000000, MSBFIRST, SPI_MODE0));
+    return 0;
+}
+

+ 52 - 0
Arduino/epd4in26/epdif.h

@@ -0,0 +1,52 @@
+/**
+ *  @filename   :   epdif.h
+ *  @brief      :   Header file of epdif.cpp providing EPD interface functions
+ *                  Users have to implement all the functions in epdif.cpp
+ *  @author     :   Yehui from Waveshare
+ *
+ *  Copyright (C) Waveshare     August 10 2017
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef EPDIF_H
+#define EPDIF_H
+
+#include <Arduino.h>
+
+// Pin definition
+#define RST_PIN         8
+#define DC_PIN          9
+#define CS_PIN          10
+#define BUSY_PIN        7
+#define PWR_PIN         6
+
+class EpdIf {
+public:
+    EpdIf(void);
+    ~EpdIf(void);
+
+    static int  IfInit(void);
+    static void DigitalWrite(int pin, int value); 
+    static int  DigitalRead(int pin);
+    static void DelayMs(unsigned int delaytime);
+    static void SpiTransfer(unsigned char data);
+};
+
+#endif

+ 223 - 0
Arduino/epd4in26/imagedata.cpp

@@ -0,0 +1,223 @@
+/**
+ *  @filename   :   imagedata.cpp
+ *  @brief      :   data file for epd demo
+ *
+ *  Copyright (C) Waveshare     August 16 2017
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include "imagedata.h"
+#include <avr/pgmspace.h>
+
+const unsigned char IMAGE_DATA[3096] PROGMEM = { //0X00,0X01,0XF0,0X00,0X67,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0XFF,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X01,0XFF,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,
+0XFF,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0XFF,0XC0,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0XFF,0XC0,0X00,0X00,
+0X00,0X00,0X01,0XF8,0X78,0X0F,0X00,0X0F,0XFF,0XFF,0XFF,0XC0,0X00,0X01,0XF0,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0XFF,0XC0,0X00,0X00,0X00,0X00,
+0X01,0XF8,0X78,0X0F,0X00,0X0F,0XFF,0XFF,0XFF,0XC0,0X00,0X01,0XF0,0X00,0X00,0X1F,
+0XFF,0XFF,0XF0,0X00,0X00,0X00,0X00,0X01,0XF8,0X3F,0XFF,0XFF,0XFF,0XFC,0X03,0XF0,
+0X78,0X0F,0X00,0X0F,0XFF,0XFF,0XFF,0XC0,0X00,0X01,0XF0,0X00,0X00,0X3F,0XFF,0XFF,
+0XF8,0X00,0X00,0X00,0X00,0X01,0XF8,0X3F,0XFF,0XFF,0XFF,0XFC,0X07,0XEF,0X7B,0XCF,
+0X00,0X0F,0XFF,0XFF,0XFF,0XC0,0X00,0X01,0XF0,0X00,0X00,0X3F,0XFF,0XFF,0XFC,0X00,
+0X00,0X00,0X00,0X01,0XF8,0X3F,0XFF,0XFF,0XFF,0XFC,0X0F,0XEF,0X7B,0XCF,0X00,0X00,
+0X00,0X7C,0X00,0X00,0X00,0X03,0XF0,0X00,0X00,0X3F,0XFF,0XFF,0XFE,0X00,0X00,0X00,
+0X00,0X01,0XF8,0X3F,0XFF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X00,0X00,0X00,0X00,0X00,0X1F,0X01,0XF0,0X1F,0X03,0XFF,0XFF,0XFF,0XFF,0XC0,
+0X00,0X00,0X00,0X00,0X0F,0X00,0X01,0X0F,0X80,0X3C,0X1F,0XE3,0XFF,0X0F,0XF0,0X07,
+0XFF,0XFF,0XFF,0X80,0X1F,0XFF,0XFF,0XFF,0X00,0X00,0X07,0XE0,0X00,0X00,0X00,0X00,
+0X00,0X00,0X0F,0X80,0X00,0X0F,0X80,0X3C,0X19,0XE3,0XFF,0X0F,0XF0,0X07,0XFF,0XFF,
+0XFF,0X80,0X1F,0XFF,0XFF,0XFF,0X00,0X00,0X03,0XE0,0X00,0X00,0X00,0X00,0X00,0X00,
+0X0F,0X80,0X60,0X0F,0X04,0X1C,0X01,0XE3,0XFF,0X0F,0XE0,0X07,0XFF,0XFF,0XFF,0X80,
+0X1F,0XFF,0XFF,0XFF,0X00,0X00,0X03,0XE0,0X00,0X00,0X00,0X00,0X00,0X00,0X0F,0X80,
+0X60,0X1E,0X04,0X1C,0X01,0XE3,0XCF,0X0F,0XE0,0X03,0XFF,0XFF,0XFF,0X80,0X1F,0XFF,
+0XFF,0XFF,0X00,0X00,0X03,0XE0,0X00,0X00,0X00,0X00,0X00,0X00,0X0F,0XC0,0X70,0X1E,
+0X0E,0X0C,0X01,0XE3,0XCF,0XF7,0XE0,0X00,0X00,0X00,0X0F,0X80,0X1F,0XFF,0XFF,0XFF,
+0X00,0X00,0X03,0XE0,0X00,0X00,0X00,0X00,0X00,0X00,0X0F,0XC0,0XF0,0X3C,0X1F,0X04,
+0X01,0XE3,0XCF,0XF7,0XC0,0X03,0XFF,0XFF,0XFF,0X80,0X1F,0X01,0XF0,0X01,0XC0,0X00,
+0X03,0XE0,0X00,0X00,0X00,0X00,0X00,0X00,0X0F,0XE0,0XF0,0X78,0X1F,0X0C,0X01,0XE7,
+0XCF,0XFF,0XE0,0X03,0XFF,0XFF,0XFF,0X80,0X1F,0X01,0XF0,0X03,0XF0,0X00,0X03,0XE0,
+0X00,0X00,0X00,0X00,0X00,0X00,0X0F,0XE0,0XF0,0X78,0X3E,0X0C,0X01,0XE7,0XCF,0XFF,
+0XF0,0X03,0XFF,0XFF,0XFF,0X80,0X1F,0X01,0XF0,0X03,0XF0,0X00,0X03,0XE0,0X00,0X00,
+0X00,0X00,0X00,0X00,0X0F,0XE0,0XF8,0X78,0X3E,0X1C,0X01,0XE7,0XCF,0XFF,0XF0,0X01,
+0XFF,0XFF,0XFF,0X80,0X00,0X01,0XF0,0X03,0XF0,0X00,0X03,0XE0,0X00,0X00,0X00,0X00,
+0X00,0X00,0X0F,0XF1,0XF8,0X78,0X3C,0X1C,0X01,0XEF,0X8F,0XBF,0XF8,0X00,0X00,0X00,
+0X0F,0X80,0X00,0X01,0XF0,0X03,0XE0,0X00,0X03,0XE0,0X00,0X00,0X00,0X00,0X00,0X00,
+0X0F,0XFF,0XFF,0XFF,0XFC,0X3C,0X01,0XEF,0X8F,0XFF,0XFC,0X07,0XFF,0XFF,0XFF,0X80,
+0X00,0X01,0XFF,0XFF,0XE0,0X03,0XFF,0XE0,0X00,0X00,0X00,0X00,0X00,0X00,0X0F,0XFF,
+0XFF,0XFF,0XF0,0X3C,0X01,0XFF,0X8F,0XFE,0XFF,0X07,0XFF,0XFF,0XFF,0X80,0X00,0X01,
+0XFF,0XFF,0XE0,0X01,0XFF,0XE0,0X00,0X00,0X00,0X00,0X00,0X00,0X0F,0XFF,0XFF,0XFF,
+0XF0,0X7C,0X01,0XFF,0X01,0XFC,0X7E,0X07,0XFF,0XFF,0XFF,0X80,0X00,0X01,0XFF,0XFF,
+0XC0,0X01,0XFF,0XE0,0X00,0X00,0X00,0X00,0X00,0X00,0X0F,0XFF,0XFF,0XFF,0XF0,0X7C,
+0X01,0XE7,0X00,0XF8,0X3C,0X07,0XFF,0XFF,0XFF,0X80,0X00,0X00,0XFF,0XFF,0XC0,0X01,
+0XFF,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X0F,0XFF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FF,0XFF,0XFF,0XF8,0XFF,0XFF,0XFF,0XFF,0X3F,0X3F,0XFF,0XF3,0XFF,0XFF,
+0XFF,0XFF,0XFF,0XFE,0X00,0X00,0X00,0X00,0X0F,0XFF,0XFF,0XFF,0XFF,0XFF,0XC6,0X23,
+0X8E,0X79,0X8F,0X80,0X1F,0X1E,0X1E,0X3F,0X3F,0X3C,0X7C,0X20,0X83,0X8E,0X4F,0X3C,
+0X30,0XFE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XC4,0X23,0X07,0X33,
+0X07,0X08,0X0E,0X0C,0X18,0X1F,0X3F,0X30,0X38,0X20,0X82,0X06,0X06,0X30,0X30,0XFE,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XE4,0X03,0X33,0X32,0X32,0X78,
+0XC6,0X44,0X39,0X9F,0X07,0X31,0XB1,0XF3,0X8E,0X66,0X22,0X31,0XE7,0XFE,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XE0,0X07,0XC3,0X02,0X03,0X18,0XC7,0X84,
+0X70,0X1F,0X3F,0X30,0X13,0XF3,0X9C,0X62,0X62,0X33,0XE1,0XFE,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0XFF,0XE1,0X87,0X03,0X06,0X03,0X88,0XC6,0X04,0X70,0X1F,
+0X3F,0X30,0X13,0XF3,0X9C,0X62,0X62,0X33,0XF0,0XFE,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0XFF,0XE1,0X86,0X33,0X06,0X7F,0XC0,0XC4,0X44,0X71,0XFF,0X3F,0X33,
+0XF3,0XF3,0X9C,0X62,0X62,0X33,0XFC,0XFE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0XFF,0XE1,0X8E,0X23,0X8F,0X3F,0XC8,0XC4,0X44,0X78,0XFF,0X3F,0X31,0XF9,0XF1,
+0X9E,0X06,0X62,0X31,0XFC,0XFE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,
+0XF1,0X8F,0X03,0X8F,0X86,0X18,0XC6,0X04,0X7C,0X1F,0X03,0X3C,0X3C,0X30,0X9F,0X0E,
+0X62,0X3C,0X61,0XFE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XFF,0XFF,
+0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
+0XFF,0XFE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XFF,0XFF,0XFF,0XFF,
+0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
+0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
+0X00,0X00,};

+ 30 - 0
Arduino/epd4in26/imagedata.h

@@ -0,0 +1,30 @@
+/**
+ *  @filename   :   imagedata.h
+ *  @brief      :   head file for imagedata.cpp
+ *
+ *  Copyright (C) Waveshare     July 10 2017
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+extern const unsigned char IMAGE_DATA[];
+
+/* FILE END */
+
+

+ 16 - 1
RaspberryPi_JetsonNano/c/Makefile

@@ -54,6 +54,9 @@ else ifeq ($(EPD), epd2in66)
 else ifeq ($(EPD), epd2in66b)
 	OBJ_C_EPD = ${DIR_EPD}/EPD_2in66b.c
 	OBJ_C_Examples = ${DIR_Examples}/EPD_2in66b_test.c
+else ifeq ($(EPD), epd2in66g)
+	OBJ_C_EPD = ${DIR_EPD}/EPD_2in66g.c
+	OBJ_C_Examples = ${DIR_Examples}/EPD_2in66g_test.c
 else ifeq ($(EPD), epd2in7)
 	OBJ_C_EPD = ${DIR_EPD}/EPD_2in7.c
 	OBJ_C_Examples = ${DIR_Examples}/EPD_2in7_test.c
@@ -78,6 +81,9 @@ else ifeq ($(EPD), epd2in9bc)
 else ifeq ($(EPD), epd2in9bV3)
 	OBJ_C_EPD = ${DIR_EPD}/EPD_2in9b_V3.c
 	OBJ_C_Examples = ${DIR_Examples}/EPD_2in9b_V3_test.c
+else ifeq ($(EPD), epd2in9bV4)
+	OBJ_C_EPD = ${DIR_EPD}/EPD_2in9b_V4.c
+	OBJ_C_Examples = ${DIR_Examples}/EPD_2in9b_V4_test.c
 else ifeq ($(EPD), epd2in9d)
 	OBJ_C_EPD = ${DIR_EPD}/EPD_2in9d.c
 	OBJ_C_Examples = ${DIR_Examples}/EPD_2in9d_test.c
@@ -129,6 +135,9 @@ else ifeq ($(EPD), epd4in2bc)
 else ifeq ($(EPD), epd4in2bV2)
 	OBJ_C_EPD = ${DIR_EPD}/EPD_4in2b_V2.c
 	OBJ_C_Examples = ${DIR_Examples}/EPD_4in2b_V2_test.c
+else ifeq ($(EPD), epd4in26)
+	OBJ_C_EPD = ${DIR_EPD}/EPD_4in26.c
+	OBJ_C_Examples = ${DIR_Examples}/EPD_4in26_test.c
 else ifeq ($(EPD), epd4in37b)
 	OBJ_C_EPD = ${DIR_EPD}/EPD_4in37b.c
 	OBJ_C_Examples = ${DIR_Examples}/EPD_4in37b_test.c
@@ -159,6 +168,9 @@ else ifeq ($(EPD), epd7in5)
 else ifeq ($(EPD), epd7in5V2)
 	OBJ_C_EPD = ${DIR_EPD}/EPD_7in5_V2.c
 	OBJ_C_Examples = ${DIR_Examples}/EPD_7in5_V2_test.c
+else ifeq ($(EPD), epd7in5V2_old)
+	OBJ_C_EPD = ${DIR_EPD}/EPD_7in5_V2_old.c
+	OBJ_C_Examples = ${DIR_Examples}/EPD_7in5_V2_test_old.c
 else ifeq ($(EPD), epd7in5bc)
 	OBJ_C_EPD = ${DIR_EPD}/EPD_7in5bc.c
 	OBJ_C_Examples = ${DIR_Examples}/EPD_7in5bc_test.c
@@ -192,13 +204,16 @@ DEBUG = -D DEBUG
 
 # USELIB_RPI = USE_BCM2835_LIB
 # USELIB_RPI = USE_WIRINGPI_LIB
-USELIB_RPI = USE_DEV_LIB
+USELIB_RPI = USE_LGPIO_LIB
+# USELIB_RPI = USE_DEV_LIB
 
 LIB_RPI=-Wl,--gc-sections
 ifeq ($(USELIB_RPI), USE_BCM2835_LIB)
 	LIB_RPI += -lbcm2835 -lm 
 else ifeq ($(USELIB_RPI), USE_WIRINGPI_LIB)
 	LIB_RPI += -lwiringPi -lm 
+else ifeq ($(USELIB_RPI), USE_LGPIO_LIB)
+	LIB_RPI += -llgpio -lm 
 else ifeq ($(USELIB_RPI), USE_DEV_LIB)
 	LIB_RPI += -lgpiod -lm 
 endif

+ 142 - 0
RaspberryPi_JetsonNano/c/examples/EPD_2in66g_test.c

@@ -0,0 +1,142 @@
+/*****************************************************************************
+* | File      	:   EPD_2in66g_test.c
+* | Author      :   Waveshare team
+* | Function    :   2.66inch e-Paper (G) test demo
+* | Info        :
+*----------------
+* |	This version:   V1.0
+* | Date        :   2023-12-20
+* | Info        :
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documnetation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to  whom the Software is
+# furished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+******************************************************************************/
+#include "EPD_Test.h"
+#include "EPD_2in66g.h"
+#include "time.h"
+
+int EPD_2in66g_test(void)
+{
+    printf("EPD_2IN66g_test Demo\r\n");
+    if(DEV_Module_Init()!=0){
+        return -1;
+    }
+
+    printf("e-Paper Init and Clear...\r\n");
+    EPD_2IN66g_Init();
+
+	struct timespec start={0,0}, finish={0,0}; 
+    clock_gettime(CLOCK_REALTIME, &start);
+    EPD_2IN66g_Clear(EPD_2IN66g_WHITE); // White
+    clock_gettime(CLOCK_REALTIME, &finish);
+    printf("%ld S\r\n", finish.tv_sec-start.tv_sec);	
+    DEV_Delay_ms(2000);
+
+    //Create a new image cache
+    UBYTE *BlackImage;
+    /* you have to edit the startup_stm32fxxx.s file and set a big enough heap size */
+    UWORD Imagesize = ((EPD_2IN66g_WIDTH % 4 == 0)? (EPD_2IN66g_WIDTH / 4 ): (EPD_2IN66g_WIDTH / 4 + 1)) * EPD_2IN66g_HEIGHT;
+    if((BlackImage = (UBYTE *)malloc(Imagesize)) == NULL) {
+        printf("Failed to apply for black memory...\r\n");
+        return -1;
+    }
+    printf("Paint_NewImage\r\n");
+    Paint_NewImage(BlackImage, EPD_2IN66g_WIDTH, EPD_2IN66g_HEIGHT, 0, WHITE);
+    Paint_SetScale(4);
+
+#if 1   // show bmp
+    printf("show window BMP-----------------\r\n");
+    Paint_SelectImage(BlackImage);
+    GUI_ReadBmp_RGB_4Color("./pic/2in66g.bmp", 0, 0);
+    EPD_2IN66g_Display(BlackImage);
+    DEV_Delay_ms(2000);
+#endif
+
+#if 1   // Drawing on the image
+    //1.Select Image
+    printf("SelectImage:BlackImage\r\n");
+    Paint_SelectImage(BlackImage);
+    Paint_Clear(EPD_2IN66g_WHITE);
+
+    // 2.Drawing on the image
+    printf("Drawing:BlackImage\r\n");
+    Paint_DrawPoint(10, 80, EPD_2IN66g_BLACK, DOT_PIXEL_1X1, DOT_STYLE_DFT);
+    Paint_DrawPoint(10, 90, EPD_2IN66g_WHITE, DOT_PIXEL_2X2, DOT_STYLE_DFT);
+    Paint_DrawPoint(10, 100, EPD_2IN66g_RED, DOT_PIXEL_3X3, DOT_STYLE_DFT);
+    Paint_DrawLine(20, 70, 70, 120, EPD_2IN66g_BLACK, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
+    Paint_DrawLine(70, 70, 20, 120, EPD_2IN66g_BLACK, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
+    Paint_DrawRectangle(20, 70, 70, 120, EPD_2IN66g_WHITE, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
+    Paint_DrawRectangle(80, 70, 130, 120, EPD_2IN66g_WHITE, DOT_PIXEL_1X1, DRAW_FILL_FULL);
+    Paint_DrawCircle(45, 95, 20, EPD_2IN66g_RED, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
+    Paint_DrawCircle(105, 95, 20, EPD_2IN66g_RED, DOT_PIXEL_1X1, DRAW_FILL_FULL);
+    Paint_DrawLine(85, 95, 125, 95, EPD_2IN66g_BLACK, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
+    Paint_DrawLine(105, 75, 105, 115, EPD_2IN66g_WHITE, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
+    Paint_DrawString_EN(10, 0, "Red, yellow, white and black", &Font16, EPD_2IN66g_BLACK, EPD_2IN66g_WHITE);
+    Paint_DrawString_EN(10, 35, "Four color e-Paper", &Font12, EPD_2IN66g_WHITE, EPD_2IN66g_RED);
+    Paint_DrawString_CN(10, 125, "΢ѩµç×Ó", &Font24CN, EPD_2IN66g_BLACK, EPD_2IN66g_YELLOW);
+    Paint_DrawNum(10, 50, 123456, &Font12, EPD_2IN66g_BLACK, EPD_2IN66g_YELLOW);
+
+    printf("EPD_Display\r\n");
+    EPD_2IN66g_Display(BlackImage);
+    DEV_Delay_ms(3000);
+#endif
+
+#if 1   // Drawing on the image
+    //1.Select Image
+    printf("SelectImage:BlackImage\r\n");
+    Paint_SelectImage(BlackImage);
+    Paint_Clear(EPD_2IN66g_WHITE);
+
+    int hNumber, hWidth, vNumber, vWidth;
+    hNumber = 16;
+	hWidth = EPD_2IN66g_HEIGHT/hNumber; // 368/16=23
+    vNumber = 16;
+	vWidth = EPD_2IN66g_WIDTH/vNumber; // 512/16=32
+
+    // 2.Drawing on the image
+    printf("Drawing:BlackImage\r\n");
+	for(int i=0; i<hNumber; i++) {  // horizontal
+		Paint_DrawRectangle(1, 1+i*hWidth, EPD_2IN66g_WIDTH, hWidth*(1+i), EPD_2IN66g_BLACK + (i % 2), DOT_PIXEL_1X1, DRAW_FILL_FULL);
+	}
+	for(int i=0; i<vNumber; i++) {  // vertical
+        if(i%2) {
+            Paint_DrawRectangle(1+i*vWidth, 1, vWidth*(i+1), EPD_2IN66g_HEIGHT, EPD_2IN66g_YELLOW + (i/2%2), DOT_PIXEL_1X1, DRAW_FILL_FULL);
+        }
+	}
+
+    printf("EPD_Display\r\n");  
+    EPD_2IN66g_Display(BlackImage);
+    DEV_Delay_ms(3000);
+#endif
+
+    printf("Clear...\r\n");
+    EPD_2IN66g_Clear(EPD_2IN66g_WHITE);
+
+    printf("Goto Sleep...\r\n");
+    EPD_2IN66g_Sleep();
+    free(BlackImage);
+    BlackImage = NULL;
+    DEV_Delay_ms(2000);//important, at least 2s
+    // close 5V
+    printf("close 5V, Module enters 0 power consumption ...\r\n");
+    DEV_Module_Exit();
+    
+    return 0;
+}
+

+ 4 - 3
RaspberryPi_JetsonNano/c/examples/EPD_2in9_V2_test.c

@@ -4,8 +4,8 @@
 * | Function    :   2.9inch e-paper V2 test demo
 * | Info        :
 *----------------
-* |	This version:   V1.1
-* | Date        :   2023-08-30
+* |	This version:   V1.2
+* | Date        :   2023-12-21
 * | Info        :
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -85,6 +85,7 @@ int EPD_2in9_V2_test(void)
 #endif
 
 #if 1  // Drawing on the image
+    EPD_2IN9_V2_Init_Fast();
 	Paint_NewImage(BlackImage, EPD_2IN9_V2_WIDTH, EPD_2IN9_V2_HEIGHT, 90, WHITE);  	
     printf("Drawing\r\n");
     //1.Select Image
@@ -118,7 +119,7 @@ int EPD_2in9_V2_test(void)
     Paint_DrawString_CN(130, 0,"ÄãºÃabc", &Font12CN, BLACK, WHITE);
     Paint_DrawString_CN(130, 20, "΢ѩµç×Ó", &Font24CN, WHITE, BLACK);
 
-    EPD_2IN9_V2_Display_Base(BlackImage);
+    EPD_2IN9_V2_Display(BlackImage);
     DEV_Delay_ms(3000);
 #endif
 

+ 201 - 0
RaspberryPi_JetsonNano/c/examples/EPD_2in9b_V4_test.c

@@ -0,0 +1,201 @@
+/*****************************************************************************
+* | File      	:   EPD_2in9b_V4_test.c
+* | Author      :   Waveshare team
+* | Function    :   2.9inch B V4 e-paper test demo
+* | Info        :
+*----------------
+* |	This version:   V1.0
+* | Date        :   2023-12-18
+* | Info        :
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documnetation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to  whom the Software is
+# furished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+******************************************************************************/
+#include "EPD_Test.h"
+#include "EPD_2in9b_V4.h"
+#include <time.h> 
+ 
+int EPD_2in9b_V4_test(void)
+{
+    printf("EPD_2IN9B_V4_test Demo\r\n");
+    if(DEV_Module_Init()!=0){
+        return -1;
+    }
+
+    printf("e-Paper Init and Clear...\r\n");
+    EPD_2IN9B_V4_Init();
+    
+    struct timespec start={0,0}, finish={0,0}; 
+    clock_gettime(CLOCK_REALTIME,&start);
+    EPD_2IN9B_V4_Clear();
+    clock_gettime(CLOCK_REALTIME,&finish);
+    printf("%ld S\r\n",finish.tv_sec-start.tv_sec);
+
+    DEV_Delay_ms(500);
+    
+
+    //Create a new image cache named IMAGE_BW and fill it with white
+    UBYTE *BlackImage, *RYImage; // Red or Yellow
+    UWORD Imagesize = ((EPD_2IN9B_V4_WIDTH % 8 == 0)? (EPD_2IN9B_V4_WIDTH / 8 ): (EPD_2IN9B_V4_WIDTH / 8 + 1)) * EPD_2IN9B_V4_HEIGHT;
+    if((BlackImage = (UBYTE *)malloc(Imagesize)) == NULL) {
+        printf("Failed to apply for black memory...\r\n");
+        return -1;
+    }
+    if((RYImage = (UBYTE *)malloc(Imagesize)) == NULL) {
+        printf("Failed to apply for red memory...\r\n");
+        return -1;
+    }
+    printf("NewImage:BlackImage and RYImage\r\n");
+    Paint_NewImage(BlackImage, EPD_2IN9B_V4_WIDTH, EPD_2IN9B_V4_HEIGHT, 270, WHITE);
+    Paint_NewImage(RYImage, EPD_2IN9B_V4_WIDTH, EPD_2IN9B_V4_HEIGHT, 270, WHITE);
+
+    //Select Image
+    Paint_SelectImage(BlackImage);
+    Paint_Clear(WHITE);
+    Paint_SelectImage(RYImage);
+    Paint_Clear(WHITE);
+    
+#if 1   // show bmp
+    printf("show window BMP-----------------\r\n");
+    Paint_SelectImage(BlackImage);
+    GUI_ReadBmp("./pic/100x100.bmp", 50, 10);
+    Paint_SelectImage(RYImage);
+    Paint_Clear(WHITE);    
+    EPD_2IN9B_V4_Display(BlackImage, RYImage);
+    DEV_Delay_ms(2000);
+
+    printf("show red bmp------------------------\r\n");
+    Paint_SelectImage(BlackImage);
+    GUI_ReadBmp("./pic/2in9bc-b.bmp", 0, 0);
+    Paint_SelectImage(RYImage);
+    GUI_ReadBmp("./pic/2in9bc-ry.bmp", 0, 0);
+    EPD_2IN9B_V4_Display(BlackImage, RYImage);
+    // DEV_Delay_ms(2000);
+
+#endif
+
+#if 1  // show image for array    
+    EPD_2IN9B_V4_Init_Fast();
+    printf("show image for array\r\n");
+    EPD_2IN9B_V4_Display_Fast(gImage_2in9bc_b, gImage_2in9bc_ry);
+    DEV_Delay_ms(2000);
+#endif
+
+#if 1   // Drawing on the image
+    /*Horizontal screen*/
+    //1.Draw black image
+    EPD_2IN9B_V4_Init();
+    Paint_SelectImage(BlackImage);
+    Paint_Clear(WHITE);
+    Paint_DrawPoint(10, 80, BLACK, DOT_PIXEL_1X1, DOT_STYLE_DFT);
+    Paint_DrawPoint(10, 90, BLACK, DOT_PIXEL_2X2, DOT_STYLE_DFT);
+    Paint_DrawPoint(10, 100, BLACK, DOT_PIXEL_3X3, DOT_STYLE_DFT);
+    Paint_DrawPoint(10, 110, BLACK, DOT_PIXEL_3X3, DOT_STYLE_DFT);
+    Paint_DrawLine(20, 70, 70, 120, BLACK, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
+    Paint_DrawLine(70, 70, 20, 120, BLACK, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
+    Paint_DrawRectangle(20, 70, 70, 120, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
+    Paint_DrawRectangle(80, 70, 130, 120, BLACK, DOT_PIXEL_1X1, DRAW_FILL_FULL);
+    Paint_DrawString_EN(10, 0, "waveshare", &Font16, BLACK, WHITE);
+    Paint_DrawString_CN(130, 20, "΢ѩµç×Ó", &Font24CN, WHITE, BLACK);
+    Paint_DrawNum(10, 50, 987654321, &Font16, WHITE, BLACK);
+
+    //2.Draw red image
+    Paint_SelectImage(RYImage);
+    Paint_Clear(WHITE);
+    // Paint_DrawCircle(160, 95, 20, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
+    // Paint_DrawCircle(210, 95, 20, BLACK, DOT_PIXEL_1X1, DRAW_FILL_FULL);
+    Paint_DrawLine(85, 95, 125, 95, BLACK, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
+    Paint_DrawLine(105, 75, 105, 115, BLACK, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
+    Paint_DrawString_CN(130, 0,"ÄãºÃabc", &Font12CN, BLACK, WHITE);
+    Paint_DrawString_EN(10, 20, "hello world", &Font12, WHITE, BLACK);
+    Paint_DrawNum(10, 33, 123456789, &Font12, BLACK, WHITE);
+
+    printf("EPD_Display\r\n");
+    EPD_2IN9B_V4_Display_Base(BlackImage, RYImage);
+    // EPD_2IN9B_V4_Display(BlackImage, RYImage);
+    DEV_Delay_ms(2000);
+#endif
+
+#if 1   //Partial refresh, example shows time    	
+    // If you didn't use the EPD_2IN9B_V4_Display_Base() function to refresh the image before,
+    // use the EPD_2IN9B_V4_Display_Base_color() function to refresh the background color, 
+    // otherwise the background color will be garbled 
+    // EPD_2IN9B_V4_Init();
+    // EPD_2IN9B_V4_Display_Base(BlackImage, RYImage);
+    // EPD_2IN9B_V4_Display_Base_color(WHITE);
+	Paint_NewImage(BlackImage, 50, 120, 270, WHITE);
+    
+    printf("Partial refresh\r\n");
+    Paint_SelectImage(BlackImage);
+	Paint_SetScale(2);
+    Paint_Clear(WHITE);
+    
+    PAINT_TIME sPaint_time;
+    sPaint_time.Hour = 12;
+    sPaint_time.Min = 34;
+    sPaint_time.Sec = 56;
+    UBYTE num = 15;
+    for (;;) {
+        sPaint_time.Sec = sPaint_time.Sec + 1;
+        if (sPaint_time.Sec == 60) {
+            sPaint_time.Min = sPaint_time.Min + 1;
+            sPaint_time.Sec = 0;
+            if (sPaint_time.Min == 60) {
+                sPaint_time.Hour =  sPaint_time.Hour + 1;
+                sPaint_time.Min = 0;
+                if (sPaint_time.Hour == 24) {
+                    sPaint_time.Hour = 0;
+                    sPaint_time.Min = 0;
+                    sPaint_time.Sec = 0;
+                }
+            }
+        }
+        
+        Paint_Clear(WHITE);
+		Paint_DrawRectangle(1, 1, 120, 50, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
+        Paint_DrawTime(10, 15, &sPaint_time, &Font20, WHITE, BLACK);
+
+        num = num - 1;
+        if(num == 0) {
+            break;
+        }
+		printf("Part refresh...\r\n");
+        EPD_2IN9B_V4_Display_Partial(BlackImage, 70, 35, 120, 155); // Xstart must be a multiple of 8
+        DEV_Delay_ms(500);
+    }
+#endif
+
+    printf("Clear...\r\n");
+    EPD_2IN9B_V4_Init();
+    EPD_2IN9B_V4_Clear();
+
+    printf("Goto Sleep...\r\n");
+    EPD_2IN9B_V4_Sleep();
+    free(BlackImage);
+    free(RYImage);
+    BlackImage = NULL;
+    RYImage = NULL;
+    DEV_Delay_ms(2000);//important, at least 2s
+    // close 5V
+    printf("close 5V, Module enters 0 power consumption ...\r\n");
+    DEV_Module_Exit();
+    
+    return 0;
+}
+

+ 215 - 0
RaspberryPi_JetsonNano/c/examples/EPD_4in26_test.c

@@ -0,0 +1,215 @@
+/*****************************************************************************
+* | File      	:   EPD_4in26_test.c
+* | Author      :   Waveshare team
+* | Function    :   4.26inch e-paper test demo
+* | Info        :
+*----------------
+* |	This version:   V1.0
+* | Date        :   2023-12-19
+* | Info        :
+* -----------------------------------------------------------------------------
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documnetation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to  whom the Software is
+# furished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+******************************************************************************/
+#include "EPD_Test.h"
+#include "EPD_4in26.h"
+#include <time.h> 
+
+int EPD_4in26_test(void)
+{
+    printf("EPD_4in26_test Demo\r\n");
+    if(DEV_Module_Init()!=0){
+        return -1;
+    }
+
+    printf("e-Paper Init and Clear...\r\n");
+    EPD_4in26_Init();
+    struct timespec start={0,0}, finish={0,0}; 
+    clock_gettime(CLOCK_REALTIME,&start);
+    EPD_4in26_Clear();
+    clock_gettime(CLOCK_REALTIME,&finish);
+    Debug("%ld S\r\n",finish.tv_sec-start.tv_sec);	
+    DEV_Delay_ms(500);
+
+    //Create a new image cache
+    UBYTE *BlackImage;
+    /* you have to edit the startup_stm32fxxx.s file and set a big enough heap size */
+    UDOUBLE Imagesize = ((EPD_4in26_WIDTH % 8 == 0)? (EPD_4in26_WIDTH / 8 ): (EPD_4in26_WIDTH / 8 + 1)) * EPD_4in26_HEIGHT;
+    if((BlackImage = (UBYTE *)malloc(Imagesize)) == NULL) {
+        printf("Failed to apply for black memory...\r\n");
+        return -1;
+    }
+    printf("Paint_NewImage\r\n");
+    Paint_NewImage(BlackImage, EPD_4in26_WIDTH, EPD_4in26_HEIGHT, 0, WHITE);
+
+#if 1  // show bmp
+    printf("show window BMP-----------------\r\n");
+    Paint_SelectImage(BlackImage);
+    Paint_Clear(WHITE);
+    GUI_ReadBmp("./pic/100x100.bmp", 10, 10);
+    EPD_4in26_Display(BlackImage);
+    DEV_Delay_ms(2000);
+
+    // EPD_4in26_Init_Fast();
+    // printf("show bmp------------------------\r\n");
+    // Paint_SelectImage(BlackImage);
+    // GUI_ReadBmp("./pic/800x480.bmp", 0, 0);
+    // EPD_4in26_Display_Fast(BlackImage);
+    // DEV_Delay_ms(2000);
+#endif        
+
+#if 1  // show image for array   
+    EPD_4in26_Init_Fast();
+    printf("show image for array\r\n");
+    Paint_SelectImage(BlackImage);
+    Paint_Clear(WHITE);
+    Paint_DrawBitMap(gImage_7in5_V2);
+    EPD_4in26_Display_Fast(BlackImage);
+    DEV_Delay_ms(2000);
+#endif
+
+#if 1   // Drawing on the image
+
+    EPD_4in26_Init();
+    //1.Select Image
+    printf("SelectImage:BlackImage\r\n");
+    Paint_SelectImage(BlackImage);
+    Paint_Clear(WHITE);
+
+    // 2.Drawing on the image
+    printf("Drawing:BlackImage\r\n");
+    Paint_DrawPoint(10, 80, BLACK, DOT_PIXEL_1X1, DOT_STYLE_DFT);
+    Paint_DrawPoint(10, 90, BLACK, DOT_PIXEL_2X2, DOT_STYLE_DFT);
+    Paint_DrawPoint(10, 100, BLACK, DOT_PIXEL_3X3, DOT_STYLE_DFT);
+    Paint_DrawLine(20, 70, 70, 120, BLACK, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
+    Paint_DrawLine(70, 70, 20, 120, BLACK, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
+    Paint_DrawRectangle(20, 70, 70, 120, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
+    Paint_DrawRectangle(80, 70, 130, 120, BLACK, DOT_PIXEL_1X1, DRAW_FILL_FULL);
+    Paint_DrawCircle(45, 95, 20, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
+    Paint_DrawCircle(105, 95, 20, WHITE, DOT_PIXEL_1X1, DRAW_FILL_FULL);
+    Paint_DrawLine(85, 95, 125, 95, BLACK, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
+    Paint_DrawLine(105, 75, 105, 115, BLACK, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
+    Paint_DrawString_EN(10, 1, "waveshare", &Font16, BLACK, WHITE);
+    Paint_DrawString_EN(10, 20, "hello world", &Font12, WHITE, BLACK);
+    Paint_DrawNum(10, 33, 123456789, &Font12, BLACK, WHITE);
+    Paint_DrawNum(10, 50, 987654321, &Font16, WHITE, BLACK);
+    Paint_DrawString_CN(130, 1, "ÄãºÃabc", &Font12CN, BLACK, WHITE);
+    Paint_DrawString_CN(130, 20, "΢ѩµç×Ó", &Font24CN, WHITE, BLACK);
+
+    printf("EPD_Display\r\n");
+    // EPD_4in26_Display(BlackImage);
+	EPD_4in26_Display_Base(BlackImage);
+	DEV_Delay_ms(2000);
+#endif
+
+#if 1
+	printf("Partial refresh\r\n");
+    Paint_NewImage(BlackImage, 200, 50, 0, WHITE);
+	PAINT_TIME sPaint_time;
+    sPaint_time.Hour = 12;
+    sPaint_time.Min = 34;
+    sPaint_time.Sec = 56;
+    UBYTE num = 10;
+	for (;;) {
+		sPaint_time.Sec = sPaint_time.Sec + 1;
+		if (sPaint_time.Sec == 60) {
+			sPaint_time.Min = sPaint_time.Min + 1;
+			sPaint_time.Sec = 0;
+			if (sPaint_time.Min == 60) {
+				sPaint_time.Hour =  sPaint_time.Hour + 1;
+				sPaint_time.Min = 0;
+				if (sPaint_time.Hour == 24) {
+					sPaint_time.Hour = 0;
+					sPaint_time.Min = 0;
+					sPaint_time.Sec = 0;
+				}
+			}
+		}
+		Paint_Clear(WHITE);
+		Paint_DrawTime(20, 10, &sPaint_time, &Font20, WHITE, BLACK);
+		EPD_4in26_Display_Part(BlackImage, 80, 200, 200, 50);
+		DEV_Delay_ms(500);//Analog clock 1s
+		num = num - 1;
+		if(num == 0) {
+			break;
+		}
+    }
+#endif
+
+#if 1 // show image for array
+    free(BlackImage);
+    printf("show Gray------------------------\r\n");
+    Imagesize = ((EPD_4in26_WIDTH % 4 == 0)? (EPD_4in26_WIDTH / 4 ): (EPD_4in26_WIDTH / 4 + 1)) * EPD_4in26_HEIGHT;
+    if((BlackImage = (UBYTE *)malloc(Imagesize)) == NULL) {
+        printf("Failed to apply for black memory...\r\n");
+        return -1;
+    }
+    EPD_4in26_Init_4GRAY();
+    printf("4 grayscale display\r\n");
+    Paint_NewImage(BlackImage, EPD_4in26_WIDTH, EPD_4in26_HEIGHT, 90, WHITE);
+    Paint_SetScale(4);
+    Paint_Clear(0xff);
+    
+    Paint_DrawPoint(10, 80, GRAY4, DOT_PIXEL_1X1, DOT_STYLE_DFT);
+    Paint_DrawPoint(10, 90, GRAY4, DOT_PIXEL_2X2, DOT_STYLE_DFT);
+    Paint_DrawPoint(10, 100, GRAY4, DOT_PIXEL_3X3, DOT_STYLE_DFT);
+    Paint_DrawLine(20, 70, 70, 120, GRAY4, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
+    Paint_DrawLine(70, 70, 20, 120, GRAY4, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
+    Paint_DrawRectangle(20, 70, 70, 120, GRAY4, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
+    Paint_DrawRectangle(80, 70, 130, 120, GRAY4, DOT_PIXEL_1X1, DRAW_FILL_FULL);
+    Paint_DrawCircle(45, 95, 20, GRAY4, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
+    Paint_DrawCircle(105, 95, 20, GRAY2, DOT_PIXEL_1X1, DRAW_FILL_FULL);
+    Paint_DrawLine(85, 95, 125, 95, GRAY4, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
+    Paint_DrawLine(105, 75, 105, 115, GRAY4, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
+    Paint_DrawString_EN(10, 0, "waveshare", &Font16, GRAY4, GRAY1);
+    Paint_DrawString_EN(10, 20, "hello world", &Font12, GRAY3, GRAY1);
+    Paint_DrawNum(10, 33, 123456789, &Font12, GRAY4, GRAY2);
+    Paint_DrawNum(10, 50, 987654321, &Font16, GRAY1, GRAY4);
+    Paint_DrawString_CN(150, 0,"ÄãºÃabc", &Font12CN, GRAY4, GRAY1);
+    Paint_DrawString_CN(150, 20,"ÄãºÃabc", &Font12CN, GRAY3, GRAY2);
+    Paint_DrawString_CN(150, 40,"ÄãºÃabc", &Font12CN, GRAY2, GRAY3);
+    Paint_DrawString_CN(150, 60,"ÄãºÃabc", &Font12CN, GRAY1, GRAY4);
+    Paint_DrawString_CN(10, 130, "΢ѩµç×Ó", &Font24CN, GRAY1, GRAY4);
+    EPD_4in26_4GrayDisplay(BlackImage);
+    DEV_Delay_ms(3000);
+
+    Paint_NewImage(BlackImage, EPD_4in26_WIDTH, EPD_4in26_HEIGHT, 0, WHITE);
+    Paint_SetScale(4);
+    Paint_Clear(WHITE);
+    GUI_ReadBmp_4Gray("./pic/4in26_Scale.bmp", 0, 0);
+    EPD_4in26_4GrayDisplay(BlackImage);
+    DEV_Delay_ms(3000);
+
+#endif
+
+    EPD_4in26_Init();
+    EPD_4in26_Clear();
+    printf("Goto Sleep...\r\n");
+    EPD_4in26_Sleep();
+    free(BlackImage);
+    BlackImage = NULL;
+    DEV_Delay_ms(2000);//important, at least 2s
+    // close 5V
+    printf("close 5V, Module enters 0 power consumption ...\r\n");
+    DEV_Module_Exit();
+    
+    return 0;
+}
+

+ 46 - 4
RaspberryPi_JetsonNano/c/examples/EPD_7in5_V2_test.c

@@ -4,8 +4,8 @@
 * | Function    :   7.5inch e-paper test demo
 * | Info        :
 *----------------
-* |	This version:   V1.0
-* | Date        :   2019-06-13
+* |	This version:   V3.0
+* | Date        :   2023-12-18
 * | Info        :
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -76,6 +76,7 @@ int EPD_7in5_V2_test(void)
 #endif        
 
 #if 1   // show image for array   
+    EPD_7IN5_V2_Init_Fast();
     printf("show image for array\r\n");
     Paint_SelectImage(BlackImage);
     Paint_Clear(WHITE);
@@ -86,6 +87,7 @@ int EPD_7in5_V2_test(void)
 
 #if 1   // Drawing on the image
     //1.Select Image
+    // EPD_7IN5_V2_Init();
     printf("SelectImage:BlackImage\r\n");
     Paint_SelectImage(BlackImage);
     Paint_Clear(WHITE);
@@ -115,13 +117,53 @@ int EPD_7in5_V2_test(void)
     DEV_Delay_ms(2000);
 #endif
 
+#if 1   //Partial refresh, example shows time
+    EPD_7IN5_V2_Init_Part();
+	Paint_NewImage(BlackImage, Font20.Width * 7, Font20.Height, 0, WHITE);
+    Debug("Partial refresh\r\n");
+    Paint_SelectImage(BlackImage);
+    Paint_Clear(WHITE);
+	
+    PAINT_TIME sPaint_time;
+    sPaint_time.Hour = 12;
+    sPaint_time.Min = 34;
+    sPaint_time.Sec = 56;
+    UBYTE num = 10;
+    for (;;) {
+        sPaint_time.Sec = sPaint_time.Sec + 1;
+        if (sPaint_time.Sec == 60) {
+            sPaint_time.Min = sPaint_time.Min + 1;
+            sPaint_time.Sec = 0;
+            if (sPaint_time.Min == 60) {
+                sPaint_time.Hour =  sPaint_time.Hour + 1;
+                sPaint_time.Min = 0;
+                if (sPaint_time.Hour == 24) {
+                    sPaint_time.Hour = 0;
+                    sPaint_time.Min = 0;
+                    sPaint_time.Sec = 0;
+                }
+            }
+        }
+        Paint_ClearWindows(0, 0, Font20.Width * 7, Font20.Height, WHITE);
+        Paint_DrawTime(0, 0, &sPaint_time, &Font20, WHITE, BLACK);
+
+        num = num - 1;
+        if(num == 0) {
+            break;
+        }
+		EPD_7IN5_V2_Display_Part(BlackImage, 150, 80, 150 + Font20.Width * 7, 80 + Font20.Height);
+        DEV_Delay_ms(500);//Analog clock 1s
+    }
+#endif
+
     printf("Clear...\r\n");
+    EPD_7IN5_V2_Init();
     EPD_7IN5_V2_Clear();
 
     printf("Goto Sleep...\r\n");
     EPD_7IN5_V2_Sleep();
-    free(BlackImage);
-    BlackImage = NULL;
+    // free(BlackImage);
+    // BlackImage = NULL;
     DEV_Delay_ms(2000);//important, at least 2s
     // close 5V
     printf("close 5V, Module enters 0 power consumption ...\r\n");

+ 175 - 0
RaspberryPi_JetsonNano/c/examples/EPD_7in5_V2_test_old.c

@@ -0,0 +1,175 @@
+/*****************************************************************************
+* | File      	:   EPD_7in5_V2_test.c
+* | Author      :   Waveshare team
+* | Function    :   7.5inch e-paper test demo
+* | Info        :
+*----------------
+* |	This version:   V1.0
+* | Date        :   2023-12-18
+* | Info        :
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documnetation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to  whom the Software is
+# furished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+******************************************************************************/
+#include "EPD_Test.h"
+#include "EPD_7in5_V2_old.h"
+#include <time.h> 
+
+int EPD_7in5_V2_test_old(void)
+{
+    printf("EPD_7IN5_V2_test Demo\r\n");
+    if(DEV_Module_Init()!=0){
+        return -1;
+    }
+
+    printf("e-Paper Init and Clear...\r\n");
+    EPD_7IN5_V2_Init();
+
+    struct timespec start={0,0}, finish={0,0}; 
+    clock_gettime(CLOCK_REALTIME,&start);
+    EPD_7IN5_V2_Clear();
+    clock_gettime(CLOCK_REALTIME,&finish);
+    printf("%ld S\r\n",finish.tv_sec-start.tv_sec);
+    DEV_Delay_ms(500);
+	
+    //Create a new image cache
+    UBYTE *BlackImage;
+    /* you have to edit the startup_stm32fxxx.s file and set a big enough heap size */
+    UWORD Imagesize = ((EPD_7IN5_V2_WIDTH % 8 == 0)? (EPD_7IN5_V2_WIDTH / 8 ): (EPD_7IN5_V2_WIDTH / 8 + 1)) * EPD_7IN5_V2_HEIGHT;
+    if((BlackImage = (UBYTE *)malloc(Imagesize)) == NULL) {
+        printf("Failed to apply for black memory...\r\n");
+        return -1;
+    }
+    printf("Paint_NewImage\r\n");
+    Paint_NewImage(BlackImage, EPD_7IN5_V2_WIDTH, EPD_7IN5_V2_HEIGHT, 0, WHITE);
+
+#if 1  // show bmp
+    printf("show window BMP-----------------\r\n");
+    Paint_SelectImage(BlackImage);
+    Paint_Clear(WHITE);
+    GUI_ReadBmp("./pic/800x480.bmp", 0, 0);
+    EPD_7IN5_V2_Display(BlackImage);
+    DEV_Delay_ms(2000);
+
+    printf("show bmp------------------------\r\n");
+    Paint_SelectImage(BlackImage);
+    Paint_Clear(WHITE);
+    GUI_ReadBmp("./pic/100x100.bmp", 0, 0);
+    EPD_7IN5_V2_Display(BlackImage);
+    DEV_Delay_ms(2000);
+#endif        
+
+#if 0   // show image for array   
+    printf("show image for array\r\n");
+    EPD_7IN5_V2_Init_Fast();
+    Paint_SelectImage(BlackImage);
+    Paint_Clear(WHITE);
+    Paint_DrawBitMap(gImage_7in5_V2);
+    EPD_7IN5_V2_Display_Fast(BlackImage);
+    DEV_Delay_ms(2000);
+#endif
+
+#if 1   // Drawing on the image
+    //1.Select Image
+    printf("SelectImage:BlackImage\r\n");
+    EPD_7IN5_V2_Init_Fast();
+    Paint_SelectImage(BlackImage);
+    Paint_Clear(WHITE);
+
+    // 2.Drawing on the image
+    printf("Drawing:BlackImage\r\n");
+    Paint_DrawPoint(10, 80, BLACK, DOT_PIXEL_1X1, DOT_STYLE_DFT);
+    Paint_DrawPoint(10, 90, BLACK, DOT_PIXEL_2X2, DOT_STYLE_DFT);
+    Paint_DrawPoint(10, 100, BLACK, DOT_PIXEL_3X3, DOT_STYLE_DFT);
+    Paint_DrawLine(20, 70, 70, 120, BLACK, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
+    Paint_DrawLine(70, 70, 20, 120, BLACK, DOT_PIXEL_1X1, LINE_STYLE_SOLID);
+    Paint_DrawRectangle(20, 70, 70, 120, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
+    Paint_DrawRectangle(80, 70, 130, 120, BLACK, DOT_PIXEL_1X1, DRAW_FILL_FULL);
+    Paint_DrawCircle(45, 95, 20, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
+    Paint_DrawCircle(105, 95, 20, WHITE, DOT_PIXEL_1X1, DRAW_FILL_FULL);
+    Paint_DrawLine(85, 95, 125, 95, BLACK, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
+    Paint_DrawLine(105, 75, 105, 115, BLACK, DOT_PIXEL_1X1, LINE_STYLE_DOTTED);
+    Paint_DrawString_EN(10, 0, "waveshare", &Font16, BLACK, WHITE);
+    Paint_DrawString_EN(10, 20, "hello world", &Font12, WHITE, BLACK);
+    Paint_DrawNum(10, 33, 123456789, &Font12, BLACK, WHITE);
+    Paint_DrawNum(10, 50, 987654321, &Font16, WHITE, BLACK);
+    Paint_DrawString_CN(130, 0, "ÄãºÃabc", &Font12CN, BLACK, WHITE);
+    Paint_DrawString_CN(130, 20, "΢ѩµç×Ó", &Font24CN, WHITE, BLACK);
+
+    printf("EPD_Display\r\n");
+    EPD_7IN5_V2_Display(BlackImage);
+    DEV_Delay_ms(2000);
+#endif
+
+#if 1   //Partial refresh, example shows time
+    EPD_7IN5_V2_Init_Partial();
+	Paint_NewImage(BlackImage, Font20.Width * 7, Font20.Height, 0, WHITE);
+    Debug("Partial refresh\r\n");
+    Paint_SelectImage(BlackImage);
+    Paint_Clear(WHITE);
+	
+    PAINT_TIME sPaint_time;
+    sPaint_time.Hour = 12;
+    sPaint_time.Min = 34;
+    sPaint_time.Sec = 56;
+    UBYTE num = 10;
+    for (;;) {
+        sPaint_time.Sec = sPaint_time.Sec + 1;
+        if (sPaint_time.Sec == 60) {
+            sPaint_time.Min = sPaint_time.Min + 1;
+            sPaint_time.Sec = 0;
+            if (sPaint_time.Min == 60) {
+                sPaint_time.Hour =  sPaint_time.Hour + 1;
+                sPaint_time.Min = 0;
+                if (sPaint_time.Hour == 24) {
+                    sPaint_time.Hour = 0;
+                    sPaint_time.Min = 0;
+                    sPaint_time.Sec = 0;
+                }
+            }
+        }
+        Paint_ClearWindows(0, 0, Font20.Width * 7, Font20.Height, WHITE);
+        Paint_DrawTime(0, 0, &sPaint_time, &Font20, WHITE, BLACK);
+
+        num = num - 1;
+        if(num == 0) {
+            break;
+        }
+		EPD_7IN5_V2_Display_Partial(BlackImage, 150, 80, 150 + Font20.Width * 7, 80 + Font20.Height);
+        DEV_Delay_ms(500);//Analog clock 1s
+
+    }
+#endif
+
+    printf("Clear...\r\n");
+    EPD_7IN5_V2_Init();
+    EPD_7IN5_V2_Clear();
+
+    printf("Goto Sleep...\r\n");
+    EPD_7IN5_V2_Sleep();
+    free(BlackImage);
+    BlackImage = NULL;
+    DEV_Delay_ms(2000);//important, at least 2s
+    // close 5V
+    printf("close 5V, Module enters 0 power consumption ...\r\n");
+    DEV_Module_Exit();
+    
+    return 0;
+}
+

+ 6 - 0
RaspberryPi_JetsonNano/c/examples/EPD_Test.h

@@ -57,6 +57,8 @@ int EPD_1in54c_test(void);
 
 int EPD_2in66_test(void);
 int	EPD_2in66b_test(void); 
+int EPD_2in66g_test(void);
+
 int EPD_2in7_test(void);
 int EPD_2in7_V2_test(void);
 int EPD_2in7b_test(void);
@@ -66,6 +68,7 @@ int EPD_2in9_test(void);
 int EPD_2in9_V2_test(void);
 int EPD_2in9bc_test(void);
 int EPD_2in9b_V3_test(void);
+int EPD_2in9b_V4_test(void);
 int EPD_2in9d_test(void);
 
 int EPD_2in13_test(void);
@@ -89,6 +92,8 @@ int EPD_4in2_V2_test(void);
 int EPD_4in2bc_test(void);
 int EPD_4in2b_V2_test(void);
 
+int EPD_4in26_test(void);
+
 int EPD_4in37b_test(void);
 
 int EPD_5in65f_test(void);
@@ -105,6 +110,7 @@ int EPD_7in3f_test(void);
 int EPD_7in5_test(void);
 int EPD_7in5_HD_test(void);
 int EPD_7in5_V2_test(void);
+int EPD_7in5_V2_test_old(void);
 int EPD_7in5bc_test(void);
 int EPD_7in5b_V2_test(void);
 int EPD_7in5b_HD_test(void);

+ 11 - 0
RaspberryPi_JetsonNano/c/examples/main.c

@@ -64,6 +64,9 @@ int main(void)
 #elif epd2in66b
     EPD_2in66b_test();
     
+#elif epd2in66g
+    EPD_2in66g_test();
+
 #elif epd2in7
     EPD_2in7_test();
     
@@ -87,6 +90,9 @@ int main(void)
     
 #elif epd2in9bV3
     EPD_2in9b_V3_test();
+
+#elif epd2in9bV4
+    EPD_2in9b_V4_test();
     
 #elif epd2in9d
     EPD_2in9d_test();
@@ -138,6 +144,9 @@ int main(void)
     
 #elif epd4in2bV2
     EPD_4in2b_V2_test();
+
+#elif epd4in26
+    EPD_4in26_test();
     
 #elif epd4in37b
     EPD_4in37b_test();
@@ -168,6 +177,8 @@ int main(void)
     
 #elif epd7in5V2
     EPD_7in5_V2_test();
+#elif epd7in5V2_old
+    EPD_7in5_V2_test_old();
     
 #elif epd7in5bc
     EPD_7in5bc_test();

+ 65 - 1
RaspberryPi_JetsonNano/c/lib/Config/DEV_Config.c

@@ -29,6 +29,12 @@
 ******************************************************************************/
 #include "DEV_Config.h"
 #include "RPI_gpiod.h"
+
+#if USE_LGPIO_LIB
+int GPIO_Handle;
+int SPI_Handle;
+#endif
+
 /**
  * GPIO
 **/
@@ -48,6 +54,8 @@ void DEV_Digital_Write(UWORD Pin, UBYTE Value)
 	bcm2835_gpio_write(Pin, Value);
 #elif USE_WIRINGPI_LIB
 	digitalWrite(Pin, Value);
+#elif  USE_LGPIO_LIB  
+    lgGpioWrite(GPIO_Handle, Pin, Value);
 #elif USE_DEV_LIB
 	GPIOD_Write(Pin, Value);
 #endif
@@ -70,6 +78,8 @@ UBYTE DEV_Digital_Read(UWORD Pin)
 	Read_value = bcm2835_gpio_lev(Pin);
 #elif USE_WIRINGPI_LIB
 	Read_value = digitalRead(Pin);
+#elif  USE_LGPIO_LIB  
+    Read_value = lgGpioRead(GPIO_Handle,Pin);
 #elif USE_DEV_LIB
 	Read_value = GPIOD_Read(Pin);
 #endif
@@ -95,6 +105,8 @@ void DEV_SPI_WriteByte(uint8_t Value)
 	bcm2835_spi_transfer(Value);
 #elif USE_WIRINGPI_LIB
 	wiringPiSPIDataRW(0,&Value,1);
+#elif  USE_LGPIO_LIB 
+    lgSpiWrite(SPI_Handle,(char*)&Value, 1);
 #elif USE_DEV_LIB
 	DEV_HARDWARE_SPI_TransferByte(Value);
 #endif
@@ -117,6 +129,8 @@ void DEV_SPI_Write_nByte(uint8_t *pData, uint32_t Len)
 	bcm2835_spi_transfernb((char *)pData,rData,Len);
 #elif USE_WIRINGPI_LIB
 	wiringPiSPIDataRW(0, pData, Len);
+#elif  USE_LGPIO_LIB 
+    lgSpiWrite(SPI_Handle,(char*)pData, Len);
 #elif USE_DEV_LIB
 	DEV_HARDWARE_SPI_Transfer(pData, Len);
 #endif
@@ -125,7 +139,10 @@ void DEV_SPI_Write_nByte(uint8_t *pData, uint32_t Len)
 #ifdef JETSON
 #ifdef USE_DEV_LIB
 	//JETSON nano waits for hardware SPI
-	Debug("not support");
+	// Debug("not support");
+    uint32_t i;
+    for(i = 0; i<Len; i++)
+        SYSFS_software_spi_transfer(pData[i]);
 #elif USE_HARDWARE_LIB
 	Debug("not support");
 #endif
@@ -152,6 +169,14 @@ void DEV_GPIO_Mode(UWORD Pin, UWORD Mode)
 		pinMode(Pin, OUTPUT);
 		// Debug (" %d OUT \r\n",Pin);
 	}
+#elif  USE_LGPIO_LIB  
+    if(Mode == 0 || Mode == LG_SET_INPUT){
+        lgGpioClaimInput(GPIO_Handle,LFLAGS,Pin);
+        // printf("IN Pin = %d\r\n",Pin);
+    }else{
+        lgGpioClaimOutput(GPIO_Handle, LFLAGS, Pin, LG_LOW);
+        // printf("OUT Pin = %d\r\n",Pin);
+    }
 #elif USE_DEV_LIB
     if(Mode == 0 || Mode == GPIOD_IN) {
         GPIOD_Direction(Pin, GPIOD_IN);
@@ -183,6 +208,8 @@ void DEV_Delay_ms(UDOUBLE xms)
 	bcm2835_delay(xms);
 #elif USE_WIRINGPI_LIB
 	delay(xms);
+#elif  USE_LGPIO_LIB  
+    lguSleep(xms/1000.0);
 #elif USE_DEV_LIB
 	UDOUBLE i;
 	for(i=0; i < xms; i++) {
@@ -318,6 +345,36 @@ UBYTE DEV_Module_Init(void)
 	DEV_GPIO_Init();
 	wiringPiSPISetup(0,10000000);
 	// wiringPiSPISetupMode(0, 32000000, 0);
+#elif  USE_LGPIO_LIB
+    char buffer[NUM_MAXBUF];
+    FILE *fp;
+
+    fp = popen("cat /proc/cpuinfo | grep 'Raspberry Pi 5'", "r");
+    if (fp == NULL) {
+        Debug("It is not possible to determine the model of the Raspberry PI\n");
+        return -1;
+    }
+
+    if(fgets(buffer, sizeof(buffer), fp) != NULL)
+    {
+        GPIO_Handle = lgGpiochipOpen(4);
+        if (GPIO_Handle < 0)
+        {
+            Debug( "gpiochip4 Export Failed\n");
+            return -1;
+        }
+    }
+    else
+    {
+        GPIO_Handle = lgGpiochipOpen(0);
+        if (GPIO_Handle < 0)
+        {
+            Debug( "gpiochip0 Export Failed\n");
+            return -1;
+        }
+    }
+    SPI_Handle = lgSpiOpen(0, 0, 10000000, 0);
+    DEV_GPIO_Init();
 #elif USE_DEV_LIB
 	printf("Write and read /dev/spidev0.0 \r\n");
     GPIOD_Export();
@@ -366,6 +423,13 @@ void DEV_Module_Exit(void)
     DEV_Digital_Write(EPD_PWR_PIN, 0);
 	DEV_Digital_Write(EPD_DC_PIN, 0);
 	DEV_Digital_Write(EPD_RST_PIN, 0);
+#elif USE_DEV_LIB 
+    DEV_Digital_Write(EPD_CS_PIN, 0);
+    DEV_Digital_Write(EPD_PWR_PIN, 0);
+	DEV_Digital_Write(EPD_DC_PIN, 0);
+	DEV_Digital_Write(EPD_RST_PIN, 0);
+    lgSpiClose(SPI_Handle);
+    lgGpiochipClose(GPIO_Handle);
 #elif USE_DEV_LIB
 	DEV_HARDWARE_SPI_end();
 	DEV_Digital_Write(EPD_CS_PIN, 0);

+ 4 - 0
RaspberryPi_JetsonNano/c/lib/Config/DEV_Config.h

@@ -62,6 +62,10 @@
     #elif USE_WIRINGPI_LIB
         #include <wiringPi.h>
         #include <wiringPiSPI.h>
+    #elif USE_LGPIO_LIB
+        #include <lgpio.h>
+        #define LFLAGS 0
+        #define NUM_MAXBUF  4
     #elif USE_DEV_LIB
         #include "RPI_gpiod.h"
         #include "dev_hardware_SPI.h"

+ 219 - 0
RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_2in66g.c

@@ -0,0 +1,219 @@
+/*****************************************************************************
+* | File      	:   EPD_2in66g.c
+* | Author      :   Waveshare team
+* | Function    :   2.66inch e-Paper (G)
+* | Info        :
+*----------------
+* |	This version:   V1.0
+* | Date        :   2023-12-20
+* | Info        :
+* -----------------------------------------------------------------------------
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documnetation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to  whom the Software is
+# furished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+******************************************************************************/
+#include "EPD_2in66g.h"
+#include "Debug.h"
+
+/******************************************************************************
+function :	Software reset
+parameter:
+******************************************************************************/
+static void EPD_2IN66g_Reset(void)
+{
+    DEV_Digital_Write(EPD_RST_PIN, 1);
+    DEV_Delay_ms(20);
+    DEV_Digital_Write(EPD_RST_PIN, 0);
+    DEV_Delay_ms(2);
+    DEV_Digital_Write(EPD_RST_PIN, 1);
+    DEV_Delay_ms(20);
+}
+
+/******************************************************************************
+function :	send command
+parameter:
+     Reg : Command register
+******************************************************************************/
+static void EPD_2IN66g_SendCommand(UBYTE Reg)
+{
+    DEV_Digital_Write(EPD_DC_PIN, 0);
+    DEV_Digital_Write(EPD_CS_PIN, 0);
+    DEV_SPI_WriteByte(Reg);
+    DEV_Digital_Write(EPD_CS_PIN, 1);
+}
+
+/******************************************************************************
+function :	send data
+parameter:
+    Data : Write data
+******************************************************************************/
+static void EPD_2IN66g_SendData(UBYTE Data)
+{
+    DEV_Digital_Write(EPD_DC_PIN, 1);
+    DEV_Digital_Write(EPD_CS_PIN, 0);
+    DEV_SPI_WriteByte(Data);
+    DEV_Digital_Write(EPD_CS_PIN, 1);
+}
+
+/******************************************************************************
+function :	Wait until the busy_pin goes LOW
+parameter:
+******************************************************************************/
+static void EPD_2IN66g_ReadBusyH(void)
+{
+    Debug("e-Paper busy H\r\n");
+    while(!DEV_Digital_Read(EPD_BUSY_PIN)) {      //LOW: idle, HIGH: busy
+        DEV_Delay_ms(5);
+    }
+    Debug("e-Paper busy H release\r\n");
+}
+
+/******************************************************************************
+function :	Turn On Display
+parameter:
+******************************************************************************/
+static void EPD_2IN66g_TurnOnDisplay(void)
+{
+    EPD_2IN66g_SendCommand(0x12); // DISPLAY_REFRESH
+    EPD_2IN66g_SendData(0x01);
+    EPD_2IN66g_ReadBusyH();
+}
+
+/******************************************************************************
+function :	Initialize the e-Paper register
+parameter:
+******************************************************************************/
+void EPD_2IN66g_Init(void)
+{
+    EPD_2IN66g_Reset();
+    EPD_2IN66g_ReadBusyH();
+
+    EPD_2IN66g_SendCommand(0x4D);
+    EPD_2IN66g_SendData(0x78);
+
+    EPD_2IN66g_SendCommand(0x00);	//PSR
+    EPD_2IN66g_SendData(0x0F);
+    EPD_2IN66g_SendData(0x29);
+
+    EPD_2IN66g_SendCommand(0x01);	//PWRR
+    EPD_2IN66g_SendData(0x07);
+    EPD_2IN66g_SendData(0x00);
+
+    EPD_2IN66g_SendCommand(0x03);	//POFS
+    EPD_2IN66g_SendData(0x10);
+    EPD_2IN66g_SendData(0x54);
+    EPD_2IN66g_SendData(0x44);
+
+    EPD_2IN66g_SendCommand(0x06);	//BTST_P
+    EPD_2IN66g_SendData(0x05);
+    EPD_2IN66g_SendData(0x00);
+    EPD_2IN66g_SendData(0x3F);
+    EPD_2IN66g_SendData(0x0A);
+    EPD_2IN66g_SendData(0x25);
+    EPD_2IN66g_SendData(0x12);
+    EPD_2IN66g_SendData(0x1A); 
+
+    EPD_2IN66g_SendCommand(0x50);	//CDI
+    EPD_2IN66g_SendData(0x37);
+
+    EPD_2IN66g_SendCommand(0x60);	//TCON
+    EPD_2IN66g_SendData(0x02);
+    EPD_2IN66g_SendData(0x02);
+
+    EPD_2IN66g_SendCommand(0x61); //TRES
+    EPD_2IN66g_SendData(EPD_2IN66g_WIDTH/256);		// Source_BITS_H
+    EPD_2IN66g_SendData(EPD_2IN66g_WIDTH%256);		// Source_BITS_L
+    EPD_2IN66g_SendData(EPD_2IN66g_HEIGHT/256);			// Gate_BITS_H
+    EPD_2IN66g_SendData(EPD_2IN66g_HEIGHT%256); 		// Gate_BITS_L	
+
+    EPD_2IN66g_SendCommand(0xE7);
+    EPD_2IN66g_SendData(0x1C);
+
+    EPD_2IN66g_SendCommand(0xE3);	
+    EPD_2IN66g_SendData(0x22);
+
+    EPD_2IN66g_SendCommand(0xB4);
+    EPD_2IN66g_SendData(0xD0);
+    EPD_2IN66g_SendCommand(0xB5);
+    EPD_2IN66g_SendData(0x03);
+
+    EPD_2IN66g_SendCommand(0xE9);
+    EPD_2IN66g_SendData(0x01); 
+
+    EPD_2IN66g_SendCommand(0x30);
+    EPD_2IN66g_SendData(0x08);  
+
+    EPD_2IN66g_SendCommand(0x04);
+    EPD_2IN66g_ReadBusyH();
+}
+
+/******************************************************************************
+function :	Clear screen
+parameter:
+******************************************************************************/
+void EPD_2IN66g_Clear(UBYTE color)
+{
+    UWORD Width, Height;
+    Width = (EPD_2IN66g_WIDTH % 4 == 0)? (EPD_2IN66g_WIDTH / 4 ): (EPD_2IN66g_WIDTH / 4 + 1);
+    Height = EPD_2IN66g_HEIGHT;
+
+    EPD_2IN66g_SendCommand(0x10);
+    for (UWORD j = 0; j < Height; j++) {
+        for (UWORD i = 0; i < Width; i++) {
+                EPD_2IN66g_SendData((color << 6) | (color << 4) | (color << 2) | color);
+        }
+    }
+
+    EPD_2IN66g_TurnOnDisplay();
+}
+
+/******************************************************************************
+function :	Sends the image buffer in RAM to e-Paper and displays
+parameter:
+******************************************************************************/
+void EPD_2IN66g_Display(UBYTE *Image)
+{
+    UWORD Width, Height;
+    Width = (EPD_2IN66g_WIDTH % 4 == 0)? (EPD_2IN66g_WIDTH / 4 ): (EPD_2IN66g_WIDTH / 4 + 1);
+    Height = EPD_2IN66g_HEIGHT;
+
+    EPD_2IN66g_SendCommand(0x10);
+    for (UWORD j = 0; j < Height; j++) {
+        for (UWORD i = 0; i < Width; i++) {
+            EPD_2IN66g_SendData(Image[i + j * Width]);
+        }
+    }
+	
+    EPD_2IN66g_TurnOnDisplay();
+}
+
+/******************************************************************************
+function :	Enter sleep mode
+parameter:
+******************************************************************************/
+void EPD_2IN66g_Sleep(void)
+{
+    EPD_2IN66g_SendCommand(0x02); // POWER_OFF
+    EPD_2IN66g_SendData(0X00);
+    EPD_2IN66g_ReadBusyH();
+
+    EPD_2IN66g_SendCommand(0x07); // DEEP_SLEEP
+    EPD_2IN66g_SendData(0XA5);
+}
+

+ 51 - 0
RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_2in66g.h

@@ -0,0 +1,51 @@
+/*****************************************************************************
+* | File      	:   EPD_2in66g.h
+* | Author      :   Waveshare team
+* | Function    :   2.66inch e-Paper (G)
+* | Info        :
+*----------------
+* |	This version:   V1.0
+* | Date        :   2023-12-20
+* | Info        :
+* -----------------------------------------------------------------------------
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documnetation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to  whom the Software is
+# furished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+******************************************************************************/
+#ifndef __EPD_2IN66g_H_
+#define __EPD_2IN66g_H_
+
+#include "DEV_Config.h"
+
+// Display resolution
+#define EPD_2IN66g_WIDTH       184
+#define EPD_2IN66g_HEIGHT      360
+
+// Color
+#define EPD_2IN66g_BLACK		0x0
+#define EPD_2IN66g_WHITE		0x1
+#define EPD_2IN66g_YELLOW		0x2
+#define EPD_2IN66g_RED			0x3
+
+void EPD_2IN66g_Init(void);
+void EPD_2IN66g_Clear(UBYTE color);
+void EPD_2IN66g_Display(UBYTE *Image);
+void EPD_2IN66g_Sleep(void);
+
+#endif

+ 81 - 17
RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_2in9_V2.c

@@ -4,8 +4,8 @@
 * | Function    :   2.9inch e-paper V2
 * | Info        :
 *----------------
-* |	This version:   V1.1
-* | Date        :   2023-08-30
+* |	This version:   V1.2
+* | Date        :   2023-12-21
 * | Info        :
 * -----------------------------------------------------------------------------
 #
@@ -79,14 +79,37 @@ UBYTE WS_20_30[159] =
 
 unsigned char Gray4[159] =			
 {											
-0x00,	0x60,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L0	 //2.28s			
-0x20,	0x60,	0x10,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L1				
-0x28,	0x60,	0x14,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L2				
-0x2A,	0x60,	0x15,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L3 				
-0x00,	0x90,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L4 				
-0x00,	0x02,	0x00,	0x05,	0x14,	0x00,	0x00,						//TP, SR, RP of Group0				
-0x1E,	0x1E,	0x00,	0x00,	0x00,	0x00,	0x01,						//TP, SR, RP of Group1				
-0x00,	0x02,	0x00,	0x05,	0x14,	0x00,	0x00,						//TP, SR, RP of Group2				
+	0x00,	0x60,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L0	 //2.28s			
+    0x20,	0x60,	0x10,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L1				
+    0x28,	0x60,	0x14,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L2				
+    0x2A,	0x60,	0x15,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L3 				
+    0x00,	0x90,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L4 				
+    0x00,	0x02,	0x00,	0x05,	0x14,	0x00,	0x00,						//TP, SR, RP of Group0				
+    0x1E,	0x1E,	0x00,	0x00,	0x00,	0x00,	0x01,						//TP, SR, RP of Group1				
+    0x00,	0x02,	0x00,	0x05,	0x14,	0x00,	0x00,						//TP, SR, RP of Group2				
+    0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group3				
+    0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group4				
+    0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group5				
+    0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group6				
+    0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group7				
+    0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group8				
+    0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group9				
+    0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group10				
+    0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group11				
+    0x24,	0x22,	0x22,	0x22,	0x23,	0x32,	0x00,	0x00,	0x00,				//FR, XON				
+    0x22,	0x17,	0x41,	0xAE,	0x32,	0x28,							//EOPT VGH VSH1 VSH2 VSL VCOM			
+};
+
+unsigned char WF_FULL[159] =
+{											
+0x90,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L0	1.00S			
+0x60,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L1				
+0x90,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L2				
+0x60,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L3 				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	//VS L4 				
+0x19,	0x19,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group0				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group1				
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group2				
 0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group3				
 0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group4				
 0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group5				
@@ -96,9 +119,9 @@ unsigned char Gray4[159] =
 0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group9				
 0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group10				
 0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,						//TP, SR, RP of Group11				
-0x24,	0x22,	0x22,	0x22,	0x23,	0x32,	0x00,	0x00,	0x00,				//FR, XON				
-0x22,	0x17,	0x41,	0xAE,	0x32,	0x28,							//EOPT VGH VSH1 VSH2 VSL VCOM				
-};	
+0x24,	0x42,	0x22,	0x22,	0x23,	0x32,	0x00,	0x00,	0x00,				//FR, XON				
+0x22,	0x17,	0x41,	0xAE,	0x32,	0x38,							//EOPT VGH VSH1 VSH2 VSL VCOM				
+};
 
 /******************************************************************************
 function :	Software reset
@@ -189,7 +212,7 @@ parameter:
 static void EPD_2IN9_V2_TurnOnDisplay(void)
 {
 	EPD_2IN9_V2_SendCommand(0x22); //Display Update Control
-	EPD_2IN9_V2_SendData(0xc7);
+	EPD_2IN9_V2_SendData(0xC7);
 	EPD_2IN9_V2_SendCommand(0x20); //Activate Display Update Sequence
 	EPD_2IN9_V2_ReadBusy();
 }
@@ -266,6 +289,38 @@ void EPD_2IN9_V2_Init(void)
 	EPD_2IN9_V2_LUT_by_host(WS_20_30);
 }
 
+void EPD_2IN9_V2_Init_Fast(void)
+{
+	EPD_2IN9_V2_Reset();
+	DEV_Delay_ms(100);
+
+	EPD_2IN9_V2_ReadBusy();   
+	EPD_2IN9_V2_SendCommand(0x12); // soft reset
+	EPD_2IN9_V2_ReadBusy();
+	
+	EPD_2IN9_V2_SendCommand(0x01); //Driver output control      
+	EPD_2IN9_V2_SendData(0x27);
+	EPD_2IN9_V2_SendData(0x01);
+	EPD_2IN9_V2_SendData(0x00);
+	
+	EPD_2IN9_V2_SendCommand(0x11); //data entry mode       
+	EPD_2IN9_V2_SendData(0x03);
+	
+	EPD_2IN9_V2_SetWindows(0, 0, EPD_2IN9_V2_WIDTH-1, EPD_2IN9_V2_HEIGHT-1);
+	
+    EPD_2IN9_V2_SendCommand(0x3C);       
+	EPD_2IN9_V2_SendData(0x05);
+
+	EPD_2IN9_V2_SendCommand(0x21); //  Display update control
+	EPD_2IN9_V2_SendData(0x00);
+	EPD_2IN9_V2_SendData(0x80);	
+	
+	EPD_2IN9_V2_SetCursor(0, 0);
+	EPD_2IN9_V2_ReadBusy();	
+	
+	EPD_2IN9_V2_LUT_by_host(WF_FULL);
+}
+
 void EPD_2IN9_V2_Gray4_Init(void)
 {
 	EPD_2IN9_V2_Reset();
@@ -274,6 +329,11 @@ void EPD_2IN9_V2_Gray4_Init(void)
 	EPD_2IN9_V2_ReadBusy();   
 	EPD_2IN9_V2_SendCommand(0x12); // soft reset
 	EPD_2IN9_V2_ReadBusy();
+
+    EPD_2IN9_V2_SendCommand(0x74); //set analog block control       
+	EPD_2IN9_V2_SendData(0x54);
+	EPD_2IN9_V2_SendCommand(0x7E); //set digital block control          
+	EPD_2IN9_V2_SendData(0x3B);
 	
 	EPD_2IN9_V2_SendCommand(0x01); //Driver output control      
 	EPD_2IN9_V2_SendData(0x27);
@@ -283,12 +343,16 @@ void EPD_2IN9_V2_Gray4_Init(void)
 	EPD_2IN9_V2_SendCommand(0x11); //data entry mode       
 	EPD_2IN9_V2_SendData(0x03);
 	
-	EPD_2IN9_V2_SetWindows(8, 0, EPD_2IN9_V2_WIDTH, EPD_2IN9_V2_HEIGHT-1);
+	EPD_2IN9_V2_SetWindows(0, 0, EPD_2IN9_V2_WIDTH-1, EPD_2IN9_V2_HEIGHT-1);
 
 	EPD_2IN9_V2_SendCommand(0x3C);       
-	EPD_2IN9_V2_SendData(0x04);
+	EPD_2IN9_V2_SendData(0x00);
 	
-	EPD_2IN9_V2_SetCursor(1, 0);
+    EPD_2IN9_V2_SendCommand(0x21); //  Display update control
+	EPD_2IN9_V2_SendData(0x00);
+	EPD_2IN9_V2_SendData(0x80);
+
+	EPD_2IN9_V2_SetCursor(0, 0);
 	EPD_2IN9_V2_ReadBusy();	
 
 	EPD_2IN9_V2_LUT_by_host(Gray4);

+ 4 - 2
RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_2in9_V2.h

@@ -4,8 +4,8 @@
 * | Function    :   2.9inch e-paper V2
 * | Info        :
 *----------------
-* |	This version:   V1.1
-* | Date        :   2023-08-30
+* |	This version:   V1.2
+* | Date        :   2023-12-21
 * | Info        :
 * -----------------------------------------------------------------------------
 #
@@ -38,9 +38,11 @@
 #define EPD_2IN9_V2_HEIGHT      296
 
 void EPD_2IN9_V2_Init(void);
+void EPD_2IN9_V2_Init_Fast(void);
 void EPD_2IN9_V2_Gray4_Init(void);
 void EPD_2IN9_V2_Clear(void);
 void EPD_2IN9_V2_Display(UBYTE *Image);
+void EPD_2IN9_V2_Display_Fast(UBYTE *Image);
 void EPD_2IN9_V2_Display_Base(UBYTE *Image);
 void EPD_2IN9_V2_4GrayDisplay(UBYTE *Image);
 void EPD_2IN9_V2_Display_Partial(UBYTE *Image);

+ 465 - 0
RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_2in9b_V4.c

@@ -0,0 +1,465 @@
+/*****************************************************************************
+* | File      	:   EPD_2in9b_V4.c
+* | Author      :   Waveshare team
+* | Function    :   2.9inch e-paper b V4
+* | Info        :
+*----------------
+* |	This version:   V1.0
+* | Date        :   2023-12-18
+* | Info        :
+* -----------------------------------------------------------------------------
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documnetation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to  whom the Software is
+# furished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+******************************************************************************/
+#include "EPD_2in9b_V4.h"
+#include "Debug.h"
+#include <time.h>
+
+/******************************************************************************
+function :	Software reset
+parameter:
+******************************************************************************/
+static void EPD_2IN9B_V4_Reset(void)
+{
+    DEV_Digital_Write(EPD_RST_PIN, 1);
+    DEV_Delay_ms(200);
+    DEV_Digital_Write(EPD_RST_PIN, 0);
+    DEV_Delay_ms(2);
+    DEV_Digital_Write(EPD_RST_PIN, 1);
+    DEV_Delay_ms(200);
+}
+
+/******************************************************************************
+function :	send command
+parameter:
+     Reg : Command register
+******************************************************************************/
+static void EPD_2IN9B_V4_SendCommand(UBYTE Reg)
+{
+    DEV_Digital_Write(EPD_DC_PIN, 0);
+    DEV_Digital_Write(EPD_CS_PIN, 0);
+    DEV_SPI_WriteByte(Reg);
+    DEV_Digital_Write(EPD_CS_PIN, 1);
+}
+
+/******************************************************************************
+function :	send data
+parameter:
+    Data : Write data
+******************************************************************************/
+static void EPD_2IN9B_V4_SendData(UBYTE Data)
+{
+    DEV_Digital_Write(EPD_DC_PIN, 1);
+    DEV_Digital_Write(EPD_CS_PIN, 0);
+    DEV_SPI_WriteByte(Data);
+    DEV_Digital_Write(EPD_CS_PIN, 1);
+}
+
+/******************************************************************************
+function :	Wait until the busy_pin goes LOW
+parameter:
+******************************************************************************/
+void EPD_2IN9B_V4_ReadBusy(void)
+{
+    Debug("e-Paper busy\r\n");
+	while(1)
+	{	 //=1 BUSY
+		if(DEV_Digital_Read(EPD_BUSY_PIN)==0) 
+			break;
+		DEV_Delay_ms(50);
+	}
+    Debug("e-Paper busy release\r\n");
+    DEV_Delay_ms(200);
+}
+
+/******************************************************************************
+function :	Turn On Display
+parameter:
+******************************************************************************/
+static void EPD_2IN9B_V4_TurnOnDisplay(void)
+{
+	EPD_2IN9B_V4_SendCommand(0x22); //Display Update Control
+	EPD_2IN9B_V4_SendData(0xF7);
+	EPD_2IN9B_V4_SendCommand(0x20); //Activate Display Update Sequence
+	EPD_2IN9B_V4_ReadBusy();
+}
+
+static void EPD_2IN9B_V4_TurnOnDisplay_Base(void)
+{
+	EPD_2IN9B_V4_SendCommand(0x22); //Display Update Control
+	EPD_2IN9B_V4_SendData(0xF4);
+	EPD_2IN9B_V4_SendCommand(0x20); //Activate Display Update Sequence
+	EPD_2IN9B_V4_ReadBusy();
+}
+
+static void EPD_2IN9B_V4_TurnOnDisplay_Partial(void)
+{
+	EPD_2IN9B_V4_SendCommand(0x22); //Display Update Control
+	EPD_2IN9B_V4_SendData(0x1C);
+	EPD_2IN9B_V4_SendCommand(0x20); //Activate Display Update Sequence
+	EPD_2IN9B_V4_ReadBusy();
+}
+
+static void EPD_2IN9B_V4_TurnOnDisplay_Fast(void)
+{
+	EPD_2IN9B_V4_SendCommand(0x22); //Display Update Control
+	EPD_2IN9B_V4_SendData(0xC7);
+	EPD_2IN9B_V4_SendCommand(0x20); //Activate Display Update Sequence
+	EPD_2IN9B_V4_ReadBusy();
+}
+
+/******************************************************************************
+function :	Initialize the e-Paper register
+parameter:
+******************************************************************************/
+void EPD_2IN9B_V4_Init(void)
+{
+    EPD_2IN9B_V4_Reset();
+
+    EPD_2IN9B_V4_ReadBusy();   
+    EPD_2IN9B_V4_SendCommand(0x12);  //SWRESET
+    EPD_2IN9B_V4_ReadBusy();   
+        
+    EPD_2IN9B_V4_SendCommand(0x01); //Driver output control      
+    EPD_2IN9B_V4_SendData((EPD_2IN9B_V4_HEIGHT-1)%256);    
+    EPD_2IN9B_V4_SendData((EPD_2IN9B_V4_HEIGHT-1)/256);
+    EPD_2IN9B_V4_SendData(0x00);
+
+    EPD_2IN9B_V4_SendCommand(0x11); //data entry mode       
+    EPD_2IN9B_V4_SendData(0x03);
+
+    EPD_2IN9B_V4_SendCommand(0x44); //set Ram-X address start/end position   
+    EPD_2IN9B_V4_SendData(0x00);
+    EPD_2IN9B_V4_SendData(EPD_2IN9B_V4_WIDTH/8-1);   
+
+    EPD_2IN9B_V4_SendCommand(0x45); //set Ram-Y address start/end position          
+    EPD_2IN9B_V4_SendData(0x00);
+    EPD_2IN9B_V4_SendData(0x00); 
+    EPD_2IN9B_V4_SendData((EPD_2IN9B_V4_HEIGHT-1)%256);    
+    EPD_2IN9B_V4_SendData((EPD_2IN9B_V4_HEIGHT-1)/256);
+
+    EPD_2IN9B_V4_SendCommand(0x3C); //BorderWavefrom
+    EPD_2IN9B_V4_SendData(0x05);	
+
+    EPD_2IN9B_V4_SendCommand(0x21); //  Display update control
+    EPD_2IN9B_V4_SendData(0x00);		
+    EPD_2IN9B_V4_SendData(0x80);	
+
+    EPD_2IN9B_V4_SendCommand(0x18); //Read built-in temperature sensor
+    EPD_2IN9B_V4_SendData(0x80);	
+
+    EPD_2IN9B_V4_SendCommand(0x4E);   // set RAM x address count to 0;
+    EPD_2IN9B_V4_SendData(0x00);
+    EPD_2IN9B_V4_SendCommand(0x4F);   // set RAM y address count to 0X199;    
+    EPD_2IN9B_V4_SendData(0x00);    
+    EPD_2IN9B_V4_SendData(0x00);
+    EPD_2IN9B_V4_ReadBusy();
+}
+
+void EPD_2IN9B_V4_Init_Fast(void)
+{
+    EPD_2IN9B_V4_Reset();
+
+    EPD_2IN9B_V4_ReadBusy();   
+    EPD_2IN9B_V4_SendCommand(0x12);  //SWRESET
+    EPD_2IN9B_V4_ReadBusy();   	
+
+    EPD_2IN9B_V4_SendCommand(0x18); //Read built-in temperature sensor
+    EPD_2IN9B_V4_SendData(0x80);
+
+    EPD_2IN9B_V4_SendCommand(0x22); // Load temperature value
+    EPD_2IN9B_V4_SendData(0xB1);		
+    EPD_2IN9B_V4_SendCommand(0x20);	
+    EPD_2IN9B_V4_ReadBusy();   
+
+    EPD_2IN9B_V4_SendCommand(0x1A); // Write to temperature register
+    EPD_2IN9B_V4_SendData(0x5a);		// 90		
+    EPD_2IN9B_V4_SendData(0x00);	
+                
+    EPD_2IN9B_V4_SendCommand(0x22); // Load temperature value
+    EPD_2IN9B_V4_SendData(0x91);		
+    EPD_2IN9B_V4_SendCommand(0x20);	
+    EPD_2IN9B_V4_ReadBusy();  
+
+    EPD_2IN9B_V4_SendCommand(0x01); //Driver output control      
+    EPD_2IN9B_V4_SendData((EPD_2IN9B_V4_HEIGHT-1)%256);    
+    EPD_2IN9B_V4_SendData((EPD_2IN9B_V4_HEIGHT-1)/256);
+    EPD_2IN9B_V4_SendData(0x00);
+
+    EPD_2IN9B_V4_SendCommand(0x11); //data entry mode       
+    EPD_2IN9B_V4_SendData(0x03);
+
+    EPD_2IN9B_V4_SendCommand(0x44); //set Ram-X address start/end position   
+    EPD_2IN9B_V4_SendData(0x00);
+    EPD_2IN9B_V4_SendData(EPD_2IN9B_V4_WIDTH/8-1);   
+
+    EPD_2IN9B_V4_SendCommand(0x45); //set Ram-Y address start/end position          
+    EPD_2IN9B_V4_SendData(0x00);
+    EPD_2IN9B_V4_SendData(0x00); 
+    EPD_2IN9B_V4_SendData((EPD_2IN9B_V4_HEIGHT-1)%256);    
+    EPD_2IN9B_V4_SendData((EPD_2IN9B_V4_HEIGHT-1)/256);	
+
+    EPD_2IN9B_V4_SendCommand(0x4E);   // set RAM x address count to 0;
+    EPD_2IN9B_V4_SendData(0x00);
+    EPD_2IN9B_V4_SendCommand(0x4F);   // set RAM y address count to 0X199;    
+    EPD_2IN9B_V4_SendData(0x00);    
+    EPD_2IN9B_V4_SendData(0x00);
+    EPD_2IN9B_V4_ReadBusy();	
+
+}
+
+
+
+/******************************************************************************
+function :	Clear screen
+parameter:
+******************************************************************************/
+void EPD_2IN9B_V4_Clear(void)
+{
+    UWORD Width = (EPD_2IN9B_V4_WIDTH % 8 == 0)? (EPD_2IN9B_V4_WIDTH / 8 ): (EPD_2IN9B_V4_WIDTH / 8 + 1);
+    UWORD Height = EPD_2IN9B_V4_HEIGHT;
+
+    //send black data
+    EPD_2IN9B_V4_SendCommand(0x24);
+    for (UWORD j = 0; j < Height; j++) {
+        for (UWORD i = 0; i < Width; i++) {
+            EPD_2IN9B_V4_SendData(0xFF);
+        }
+    }
+
+    //send red data
+    EPD_2IN9B_V4_SendCommand(0x26);
+    for (UWORD j = 0; j < Height; j++) {
+        for (UWORD i = 0; i < Width; i++) {
+            EPD_2IN9B_V4_SendData(0x00);
+        }
+    }
+
+    EPD_2IN9B_V4_TurnOnDisplay();
+}
+
+void EPD_2IN9B_V4_Clear_Fast(void)
+{
+    UWORD Width = (EPD_2IN9B_V4_WIDTH % 8 == 0)? (EPD_2IN9B_V4_WIDTH / 8 ): (EPD_2IN9B_V4_WIDTH / 8 + 1);
+    UWORD Height = EPD_2IN9B_V4_HEIGHT;
+
+    //send black data
+    EPD_2IN9B_V4_SendCommand(0x24);
+    for (UWORD j = 0; j < Height; j++) {
+        for (UWORD i = 0; i < Width; i++) {
+            EPD_2IN9B_V4_SendData(0xFF);
+        }
+    }
+
+    //send red data
+    EPD_2IN9B_V4_SendCommand(0x26);
+    for (UWORD j = 0; j < Height; j++) {
+        for (UWORD i = 0; i < Width; i++) {
+            EPD_2IN9B_V4_SendData(0x00);
+        }
+    }
+
+    EPD_2IN9B_V4_TurnOnDisplay_Fast();
+}
+
+void EPD_2IN9B_V4_Clear_Black_Fast(void)
+{
+    UWORD Width = (EPD_2IN9B_V4_WIDTH % 8 == 0)? (EPD_2IN9B_V4_WIDTH / 8 ): (EPD_2IN9B_V4_WIDTH / 8 + 1);
+    UWORD Height = EPD_2IN9B_V4_HEIGHT;
+
+    //send black data
+    EPD_2IN9B_V4_SendCommand(0x24);
+    for (UWORD j = 0; j < Height; j++) {
+        for (UWORD i = 0; i < Width; i++) {
+            EPD_2IN9B_V4_SendData(0x00);
+        }
+    }
+
+    //send red data
+    EPD_2IN9B_V4_SendCommand(0x26);
+    for (UWORD j = 0; j < Height; j++) {
+        for (UWORD i = 0; i < Width; i++) {
+            EPD_2IN9B_V4_SendData(0x00);
+        }
+    }
+
+    EPD_2IN9B_V4_TurnOnDisplay_Fast();
+}
+
+void EPD_2IN9B_V4_Clear_Red_Fast(void)
+{
+    UWORD Width = (EPD_2IN9B_V4_WIDTH % 8 == 0)? (EPD_2IN9B_V4_WIDTH / 8 ): (EPD_2IN9B_V4_WIDTH / 8 + 1);
+    UWORD Height = EPD_2IN9B_V4_HEIGHT;
+
+    //send black data
+    EPD_2IN9B_V4_SendCommand(0x24);
+    for (UWORD j = 0; j < Height; j++) {
+        for (UWORD i = 0; i < Width; i++) {
+            EPD_2IN9B_V4_SendData(0xFF);
+        }
+    }
+
+    //send red data
+    EPD_2IN9B_V4_SendCommand(0x26);
+    for (UWORD j = 0; j < Height; j++) {
+        for (UWORD i = 0; i < Width; i++) {
+            EPD_2IN9B_V4_SendData(0xFF);
+        }
+    }
+
+    EPD_2IN9B_V4_TurnOnDisplay_Fast();
+}
+
+/******************************************************************************
+function :	Sends the image buffer in RAM to e-Paper and displays
+parameter:
+******************************************************************************/
+void EPD_2IN9B_V4_Display(const UBYTE *blackimage, const UBYTE *ryimage)
+{
+    UWORD Width, Height;
+    Width = (EPD_2IN9B_V4_WIDTH % 8 == 0)? (EPD_2IN9B_V4_WIDTH / 8 ): (EPD_2IN9B_V4_WIDTH / 8 + 1);
+    Height = EPD_2IN9B_V4_HEIGHT;
+
+    EPD_2IN9B_V4_SendCommand(0x24);
+    for (UWORD j = 0; j < Height; j++) {
+        for (UWORD i = 0; i < Width; i++) {
+            EPD_2IN9B_V4_SendData(blackimage[i + j * Width]);
+        }
+    }
+
+    EPD_2IN9B_V4_SendCommand(0x26);
+    for (UWORD j = 0; j < Height; j++) {
+        for (UWORD i = 0; i < Width; i++) {
+            EPD_2IN9B_V4_SendData(~ryimage[i + j * Width]);
+        }
+    }
+
+    EPD_2IN9B_V4_TurnOnDisplay();
+}
+
+void EPD_2IN9B_V4_Display_Fast(const UBYTE *blackimage, const UBYTE *ryimage)
+{
+    UWORD Width, Height;
+    Width = (EPD_2IN9B_V4_WIDTH % 8 == 0)? (EPD_2IN9B_V4_WIDTH / 8 ): (EPD_2IN9B_V4_WIDTH / 8 + 1);
+    Height = EPD_2IN9B_V4_HEIGHT;
+
+    EPD_2IN9B_V4_SendCommand(0x24);
+    for (UWORD j = 0; j < Height; j++) {
+        for (UWORD i = 0; i < Width; i++) {
+            EPD_2IN9B_V4_SendData(blackimage[i + j * Width]);
+        }
+    }
+
+    EPD_2IN9B_V4_SendCommand(0x26);
+    for (UWORD j = 0; j < Height; j++) {
+        for (UWORD i = 0; i < Width; i++) {
+            EPD_2IN9B_V4_SendData(~ryimage[i + j * Width]);
+        }
+    }
+
+    EPD_2IN9B_V4_TurnOnDisplay_Fast();
+}
+
+void EPD_2IN9B_V4_Display_Base(const UBYTE *blackimage, const UBYTE *ryimage)
+{
+    UWORD Width, Height;
+    Width = (EPD_2IN9B_V4_WIDTH % 8 == 0)? (EPD_2IN9B_V4_WIDTH / 8 ): (EPD_2IN9B_V4_WIDTH / 8 + 1);
+    Height = EPD_2IN9B_V4_HEIGHT;
+
+    EPD_2IN9B_V4_SendCommand(0x24);
+    for (UWORD j = 0; j < Height; j++) {
+        for (UWORD i = 0; i < Width; i++) {
+            EPD_2IN9B_V4_SendData(blackimage[i + j * Width]);
+        }
+    }
+
+    EPD_2IN9B_V4_SendCommand(0x26);
+    for (UWORD j = 0; j < Height; j++) {
+        for (UWORD i = 0; i < Width; i++) {
+            EPD_2IN9B_V4_SendData(~ryimage[i + j * Width]);
+        }
+    }
+
+    EPD_2IN9B_V4_TurnOnDisplay_Base();
+
+    EPD_2IN9B_V4_SendCommand(0x26);
+    for (UWORD j = 0; j < Height; j++) {
+        for (UWORD i = 0; i < Width; i++) {
+            EPD_2IN9B_V4_SendData(blackimage[i + j * Width]);
+        }
+    }
+}
+
+//Partial refresh display
+void EPD_2IN9B_V4_Display_Partial(const UBYTE *Image, UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend)
+{
+    if((Xstart % 8 + Xend % 8 == 8 && Xstart % 8 > Xend % 8) || Xstart % 8 + Xend % 8 == 0 || (Xend - Xstart)%8 == 0)
+    {
+        Xstart = Xstart / 8 ;
+        Xend = Xend / 8;
+    }
+    else
+    {
+        Xstart = Xstart / 8 ;
+        Xend = Xend % 8 == 0 ? Xend / 8 : Xend / 8 + 1;
+    }
+    
+
+    UWORD i, Width;
+	Width = Xend -  Xstart;
+	UWORD IMAGE_COUNTER = Width * (Yend-Ystart);
+
+	Xend -= 1;
+	Yend -= 1;	
+
+    EPD_2IN9B_V4_SendCommand(0x44);       // set RAM x address start/end, in page 35
+    EPD_2IN9B_V4_SendData(Xstart & 0xff);    // RAM x address start at 00h;
+    EPD_2IN9B_V4_SendData(Xend & 0xff);    // RAM x address end at 0fh(15+1)*8->128 
+    EPD_2IN9B_V4_SendCommand(0x45);       // set RAM y address start/end, in page 35
+    EPD_2IN9B_V4_SendData(Ystart & 0xff);    // RAM y address start at 0127h;
+    EPD_2IN9B_V4_SendData((Ystart>>8) & 0x01);    // RAM y address start at 0127h;
+    EPD_2IN9B_V4_SendData(Yend & 0xff);    // RAM y address end at 00h;
+    EPD_2IN9B_V4_SendData((Yend>>8) & 0x01); 
+
+    EPD_2IN9B_V4_SendCommand(0x4E);   // set RAM x address count to 0;
+    EPD_2IN9B_V4_SendData(Xstart & 0xff); 
+    EPD_2IN9B_V4_SendCommand(0x4F);   // set RAM y address count to 0X127;    
+    EPD_2IN9B_V4_SendData(Ystart & 0xff);
+    EPD_2IN9B_V4_SendData((Ystart>>8) & 0x01);
+
+
+    EPD_2IN9B_V4_SendCommand(0x24);   //Write Black and White image to RAM
+    for (i = 0; i < IMAGE_COUNTER; i++) {
+	    EPD_2IN9B_V4_SendData(Image[i]);
+	}
+	EPD_2IN9B_V4_TurnOnDisplay_Partial();
+
+}
+
+/******************************************************************************
+function :	Enter sleep mode
+parameter:
+******************************************************************************/
+void EPD_2IN9B_V4_Sleep(void)
+{
+    EPD_2IN9B_V4_SendCommand(0x10); //enter deep sleep
+	EPD_2IN9B_V4_SendData(0x01); 
+	DEV_Delay_ms(100);
+}

+ 52 - 0
RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_2in9b_V4.h

@@ -0,0 +1,52 @@
+/*****************************************************************************
+* | File      	:   EPD_2in9b V4.h
+* | Author      :   Waveshare team
+* | Function    :   2.9inch e-paper b V4
+* | Info        :
+*----------------
+* |	This version:   V1.0
+* | Date        :   2023-12-18
+* | Info        :
+* -----------------------------------------------------------------------------
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documnetation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to  whom the Software is
+# furished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+******************************************************************************/
+#ifndef __EPD_2IN9B_V4_H_
+#define __EPD_2IN9B_V4_H_
+
+#include "DEV_Config.h"
+
+// Display resolution
+#define EPD_2IN9B_V4_WIDTH       128
+#define EPD_2IN9B_V4_HEIGHT      296
+
+void EPD_2IN9B_V4_Init(void);
+void EPD_2IN9B_V4_Init_Fast(void);
+void EPD_2IN9B_V4_Clear_Fast(void);
+void EPD_2IN9B_V4_Clear_Black_Fast(void);
+void EPD_2IN9B_V4_Clear_Red_Fast(void);
+void EPD_2IN9B_V4_Clear(void);
+void EPD_2IN9B_V4_Display(const UBYTE *blackimage, const UBYTE *ryimage);
+void EPD_2IN9B_V4_Display_Fast(const UBYTE *blackimage, const UBYTE *ryimage);
+void EPD_2IN9B_V4_Display_Base(const UBYTE *blackimage, const UBYTE *ryimage);
+void EPD_2IN9B_V4_Display_Partial(const UBYTE *Image, UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend);
+void EPD_2IN9B_V4_Sleep(void);
+
+#endif

+ 541 - 0
RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_4in26.c

@@ -0,0 +1,541 @@
+/*****************************************************************************
+* | File      	:  	EPD_4in26.c
+* | Author      :   Waveshare team
+* | Function    :   4.26inch e-paper test demo
+* | Info        :
+*----------------
+* |	This version:   V1.0
+* | Date        :   2023-12-19
+* | Info        :
+* -----------------------------------------------------------------------------
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documnetation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to  whom the Software is
+# furished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+******************************************************************************/
+#include "EPD_4in26.h"
+#include "Debug.h"
+
+const unsigned char LUT_DATA_4Gray[112] =    //112bytes
+{											
+0x80,	0x48,	0x4A,	0x22,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	
+0x0A,	0x48,	0x68,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	
+0x88,	0x48,	0x60,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	
+0xA8,	0x48,	0x45,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	0x00,	
+0x07,	0x1E,	0x1C,	0x02,	0x00,						
+0x05,	0x01,	0x05,	0x01,	0x02,						
+0x08,	0x01,	0x01,	0x04,	0x04,						
+0x00,	0x02,	0x00,	0x02,	0x01,						
+0x00,	0x00,	0x00,	0x00,	0x00,						
+0x00,	0x00,	0x00,	0x00,	0x00,						
+0x00,	0x00,	0x00,	0x00,	0x00,						
+0x00,	0x00,	0x00,	0x00,	0x00,						
+0x00,	0x00,	0x00,	0x00,	0x00,						
+0x00,	0x00,	0x00,	0x00,	0x01,						
+0x22,	0x22,	0x22,	0x22,	0x22,						
+0x17,	0x41,	0xA8,	0x32,	0x30,						
+0x00,	0x00,	
+};	
+
+/******************************************************************************
+function :	Software reset
+parameter:
+******************************************************************************/
+static void EPD_4in26_Reset(void)
+{
+    DEV_Digital_Write(EPD_RST_PIN, 1);
+    DEV_Delay_ms(100);
+    DEV_Digital_Write(EPD_RST_PIN, 0);
+    DEV_Delay_ms(2);
+    DEV_Digital_Write(EPD_RST_PIN, 1);
+    DEV_Delay_ms(100);
+}
+
+/******************************************************************************
+function :	send command
+parameter:
+     Reg : Command register
+******************************************************************************/
+static void EPD_4in26_SendCommand(UBYTE Reg)
+{
+    DEV_Digital_Write(EPD_DC_PIN, 0);
+    DEV_Digital_Write(EPD_CS_PIN, 0);
+    DEV_SPI_WriteByte(Reg);
+    DEV_Digital_Write(EPD_CS_PIN, 1);
+}
+
+/******************************************************************************
+function :	send data
+parameter:
+    Data : Write data
+******************************************************************************/
+static void EPD_4in26_SendData(UBYTE Data)
+{
+    DEV_Digital_Write(EPD_DC_PIN, 1);
+    DEV_Digital_Write(EPD_CS_PIN, 0);
+    DEV_SPI_WriteByte(Data);
+    DEV_Digital_Write(EPD_CS_PIN, 1);
+}
+
+static void EPD_4in26_SendData2(UBYTE *pData, UDOUBLE len)
+{
+    DEV_Digital_Write(EPD_DC_PIN, 1);
+    DEV_Digital_Write(EPD_CS_PIN, 0);
+    DEV_SPI_Write_nByte(pData, len);
+    DEV_Digital_Write(EPD_CS_PIN, 1);
+}
+
+/******************************************************************************
+function :	Wait until the busy_pin goes LOW
+parameter:
+******************************************************************************/
+void EPD_4in26_ReadBusy(void)
+{
+    Debug("e-Paper busy\r\n");
+	while(1)
+	{	 //=1 BUSY
+		if(DEV_Digital_Read(EPD_BUSY_PIN)==0) 
+			break;
+		DEV_Delay_ms(20);
+	}
+	DEV_Delay_ms(20);
+    Debug("e-Paper busy release\r\n");
+}
+
+/******************************************************************************
+function :	Turn On Display
+parameter:
+******************************************************************************/
+static void EPD_4in26_TurnOnDisplay(void)
+{
+	EPD_4in26_SendCommand(0x22); //Display Update Control
+	EPD_4in26_SendData(0xF7);
+	EPD_4in26_SendCommand(0x20); //Activate Display Update Sequence
+	EPD_4in26_ReadBusy();
+}
+
+static void EPD_4in26_TurnOnDisplay_Fast(void)
+{
+	EPD_4in26_SendCommand(0x22); //Display Update Control
+	EPD_4in26_SendData(0xC7);
+	EPD_4in26_SendCommand(0x20); //Activate Display Update Sequence
+	EPD_4in26_ReadBusy();
+}
+
+static void EPD_4in26_TurnOnDisplay_Part(void)
+{
+	EPD_4in26_SendCommand(0x22); //Display Update Control
+	EPD_4in26_SendData(0xFF);
+	EPD_4in26_SendCommand(0x20); //Activate Display Update Sequence
+	EPD_4in26_ReadBusy();
+}
+
+static void EPD_4in26_TurnOnDisplay_4GRAY(void)
+{
+    EPD_4in26_SendCommand(0x22);
+    EPD_4in26_SendData(0xC7);
+	EPD_4in26_SendCommand(0x20);
+    EPD_4in26_ReadBusy();
+}
+
+/******************************************************************************
+function :	set the look-up tables
+parameter:
+******************************************************************************/
+static void EPD_4in26_Lut(void)
+{
+    unsigned int count;
+    EPD_4in26_SendCommand(0x32); //vcom
+    for(count = 0; count < 105 ; count++) {
+        EPD_4in26_SendData(LUT_DATA_4Gray[count]);
+    }
+
+    EPD_4in26_SendCommand(0x03); //VGH      
+	EPD_4in26_SendData(LUT_DATA_4Gray[105]);
+
+	EPD_4in26_SendCommand(0x04); //      
+	EPD_4in26_SendData(LUT_DATA_4Gray[106]); //VSH1   
+	EPD_4in26_SendData(LUT_DATA_4Gray[107]); //VSH2   
+	EPD_4in26_SendData(LUT_DATA_4Gray[108]); //VSL   
+
+	EPD_4in26_SendCommand(0x2C);     //VCOM Voltage
+	EPD_4in26_SendData(LUT_DATA_4Gray[109]);    //0x1C
+}
+
+/******************************************************************************
+function :	Setting the display window
+parameter:
+******************************************************************************/
+static void EPD_4in26_SetWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend)
+{
+    EPD_4in26_SendCommand(0x44); // SET_RAM_X_ADDRESS_START_END_POSITION
+    EPD_4in26_SendData(Xstart & 0xFF);
+    EPD_4in26_SendData((Xstart>>8) & 0x03);
+    EPD_4in26_SendData(Xend & 0xFF);
+    EPD_4in26_SendData((Xend>>8) & 0x03);
+	
+    EPD_4in26_SendCommand(0x45); // SET_RAM_Y_ADDRESS_START_END_POSITION
+    EPD_4in26_SendData(Ystart & 0xFF);
+    EPD_4in26_SendData((Ystart>>8) & 0x03);
+    EPD_4in26_SendData(Yend & 0xFF);
+    EPD_4in26_SendData((Yend>>8) & 0x03);
+}
+
+/******************************************************************************
+function :	Set Cursor
+parameter:
+******************************************************************************/
+static void EPD_4in26_SetCursor(UWORD Xstart, UWORD Ystart)
+{
+    EPD_4in26_SendCommand(0x4E); // SET_RAM_X_ADDRESS_COUNTER
+    EPD_4in26_SendData(Xstart & 0xFF);
+    EPD_4in26_SendData((Xstart>>8) & 0x03);
+
+    EPD_4in26_SendCommand(0x4F); // SET_RAM_Y_ADDRESS_COUNTER
+    EPD_4in26_SendData(Ystart & 0xFF);
+    EPD_4in26_SendData((Ystart>>8) & 0x03);
+}
+
+/******************************************************************************
+function :	Initialize the e-Paper register
+parameter:
+******************************************************************************/
+void EPD_4in26_Init(void)
+{
+	EPD_4in26_Reset();
+	DEV_Delay_ms(100);
+
+	EPD_4in26_ReadBusy();   
+	EPD_4in26_SendCommand(0x12);  //SWRESET
+	EPD_4in26_ReadBusy();   
+	
+	EPD_4in26_SendCommand(0x18); // use the internal temperature sensor
+	EPD_4in26_SendData(0x80);
+
+	EPD_4in26_SendCommand(0x0C); //set soft start     
+	EPD_4in26_SendData(0xAE);
+	EPD_4in26_SendData(0xC7);
+	EPD_4in26_SendData(0xC3);
+	EPD_4in26_SendData(0xC0);
+	EPD_4in26_SendData(0x80);
+
+	EPD_4in26_SendCommand(0x01);   //      drive output control    
+	EPD_4in26_SendData((EPD_4in26_HEIGHT-1)%256); //  Y  
+	EPD_4in26_SendData((EPD_4in26_HEIGHT-1)/256); //  Y 
+	EPD_4in26_SendData(0x02);
+
+	EPD_4in26_SendCommand(0x3C);        // Border       Border setting 
+	EPD_4in26_SendData(0x01);
+
+	EPD_4in26_SendCommand(0x11);        //    data  entry  mode
+	EPD_4in26_SendData(0x01);           //       X-mode  x+ y-    
+
+	EPD_4in26_SetWindows(0, EPD_4in26_HEIGHT-1, EPD_4in26_WIDTH-1, 0);
+
+	EPD_4in26_SetCursor(0, 0);
+
+	EPD_4in26_ReadBusy();
+}
+
+void EPD_4in26_Init_Fast(void)
+{
+	EPD_4in26_Reset();
+	DEV_Delay_ms(100);
+
+	EPD_4in26_ReadBusy();   
+	EPD_4in26_SendCommand(0x12);  //SWRESET
+	EPD_4in26_ReadBusy();   
+	
+	EPD_4in26_SendCommand(0x18); // use the internal temperature sensor
+	EPD_4in26_SendData(0x80);
+
+	EPD_4in26_SendCommand(0x0C); //set soft start     
+	EPD_4in26_SendData(0xAE);
+	EPD_4in26_SendData(0xC7);
+	EPD_4in26_SendData(0xC3);
+	EPD_4in26_SendData(0xC0);
+	EPD_4in26_SendData(0x80);
+
+	EPD_4in26_SendCommand(0x01);   //      drive output control    
+	EPD_4in26_SendData((EPD_4in26_HEIGHT-1)%256); //  Y  
+	EPD_4in26_SendData((EPD_4in26_HEIGHT-1)/256); //  Y 
+	EPD_4in26_SendData(0x02);
+
+	EPD_4in26_SendCommand(0x3C);        // Border       Border setting 
+	EPD_4in26_SendData(0x01);
+
+	EPD_4in26_SendCommand(0x11);        //    data  entry  mode
+	EPD_4in26_SendData(0x01);           //       X-mode  x+ y-    
+
+	EPD_4in26_SetWindows(0, EPD_4in26_HEIGHT-1, EPD_4in26_WIDTH-1, 0);
+
+	EPD_4in26_SetCursor(0, 0);
+
+	EPD_4in26_ReadBusy();
+
+	//TEMP (1.5s)
+	EPD_4in26_SendCommand(0x1A);  
+    EPD_4in26_SendData(0x5A); 
+
+    EPD_4in26_SendCommand(0x22);  
+    EPD_4in26_SendData(0x91); 
+    EPD_4in26_SendCommand(0x20); 
+	
+	EPD_4in26_ReadBusy();
+}
+
+void EPD_4in26_Init_4GRAY(void)
+{
+    EPD_4in26_Reset();
+	DEV_Delay_ms(100);
+
+	EPD_4in26_ReadBusy();   
+	EPD_4in26_SendCommand(0x12);  //SWRESET
+	EPD_4in26_ReadBusy();   
+	
+	EPD_4in26_SendCommand(0x18); // use the internal temperature sensor
+	EPD_4in26_SendData(0x80);
+
+	EPD_4in26_SendCommand(0x0C); //set soft start     
+	EPD_4in26_SendData(0xAE);
+	EPD_4in26_SendData(0xC7);
+	EPD_4in26_SendData(0xC3);
+	EPD_4in26_SendData(0xC0);
+	EPD_4in26_SendData(0x80);
+
+	EPD_4in26_SendCommand(0x01);   //      drive output control    
+	EPD_4in26_SendData((EPD_4in26_WIDTH-1)%256); //  Y  
+	EPD_4in26_SendData((EPD_4in26_WIDTH-1)/256); //  Y 
+	EPD_4in26_SendData(0x02);
+
+	EPD_4in26_SendCommand(0x3C);        // Border       Border setting 
+	EPD_4in26_SendData(0x01);
+
+	EPD_4in26_SendCommand(0x11);        //    data  entry  mode
+	EPD_4in26_SendData(0x01);           //       X-mode  x+ y-    
+
+	EPD_4in26_SetWindows(0, EPD_4in26_HEIGHT-1, EPD_4in26_WIDTH-1, 0);
+
+	EPD_4in26_SetCursor(0, 0);
+
+	EPD_4in26_ReadBusy();
+
+    EPD_4in26_Lut();
+}
+
+/******************************************************************************
+function :	Clear screen
+parameter:
+******************************************************************************/
+void EPD_4in26_Clear(void)
+{
+	UWORD i;
+	UWORD height = EPD_4in26_HEIGHT;
+	UWORD width = EPD_4in26_WIDTH/8;	
+	UBYTE image[EPD_4in26_WIDTH / 8] = {0x00};
+    for(i=0; i<width; i++) {
+        image[i] = 0xff;
+    }
+    
+	EPD_4in26_SendCommand(0x24);   //write RAM for black(0)/white (1)
+	for(i=0; i<height; i++)
+	{
+	    EPD_4in26_SendData2(image, width);
+	}
+
+	EPD_4in26_SendCommand(0x26);   //write RAM for black(0)/white (1)
+	for(i=0; i<height; i++)
+	{
+		EPD_4in26_SendData2(image, width);
+	}
+	EPD_4in26_TurnOnDisplay();
+}
+
+/******************************************************************************
+function :	Sends the image buffer in RAM to e-Paper and displays
+parameter:
+******************************************************************************/
+void EPD_4in26_Display(UBYTE *Image)
+{
+	UWORD i;
+	UWORD height = EPD_4in26_HEIGHT;
+	UWORD width = EPD_4in26_WIDTH/8;
+	
+	EPD_4in26_SendCommand(0x24);   //write RAM for black(0)/white (1)
+	for(i=0; i<height; i++)
+	{
+        EPD_4in26_SendData2((UBYTE *)(Image+i*width), width);
+	}
+	EPD_4in26_TurnOnDisplay();	
+}
+
+void EPD_4in26_Display_Base(UBYTE *Image)
+{
+	UWORD i;
+	UWORD height = EPD_4in26_HEIGHT;
+	UWORD width = EPD_4in26_WIDTH/8;
+	
+	EPD_4in26_SendCommand(0x24);   //write RAM for black(0)/white (1)
+	for(i=0; i<height; i++)
+	{
+		EPD_4in26_SendData2((UBYTE *)(Image+i*width), width);
+	}
+
+	EPD_4in26_SendCommand(0x26);   //write RAM for black(0)/white (1)
+	for(i=0; i<height; i++)
+	{
+		EPD_4in26_SendData2((UBYTE *)(Image+i*width), width);
+	}
+	EPD_4in26_TurnOnDisplay();	
+}
+
+void EPD_4in26_Display_Fast(UBYTE *Image)
+{
+	UWORD i;
+	UWORD height = EPD_4in26_HEIGHT;
+	UWORD width = EPD_4in26_WIDTH/8;
+	
+	EPD_4in26_SendCommand(0x24);   //write RAM for black(0)/white (1)
+	for(i=0; i<height; i++)
+	{
+		EPD_4in26_SendData2((UBYTE *)(Image+i*width), width);
+	}
+	EPD_4in26_TurnOnDisplay_Fast();	
+}
+
+void EPD_4in26_Display_Part(UBYTE *Image, UWORD x, UWORD y, UWORD w, UWORD l)
+{
+	UWORD i;
+	UWORD height = l;
+	UWORD width =  (w % 8 == 0)? (w / 8 ): (w / 8 + 1);
+
+    EPD_4in26_Reset();
+
+	EPD_4in26_SendCommand(0x18); // use the internal temperature sensor
+	EPD_4in26_SendData(0x80);
+
+	EPD_4in26_SendCommand(0x3C);        // Border       Border setting 
+	EPD_4in26_SendData(0x80);
+
+	EPD_4in26_SetWindows(x, y, x+w-1, y+l-1);
+
+	EPD_4in26_SetCursor(x, y);
+
+	EPD_4in26_SendCommand(0x24);   //write RAM for black(0)/white (1)
+	for(i=0; i<height; i++)
+	{
+		EPD_4in26_SendData2((UBYTE *)(Image+i*width), width);
+	}
+	EPD_4in26_TurnOnDisplay_Part();	
+}
+
+void EPD_4in26_4GrayDisplay(UBYTE *Image)
+{
+    UDOUBLE i,j,k;
+    UBYTE temp1,temp2,temp3;
+
+    // old  data
+    EPD_4in26_SendCommand(0x24);
+    for(i=0; i<48000; i++) {             //5808*4  46464
+        temp3=0;
+        for(j=0; j<2; j++) {
+            temp1 = Image[i*2+j];
+            for(k=0; k<2; k++) {
+                temp2 = temp1&0xC0;
+                if(temp2 == 0xC0)
+                    temp3 |= 0x00;
+                else if(temp2 == 0x00)
+                    temp3 |= 0x01; 
+                else if(temp2 == 0x80)
+                    temp3 |= 0x01; 
+                else //0x40
+                    temp3 |= 0x00; 
+                temp3 <<= 1;
+
+                temp1 <<= 2;
+                temp2 = temp1&0xC0 ;
+                if(temp2 == 0xC0) 
+                    temp3 |= 0x00;
+                else if(temp2 == 0x00) 
+                    temp3 |= 0x01;
+                else if(temp2 == 0x80)
+                    temp3 |= 0x01; 
+                else    //0x40
+                    temp3 |= 0x00;	
+                if(j!=1 || k!=1)
+                    temp3 <<= 1;
+
+                temp1 <<= 2;
+            }
+
+        }
+        EPD_4in26_SendData(temp3);
+        // printf("%x",temp3);
+    }
+
+    EPD_4in26_SendCommand(0x26);   //write RAM for black(0)/white (1)
+    for(i=0; i<48000; i++) {             //5808*4  46464
+        temp3=0;
+        for(j=0; j<2; j++) {
+            temp1 = Image[i*2+j];
+            for(k=0; k<2; k++) {
+                temp2 = temp1&0xC0 ;
+                if(temp2 == 0xC0)
+                    temp3 |= 0x00;//white
+                else if(temp2 == 0x00)
+                    temp3 |= 0x01;  //black
+                else if(temp2 == 0x80)
+                    temp3 |= 0x00;  //gray1
+                else //0x40
+                    temp3 |= 0x01; //gray2
+                temp3 <<= 1;
+
+                temp1 <<= 2;
+                temp2 = temp1&0xC0 ;
+                if(temp2 == 0xC0)  //white
+                    temp3 |= 0x00;
+                else if(temp2 == 0x00) //black
+                    temp3 |= 0x01;
+                else if(temp2 == 0x80)
+                    temp3 |= 0x00; //gray1
+                else    //0x40
+                    temp3 |= 0x01;	//gray2
+                if(j!=1 || k!=1)
+                    temp3 <<= 1;
+
+                temp1 <<= 2;
+            }
+        }
+        EPD_4in26_SendData(temp3);
+        // printf("%x",temp3);
+    }
+
+    EPD_4in26_TurnOnDisplay_4GRAY();
+}
+
+/******************************************************************************
+function :	Enter sleep mode
+parameter:
+******************************************************************************/
+void EPD_4in26_Sleep(void)
+{
+	EPD_4in26_SendCommand(0x10); //enter deep sleep
+	EPD_4in26_SendData(0x01); 
+	DEV_Delay_ms(100);
+}

+ 52 - 0
RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_4in26.h

@@ -0,0 +1,52 @@
+/*****************************************************************************
+* | File      	:   EPD_4in26.h
+* | Author      :   Waveshare team
+* | Function    :   4.26inch e-paper test demo
+* | Info        :
+*----------------
+* |	This version:   V1.0
+* | Date        :   2023-12-19
+* | Info        :
+* -----------------------------------------------------------------------------
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documnetation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to  whom the Software is
+# furished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+******************************************************************************/
+#ifndef __EPD_4in26_H_
+#define __EPD_4in26_H_
+
+#include "DEV_Config.h"
+
+// Display resolution
+#define EPD_4in26_WIDTH       800
+#define EPD_4in26_HEIGHT      480
+
+void EPD_4in26_Init(void);
+void EPD_4in26_Init_Fast(void);
+void EPD_4in26_Init_4GRAY(void);
+void EPD_4in26_Clear(void);
+void EPD_4in26_Display(UBYTE *Image);
+void EPD_4in26_Display_Base(UBYTE *Image);
+void EPD_4in26_Display_Fast(UBYTE *Image);
+void EPD_4in26_Display_Part(UBYTE *Image, UWORD x, UWORD y, UWORD w, UWORD l);
+void EPD_4in26_4GrayDisplay(UBYTE *Image);
+void EPD_4in26_Sleep(void);
+
+
+#endif

+ 153 - 143
RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_7in5_V2.c

@@ -4,8 +4,8 @@
 * | Function    :   Electronic paper driver
 * | Info        :
 *----------------
-* |	This version:   V2.0
-* | Date        :   2018-11-09
+* |	This version:   V3.0
+* | Date        :   2023-12-18
 * | Info        :
 *****************************************************************************
 #
@@ -31,61 +31,6 @@
 #include "EPD_7in5_V2.h"
 #include "Debug.h"
 
-
-UBYTE Voltage_Frame_7IN5_V2[]={
-	0x6, 0x3F, 0x3F, 0x11, 0x24, 0x7, 0x17,
-};
-
-UBYTE LUT_VCOM_7IN5_V2[]={	
-	0x0,	0xF,	0xF,	0x0,	0x0,	0x1,	
-	0x0,	0xF,	0x1,	0xF,	0x1,	0x2,	
-	0x0,	0xF,	0xF,	0x0,	0x0,	0x1,	
-	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
-	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
-	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
-	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
-};						
-
-UBYTE LUT_WW_7IN5_V2[]={	
-	0x10,	0xF,	0xF,	0x0,	0x0,	0x1,	
-	0x84,	0xF,	0x1,	0xF,	0x1,	0x2,	
-	0x20,	0xF,	0xF,	0x0,	0x0,	0x1,	
-	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
-	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
-	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
-	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
-};
-
-UBYTE LUT_BW_7IN5_V2[]={	
-	0x10,	0xF,	0xF,	0x0,	0x0,	0x1,	
-	0x84,	0xF,	0x1,	0xF,	0x1,	0x2,	
-	0x20,	0xF,	0xF,	0x0,	0x0,	0x1,	
-	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
-	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
-	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
-	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
-};
-
-UBYTE LUT_WB_7IN5_V2[]={	
-	0x80,	0xF,	0xF,	0x0,	0x0,	0x1,	
-	0x84,	0xF,	0x1,	0xF,	0x1,	0x2,	
-	0x40,	0xF,	0xF,	0x0,	0x0,	0x1,	
-	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
-	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
-	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
-	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
-};
-
-UBYTE LUT_BB_7IN5_V2[]={	
-	0x80,	0xF,	0xF,	0x0,	0x0,	0x1,	
-	0x84,	0xF,	0x1,	0xF,	0x1,	0x2,	
-	0x40,	0xF,	0xF,	0x0,	0x0,	0x1,	
-	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
-	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
-	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
-	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
-};
-
 /******************************************************************************
 function :	Software reset
 parameter:
@@ -126,6 +71,14 @@ static void EPD_SendData(UBYTE Data)
     DEV_Digital_Write(EPD_CS_PIN, 1);
 }
 
+static void EPD_SendData2(UBYTE *pData, UDOUBLE len)
+{
+    DEV_Digital_Write(EPD_DC_PIN, 1);
+    DEV_Digital_Write(EPD_CS_PIN, 0);
+    DEV_SPI_Write_nByte(pData, len);
+    DEV_Digital_Write(EPD_CS_PIN, 1);
+}
+
 /******************************************************************************
 function :	Wait until the busy_pin goes LOW
 parameter:
@@ -139,32 +92,6 @@ static void EPD_WaitUntilIdle(void)
 	DEV_Delay_ms(5);      
     Debug("e-Paper busy release\r\n");
 }
-
-static void EPD_7IN5_V2_LUT(UBYTE* lut_vcom,  UBYTE* lut_ww, UBYTE* lut_bw, UBYTE* lut_wb, UBYTE* lut_bb)
-{
-	UBYTE count;
-
-	EPD_SendCommand(0x20); //VCOM	
-	for(count=0; count<42; count++)
-		EPD_SendData(lut_vcom[count]);
-
-	EPD_SendCommand(0x21); //LUTBW
-	for(count=0; count<42; count++)
-		EPD_SendData(lut_ww[count]);
-
-	EPD_SendCommand(0x22); //LUTBW
-	for(count=0; count<42; count++)
-		EPD_SendData(lut_bw[count]);
-
-	EPD_SendCommand(0x23); //LUTWB
-	for(count=0; count<42; count++)
-		EPD_SendData(lut_wb[count]);
-
-	EPD_SendCommand(0x24); //LUTBB
-	for(count=0; count<42; count++)
-		EPD_SendData(lut_bb[count]);
-}
-
 /******************************************************************************
 function :	Turn On Display
 parameter:
@@ -183,62 +110,89 @@ parameter:
 UBYTE EPD_7IN5_V2_Init(void)
 {
     EPD_Reset();
+    EPD_SendCommand(0x01);			//POWER SETTING
+	EPD_SendData(0x07);
+	EPD_SendData(0x07);    //VGH=20V,VGL=-20V
+	EPD_SendData(0x3f);		//VDH=15V
+	EPD_SendData(0x3f);		//VDL=-15V
+
+	//Enhanced display drive(Add 0x06 command)
+	EPD_SendCommand(0x06);			//Booster Soft Start 
+	EPD_SendData(0x17);
+	EPD_SendData(0x17);   
+	EPD_SendData(0x28);		
+	EPD_SendData(0x17);	
 
-    // EPD_SendCommand(0x01);			//POWER SETTING
-    // EPD_SendData(0x07);
-    // EPD_SendData(0x07);		//VGH=20V,VGL=-20V
-    // EPD_SendData(0x3f);		//VDH=15V
-    // EPD_SendData(0x3f);		//VDL=-15V
-
-	EPD_SendCommand(0x01);  // power setting
-	EPD_SendData(0x17);  // 1-0=11: internal power
-	EPD_SendData(*(Voltage_Frame_7IN5_V2+6));  // VGH&VGL
-	EPD_SendData(*(Voltage_Frame_7IN5_V2+1));  // VSH
-	EPD_SendData(*(Voltage_Frame_7IN5_V2+2));  //  VSL
-	EPD_SendData(*(Voltage_Frame_7IN5_V2+3));  //  VSHR
-	
-	EPD_SendCommand(0x82);  // VCOM DC Setting
-	EPD_SendData(*(Voltage_Frame_7IN5_V2+4));  // VCOM
+	EPD_SendCommand(0x04); //POWER ON
+	DEV_Delay_ms(100); 
+	EPD_WaitUntilIdle();        //waiting for the electronic paper IC to release the idle signal
 
-	EPD_SendCommand(0x06);  // Booster Setting
-	EPD_SendData(0x27);
-	EPD_SendData(0x27);
-	EPD_SendData(0x2F);
-	EPD_SendData(0x17);
-	
-	EPD_SendCommand(0x30);   // OSC Setting
-	EPD_SendData(*(Voltage_Frame_7IN5_V2+0));  // 2-0=100: N=4  ; 5-3=111: M=7  ;  3C=50Hz     3A=100HZ
+	EPD_SendCommand(0X00);			//PANNEL SETTING
+	EPD_SendData(0x1F);   //KW-3f   KWR-2F	BWROTP 0f	BWOTP 1f
 
-    EPD_SendCommand(0x04); //POWER ON
-    DEV_Delay_ms(100);
-    EPD_WaitUntilIdle();
+	EPD_SendCommand(0x61);        	//tres			
+	EPD_SendData(0x03);		//source 800
+	EPD_SendData(0x20);
+	EPD_SendData(0x01);		//gate 480
+	EPD_SendData(0xE0);  
 
-    EPD_SendCommand(0X00);			//PANNEL SETTING
-    EPD_SendData(0x3F);   //KW-3f   KWR-2F	BWROTP 0f	BWOTP 1f
+	EPD_SendCommand(0X15);		
+	EPD_SendData(0x00);		
 
-    EPD_SendCommand(0x61);        	//tres
-    EPD_SendData(0x03);		//source 800
-    EPD_SendData(0x20);
-    EPD_SendData(0x01);		//gate 480
-    EPD_SendData(0xE0);
+	EPD_SendCommand(0X50);			//VCOM AND DATA INTERVAL SETTING
+	EPD_SendData(0x10);
+	EPD_SendData(0x07);
 
-    EPD_SendCommand(0X15);
-    EPD_SendData(0x00);
+	EPD_SendCommand(0X60);			//TCON SETTING
+	EPD_SendData(0x22);
+	
+    return 0;
+}
+
+UBYTE EPD_7IN5_V2_Init_Fast(void)
+{
+    EPD_Reset();
+    EPD_SendCommand(0X00);			//PANNEL SETTING
+    EPD_SendData(0x1F);   //KW-3f   KWR-2F	BWROTP 0f	BWOTP 1f
 
     EPD_SendCommand(0X50);			//VCOM AND DATA INTERVAL SETTING
     EPD_SendData(0x10);
-    EPD_SendData(0x00);
+    EPD_SendData(0x07);
+
+    EPD_SendCommand(0x04); //POWER ON
+    DEV_Delay_ms(100); 
+	EPD_WaitUntilIdle();        //waiting for the electronic paper IC to release the idle signal
+
+    //Enhanced display drive(Add 0x06 command)
+    EPD_SendCommand(0x06);			//Booster Soft Start 
+    EPD_SendData (0x27);
+    EPD_SendData (0x27);   
+    EPD_SendData (0x18);		
+    EPD_SendData (0x17);		
+
+    EPD_SendCommand(0xE0);
+    EPD_SendData(0x02);
+    EPD_SendCommand(0xE5);
+    EPD_SendData(0x5A);
+	
+    return 0;
+}
 
-    EPD_SendCommand(0X60);			//TCON SETTING
-    EPD_SendData(0x22);
+UBYTE EPD_7IN5_V2_Init_Part(void)
+{
+    EPD_Reset();
 
-    EPD_SendCommand(0x65);  // Resolution setting
-    EPD_SendData(0x00);
-    EPD_SendData(0x00);//800*480
-    EPD_SendData(0x00);
-    EPD_SendData(0x00);
+	EPD_SendCommand(0X00);			//PANNEL SETTING
+	EPD_SendData(0x1F);   //KW-3f   KWR-2F	BWROTP 0f	BWOTP 1f
 	
-	EPD_7IN5_V2_LUT(LUT_VCOM_7IN5_V2, LUT_WW_7IN5_V2, LUT_BW_7IN5_V2, LUT_WB_7IN5_V2, LUT_BB_7IN5_V2);
+	EPD_SendCommand(0x04); //POWER ON
+	DEV_Delay_ms(100); 
+	EPD_WaitUntilIdle();        //waiting for the electronic paper IC to release the idle signal
+	
+	EPD_SendCommand(0xE0);
+	EPD_SendData(0x02);
+	EPD_SendCommand(0xE5);
+	EPD_SendData(0x6E);
 	
     return 0;
 }
@@ -252,16 +206,27 @@ void EPD_7IN5_V2_Clear(void)
     UWORD Width, Height;
     Width =(EPD_7IN5_V2_WIDTH % 8 == 0)?(EPD_7IN5_V2_WIDTH / 8 ):(EPD_7IN5_V2_WIDTH / 8 + 1);
     Height = EPD_7IN5_V2_HEIGHT;
+    UBYTE image[EPD_7IN5_V2_WIDTH / 8] = {0x00};
 
     UWORD i;
     EPD_SendCommand(0x10);
-    for(i=0; i<Height*Width; i++) {
-        EPD_SendData(0xFF);
+    for(i=0; i<Width; i++) {
+        image[i] = 0xFF;
+    }
+    for(i=0; i<Height; i++)
+    {
+        EPD_SendData2(image, Width);
     }
+
     EPD_SendCommand(0x13);
-    for(i=0; i<Height*Width; i++)	{
-        EPD_SendData(0x00);
+    for(i=0; i<Width; i++) {
+        image[i] = 0x00;
+    }
+    for(i=0; i<Height; i++)
+    {
+        EPD_SendData2(image, Width);
     }
+    
     EPD_7IN5_V2_TurnOnDisplay();
 }
 
@@ -270,16 +235,27 @@ void EPD_7IN5_V2_ClearBlack(void)
     UWORD Width, Height;
     Width =(EPD_7IN5_V2_WIDTH % 8 == 0)?(EPD_7IN5_V2_WIDTH / 8 ):(EPD_7IN5_V2_WIDTH / 8 + 1);
     Height = EPD_7IN5_V2_HEIGHT;
+    UBYTE image[EPD_7IN5_V2_WIDTH / 8] = {0x00};
 
     UWORD i;
     EPD_SendCommand(0x10);
-    for(i=0; i<Height*Width; i++) {
-        EPD_SendData(0x00);
+    for(i=0; i<Width; i++) {
+        image[i] = 0x00;
     }
+    for(i=0; i<Height; i++)
+    {
+        EPD_SendData2(image, Width);
+    }
+
     EPD_SendCommand(0x13);
-    for(i=0; i<Height*Width; i++) {
-        EPD_SendData(0xFF);
+    for(i=0; i<Width; i++) {
+        image[i] = 0xFF;
     }
+    for(i=0; i<Height; i++)
+    {
+        EPD_SendData2(image, Width);
+    }
+    
     EPD_7IN5_V2_TurnOnDisplay();
 }
 
@@ -287,24 +263,58 @@ void EPD_7IN5_V2_ClearBlack(void)
 function :	Sends the image buffer in RAM to e-Paper and displays
 parameter:
 ******************************************************************************/
-void EPD_7IN5_V2_Display(const UBYTE *blackimage)
+void EPD_7IN5_V2_Display(UBYTE *blackimage)
 {
     UDOUBLE Width, Height;
     Width =(EPD_7IN5_V2_WIDTH % 8 == 0)?(EPD_7IN5_V2_WIDTH / 8 ):(EPD_7IN5_V2_WIDTH / 8 + 1);
     Height = EPD_7IN5_V2_HEIGHT;
 	
-    // EPD_SendCommand(0x10);
-    // for (UDOUBLE j = 0; j < Height; j++) {
-    //     for (UDOUBLE i = 0; i < Width; i++) {
-    //         EPD_SendData(blackimage[i + j * Width]);
-    //     }
-    // }
+    EPD_SendCommand(0x10);
+    for (UDOUBLE j = 0; j < Height; j++) {
+        EPD_SendData2((UBYTE *)(blackimage+j*Width), Width);
+    }
+
     EPD_SendCommand(0x13);
     for (UDOUBLE j = 0; j < Height; j++) {
         for (UDOUBLE i = 0; i < Width; i++) {
-            EPD_SendData(~blackimage[i + j * Width]);
+            blackimage[i + j * Width] = ~blackimage[i + j * Width];
         }
     }
+    for (UDOUBLE j = 0; j < Height; j++) {
+        EPD_SendData2((UBYTE *)(blackimage+j*Width), Width);
+    }
+    EPD_7IN5_V2_TurnOnDisplay();
+}
+
+void EPD_7IN5_V2_Display_Part(UBYTE *blackimage,UDOUBLE x_start, UDOUBLE y_start, UDOUBLE x_end, UDOUBLE y_end)
+{
+    UDOUBLE Width, Height;
+    Width =((x_end - x_start) % 8 == 0)?((x_end - x_start) / 8 ):((x_end - x_start) / 8 + 1);
+    Height = y_end - y_start;
+
+    EPD_SendCommand(0x50);
+	EPD_SendData(0xA9);
+	EPD_SendData(0x07);
+
+	EPD_SendCommand(0x91);		//This command makes the display enter partial mode
+	EPD_SendCommand(0x90);		//resolution setting
+	EPD_SendData (x_start/256);
+	EPD_SendData (x_start%256);   //x-start    
+
+	EPD_SendData (x_end/256);		
+	EPD_SendData (x_end%256-1);  //x-end	
+
+	EPD_SendData (y_start/256);  //
+	EPD_SendData (y_start%256);   //y-start    
+
+	EPD_SendData (y_end/256);		
+	EPD_SendData (y_end%256-1);  //y-end
+	EPD_SendData (0x01);
+    
+    EPD_SendCommand(0x13);
+    for (UDOUBLE j = 0; j < Height; j++) {
+        EPD_SendData2((UBYTE *)(blackimage+j*Width), Width);
+    }
     EPD_7IN5_V2_TurnOnDisplay();
 }
 

+ 6 - 3
RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_7in5_V2.h

@@ -4,8 +4,8 @@
 * | Function    :   Electronic paper driver
 * | Info        :
 *----------------
-* |	This version:   V2.0
-* | Date        :   2018-11-09
+* |	This version:   V3.0
+* | Date        :   2023-12-18
 * | Info        :   
 * 1.Remove:ImageBuff[EPD_HEIGHT * EPD_WIDTH / 8]
 * 2.Change:EPD_Display(UBYTE *Image)
@@ -41,9 +41,12 @@
 #define EPD_7IN5_V2_HEIGHT      480
 
 UBYTE EPD_7IN5_V2_Init(void);
+UBYTE EPD_7IN5_V2_Init_Fast(void);
+UBYTE EPD_7IN5_V2_Init_Part(void);
 void EPD_7IN5_V2_Clear(void);
 void EPD_7IN5_V2_ClearBlack(void);
-void EPD_7IN5_V2_Display(const UBYTE *blackimage);
+void EPD_7IN5_V2_Display(UBYTE *blackimage);
+void EPD_7IN5_V2_Display_Part(UBYTE *blackimage,UDOUBLE x_start, UDOUBLE y_start, UDOUBLE x_end, UDOUBLE y_end);
 void EPD_7IN5_V2_Sleep(void);
 
 #endif

+ 601 - 0
RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_7in5_V2_old.c

@@ -0,0 +1,601 @@
+/*****************************************************************************
+* | File      	:	EPD_7in5.c
+* | Author      :   Waveshare team
+* | Function    :   Electronic paper driver
+* | Info        :
+*----------------
+* |	This version:   V1.0
+* | Date        :   2023-12-18
+* | Info        :
+*****************************************************************************
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documnetation files(the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to  whom the Software is
+# furished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+******************************************************************************/
+#include "EPD_7in5_V2_old.h"
+#include "Debug.h"
+#include <time.h>
+
+UBYTE Voltage_Frame_7IN5_V2[]={
+	0x6, 0x3F, 0x3F, 0x11, 0x24, 0x7, 0x17,
+};
+
+UBYTE LUT_VCOM_7IN5_V2[]={	
+	0x0,	0xF,	0xF,	0x0,	0x0,	0x1,	
+	0x0,	0xF,	0x1,	0xF,	0x1,	0x2,	
+	0x0,	0xF,	0xF,	0x0,	0x0,	0x1,	
+	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
+	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
+	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
+	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
+};						
+
+UBYTE LUT_WW_7IN5_V2[]={	
+	0x10,	0xF,	0xF,	0x0,	0x0,	0x1,	
+	0x84,	0xF,	0x1,	0xF,	0x1,	0x2,	
+	0x20,	0xF,	0xF,	0x0,	0x0,	0x1,	
+	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
+	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
+	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
+	0x0,	0x0,	0x0,	0x0,	0x0,	0x0,	
+};
+
+UBYTE LUT_BW_7IN5_V2[]={	
+	0x10,	0xF,	0xF,	0x0,	0x0,	0x1,	
+	0x84,	0x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,	0x00,	0x01,
+0x60,	0x0A,	0x0A,	0x00,	0x00,	0x00,
+0x80,	0x28,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+//BW					
+0x60,	0x32,	0x32,	0x00,	0x00,	0x01,
+0x60,	0x0A,	0x0A,	0x00,	0x00,	0x00,
+0x80,	0x28,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+//WB					
+0x90,	0x32,	0x32,	0x00,	0x00,	0x01,
+0x60,	0x0A,	0x0A,	0x00,	0x00,	0x00,
+0x40,	0x28,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+//BB					
+0x90,	0x32,	0x32,	0x00,	0x00,	0x01,
+0x60,	0x0A,	0x0A,	0x00,	0x00,	0x00,
+0x40,	0x28,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+//Reserved					
+0xFF,	0xFF,	0xFF,	0xFF,	0xFF,	0xFF,
+0xFF,	0xFF,	0xFF,	0xFF,	0xFF,	0xFF,
+0xFF,	0xFF,	0xFF,	0xFF,	0xFF,	0xFF,
+0xFF,	0xFF,	0xFF,	0xFF,	0xFF,	0xFF,
+0xFF,	0xFF,	0xFF,	0xFF,	0xFF,	0xFF,
+0xFF,					
+};					
+
+			
+					
+const unsigned char						
+Lut_partial[]={0x67,	0xBF,	0x3F,	0x0D,	0x00,	0x1C,
+//VCOM					
+0x00,	0x14,	0x02,	0x00,	0x00,	0x01,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+//WW					
+0x20,	0x14,	0x02,	0x00,	0x00,	0x01,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+//BW					
+0x80,	0x14,	0x02,	0x00,	0x00,	0x01,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+//WB					
+0x40,	0x14,	0x02,	0x00,	0x00,	0x01,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+//BB					
+0x00,	0x14,	0x02,	0x00,	0x00,	0x01,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+0x00,	0x00,	0x00,	0x00,	0x00,	0x00,
+//Reserved					
+0xFF,	0xFF,	0xFF,	0xFF,	0xFF,	0xFF,
+0xFF,	0xFF,	0xFF,	0xFF,	0xFF,	0xFF,
+0xFF,	0xFF,	0xFF,	0xFF,	0xFF,	0xFF,
+0xFF,	0xFF,	0xFF,	0xFF,	0xFF,	0xFF,
+0xFF,	0xFF,	0xFF,	0xFF,	0xFF,	0xFF,
+0xFF,					
+};
+
+/******************************************************************************
+function :	Software reset
+parameter:
+******************************************************************************/
+static void EPD_Reset(void)
+{
+    DEV_Digital_Write(EPD_RST_PIN, 1);
+    DEV_Delay_ms(20);
+    DEV_Digital_Write(EPD_RST_PIN, 0);
+    DEV_Delay_ms(2);
+    DEV_Digital_Write(EPD_RST_PIN, 1);
+    DEV_Delay_ms(20);
+}
+
+/******************************************************************************
+function :	send command
+parameter:
+     Reg : Command register
+******************************************************************************/
+static void EPD_SendCommand(UBYTE Reg)
+{
+    DEV_Digital_Write(EPD_DC_PIN, 0);
+    DEV_Digital_Write(EPD_CS_PIN, 0);
+    DEV_SPI_WriteByte(Reg);
+    DEV_Digital_Write(EPD_CS_PIN, 1);
+}
+
+/******************************************************************************
+function :	send data
+parameter:
+    Data : Write data
+******************************************************************************/
+static void EPD_SendData(UBYTE Data)
+{
+    DEV_Digital_Write(EPD_DC_PIN, 1);
+    DEV_Digital_Write(EPD_CS_PIN, 0);
+    DEV_SPI_WriteByte(Data);
+    DEV_Digital_Write(EPD_CS_PIN, 1);
+}
+
+static void EPD_SendData2(UBYTE *pData, UDOUBLE len)
+{
+    DEV_Digital_Write(EPD_DC_PIN, 1);
+    DEV_Digital_Write(EPD_CS_PIN, 0);
+    DEV_SPI_Write_nByte(pData, len);
+    DEV_Digital_Write(EPD_CS_PIN, 1);
+}
+
+/******************************************************************************
+function :	Wait until the busy_pin goes LOW
+parameter:
+******************************************************************************/
+static void EPD_WaitUntilIdle(void)
+{
+    Debug("e-Paper busy\r\n");
+	do{
+		DEV_Delay_ms(5);  
+	}while(!(DEV_Digital_Read(EPD_BUSY_PIN)));   
+	DEV_Delay_ms(5);      
+    Debug("e-Paper busy release\r\n");
+}
+
+static void EPD_7IN5_V2_LUT(UBYTE* lut_vcom,  UBYTE* lut_ww, UBYTE* lut_bw, UBYTE* lut_wb, UBYTE* lut_bb)
+{
+	UBYTE count;
+
+	EPD_SendCommand(0x20); //VCOM	
+	for(count=0; count<42; count++)
+		EPD_SendData(lut_vcom[count]);
+
+	EPD_SendCommand(0x21); //LUTBW
+	for(count=0; count<42; count++)
+		EPD_SendData(lut_ww[count]);
+
+	EPD_SendCommand(0x22); //LUTBW
+	for(count=0; count<42; count++)
+		EPD_SendData(lut_bw[count]);
+
+	EPD_SendCommand(0x23); //LUTWB
+	for(count=0; count<42; count++)
+		EPD_SendData(lut_wb[count]);
+
+	EPD_SendCommand(0x24); //LUTBB
+	for(count=0; count<42; count++)
+		EPD_SendData(lut_bb[count]);
+}
+
+/******************************************************************************
+function :	Turn On Display
+parameter:
+******************************************************************************/
+static void EPD_7IN5_V2_TurnOnDisplay(void)
+{	
+    EPD_SendCommand(0x12);			//DISPLAY REFRESH
+    DEV_Delay_ms(100);	        //!!!The delay here is necessary, 200uS at least!!!
+    EPD_WaitUntilIdle();
+}
+
+/******************************************************************************
+function :	Initialize the e-Paper register
+parameter:
+******************************************************************************/
+UBYTE EPD_7IN5_V2_Init(void)
+{
+    EPD_Reset();
+
+    // EPD_SendCommand(0x01);			//POWER SETTING
+    // EPD_SendData(0x07);
+    // EPD_SendData(0x07);		//VGH=20V,VGL=-20V
+    // EPD_SendData(0x3f);		//VDH=15V
+    // EPD_SendData(0x3f);		//VDL=-15V
+
+	EPD_SendCommand(0x01);  // power setting
+	EPD_SendData(0x17);  // 1-0=11: internal power
+	EPD_SendData(*(Voltage_Frame_7IN5_V2+6));  // VGH&VGL
+	EPD_SendData(*(Voltage_Frame_7IN5_V2+1));  // VSH
+	EPD_SendData(*(Voltage_Frame_7IN5_V2+2));  //  VSL
+	EPD_SendData(*(Voltage_Frame_7IN5_V2+3));  //  VSHR
+	
+	EPD_SendCommand(0x82);  // VCOM DC Setting
+	EPD_SendData(*(Voltage_Frame_7IN5_V2+4));  // VCOM
+
+	EPD_SendCommand(0x06);  // Booster Setting
+	EPD_SendData(0x27);
+	EPD_SendData(0x27);
+	EPD_SendData(0x2F);
+	EPD_SendData(0x17);
+	
+	EPD_SendCommand(0x30);   // OSC Setting
+	EPD_SendData(*(Voltage_Frame_7IN5_V2+0));  // 2-0=100: N=4  ; 5-3=111: M=7  ;  3C=50Hz     3A=100HZ
+
+    EPD_SendCommand(0x04); //POWER ON
+    DEV_Delay_ms(100);
+    EPD_WaitUntilIdle();
+
+    EPD_SendCommand(0X00);			//PANNEL SETTING
+    EPD_SendData(0x3F);   //KW-3f   KWR-2F	BWROTP 0f	BWOTP 1f
+
+    EPD_SendCommand(0x61);        	//tres
+    EPD_SendData(0x03);		//source 800
+    EPD_SendData(0x20);
+    EPD_SendData(0x01);		//gate 480
+    EPD_SendData(0xE0);
+
+    EPD_SendCommand(0X15);
+    EPD_SendData(0x00);
+
+    EPD_SendCommand(0X50);			//VCOM AND DATA INTERVAL SETTING
+    EPD_SendData(0x10);
+    EPD_SendData(0x00);
+
+    EPD_SendCommand(0X60);			//TCON SETTING
+    EPD_SendData(0x22);
+
+    EPD_SendCommand(0x65);  // Resolution setting
+    EPD_SendData(0x00);
+    EPD_SendData(0x00);//800*480
+    EPD_SendData(0x00);
+    EPD_SendData(0x00);
+	
+	EPD_7IN5_V2_LUT(LUT_VCOM_7IN5_V2, LUT_WW_7IN5_V2, LUT_BW_7IN5_V2, LUT_WB_7IN5_V2, LUT_BB_7IN5_V2);
+	
+    return 0;
+}
+
+void Epaper_LUT_By_MCU( UBYTE* wavedata)
+{
+    UBYTE count;
+    UBYTE VCEND,BDEND,EVS,XON,PLL;
+
+    VCEND=wavedata[0]&0x08;
+    BDEND=(wavedata[1]&0xC0)>>6;
+    EVS=VCEND|BDEND;
+    PLL=(wavedata[0]&0xF0)>>4;
+    XON=wavedata[2]&0xC0;
+
+    EPD_SendCommand(0x52);	      //EVS
+    EPD_SendData(EVS);
+
+    EPD_SendCommand(0x30);			  //PLL setting 
+    EPD_SendData(PLL);
+
+    EPD_SendCommand(0x01);       //Set VGH VGL VSH VSL VSHR
+    EPD_SendData (0x17);
+    EPD_SendData ((*wavedata++)&0x07);  	//VGH/VGL Voltage Level selection
+    EPD_SendData ((*wavedata++)&0x3F);		//VSH for black
+    EPD_SendData ((*wavedata++)&0x3F);  	//VSL for white
+    EPD_SendData ((*wavedata++)&0x3F);  	//VSHR for red
+
+    EPD_SendCommand(0x2A);	      //LUTOPT
+    EPD_SendData(XON);
+    EPD_SendData(*wavedata++);
+
+    EPD_SendCommand(0x82);       //VCOM_DC setting
+    EPD_SendData (*wavedata++);  //Vcom value
+
+
+    EPD_SendCommand(0x20);
+    for(count=0;count<42;count++)
+        EPD_SendData(*wavedata++);
+
+    EPD_SendCommand(0x21);	
+    for(count=0;count<42;count++)
+        EPD_SendData(*wavedata++);
+
+    EPD_SendCommand(0x22);	
+    for(count=0;count<42;count++)
+        EPD_SendData(*wavedata++);
+
+    EPD_SendCommand(0x23);	
+    for(count=0;count<42;count++)
+        EPD_SendData(*wavedata++);
+
+    EPD_SendCommand(0x24);	
+    for(count=0;count<42;count++)
+        EPD_SendData(*wavedata++);
+ 
+	 
+}
+
+UBYTE EPD_7IN5_V2_Init2(void)
+{
+    EPD_Reset();
+
+    EPD_SendCommand(0x00);  // Panel setting   
+    EPD_SendData(0x3F);
+
+    EPD_SendCommand(0x06);  // Booster Setting
+    EPD_SendData(0x17);  
+    EPD_SendData(0x17);
+    EPD_SendData(0x28);
+    EPD_SendData(0x18);
+
+    EPD_SendCommand(0x50);  // VCOM and DATA interval setting    
+    EPD_SendData(0x22);
+    EPD_SendData(0x07);
+
+    EPD_SendCommand(0x60);  // TCON setting
+    EPD_SendData(0x22);  // S-G G-S
+
+    EPD_SendCommand(0x61);  // Resolution setting
+    EPD_SendData(0x03);//800*480
+    EPD_SendData(0x20);
+    EPD_SendData(0x01);
+    EPD_SendData(0xE0); 
+
+    EPD_SendCommand(0x65);  // Resolution setting
+    EPD_SendData(0x00);
+    EPD_SendData(0x00);
+    EPD_SendData(0x00);
+    EPD_SendData(0x00);
+
+    EPD_SendCommand(0x04); //POWER ON
+    DEV_Delay_ms(100);
+    EPD_WaitUntilIdle();    
+
+    return 0;
+}
+
+UBYTE EPD_7IN5_V2_Init_Fast(void)
+{
+    EPD_7IN5_V2_Init2();
+    Epaper_LUT_By_MCU((UBYTE*)Lut_all_fresh);
+    return 0;
+}
+
+UBYTE EPD_7IN5_V2_Init_Partial(void)
+{
+    EPD_7IN5_V2_Init2();
+    Epaper_LUT_By_MCU((UBYTE*)Lut_partial);
+    return 0;
+}
+
+/******************************************************************************
+function :	Clear screen
+parameter:
+******************************************************************************/
+void EPD_7IN5_V2_Clear(void)
+{
+    UWORD Width, Height;
+    Width =(EPD_7IN5_V2_WIDTH % 8 == 0)?(EPD_7IN5_V2_WIDTH / 8 ):(EPD_7IN5_V2_WIDTH / 8 + 1);
+    Height = EPD_7IN5_V2_HEIGHT;
+    UBYTE image[EPD_7IN5_V2_WIDTH / 8] = {0x00};
+
+    UWORD i;
+    EPD_SendCommand(0x10);
+    for(i=0; i<Width; i++) {
+        image[i] = 0xFF;
+    }
+    for(i=0; i<Height; i++)
+    {
+        EPD_SendData2(image, Width);
+    }
+
+    EPD_SendCommand(0x13);
+    for(i=0; i<Width; i++) {
+        image[i] = 0x00;
+    }
+    for(i=0; i<Height; i++)
+    {
+        EPD_SendData2(image, Width);
+    }
+    
+    EPD_7IN5_V2_TurnOnDisplay();
+}
+
+void EPD_7IN5_V2_ClearBlack(void)
+{
+    UWORD Width, Height;
+    Width =(EPD_7IN5_V2_WIDTH % 8 == 0)?(EPD_7IN5_V2_WIDTH / 8 ):(EPD_7IN5_V2_WIDTH / 8 + 1);
+    Height = EPD_7IN5_V2_HEIGHT;
+    UBYTE image[EPD_7IN5_V2_WIDTH / 8] = {0x00};
+
+    UWORD i;
+    EPD_SendCommand(0x10);
+    for(i=0; i<Width; i++) {
+        image[i] = 0x00;
+    }
+    for(i=0; i<Height; i++)
+    {
+        EPD_SendData2(image, Width);
+    }
+
+    EPD_SendCommand(0x13);
+    for(i=0; i<Width; i++) {
+        image[i] = 0xFF;
+    }
+    for(i=0; i<Height; i++)
+    {
+        EPD_SendData2(image, Width);
+    }
+    
+    EPD_7IN5_V2_TurnOnDisplay();
+}
+/******************************************************************************
+function :	Sends the image buffer in RAM to e-Paper and displays
+parameter:
+******************************************************************************/
+void EPD_7IN5_V2_Display(UBYTE *blackimage)
+{
+    UDOUBLE Width, Height;
+    Width =(EPD_7IN5_V2_WIDTH % 8 == 0)?(EPD_7IN5_V2_WIDTH / 8 ):(EPD_7IN5_V2_WIDTH / 8 + 1);
+    Height = EPD_7IN5_V2_HEIGHT;
+	
+    EPD_SendCommand(0x10);
+    for (UDOUBLE j = 0; j < Height; j++) {
+        EPD_SendData2((UBYTE *)(blackimage+j*Width), Width);
+    }
+
+    EPD_SendCommand(0x13);
+    for (UDOUBLE j = 0; j < Height; j++) {
+        for (UDOUBLE i = 0; i < Width; i++) {
+            blackimage[i + j * Width] = ~blackimage[i + j * Width];
+        }
+    }
+    for (UDOUBLE j = 0; j < Height; j++) {
+        EPD_SendData2((UBYTE *)(blackimage+j*Width), Width);
+    }
+    EPD_7IN5_V2_TurnOnDisplay();
+}
+
+void EPD_7IN5_V2_Display_Partial(UBYTE *blackimage,UDOUBLE x_start, UDOUBLE y_start, UDOUBLE x_end, UDOUBLE y_end)
+{
+    UDOUBLE Width, Height;
+    
+    Width =((x_end - x_start) % 8 == 0)?((x_end - x_start) / 8 ):((x_end - x_start) / 8 + 1);
+    Height = y_end - y_start;
+
+	EPD_SendCommand(0x91);		//This command makes the display enter partial mode
+	EPD_SendCommand(0x90);		//resolution setting
+	EPD_SendData(x_start/256);
+	EPD_SendData(x_start%256);   //x-start    
+
+	EPD_SendData((x_end-1)/256);		
+	EPD_SendData((x_end-1)%256);  //x-end	
+
+	EPD_SendData(y_start/256);  //
+	EPD_SendData(y_start%256);   //y-start    
+
+	EPD_SendData((y_end-1)/256);		
+	EPD_SendData((y_end-1)%256);  //y-end
+	EPD_SendData(0x01);
+	
+    // for (UDOUBLE j = 0; j < Height; j++) {
+    //     for (UDOUBLE i = 0; i < Width; i++) {
+    //         blackimage[i+j*Width] = ~blackimage[i+j*Width]; 
+    //     }
+    // }
+    
+    EPD_SendCommand(0x13);
+    for (UDOUBLE j = 0; j < Height; j++) {
+        EPD_SendData2((UBYTE *)(blackimage+j*Width), Width);
+    }
+
+    EPD_7IN5_V2_TurnOnDisplay();
+    EPD_SendCommand(0x92);
+}
+
+/******************************************************************************
+function :	Enter sleep mode
+parameter:
+******************************************************************************/
+void EPD_7IN5_V2_Sleep(void)
+{
+    EPD_SendCommand(0X02);  	//power off
+    EPD_WaitUntilIdle();
+    EPD_SendCommand(0X07);  	//deep sleep
+    EPD_SendData(0xA5);
+}

+ 52 - 0
RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_7in5_V2_old.h

@@ -0,0 +1,52 @@
+/*****************************************************************************
+* | File      	:	EPD_7in5_V2.h
+* | Author      :   Waveshare team
+* | Function    :   Electronic paper driver
+* | Info        :
+*----------------
+* |	This version:   V1.0
+* | Date        :   2023-12-18
+* | Info        :   
+* 1.Remove:ImageBuff[EPD_HEIGHT * EPD_WIDTH / 8]
+* 2.Change:EPD_Display(UBYTE *Image)
+*   Need to pass parameters: pointer to cached data
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documnetation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to  whom the Software is
+# furished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+******************************************************************************/
+#ifndef _EPD_7IN5_V2_H_
+#define _EPD_7IN5_V2_H_
+
+#include "DEV_Config.h"
+
+
+// Display resolution
+#define EPD_7IN5_V2_WIDTH       800
+#define EPD_7IN5_V2_HEIGHT      480
+
+UBYTE EPD_7IN5_V2_Init(void);
+UBYTE EPD_7IN5_V2_Init_Fast(void);
+UBYTE EPD_7IN5_V2_Init_Partial(void);
+void EPD_7IN5_V2_Clear(void);
+void EPD_7IN5_V2_ClearBlack(void);
+void EPD_7IN5_V2_Display(UBYTE *blackimage);
+void EPD_7IN5_V2_Display_Partial(UBYTE *blackimage,UDOUBLE x_start, UDOUBLE y_start, UDOUBLE x_end, UDOUBLE y_end);
+void EPD_7IN5_V2_Sleep(void);
+
+#endif

BIN
RaspberryPi_JetsonNano/c/pic/2in66g.bmp


BIN
RaspberryPi_JetsonNano/c/pic/4in26_Scale.bmp


+ 3 - 3
RaspberryPi_JetsonNano/c/readme_CN.txt

@@ -31,15 +31,15 @@ BUSY   ->    24
 由于本工程是一个综合工程,对于使用而言,你可能需要阅读以下内容:
 你可以在main.c中看到许多测试函数和宏定义设置,在编译时指定屏幕对应的宏定义可以直接编译对应的测试程序。
 请注意你购买的是哪一款的墨水屏。具体的对应关系可以查阅我们的Wiki和list.txt文件。
-子1:
+子1:
     如果你购买的3.7inch e-paper (V1),那么你应该在编译时加上 EPD=epd3in7
         sudo make clean
         sudo make EPD=epd3in7
-子2:
+子2:
     如果你购买的2.9inch e-paper (B) (V1),由于2.9寸的B型和C型是公用的驱动代码,那么你应该在编译时加上 EPD=epd2in9bc
         sudo make clean
         sudo make EPD=epd2in9bc
-子3:
+子3:
     如果你购买的是7.5inch e-Paper (V2),那么你应该在编译时加上 EPD=epd7in5V2
         sudo make clean
         sudo make EPD=epd7in5V2

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_13in3k_test.py

@@ -86,5 +86,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd7in5_V2.epdconfig.module_exit()
+    epd13in3k.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_1in02_test.py

@@ -95,5 +95,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd1in54.epdconfig.module_exit()
+    epd1in02.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_1in54_V2_test.py

@@ -92,5 +92,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd1in54_V2.epdconfig.module_exit()
+    epd1in54_V2.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_1in54_test.py

@@ -89,5 +89,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd1in54.epdconfig.module_exit()
+    epd1in54.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_1in54b_V2_test.py

@@ -76,5 +76,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd1in54b_V2.epdconfig.module_exit()
+    epd1in54b_V2.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_1in54b_test.py

@@ -77,5 +77,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd1in54b.epdconfig.module_exit()
+    epd1in54b.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_1in54c_test.py

@@ -74,5 +74,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd1in54c.epdconfig.module_exit()
+    epd1in54c.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_1in64g_test.py

@@ -66,5 +66,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd1in64g.epdconfig.module_exit()
+    epd1in64g.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_2in13_V2_test.py

@@ -91,5 +91,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd2in13_V2.epdconfig.module_exit()
+    epd2in13_V2.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_2in13_V3_test.py

@@ -89,5 +89,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd2in13_V3.epdconfig.module_exit()
+    epd2in13_V3.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_2in13_V4_test.py

@@ -129,5 +129,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd2in13_V4.epdconfig.module_exit()
+    epd2in13_V4.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_2in13_test.py

@@ -89,5 +89,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd2in13.epdconfig.module_exit()
+    epd2in13.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_2in13b_V3_test.py

@@ -92,5 +92,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd2in13b_V3.epdconfig.module_exit()
+    epd2in13b_V3.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_2in13b_V4_test.py

@@ -92,5 +92,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd2in13b_V4.epdconfig.module_exit()
+    epd2in13b_V4.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_2in13bc_test.py

@@ -93,5 +93,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd2in13bc.epdconfig.module_exit()
+    epd2in13bc.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_2in13d_test.py

@@ -86,5 +86,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd2in13d.epdconfig.module_exit()
+    epd2in13d.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_2in13g_test.py

@@ -64,5 +64,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd2in13g.epdconfig.module_exit()
+    epd2in13g.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_2in36g_test.py

@@ -69,5 +69,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd2in36g.epdconfig.module_exit()
+    epd2in36g.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_2in66_test.py

@@ -101,5 +101,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd2in66.epdconfig.module_exit()
+    epd2in66.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_2in66b_test.py

@@ -93,5 +93,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd2in66b.epdconfig.module_exit()
+    epd2in66b.epdconfig.module_exit(cleanup=True)
     exit()

+ 69 - 0
RaspberryPi_JetsonNano/python/examples/epd_2in66g_test.py

@@ -0,0 +1,69 @@
+#!/usr/bin/python
+# -*- coding:utf-8 -*-
+import sys
+import os
+picdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic')
+libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib')
+if os.path.exists(libdir):
+    sys.path.append(libdir)
+
+import logging
+from waveshare_epd import epd2in66g
+import time
+from PIL import Image,ImageDraw,ImageFont
+import traceback
+
+logging.basicConfig(level=logging.DEBUG)
+
+try:
+    logging.info("epd2in9g Demo")
+
+    epd = epd2in66g.EPD()  
+    logging.info("init and Clear")
+    epd.init()
+    epd.Clear()
+    font24 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 24)
+    font18 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 18)
+    font40 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 40)
+
+    # Drawing on the image
+    logging.info("1.Drawing on the image...")
+    Himage = Image.new('RGB', (epd.width, epd.height), epd.WHITE)  
+    draw = ImageDraw.Draw(Himage)
+    draw.text((5, 0), 'hello world', font = font18, fill = epd.RED)
+    draw.text((5, 20), '2.66inch G', font = font18, fill = epd.YELLOW)
+    draw.text((5, 50), u'微雪电子', font = font40, fill = epd.BLACK)
+    draw.text((5, 100), u'微雪电子', font = font40, fill = epd.YELLOW)
+    draw.text((5, 150), u'微雪电子', font = font40, fill = epd.RED)
+
+    draw.rectangle((5, 200, 75, 270), outline = epd.BLACK)
+    draw.line((5, 200, 75, 270), fill = epd.RED)
+    draw.line((75, 200, 5, 270), fill = epd.YELLOW)
+    draw.rectangle((90, 200, 160, 270), fill = epd.BLACK)
+
+    draw.arc((5, 300, 45, 340), 0, 360, fill = epd.BLACK)
+    draw.chord((45, 300, 85, 340), 0, 360, fill = epd.BLACK)
+    draw.chord((85, 300, 125, 340), 0, 360, fill = epd.YELLOW)
+    draw.chord((125, 300, 165, 340), 0, 360, fill = epd.RED)
+    epd.display(epd.getbuffer(Himage))
+    time.sleep(3)
+    
+    # read bmp file 
+    logging.info("2.read bmp file")
+    Himage = Image.open(os.path.join(picdir, '2in66g.bmp'))
+    epd.display(epd.getbuffer(Himage))
+    time.sleep(3)
+    
+    logging.info("Clear...")
+    epd.Clear()
+    
+    logging.info("Goto Sleep...")
+    epd.sleep()
+        
+except IOError as e:
+    logging.info(e)
+    
+except KeyboardInterrupt:    
+    logging.info("ctrl + c:")
+    epd2in66g.epdconfig.module_exit(cleanup=True)
+    exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_2in7_V2_test.py

@@ -155,5 +155,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd2in7.epdconfig.module_exit()
+    epd2in7_V2.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_2in7_test.py

@@ -109,5 +109,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd2in7.epdconfig.module_exit()
+    epd2in7.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_2in7b_V2_test.py

@@ -99,5 +99,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd2in7b_V2.epdconfig.module_exit()
+    epd2in7b_V2.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_2in7b_test.py

@@ -99,5 +99,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd2in7b.epdconfig.module_exit()
+    epd2in7b.epdconfig.module_exit(cleanup=True)
     exit()

+ 3 - 2
RaspberryPi_JetsonNano/python/examples/epd_2in9_V2_test.py

@@ -69,7 +69,8 @@ try:
     epd.display(epd.getbuffer(Himage))
     time.sleep(2)
     
-    logging.info("4.read bmp file on window")
+    logging.info("4.read bmp file on window,Quick brush demo")
+    epd.init_Fast()
     Himage2 = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
     bmp = Image.open(os.path.join(picdir, '100x100.bmp'))
     Himage2.paste(bmp, (50,10))
@@ -132,5 +133,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd2in9_V2.epdconfig.module_exit()
+    epd2in9_V2.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_2in9_test.py

@@ -104,5 +104,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd2in9.epdconfig.module_exit()
+    epd2in9.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_2in9b_V3_test.py

@@ -95,5 +95,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd2in9b_V3.epdconfig.module_exit()
+    epd2in9b_V3.epdconfig.module_exit(cleanup=True)
     exit()

+ 118 - 0
RaspberryPi_JetsonNano/python/examples/epd_2in9b_V4_test.py

@@ -0,0 +1,118 @@
+#!/usr/bin/python
+# -*- coding:utf-8 -*-
+import sys
+import os
+picdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic')
+libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib')
+if os.path.exists(libdir):
+    sys.path.append(libdir)
+
+import logging
+from waveshare_epd import epd2in9b_V4
+import time
+from PIL import Image,ImageDraw,ImageFont
+import traceback
+
+logging.basicConfig(level=logging.DEBUG)
+
+try:
+    logging.info("epd2in9b V4 Demo")
+    
+    epd = epd2in9b_V4.EPD()
+    logging.info("init and Clear")
+    epd.init()
+    epd.Clear()
+    time.sleep(1)
+    
+    # Drawing on the image
+    logging.info("Drawing")    
+    font24 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 24)
+    font18 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 18)
+
+    logging.info("read bmp file")
+    HBlackimage = Image.open(os.path.join(picdir, '2in9bc-b.bmp'))
+    HRYimage = Image.open(os.path.join(picdir, '2in9bc-ry.bmp'))
+    epd.display(epd.getbuffer(HBlackimage), epd.getbuffer(HRYimage))
+    time.sleep(2)
+    
+    # Drawing on the Horizontal image
+    logging.info("Drawing on the Horizontal image...") 
+    epd.init_Fast()
+    HBlackimage = Image.new('1', (epd.height, epd.width), 255)  # 298*126
+    HRYimage = Image.new('1', (epd.height, epd.width), 255)  # 298*126  ryimage: red or yellow image  
+    drawblack = ImageDraw.Draw(HBlackimage)
+    drawry = ImageDraw.Draw(HRYimage)
+    drawblack.text((10, 0), 'hello world', font = font24, fill = 0)
+    drawblack.text((10, 20), '2.9inch e-Paper b V4', font = font24, fill = 0)
+    drawblack.text((150, 0), u'微雪电子', font = font24, fill = 0)    
+    drawblack.line((20, 50, 70, 100), fill = 0)
+    drawblack.line((70, 50, 20, 100), fill = 0)
+    drawblack.rectangle((20, 50, 70, 100), outline = 0)    
+    drawry.line((165, 50, 165, 100), fill = 0)
+    drawry.line((140, 75, 190, 75), fill = 0)
+    drawry.arc((140, 50, 190, 100), 0, 360, fill = 0)
+    drawry.rectangle((80, 50, 130, 100), fill = 0)
+    drawry.chord((200, 50, 250, 100), 0, 360, fill = 0)
+    epd.display_Fast(epd.getbuffer(HBlackimage), epd.getbuffer(HRYimage))
+    time.sleep(2)
+
+    '''
+    # If you didn't use the display_Base() function to refresh the image before,
+    # use the display_Base_color() function to refresh the background color, 
+    # otherwise the background color will be garbled 
+    # epd.init()
+    # epd.display_Base(epd.getbuffer(HBlackimage), epd.getbuffer(HRYimage))
+    # epd.display_Base_color(0xFF)
+    '''
+    # partial update
+    logging.info("5.show time")
+    epd.init()
+    epd.display_Base_color(0xFF)
+    HBlackimage = Image.new('1', (epd.height, epd.width), 255)
+    drawblack = ImageDraw.Draw(HBlackimage)
+    num = 0
+    while (True):
+        drawblack.rectangle((10, 10, 120, 50), fill = 255)
+        drawblack.text((10, 10), time.strftime('%H:%M:%S'), font = font24, fill = 0)
+        newimage = HBlackimage.crop([10, 10, 120, 50])
+        HBlackimage.paste(newimage, (10,10))  
+        epd.display_Partial(epd.getbuffer(HBlackimage),10, epd.height - 120, 50, epd.height - 10)
+        num = num + 1
+        if(num == 10):
+            break
+    
+    # # Drawing on the Vertical image
+    # logging.info("Drawing on the Vertical image...")
+    # LBlackimage = Image.new('1', (epd.width, epd.height), 255)  # 126*298
+    # LRYimage = Image.new('1', (epd.width, epd.height), 255)  # 126*298
+    # drawblack = ImageDraw.Draw(LBlackimage)
+    # drawry = ImageDraw.Draw(LRYimage)
+    
+    # drawblack.text((2, 0), 'hello world', font = font18, fill = 0)
+    # drawblack.text((2, 20), '2.9inch epd b V4', font = font18, fill = 0)
+    # drawblack.text((20, 50), u'微雪电子', font = font18, fill = 0)
+    # drawblack.line((10, 90, 60, 140), fill = 0)
+    # drawblack.line((60, 90, 10, 140), fill = 0)
+    # drawblack.rectangle((10, 90, 60, 140), outline = 0)
+    # drawry.line((95, 90, 95, 140), fill = 0)
+    # drawry.line((70, 115, 120, 115), fill = 0)
+    # drawry.arc((70, 90, 120, 140), 0, 360, fill = 0)
+    # drawry.rectangle((10, 150, 60, 200), fill = 0)
+    # drawry.chord((70, 150, 120, 200), 0, 360, fill = 0)
+    # epd.display(epd.getbuffer(LBlackimage), epd.getbuffer(LRYimage))
+    # time.sleep(2)
+    
+    logging.info("Clear...")
+    epd.init()
+    epd.Clear()
+    
+    logging.info("Goto Sleep...")
+    epd.sleep()
+        
+except IOError as e:
+    logging.info(e)
+    
+except KeyboardInterrupt:    
+    logging.info("ctrl + c:")
+    epd2in9b_V4.epdconfig.module_exit(cleanup=True)
+    exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_2in9bc_test.py

@@ -95,5 +95,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd2in9bc.epdconfig.module_exit()
+    epd2in9bc.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_2in9d_test.py

@@ -104,5 +104,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd2in9d.epdconfig.module_exit()
+    epd2in9d.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_3in0g_test.py

@@ -95,5 +95,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd3in0g.epdconfig.module_exit()
+    epd3in0g.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_3in52_test.py

@@ -115,5 +115,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd3in52.epdconfig.module_exit()
+    epd3in52.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_3in7_test.py

@@ -111,5 +111,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd3in7.epdconfig.module_exit()
+    epd3in7.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_4in01f_test.py

@@ -102,5 +102,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd4in01f.epdconfig.module_exit()
+    epd4in01f.epdconfig.module_exit(cleanup=True)
     exit()

+ 135 - 0
RaspberryPi_JetsonNano/python/examples/epd_4in26_test.py

@@ -0,0 +1,135 @@
+#!/usr/bin/python
+# -*- coding:utf-8 -*-
+import sys
+import os
+picdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic')
+libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib')
+if os.path.exists(libdir):
+    sys.path.append(libdir)
+
+import logging
+from waveshare_epd import epd4in26
+import time
+from PIL import Image,ImageDraw,ImageFont
+import traceback
+
+logging.basicConfig(level=logging.DEBUG)
+
+try:
+    logging.info("epd4in26 Demo")
+    epd = epd4in26.EPD()
+    
+    logging.info("init and Clear")
+    epd.init()
+    epd.Clear()
+
+    font24 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 24)
+    font18 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 18)
+    font35 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 35)
+
+    # Drawing on the Vertical image
+    logging.info("Drawing on the Vertical image...")
+    Limage = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
+    draw = ImageDraw.Draw(Limage)
+    draw.text((2, 0), 'hello world', font = font18, fill = 0)
+    draw.text((2, 20), '4.26inch e-Paper', font = font18, fill = 0)
+    draw.text((20, 50), u'微雪电子', font = font18, fill = 0)
+    draw.line((10, 90, 60, 140), fill = 0)
+    draw.line((60, 90, 10, 140), fill = 0)
+    draw.rectangle((10, 90, 60, 140), outline = 0)
+    draw.line((95, 90, 95, 140), fill = 0)
+    draw.line((70, 115, 120, 115), fill = 0)
+    draw.arc((70, 90, 120, 140), 0, 360, fill = 0)
+    draw.rectangle((10, 150, 60, 200), fill = 0)
+    draw.chord((70, 150, 120, 200), 0, 360, fill = 0)
+    epd.display(epd.getbuffer(Limage))
+    time.sleep(2)
+
+    logging.info("read bmp file")
+    epd.init_Fast()
+    Himage = Image.open(os.path.join(picdir, '7in5_V2.bmp'))
+    epd.display_Fast(epd.getbuffer(Himage))
+    time.sleep(2)
+
+    logging.info("read bmp file on window")
+    Himage2 = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
+    bmp = Image.open(os.path.join(picdir, '100x100.bmp'))
+    Himage2.paste(bmp, (50,10))
+    epd.display_Fast(epd.getbuffer(Himage2))
+    time.sleep(2)
+
+    # Drawing on the Horizontal image
+    logging.info("Drawing on the Horizontal image...")
+    epd.init()
+    Himage = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
+    draw = ImageDraw.Draw(Himage)
+    draw.text((10, 0), 'hello world', font = font24, fill = 0)
+    draw.text((10, 20), '4.26inch e-Paper', font = font24, fill = 0)
+    draw.text((150, 0), u'微雪电子', font = font24, fill = 0)
+    draw.line((20, 50, 70, 100), fill = 0)
+    draw.line((70, 50, 20, 100), fill = 0)
+    draw.rectangle((20, 50, 70, 100), outline = 0)
+    draw.line((165, 50, 165, 100), fill = 0)
+    draw.line((140, 75, 190, 75), fill = 0)
+    draw.arc((140, 50, 190, 100), 0, 360, fill = 0)
+    draw.rectangle((80, 50, 130, 100), fill = 0)
+    draw.chord((200, 50, 250, 100), 0, 360, fill = 0)
+    epd.display_Base(epd.getbuffer(Himage))
+    time.sleep(2)
+
+    # partial update
+    logging.info("5.show time")
+    # epd.init()
+    # epd.Clear()
+    # Himage = Image.new('1', (epd.width, epd.height), 255)
+    # draw = ImageDraw.Draw(Himage)
+    num = 0
+    while (True):
+        draw.rectangle((10, 120, 130, 170), fill = 255)
+        draw.text((10, 120), time.strftime('%H:%M:%S'), font = font24, fill = 0)
+        epd.display_Partial(epd.getbuffer(Himage))
+        num = num + 1
+        if(num == 10):
+            break
+
+    '''4Gray display'''
+    logging.info("4Gray display--------------------------------")
+    epd.init_4GRAY()
+    
+    Limage = Image.new('L', (epd.width, epd.height), 0)  # 255: clear the frame
+    draw = ImageDraw.Draw(Limage)
+    draw.text((20, 0), u'微雪电子', font = font35, fill = epd.GRAY1)
+    draw.text((20, 35), u'微雪电子', font = font35, fill = epd.GRAY2)
+    draw.text((20, 70), u'微雪电子', font = font35, fill = epd.GRAY3)
+    draw.text((40, 110), 'hello world', font = font18, fill = epd.GRAY1)
+    draw.line((10, 140, 60, 190), fill = epd.GRAY1)
+    draw.line((60, 140, 10, 190), fill = epd.GRAY1)
+    draw.rectangle((10, 140, 60, 190), outline = epd.GRAY1)
+    draw.line((95, 140, 95, 190), fill = epd.GRAY1)
+    draw.line((70, 165, 120, 165), fill = epd.GRAY1)
+    draw.arc((70, 140, 120, 190), 0, 360, fill = epd.GRAY1)
+    draw.rectangle((10, 200, 60, 250), fill = epd.GRAY1)
+    draw.chord((70, 200, 120, 250), 0, 360, fill = epd.GRAY1)
+    epd.display_4Gray(epd.getbuffer_4Gray(Limage))
+    time.sleep(2)
+    
+    #display 4Gra bmp
+    Himage = Image.open(os.path.join(picdir, '4in26_Scale.bmp'))
+    epd.display_4Gray(epd.getbuffer_4Gray(Himage))
+    time.sleep(2)
+    
+
+    logging.info("Clear...")
+    epd.init()
+    epd.Clear()
+
+    logging.info("Goto Sleep...")
+    epd.sleep()
+    
+except IOError as e:
+    logging.info(e)
+    
+except KeyboardInterrupt:    
+    logging.info("ctrl + c:")
+    epd4in26.epdconfig.module_exit(cleanup=True)
+    exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_4in2_V2_test.py

@@ -179,5 +179,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd4in2_V2.epdconfig.module_exit()
+    epd4in2_V2.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_4in2_test.py

@@ -127,5 +127,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd4in2.epdconfig.module_exit()
+    epd4in2.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_4in2b_V2_test.py

@@ -97,5 +97,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd4in2b_V2.epdconfig.module_exit()
+    epd4in2b_V2.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_4in2bc_test.py

@@ -97,5 +97,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd4in2bc.epdconfig.module_exit()
+    epd4in2bc.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_4in37g_test.py

@@ -72,5 +72,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd4in37g.epdconfig.module_exit()
+    epd4in37g.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_5in65f_test.py

@@ -89,5 +89,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd5in65f.epdconfig.module_exit()
+    epd5in65f.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_5in83_V2_test.py

@@ -85,5 +85,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd5in83_V2.epdconfig.module_exit()
+    epd5in83_V2.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_5in83_test.py

@@ -86,5 +86,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd5in83.epdconfig.module_exit()
+    epd5in83.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_5in83b_V2_test.py

@@ -95,5 +95,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd5in83b_V2.epdconfig.module_exit()
+    epd5in83b_V2.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_5in83bc_test.py

@@ -95,5 +95,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd5in83bc.epdconfig.module_exit()
+    epd5in83bc.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_7in3f_test.py

@@ -67,5 +67,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd7in3f.epdconfig.module_exit()
+    epd7in3f.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_7in3g_test.py

@@ -72,5 +72,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd7in3g.epdconfig.module_exit()
+    epd7in3g.epdconfig.module_exit(cleanup=True)
     exit()

+ 1 - 1
RaspberryPi_JetsonNano/python/examples/epd_7in5_HD_test.py

@@ -86,5 +86,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd7in5_HD.epdconfig.module_exit()
+    epd7in5_HD.epdconfig.module_exit(cleanup=True)
     exit()

+ 49 - 29
RaspberryPi_JetsonNano/python/examples/epd_7in5_V2_test.py

@@ -26,8 +26,21 @@ try:
     font24 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 24)
     font18 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 18)
 
+    logging.info("read bmp file")
+    Himage = Image.open(os.path.join(picdir, '7in5_V2.bmp'))
+    epd.display(epd.getbuffer(Himage))
+    time.sleep(2)
+
+    logging.info("read bmp file on window")
+    Himage2 = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
+    bmp = Image.open(os.path.join(picdir, '100x100.bmp'))
+    Himage2.paste(bmp, (50,10))
+    epd.display(epd.getbuffer(Himage2))
+    time.sleep(2)
+
     # Drawing on the Horizontal image
-    logging.info("1.Drawing on the Horizontal image...")
+    logging.info("Drawing on the Horizontal image...")
+    epd.init_fast()
     Himage = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
     draw = ImageDraw.Draw(Himage)
     draw.text((10, 0), 'hello world', font = font24, fill = 0)
@@ -44,35 +57,42 @@ try:
     epd.display(epd.getbuffer(Himage))
     time.sleep(2)
 
-    # Drawing on the Vertical image
-    logging.info("2.Drawing on the Vertical image...")
-    Limage = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
-    draw = ImageDraw.Draw(Limage)
-    draw.text((2, 0), 'hello world', font = font18, fill = 0)
-    draw.text((2, 20), '7.5inch epd', font = font18, fill = 0)
-    draw.text((20, 50), u'微雪电子', font = font18, fill = 0)
-    draw.line((10, 90, 60, 140), fill = 0)
-    draw.line((60, 90, 10, 140), fill = 0)
-    draw.rectangle((10, 90, 60, 140), outline = 0)
-    draw.line((95, 90, 95, 140), fill = 0)
-    draw.line((70, 115, 120, 115), fill = 0)
-    draw.arc((70, 90, 120, 140), 0, 360, fill = 0)
-    draw.rectangle((10, 150, 60, 200), fill = 0)
-    draw.chord((70, 150, 120, 200), 0, 360, fill = 0)
-    epd.display(epd.getbuffer(Limage))
-    time.sleep(2)
+    # partial update
+    logging.info("5.show time")
+    epd.init_part()
+    # Himage = Image.new('1', (epd.width, epd.height), 0)
+    # draw = ImageDraw.Draw(Himage)
+    num = 0
+    while (True):
+        draw.rectangle((10, 120, 130, 170), fill = 255)
+        draw.text((10, 120), time.strftime('%H:%M:%S'), font = font24, fill = 0)
+        epd.display_Partial(epd.getbuffer(Himage),0, 0, epd.width, epd.height)
+        num = num + 1
+        if(num == 10):
+            break
 
-    logging.info("3.read bmp file")
-    Himage = Image.open(os.path.join(picdir, '7in5_V2.bmp'))
-    epd.display(epd.getbuffer(Himage))
-    time.sleep(2)
 
-    logging.info("4.read bmp file on window")
-    Himage2 = Image.new('1', (epd.width, epd.height), 255)  # 255: clear the frame
-    bmp = Image.open(os.path.join(picdir, '100x100.bmp'))
-    Himage2.paste(bmp, (50,10))
-    epd.display(epd.getbuffer(Himage2))
-    time.sleep(2)
+
+    # # Drawing on the Vertical image
+    # logging.info("2.Drawing on the Vertical image...")
+    # epd.init()
+    # Limage = Image.new('1', (epd.height, epd.width), 255)  # 255: clear the frame
+    # draw = ImageDraw.Draw(Limage)
+    # draw.text((2, 0), 'hello world', font = font18, fill = 0)
+    # draw.text((2, 20), '7.5inch epd', font = font18, fill = 0)
+    # draw.text((20, 50), u'微雪电子', font = font18, fill = 0)
+    # draw.line((10, 90, 60, 140), fill = 0)
+    # draw.line((60, 90, 10, 140), fill = 0)
+    # draw.rectangle((10, 90, 60, 140), outline = 0)
+    # draw.line((95, 90, 95, 140), fill = 0)
+    # draw.line((70, 115, 120, 115), fill = 0)
+    # draw.arc((70, 90, 120, 140), 0, 360, fill = 0)
+    # draw.rectangle((10, 150, 60, 200), fill = 0)
+    # draw.chord((70, 150, 120, 200), 0, 360, fill = 0)
+    # epd.display(epd.getbuffer(Limage))
+    # time.sleep(2)
+
+    
 
     logging.info("Clear...")
     epd.init()
@@ -86,5 +106,5 @@ except IOError as e:
     
 except KeyboardInterrupt:    
     logging.info("ctrl + c:")
-    epd7in5_V2.epdconfig.module_exit()
+    epd7in5_V2.epdconfig.module_exit(cleanup=True)
     exit()

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません