├── .github
├── ISSUE_TEMPLATE.md
├── PULL_REQUEST_TEMPLATE.md
└── workflows
│ └── githubci.yml
├── .gitignore
├── README.md
├── examples
├── EPDTest
│ └── EPDTest.ino
├── FeatherWingTest
│ ├── .esp32.test.only
│ ├── .esp8266.test.only
│ ├── .feather_m0_express.test.only
│ ├── .feather_m4_can.test.only
│ ├── .feather_m4_can_tinyusb.test.only
│ ├── .feather_rp2040.test.only
│ ├── .feather_rp2040_tinyusb.test.only
│ ├── .nrf52840.test.only
│ └── FeatherWingTest.ino
├── GizmoTest
│ ├── .cpb.test.only
│ ├── .cpx.test.skip
│ └── GizmoTest.ino
├── ThinkInk_gray4
│ └── ThinkInk_gray4.ino
├── ThinkInk_mono
│ └── ThinkInk_mono.ino
├── ThinkInk_partial
│ └── ThinkInk_partial.ino
├── ThinkInk_tricolor
│ └── ThinkInk_tricolor.ino
├── acep_7ColorTest
│ ├── .metro_m4_tinyusb.test.only
│ ├── acep_7ColorTest.ino
│ ├── adabot.bmp
│ └── adafruit_characters.bmp
├── graphicstest
│ └── graphicstest.ino
├── rotation_test
│ └── rotation_test.ino
└── text_test
│ └── text_test.ino
├── library.properties
├── src
├── Adafruit_EPD.cpp
├── Adafruit_EPD.h
├── Adafruit_MCPSRAM.cpp
├── Adafruit_MCPSRAM.h
├── Adafruit_ThinkInk.h
├── drivers
│ ├── Adafruit_ACeP.cpp
│ ├── Adafruit_ACeP.h
│ ├── Adafruit_EK79686.cpp
│ ├── Adafruit_EK79686.h
│ ├── Adafruit_IL0373.cpp
│ ├── Adafruit_IL0373.h
│ ├── Adafruit_IL0398.cpp
│ ├── Adafruit_IL0398.h
│ ├── Adafruit_IL91874.cpp
│ ├── Adafruit_IL91874.h
│ ├── Adafruit_SSD1608.cpp
│ ├── Adafruit_SSD1608.h
│ ├── Adafruit_SSD1619.cpp
│ ├── Adafruit_SSD1619.h
│ ├── Adafruit_SSD1675.cpp
│ ├── Adafruit_SSD1675.h
│ ├── Adafruit_SSD1675B.cpp
│ ├── Adafruit_SSD1675B.h
│ ├── Adafruit_SSD1680.cpp
│ ├── Adafruit_SSD1680.h
│ ├── Adafruit_SSD1681.cpp
│ ├── Adafruit_SSD1681.h
│ ├── Adafruit_UC8151D.cpp
│ ├── Adafruit_UC8151D.h
│ ├── Adafruit_UC8276.cpp
│ └── Adafruit_UC8276.h
└── panels
│ ├── ThinkInk_154_Grayscale4_T8.h
│ ├── ThinkInk_154_Mono_D27.h
│ ├── ThinkInk_154_Mono_D67.h
│ ├── ThinkInk_154_Mono_M10.h
│ ├── ThinkInk_154_Tricolor_RW.h
│ ├── ThinkInk_154_Tricolor_Z17.h
│ ├── ThinkInk_154_Tricolor_Z90.h
│ ├── ThinkInk_213_Grayscale4_T5.h
│ ├── ThinkInk_213_Mono_B72.h
│ ├── ThinkInk_213_Mono_B73.h
│ ├── ThinkInk_213_Mono_BN.h
│ ├── ThinkInk_213_Mono_GDEY0213B74.h
│ ├── ThinkInk_213_Mono_M21.h
│ ├── ThinkInk_213_Tricolor_RW.h
│ ├── ThinkInk_213_Tricolor_Z16.h
│ ├── ThinkInk_270_Grayscale4_W3.h
│ ├── ThinkInk_270_Tricolor_C44.h
│ ├── ThinkInk_270_Tricolor_Z70.h
│ ├── ThinkInk_290_Grayscale4_T5.h
│ ├── ThinkInk_290_Mono_BN.h
│ ├── ThinkInk_290_Mono_M06.h
│ ├── ThinkInk_290_Tricolor_RH.h
│ ├── ThinkInk_290_Tricolor_Z10.h
│ ├── ThinkInk_290_Tricolor_Z13.h
│ ├── ThinkInk_290_Tricolor_Z94.h
│ ├── ThinkInk_420_Grayscale4_T2.h
│ ├── ThinkInk_420_Mono_BN.h
│ ├── ThinkInk_420_Mono_M06.h
│ ├── ThinkInk_420_Tricolor_RW.h
│ └── ThinkInk_420_Tricolor_Z21.h
└── unsupported
├── Adafruit_IL0371.cpp
├── Adafruit_IL0371.h
├── Adafruit_IL0376F.cpp
├── Adafruit_IL0376F.h
├── Adafruit_IL3897.cpp
└── Adafruit_IL3897.h
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | Thank you for opening an issue on an Adafruit Arduino library repository. To
2 | improve the speed of resolution please review the following guidelines and
3 | common troubleshooting steps below before creating the issue:
4 |
5 | - **Do not use GitHub issues for troubleshooting projects and issues.** Instead use
6 | the forums at http://forums.adafruit.com to ask questions and troubleshoot why
7 | something isn't working as expected. In many cases the problem is a common issue
8 | that you will more quickly receive help from the forum community. GitHub issues
9 | are meant for known defects in the code. If you don't know if there is a defect
10 | in the code then start with troubleshooting on the forum first.
11 |
12 | - **If following a tutorial or guide be sure you didn't miss a step.** Carefully
13 | check all of the steps and commands to run have been followed. Consult the
14 | forum if you're unsure or have questions about steps in a guide/tutorial.
15 |
16 | - **For Arduino projects check these very common issues to ensure they don't apply**:
17 |
18 | - For uploading sketches or communicating with the board make sure you're using
19 | a **USB data cable** and **not** a **USB charge-only cable**. It is sometimes
20 | very hard to tell the difference between a data and charge cable! Try using the
21 | cable with other devices or swapping to another cable to confirm it is not
22 | the problem.
23 |
24 | - **Be sure you are supplying adequate power to the board.** Check the specs of
25 | your board and plug in an external power supply. In many cases just
26 | plugging a board into your computer is not enough to power it and other
27 | peripherals.
28 |
29 | - **Double check all soldering joints and connections.** Flakey connections
30 | cause many mysterious problems. See the [guide to excellent soldering](https://learn.adafruit.com/adafruit-guide-excellent-soldering/tools) for examples of good solder joints.
31 |
32 | - **Ensure you are using an official Arduino or Adafruit board.** We can't
33 | guarantee a clone board will have the same functionality and work as expected
34 | with this code and don't support them.
35 |
36 | If you're sure this issue is a defect in the code and checked the steps above
37 | please fill in the following fields to provide enough troubleshooting information.
38 | You may delete the guideline and text above to just leave the following details:
39 |
40 | - Arduino board: **INSERT ARDUINO BOARD NAME/TYPE HERE**
41 |
42 | - Arduino IDE version (found in Arduino -> About Arduino menu): **INSERT ARDUINO
43 | VERSION HERE**
44 |
45 | - List the steps to reproduce the problem below (if possible attach a sketch or
46 | copy the sketch code in too): **LIST REPRO STEPS BELOW**
47 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | Thank you for creating a pull request to contribute to Adafruit's GitHub code!
2 | Before you open the request please review the following guidelines and tips to
3 | help it be more easily integrated:
4 |
5 | - **Describe the scope of your change--i.e. what the change does and what parts
6 | of the code were modified.** This will help us understand any risks of integrating
7 | the code.
8 |
9 | - **Describe any known limitations with your change.** For example if the change
10 | doesn't apply to a supported platform of the library please mention it.
11 |
12 | - **Please run any tests or examples that can exercise your modified code.** We
13 | strive to not break users of the code and running tests/examples helps with this
14 | process.
15 |
16 | Thank you again for contributing! We will try to test and integrate the change
17 | as soon as we can, but be aware we have many GitHub repositories to manage and
18 | can't immediately respond to every request. There is no need to bump or check in
19 | on a pull request (it will clutter the discussion of the request).
20 |
21 | Also don't be worried if the request is closed or not integrated--sometimes the
22 | priorities of Adafruit's GitHub code (education, ease of use) might not match the
23 | priorities of the pull request. Don't fret, the open source community thrives on
24 | forks and GitHub makes it easy to keep your changes in a forked repo.
25 |
26 | After reviewing the guidelines above you can delete this text from the pull request.
27 |
--------------------------------------------------------------------------------
/.github/workflows/githubci.yml:
--------------------------------------------------------------------------------
1 | name: Arduino Library CI
2 |
3 | on: [pull_request, push, repository_dispatch]
4 |
5 | jobs:
6 | build:
7 | runs-on: ubuntu-latest
8 | strategy:
9 | fail-fast: false
10 | matrix:
11 | arduino-platform:
12 | - 'uno'
13 | - 'leonardo'
14 | - 'mega2560'
15 | - 'esp8266'
16 | - 'esp32'
17 | - 'trinket_m0'
18 | - 'cpb'
19 | - 'cpx'
20 | - 'metro_m0'
21 | - 'metro_m4_tinyusb'
22 |
23 | steps:
24 | - uses: actions/setup-python@v4
25 | with:
26 | python-version: '3.8'
27 | - uses: actions/checkout@v3
28 | - uses: actions/checkout@v3
29 | with:
30 | repository: adafruit/ci-arduino
31 | path: ci
32 |
33 | - name: pre-install
34 | run: bash ci/actions_install.sh
35 |
36 | # manually install SDFat
37 | - name: extra libraries
38 | run: |
39 | git clone --quiet https://github.com/adafruit/SdFat.git /home/runner/Arduino/libraries/SdFat
40 | git clone --quiet https://github.com/adafruit/Adafruit_SPIFlash.git /home/runner/Arduino/libraries/Adafruit_SPIFlash
41 |
42 | - name: test platforms
43 | run: python3 ci/build_platform.py ${{ matrix.arduino-platform }}
44 |
45 | clang_and_doxy:
46 | runs-on: ubuntu-latest
47 | steps:
48 | - name: Setup Python
49 | uses: actions/setup-python@v1
50 | with:
51 | python-version: '3.x'
52 |
53 | - name: Checkout code
54 | uses: actions/checkout@v2
55 |
56 | - name: Checkout adafruit/ci-arduino
57 | uses: actions/checkout@v2
58 | with:
59 | repository: adafruit/ci-arduino
60 | path: ci
61 |
62 | - name: pre-install
63 | run: bash ci/actions_install.sh
64 |
65 | - name: clang
66 | run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r .
67 |
68 | - name: doxygen
69 | env:
70 | GH_REPO_TOKEN: ${{ secrets.GH_REPO_TOKEN }}
71 | PRETTYNAME : "Adafruit E-Paper Display Library"
72 | run: bash ci/doxy_gen_and_deploy.sh
73 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | default.vim
2 | fontconvert/fontconvert
3 | # Our handy .gitignore for automation ease
4 | Doxyfile*
5 | doxygen_sqlite3.db
6 | html
7 | .DS_STORE
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Adafruit EPD Library [](https://github.com/adafruit/Adafruit_EPD/actions)[](http://adafruit.github.io/Adafruit_EPD/html/index.html)
2 |
3 |
4 |
5 | This is a library for the Adafruit E-paper displays:
6 | * https://www.adafruit.com/products/3625
7 |
8 | Check out the links above for our tutorials and wiring diagrams. These devices use SPI to communicate
9 |
10 | Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!
11 |
12 | Written by Dean Miller for Adafruit Industries.
13 | MIT license, all text above must be included in any redistribution
14 |
--------------------------------------------------------------------------------
/examples/EPDTest/EPDTest.ino:
--------------------------------------------------------------------------------
1 | /***************************************************
2 | Adafruit invests time and resources providing this open source code,
3 | please support Adafruit and open-source hardware by purchasing
4 | products from Adafruit!
5 |
6 | Written by Limor Fried/Ladyada for Adafruit Industries.
7 | MIT license, all text above must be included in any redistribution
8 | ****************************************************/
9 |
10 | #include "Adafruit_EPD.h"
11 |
12 | #ifdef ARDUINO_ADAFRUIT_FEATHER_RP2040_THINKINK // detects if compiling for
13 | // Feather RP2040 ThinkInk
14 | #define EPD_DC PIN_EPD_DC // ThinkInk 24-pin connector DC
15 | #define EPD_CS PIN_EPD_CS // ThinkInk 24-pin connector CS
16 | #define EPD_BUSY PIN_EPD_BUSY // ThinkInk 24-pin connector Busy
17 | #define SRAM_CS -1 // use onboard RAM
18 | #define EPD_RESET PIN_EPD_RESET // ThinkInk 24-pin connector Reset
19 | #define EPD_SPI &SPI1 // secondary SPI for ThinkInk
20 | #else
21 | #define EPD_DC 10
22 | #define EPD_CS 9
23 | #define EPD_BUSY 7 // can set to -1 to not use a pin (will wait a fixed delay)
24 | #define SRAM_CS 6
25 | #define EPD_RESET 8 // can set to -1 and share with microcontroller Reset!
26 | #define EPD_SPI &SPI // primary SPI
27 | #endif
28 |
29 | // Uncomment the following line if you are using 1.54" EPD with IL0373
30 | // Adafruit_IL0373 display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
31 | // EPD_BUSY, EPD_SPI);
32 | // Uncomment the following line if you are using 1.54" EPD with SSD1680
33 | // Adafruit_SSD1680 display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
34 | // EPD_BUSY, EPD_SPI);
35 | // Uncomment the following line if you are using 1.54" EPD with SSD1608
36 | // Adafruit_SSD1608 display(200, 200, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
37 | // EPD_BUSY, EPD_SPI);
38 | // Uncomment the following line if you are using 1.54" EPD with SSD1681
39 | // Adafruit_SSD1681 display(200, 200, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
40 | // EPD_BUSY, EPD_SPI);
41 | // Uncomment the following line if you are using 1.54" EPD with UC8151D
42 | // Adafruit_UC8151D display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
43 | // EPD_BUSY, EPD_SPI);
44 |
45 | // Uncomment the following line if you are using 2.13" EPD with SSD1680
46 | // Adafruit_SSD1680 display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
47 | // EPD_BUSY, EPD_SPI);
48 |
49 | // Uncomment the following line if you are using 2.13" EPD with SSD1675
50 | // Adafruit_SSD1675 display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
51 | // EPD_BUSY, EPD_SPI);
52 |
53 | // Uncomment the following line if you are using 2.13" EPD with SSD1675B
54 | // Adafruit_SSD1675B display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
55 | // EPD_BUSY, EPD_SPI);
56 |
57 | // Uncomment the following line if you are using 2.13" EPD with UC8151D
58 | // Adafruit_UC8151D display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
59 | // EPD_BUSY, EPD_SPI);
60 |
61 | // Uncomment the following line if you are using 2.13" EPD with IL0373
62 | Adafruit_IL0373 display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY,
63 | EPD_SPI);
64 | //#define FLEXIBLE_213
65 |
66 | // Uncomment the following line if you are using 2.7" EPD with IL91874
67 | // Adafruit_IL91874 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
68 | // EPD_BUSY, EPD_SPI);
69 |
70 | // Uncomment the following line if you are using 2.7" EPD with EK79686
71 | // Adafruit_EK79686 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
72 | // EPD_BUSY, EPD_SPI);
73 |
74 | // Uncomment the following line if you are using 2.9" EPD with IL0373
75 | // Adafruit_IL0373 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
76 | // EPD_BUSY, EPD_SPI); #define FLEXIBLE_290
77 |
78 | // Uncomment the following line if you are using 2.9" EPD with SSD1680
79 | // Adafruit_SSD1680 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
80 | // EPD_BUSY, EPD_SPI);
81 |
82 | // Uncomment the following line if you are using 2.9" EPD with UC8151D
83 | // Adafruit_UC8151D display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
84 | // EPD_BUSY, EPD_SPI);
85 |
86 | #define COLOR1 EPD_BLACK
87 | #define COLOR2 EPD_RED
88 |
89 | void setup() {
90 | Serial.begin(115200);
91 | // while (!Serial) { delay(10); }
92 | Serial.println("Adafruit EPD test");
93 |
94 | display.begin();
95 |
96 | #if defined(FLEXIBLE_213) || defined(FLEXIBLE_290)
97 | // The flexible displays have different buffers and invert settings!
98 | display.setBlackBuffer(1, false);
99 | display.setColorBuffer(1, false);
100 | #endif
101 |
102 | // large block of text
103 | display.clearBuffer();
104 | testdrawtext(
105 | "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur "
106 | "adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa, "
107 | "fringilla sed malesuada et, malesuada sit amet turpis. Sed porttitor "
108 | "neque ut ante pretium vitae malesuada nunc bibendum. Nullam aliquet "
109 | "ultrices massa eu hendrerit. Ut sed nisi lorem. In vestibulum purus a "
110 | "tortor imperdiet posuere. ",
111 | COLOR1);
112 | display.display();
113 |
114 | delay(5000);
115 |
116 | display.clearBuffer();
117 | for (int16_t i = 0; i < display.width(); i += 4) {
118 | display.drawLine(0, 0, i, display.height() - 1, COLOR1);
119 | }
120 |
121 | for (int16_t i = 0; i < display.height(); i += 4) {
122 | display.drawLine(display.width() - 1, 0, 0, i,
123 | COLOR2); // on grayscale this will be mid-gray
124 | }
125 | display.display();
126 | }
127 |
128 | void loop() {
129 | // don't do anything!
130 | }
131 |
132 | void testdrawtext(const char *text, uint16_t color) {
133 | display.setCursor(0, 0);
134 | display.setTextColor(color);
135 | display.setTextWrap(true);
136 | display.print(text);
137 | }
138 |
--------------------------------------------------------------------------------
/examples/FeatherWingTest/.esp32.test.only:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adafruit/Adafruit_EPD/157135b7a75be872b496e8ba335ceaecc6b1a2b7/examples/FeatherWingTest/.esp32.test.only
--------------------------------------------------------------------------------
/examples/FeatherWingTest/.esp8266.test.only:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adafruit/Adafruit_EPD/157135b7a75be872b496e8ba335ceaecc6b1a2b7/examples/FeatherWingTest/.esp8266.test.only
--------------------------------------------------------------------------------
/examples/FeatherWingTest/.feather_m0_express.test.only:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adafruit/Adafruit_EPD/157135b7a75be872b496e8ba335ceaecc6b1a2b7/examples/FeatherWingTest/.feather_m0_express.test.only
--------------------------------------------------------------------------------
/examples/FeatherWingTest/.feather_m4_can.test.only:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adafruit/Adafruit_EPD/157135b7a75be872b496e8ba335ceaecc6b1a2b7/examples/FeatherWingTest/.feather_m4_can.test.only
--------------------------------------------------------------------------------
/examples/FeatherWingTest/.feather_m4_can_tinyusb.test.only:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adafruit/Adafruit_EPD/157135b7a75be872b496e8ba335ceaecc6b1a2b7/examples/FeatherWingTest/.feather_m4_can_tinyusb.test.only
--------------------------------------------------------------------------------
/examples/FeatherWingTest/.feather_rp2040.test.only:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adafruit/Adafruit_EPD/157135b7a75be872b496e8ba335ceaecc6b1a2b7/examples/FeatherWingTest/.feather_rp2040.test.only
--------------------------------------------------------------------------------
/examples/FeatherWingTest/.feather_rp2040_tinyusb.test.only:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adafruit/Adafruit_EPD/157135b7a75be872b496e8ba335ceaecc6b1a2b7/examples/FeatherWingTest/.feather_rp2040_tinyusb.test.only
--------------------------------------------------------------------------------
/examples/FeatherWingTest/.nrf52840.test.only:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adafruit/Adafruit_EPD/157135b7a75be872b496e8ba335ceaecc6b1a2b7/examples/FeatherWingTest/.nrf52840.test.only
--------------------------------------------------------------------------------
/examples/FeatherWingTest/FeatherWingTest.ino:
--------------------------------------------------------------------------------
1 | /***************************************************
2 | Adafruit invests time and resources providing this open source code,
3 | please support Adafruit and open-source hardware by purchasing
4 | products from Adafruit!
5 |
6 | Written by Limor Fried/Ladyada for Adafruit Industries.
7 | MIT license, all text above must be included in any redistribution
8 | ****************************************************/
9 |
10 | #include "Adafruit_ThinkInk.h"
11 |
12 | #ifdef ESP8266
13 | #define SRAM_CS 16
14 | #define EPD_CS 0
15 | #define EPD_DC 15
16 | #endif
17 | #ifdef ESP32
18 | #define SRAM_CS 32
19 | #define EPD_CS 15
20 | #define EPD_DC 33
21 | #endif
22 | #if defined (__AVR_ATmega32U4__) || defined(ARDUINO_SAMD_FEATHER_M0) || defined(ARDUINO_FEATHER_M4) || defined (__AVR_ATmega328P__) || defined(ARDUINO_NRF52840_FEATHER)
23 | #define SRAM_CS 6
24 | #define EPD_CS 9
25 | #define EPD_DC 10
26 | #endif
27 | #ifdef TEENSYDUINO
28 | #define SRAM_CS 3
29 | #define EPD_CS 4
30 | #define EPD_DC 10
31 | #endif
32 | #ifdef ARDUINO_STM32_FEATHER
33 | #define TFT_DC PB4
34 | #define TFT_CS PA15
35 | #define STMPE_CS PC7
36 | #endif
37 | #ifdef ARDUINO_NRF52832_FEATHER
38 | #define SRAM_CS 30
39 | #define EPD_CS 31
40 | #define EPD_DC 11
41 | #endif
42 | #ifdef ARDUINO_ADAFRUIT_FEATHER_RP2040
43 | #define SRAM_CS 8
44 | #define EPD_CS 9
45 | #define EPD_DC 10
46 | #endif
47 |
48 | #define EPD_RESET -1 // can set to -1 and share with microcontroller Reset!
49 | #define EPD_BUSY -1 // can set to -1 to not use a pin (will wait a fixed delay)
50 |
51 | // Uncomment the following line if you are using 2.13" Monochrome EPD with SSD1680
52 | ThinkInk_213_Mono_BN display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
53 | //ThinkInk_213_Mono_B74 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
54 |
55 | // Uncomment the following line if you are using 2.13" Tri-Color EPD with SSD1680
56 | //ThinkInk_213_Tricolor_RW display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
57 |
58 | // Uncomment the following line if you are using 2.13" EPD with SSD1675
59 | // ThinkInk_213_Mono_B72 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
60 |
61 | // Uncomment the following line if you are using 2.13" EPD with SSD1675B
62 | //ThinkInk_213_Mono_B73 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
63 |
64 | // Uncomment the following line if you are using 2.13" EPD with UC8151D
65 | //ThinkInk_213_Mono_M21 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
66 |
67 | //Uncomment the following line if you are using 2.13" EPD with IL0373
68 | //ThinkInk_213_Tricolor_Z16 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
69 | //#define FLEXIBLE_213
70 |
71 | // Uncomment the following line if you are using 2.9" Tri-Color EPD with IL0373
72 | //ThinkInk_290_Tricolor_Z10 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
73 |
74 | // Uncomment the following line if you are using 2.9" Grayscale EPD with IL0373
75 | //ThinkInk_290_Grayscale4_T5 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
76 | //#define FLEXIBLE_290
77 |
78 | // Uncomment the following line if you are using 2.9" Monochrome EPD with UC8151D
79 | //ThinkInk_290_Mono_M06 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
80 |
81 | // Uncomment the following line if you are using 2.9" Tri-Color EPD with UC8151D
82 | //ThinkInk_290_Tricolor_Z13 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
83 |
84 | #define COLOR1 EPD_BLACK
85 | #define COLOR2 EPD_RED
86 |
87 | void setup() {
88 | Serial.begin(115200);
89 | //while (!Serial) { delay(10); }
90 | Serial.println("2.13 inch EInk Featherwing test");
91 |
92 | display.begin();
93 |
94 | #if defined(FLEXIBLE_213) || defined(FLEXIBLE_290)
95 | // The flexible displays have different buffers and invert settings!
96 | display.setBlackBuffer(1, false);
97 | display.setColorBuffer(1, false);
98 | #endif
99 |
100 | // large block of text
101 | display.clearBuffer();
102 | testdrawtext("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa, fringilla sed malesuada et, malesuada sit amet turpis. Sed porttitor neque ut ante pretium vitae malesuada nunc bibendum. Nullam aliquet ultrices massa eu hendrerit. Ut sed nisi lorem. In vestibulum purus a tortor imperdiet posuere. ", COLOR1);
103 | display.display();
104 |
105 | delay(5000);
106 |
107 | display.clearBuffer();
108 | for (int16_t i=0; i // Core graphics library
12 |
13 | // Default is FeatherWing pinouts
14 |
15 | #ifdef ARDUINO_ADAFRUIT_FEATHER_RP2040_THINKINK // detects if compiling for
16 | // Feather RP2040 ThinkInk
17 | #define EPD_DC PIN_EPD_DC // ThinkInk 24-pin connector DC
18 | #define EPD_CS PIN_EPD_CS // ThinkInk 24-pin connector CS
19 | #define EPD_BUSY PIN_EPD_BUSY // ThinkInk 24-pin connector Busy
20 | #define SRAM_CS -1 // use onboard RAM
21 | #define EPD_RESET PIN_EPD_RESET // ThinkInk 24-pin connector Reset
22 | #define EPD_SPI &SPI1 // secondary SPI for ThinkInk
23 | #else
24 | #define EPD_DC 10
25 | #define EPD_CS 9
26 | #define EPD_BUSY 7 // can set to -1 to not use a pin (will wait a fixed delay)
27 | #define SRAM_CS 6
28 | #define EPD_RESET 8 // can set to -1 and share with microcontroller Reset!
29 | #define EPD_SPI &SPI // primary SPI
30 | #endif
31 |
32 | /* Uncomment the following line if you are using 1.54" tricolor EPD */
33 | // Adafruit_IL0373 display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
34 | // EPD_BUSY, EPD_SPI);
35 |
36 | /* Uncomment the following line if you are using 1.54" monochrome EPD */
37 | // Adafruit_SSD1608 display(200, 200, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
38 | // EPD_BUSY, EPD_SPI);
39 |
40 | /* Uncomment the following line if you are using 2.13" tricolor EPD */
41 | Adafruit_IL0373 display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY,
42 | EPD_SPI);
43 | //#define FLEXIBLE_213
44 |
45 | /* Uncomment the following line if you are using 2.13" monochrome 250*122 EPD */
46 | // Adafruit_SSD1675 display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
47 | // EPD_BUSY, EPD_SPI);
48 |
49 | /* Uncomment the following line if you are using 2.7" tricolor or grayscale EPD
50 | */
51 | // Adafruit_IL91874 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
52 | // EPD_BUSY, EPD_SPI);
53 |
54 | /* Uncomment the following line if you are using 2.9" EPD */
55 | // Adafruit_IL0373 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
56 | // EPD_BUSY, EPD_SPI); #define FLEXIBLE_290
57 |
58 | /* Uncomment the following line if you are using 4.2" tricolor EPD */
59 | // Adafruit_IL0398 display(300, 400, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
60 | // EPD_BUSY, EPD_SPI);
61 |
62 | void setup(void) {
63 | Serial.begin(115200);
64 | Serial.print("Hello! EPD Test");
65 |
66 | display.begin();
67 | Serial.println("Initialized");
68 |
69 | #if defined(FLEXIBLE_213) || defined(FLEXIBLE_290)
70 | // The flexible displays have different buffers and invert settings!
71 | display.setBlackBuffer(1, false);
72 | display.setColorBuffer(1, false);
73 | #endif
74 | }
75 |
76 | void loop() {
77 | for (int rot = 0; rot < 4; rot++) {
78 | display.setRotation(rot);
79 | display.clearBuffer();
80 | display.fillScreen(EPD_WHITE);
81 | display.drawRect(10, 20, 10, 20, EPD_BLACK);
82 |
83 | display.display();
84 |
85 | delay(1000);
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/examples/text_test/text_test.ino:
--------------------------------------------------------------------------------
1 | /***************************************************
2 | Adafruit invests time and resources providing this open source code,
3 | please support Adafruit and open-source hardware by purchasing
4 | products from Adafruit!
5 |
6 | Written by Limor Fried/Ladyada for Adafruit Industries.
7 | MIT license, all text above must be included in any redistribution
8 | ****************************************************/
9 |
10 | #include "Adafruit_EPD.h"
11 | #include // Core graphics library
12 |
13 | #ifdef ARDUINO_ADAFRUIT_FEATHER_RP2040_THINKINK // detects if compiling for
14 | // Feather RP2040 ThinkInk
15 | #define EPD_DC PIN_EPD_DC // ThinkInk 24-pin connector DC
16 | #define EPD_CS PIN_EPD_CS // ThinkInk 24-pin connector CS
17 | #define EPD_BUSY PIN_EPD_BUSY // ThinkInk 24-pin connector Busy
18 | #define SRAM_CS -1 // use onboard RAM
19 | #define EPD_RESET PIN_EPD_RESET // ThinkInk 24-pin connector Reset
20 | #define EPD_SPI &SPI1 // secondary SPI for ThinkInk
21 | #else
22 | #define EPD_DC 10
23 | #define EPD_CS 9
24 | #define EPD_BUSY 7 // can set to -1 to not use a pin (will wait a fixed delay)
25 | #define SRAM_CS 6
26 | #define EPD_RESET 8 // can set to -1 and share with microcontroller Reset!
27 | #define EPD_SPI &SPI // primary SPI
28 | #endif
29 |
30 | /* Uncomment the following line if you are using 1.54" tricolor EPD */
31 | // Adafruit_IL0373 display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
32 | // EPD_BUSY, EPD_SPI);
33 |
34 | /* Uncomment the following line if you are using 1.54" monochrome EPD */
35 | // Adafruit_SSD1608 display(200, 200, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
36 | // EPD_BUSY, EPD_SPI);
37 |
38 | /* Uncomment the following line if you are using 2.13" tricolor EPD */
39 | Adafruit_IL0373 display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY,
40 | EPD_SPI);
41 | //#define FLEXIBLE_213
42 |
43 | /* Uncomment the following line if you are using 2.13" monochrome 250*122 EPD */
44 | // Adafruit_SSD1675 display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
45 | // EPD_BUSY, EPD_SPI);
46 |
47 | /* Uncomment the following line if you are using 2.7" tricolor or grayscale EPD
48 | */
49 | // Adafruit_IL91874 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
50 | // EPD_BUSY, EPD_SPI);
51 |
52 | /* Uncomment the following line if you are using 2.9" EPD */
53 | // Adafruit_IL0373 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
54 | // EPD_BUSY, EPD_SPI); #define FLEXIBLE_290
55 |
56 | /* Uncomment the following line if you are using 4.2" tricolor EPD */
57 | // Adafruit_IL0398 display(300, 400, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
58 | // EPD_BUSY, EPD_SPI);
59 |
60 | void setup(void) {
61 | Serial.begin(115200);
62 | Serial.print("Hello! EPD Test");
63 |
64 | display.begin();
65 | #if defined(FLEXIBLE_213) || defined(FLEXIBLE_290)
66 | // The flexible displays have different buffers and invert settings!
67 | display.setBlackBuffer(1, false);
68 | display.setColorBuffer(1, false);
69 | #endif
70 |
71 | Serial.println("Initialized");
72 |
73 | display.setRotation(2);
74 |
75 | // large block of text
76 | display.clearBuffer();
77 | display.setTextWrap(true);
78 |
79 | display.setCursor(10, 10);
80 | display.setTextSize(1);
81 | display.setTextColor(EPD_BLACK);
82 | display.print(
83 | "Get as much education as you can. Nobody can take that away from you");
84 |
85 | display.setCursor(50, 70);
86 | display.setTextColor(EPD_RED);
87 | display.print("--Eben Upton");
88 |
89 | display.display();
90 | }
91 |
92 | void loop() { delay(500); }
93 |
--------------------------------------------------------------------------------
/library.properties:
--------------------------------------------------------------------------------
1 | name=Adafruit EPD
2 | version=4.5.6
3 | author=Adafruit
4 | maintainer=Adafruit
5 | sentence=ePaper display driver
6 | paragraph=ePaper display driver
7 | category=Display
8 | url=https://github.com/adafruit/Adafruit_EPD
9 | architectures=*
10 | depends=Adafruit GFX Library
11 |
--------------------------------------------------------------------------------
/src/Adafruit_EPD.h:
--------------------------------------------------------------------------------
1 | /*!
2 | * @file Adafruit_EPD.h
3 | *
4 | * This is a library for our EPD displays based on EPD drivers.
5 | * Designed specifically to work with Adafruit EPD displays.
6 | *
7 | * These displays use SPI to communicate, 4 or 5 pins are required to
8 | * interface
9 | *
10 | * Adafruit invests time and resources providing this open source code,
11 | * please support Adafruit and open-source hardware by purchasing
12 | * products from Adafruit!
13 | *
14 | * Written by Dean Miller for Adafruit Industries.
15 | *
16 | * BSD license, all text here must be included in any redistribution.
17 | *
18 | */
19 |
20 | #ifndef _ADAFRUIT_EPD_H_
21 | #define _ADAFRUIT_EPD_H_
22 |
23 | //#define EPD_DEBUG
24 |
25 | #define RAMBUFSIZE 64 ///< size of the ram buffer
26 |
27 | #include "Adafruit_MCPSRAM.h"
28 | #include
29 | #include
30 |
31 | /**************************************************************************/
32 | /*!
33 | @brief available EPD colors
34 | */
35 | /**************************************************************************/
36 | enum {
37 | EPD_WHITE, ///< white color
38 | EPD_BLACK, ///< black color
39 | EPD_RED, ///< red color
40 | EPD_GRAY, ///< gray color ('red' on grayscale)
41 | EPD_DARK, ///< darker color
42 | EPD_LIGHT, ///< lighter color
43 | EPD_NUM_COLORS
44 | };
45 |
46 | typedef enum {
47 | THINKINK_MONO,
48 | THINKINK_TRICOLOR,
49 | THINKINK_GRAYSCALE4,
50 | THINKINK_MONO_PARTIAL,
51 | } thinkinkmode_t;
52 |
53 | #define EPD_swap(a, b) \
54 | { \
55 | int16_t t = a; \
56 | a = b; \
57 | b = t; \
58 | } ///< simple swap function
59 |
60 | /**************************************************************************/
61 | /*!
62 | @brief Class for interfacing with Adafruit EPD display breakouts.
63 | */
64 | /**************************************************************************/
65 | class Adafruit_EPD : public Adafruit_GFX {
66 | public:
67 | Adafruit_EPD(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
68 | int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
69 | int16_t BUSY = -1);
70 | Adafruit_EPD(int width, int height, int16_t DC, int16_t RST, int16_t CS,
71 | int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
72 | ~Adafruit_EPD();
73 |
74 | void begin(bool reset = true);
75 | void drawPixel(int16_t x, int16_t y, uint16_t color);
76 | void clearBuffer();
77 | void clearDisplay();
78 | void setBlackBuffer(int8_t index, bool inverted);
79 | void setColorBuffer(int8_t index, bool inverted);
80 | void display(bool sleep = false);
81 |
82 | thinkinkmode_t getMode(void) { return inkmode; }
83 |
84 | protected:
85 | void writeRAMFramebufferToEPD(uint8_t *buffer, uint32_t buffer_size,
86 | uint8_t EPDlocation, bool invertdata = false);
87 | void writeSRAMFramebufferToEPD(uint16_t SRAM_buffer_addr,
88 | uint32_t buffer_size, uint8_t EPDlocation,
89 | bool invertdata = false);
90 |
91 | /**************************************************************************/
92 | /*!
93 | @brief Send the specific command to start writing to EPD display RAM
94 | @param index The index for which buffer to write (0 or 1 or tri-color
95 | displays) Ignored for monochrome displays.
96 | @returns The byte that is read from SPI at the same time as sending the
97 | command
98 | */
99 | /**************************************************************************/
100 | virtual uint8_t writeRAMCommand(uint8_t index) = 0;
101 |
102 | /**************************************************************************/
103 | /*!
104 | @brief Some displays require setting the RAM address pointer
105 | @param x X address counter value
106 | @param y Y address counter value
107 | */
108 | /**************************************************************************/
109 | virtual void setRAMAddress(uint16_t x, uint16_t y) = 0;
110 |
111 | virtual void busy_wait(void) = 0;
112 |
113 | /**************************************************************************/
114 | /*!
115 | @brief start up the display
116 | */
117 | /**************************************************************************/
118 | virtual void powerUp() = 0;
119 |
120 | /**************************************************************************/
121 | /*!
122 | @brief signal the display to update
123 | */
124 | /**************************************************************************/
125 | virtual void update(void) = 0;
126 |
127 | /**************************************************************************/
128 | /*!
129 | @brief wind down the display
130 | */
131 | /**************************************************************************/
132 | virtual void powerDown(void) = 0;
133 | void hardwareReset(void);
134 |
135 | int16_t _dc_pin, ///< data/command pin
136 | _reset_pin, ///< reset pin
137 | _cs_pin, ///< chip select pin
138 | _busy_pin; ///< busy pin
139 | Adafruit_SPIDevice *spi_dev = NULL; ///< SPI object
140 | static bool _isInTransaction; ///< true if SPI bus is in trasnfer state
141 | bool singleByteTxns; ///< if true CS will go high after every data byte
142 | ///< transferred
143 |
144 | const uint8_t *_epd_init_code = NULL;
145 | const uint8_t *_epd_lut_code = NULL;
146 | const uint8_t *_epd_partial_init_code = NULL;
147 | const uint8_t *_epd_partial_lut_code = NULL;
148 |
149 | uint16_t default_refresh_delay = 15000;
150 |
151 | Adafruit_MCPSRAM sram; ///< the ram chip object if using off-chip ram
152 |
153 | bool blackInverted; ///< is black channel inverted
154 | bool colorInverted; ///< is red channel inverted
155 |
156 | uint8_t layer_colors[EPD_NUM_COLORS];
157 |
158 | uint32_t buffer1_size; ///< size of the primary buffer
159 | uint32_t buffer2_size; ///< size of the secondary buffer
160 | uint8_t *buffer1; ///< the pointer to the primary buffer if using on-chip ram
161 | uint8_t
162 | *buffer2; ///< the pointer to the secondary buffer if using on-chip ram
163 | uint8_t
164 | *color_buffer; ///< the pointer to the color buffer if using on-chip ram
165 | uint8_t
166 | *black_buffer; ///< the pointer to the black buffer if using on-chip ram
167 | uint16_t buffer1_addr; ///< The SRAM address offsets for the primary buffer
168 | uint16_t buffer2_addr; ///< The SRAM address offsets for the secondary buffer
169 | uint16_t colorbuffer_addr; ///< The SRAM address offsets for the color buffer
170 | uint16_t blackbuffer_addr; ///< The SRAM address offsets for the black buffer
171 |
172 | void EPD_commandList(const uint8_t *init_code);
173 | void EPD_command(uint8_t c, const uint8_t *buf, uint16_t len);
174 | uint8_t EPD_command(uint8_t c, bool end = true);
175 | void EPD_data(const uint8_t *buf, uint16_t len);
176 | void EPD_data(uint8_t data);
177 |
178 | uint8_t SPItransfer(uint8_t c);
179 |
180 | bool use_sram; ///< true if we are using an SRAM chip as a framebuffer
181 |
182 | thinkinkmode_t inkmode; // Ink mode passed to begin()
183 |
184 | uint8_t partialsSinceLastFullUpdate = 0;
185 |
186 | #if defined(BUSIO_USE_FAST_PINIO)
187 | BusIO_PortReg *csPort, *dcPort;
188 | BusIO_PortMask csPinMask, dcPinMask;
189 | #endif
190 |
191 | void csLow();
192 | void csHigh();
193 | void dcHigh();
194 | void dcLow();
195 | };
196 |
197 | #include "drivers/Adafruit_ACeP.h"
198 | #include "drivers/Adafruit_EK79686.h"
199 | #include "drivers/Adafruit_IL0373.h"
200 | #include "drivers/Adafruit_IL0398.h"
201 | #include "drivers/Adafruit_IL91874.h"
202 | #include "drivers/Adafruit_SSD1608.h"
203 | #include "drivers/Adafruit_SSD1619.h"
204 | #include "drivers/Adafruit_SSD1675.h"
205 | #include "drivers/Adafruit_SSD1675B.h"
206 | #include "drivers/Adafruit_SSD1680.h"
207 | #include "drivers/Adafruit_SSD1681.h"
208 | #include "drivers/Adafruit_UC8151D.h"
209 | #include "drivers/Adafruit_UC8276.h"
210 |
211 | #endif /* _ADAFRUIT_EPD_H_ */
212 |
--------------------------------------------------------------------------------
/src/Adafruit_MCPSRAM.h:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #define MCPSRAM_READ 0x03 ///< read command
5 | #define MCPSRAM_WRITE 0x02 ///< write command
6 | #define MCPSRAM_RDSR 0x05 ///< read status register command
7 | #define MCPSRAM_WRSR 0x01 ///< write status register command
8 |
9 | #define K640_SEQUENTIAL_MODE (1 << 6) ///< put ram chip in sequential mode
10 |
11 | /**************************************************************************/
12 | /*!
13 | @brief Class for interfacing with Microchip SPI SRAM chips
14 | */
15 | /**************************************************************************/
16 | class Adafruit_MCPSRAM {
17 | public:
18 | Adafruit_MCPSRAM(int16_t mosi, int16_t miso, int16_t sck, int16_t cs);
19 | Adafruit_MCPSRAM(int16_t cs, SPIClass *spi = &SPI);
20 | ~Adafruit_MCPSRAM() {}
21 |
22 | void begin();
23 |
24 | void write(uint16_t addr, uint8_t *buf, uint16_t num,
25 | uint8_t reg = MCPSRAM_WRITE);
26 | void read(uint16_t addr, uint8_t *buf, uint16_t num,
27 | uint8_t reg = MCPSRAM_READ);
28 | void erase(uint16_t addr, uint16_t length, uint8_t val = 0x00);
29 |
30 | uint8_t read8(uint16_t addr, uint8_t reg = MCPSRAM_READ);
31 | uint16_t read16(uint16_t addr);
32 |
33 | void write8(uint16_t addr, uint8_t val, uint8_t reg = MCPSRAM_WRITE);
34 | void write16(uint16_t addr, uint16_t val);
35 |
36 | void csHigh();
37 | void csLow();
38 |
39 | private:
40 | boolean hwSPI; ///< true if using hardware SPI
41 | #ifdef HAVE_PORTREG
42 | PortReg *mosiport, *clkport, *csport, *misoport;
43 | PortMask mosipinmask, clkpinmask, cspinmask, misopinmask;
44 | #endif
45 | int16_t _cs, _mosi, _miso, _sck;
46 | SPIClass *_spi = NULL;
47 | };
48 |
--------------------------------------------------------------------------------
/src/Adafruit_ThinkInk.h:
--------------------------------------------------------------------------------
1 | #ifndef _ADAFRUIT_THINKINK_H_
2 | #define _ADAFRUIT_THINKINK_H_
3 |
4 | #include "Adafruit_EPD.h"
5 |
6 | #include "panels/ThinkInk_154_Tricolor_RW.h"
7 | #include "panels/ThinkInk_154_Tricolor_Z17.h"
8 | #include "panels/ThinkInk_154_Tricolor_Z90.h"
9 | #include "panels/ThinkInk_213_Tricolor_RW.h"
10 | #include "panels/ThinkInk_213_Tricolor_Z16.h"
11 | #include "panels/ThinkInk_270_Tricolor_C44.h"
12 | #include "panels/ThinkInk_270_Tricolor_Z70.h"
13 | #include "panels/ThinkInk_290_Tricolor_RH.h"
14 | #include "panels/ThinkInk_290_Tricolor_Z10.h"
15 | #include "panels/ThinkInk_290_Tricolor_Z13.h"
16 | #include "panels/ThinkInk_290_Tricolor_Z94.h"
17 | #include "panels/ThinkInk_420_Tricolor_RW.h"
18 | #include "panels/ThinkInk_420_Tricolor_Z21.h"
19 |
20 | #include "panels/ThinkInk_154_Grayscale4_T8.h"
21 | #include "panels/ThinkInk_213_Grayscale4_T5.h"
22 | #include "panels/ThinkInk_270_Grayscale4_W3.h"
23 | #include "panels/ThinkInk_290_Grayscale4_T5.h"
24 | #include "panels/ThinkInk_420_Grayscale4_T2.h"
25 |
26 | #include "panels/ThinkInk_154_Mono_D27.h"
27 | #include "panels/ThinkInk_154_Mono_D67.h"
28 | #include "panels/ThinkInk_154_Mono_M10.h"
29 |
30 | #include "panels/ThinkInk_213_Mono_B72.h"
31 | #include "panels/ThinkInk_213_Mono_B73.h"
32 | #include "panels/ThinkInk_213_Mono_BN.h"
33 | #include "panels/ThinkInk_213_Mono_GDEY0213B74.h"
34 | #include "panels/ThinkInk_213_Mono_M21.h"
35 |
36 | #include "panels/ThinkInk_290_Mono_BN.h"
37 | #include "panels/ThinkInk_290_Mono_M06.h"
38 | #include "panels/ThinkInk_420_Mono_BN.h"
39 | #include "panels/ThinkInk_420_Mono_M06.h"
40 |
41 | #endif // _ADAFRUIT_THINKINK_H_
42 |
--------------------------------------------------------------------------------
/src/drivers/Adafruit_ACeP.h:
--------------------------------------------------------------------------------
1 | #ifndef LIB_ADAFRUIT_ACEP
2 | #define LIB_ADAFRUIT_ACEP
3 |
4 | #include "Adafruit_EPD.h"
5 | #include
6 |
7 | #define ACEP_PANEL_SETTING 0x00
8 | #define ACEP_POWER_SETTING 0x01
9 | #define ACEP_POWER_OFF 0x02
10 | #define ACEP_POWER_OFF_SEQUENCE 0x03
11 | #define ACEP_POWER_ON 0x04
12 | #define ACEP_BOOSTER_SOFT_START 0x06
13 | #define ACEP_DEEP_SLEEP 0x07
14 | #define ACEP_DTM 0x10
15 | #define ACEP_DISPLAY_REFRESH 0x12
16 | #define ACEP_PLL 0x30
17 | #define ACEP_TSE 0x40
18 | #define ACEP_CDI 0x50
19 | #define ACEP_TCON 0x60
20 | #define ACEP_RESOLUTION 0x61
21 | #define ACEP_PWS 0xE3
22 |
23 | #define ACEP_COLOR_BLACK 0x0 /// 000
24 | #define ACEP_COLOR_WHITE 0x1 /// 001
25 | #define ACEP_COLOR_GREEN 0x2 /// 010
26 | #define ACEP_COLOR_BLUE 0x3 /// 011
27 | #define ACEP_COLOR_RED 0x4 /// 100
28 | #define ACEP_COLOR_YELLOW 0x5 /// 101
29 | #define ACEP_COLOR_ORANGE 0x6 /// 110
30 |
31 | /**************************************************************************/
32 | /*!
33 | @brief Class for interfacing with ACEP EPD drivers
34 | */
35 | /**************************************************************************/
36 | class Adafruit_ACEP : public Adafruit_EPD {
37 | public:
38 | Adafruit_ACEP(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
39 | int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
40 | int16_t BUSY = -1);
41 | Adafruit_ACEP(int width, int height, int16_t DC, int16_t RST, int16_t CS,
42 | int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
43 |
44 | void begin(bool reset = true);
45 | void powerUp();
46 | void powerDown();
47 | void update();
48 | void display(bool sleep = true);
49 |
50 | void clearBuffer();
51 | void clearDisplay();
52 | void deGhost();
53 | void drawPixel(int16_t x, int16_t y, uint16_t color);
54 |
55 | protected:
56 | uint8_t writeRAMCommand(uint8_t index);
57 | void setRAMAddress(uint16_t x, uint16_t y);
58 | void busy_wait();
59 | };
60 |
61 | #endif
62 |
--------------------------------------------------------------------------------
/src/drivers/Adafruit_EK79686.cpp:
--------------------------------------------------------------------------------
1 | #include "Adafruit_EK79686.h"
2 | #include "Adafruit_EPD.h"
3 |
4 | #define BUSY_WAIT 500
5 |
6 | // clang-format off
7 |
8 | const uint8_t ek79686_default_init_code[] {
9 | EK79686_PSR, 1, 0x0F, // LUT from OTP 128x296
10 | 0x4D, 1, 0xAA, // FITI cmd (???)
11 | 0x87, 1, 0x28,
12 | 0x84, 1, 0x00,
13 | 0x83, 1, 0x05,
14 | 0xA8, 1, 0xDF,
15 | 0xA9, 1, 0x05,
16 | 0xB1, 1, 0xE8,
17 | 0xAB, 1, 0xA1,
18 | 0xB9, 1, 0x10,
19 | 0x88, 1, 0x80,
20 | 0x90, 1, 0x02,
21 | 0x86, 1, 0x15,
22 | 0x91, 1, 0x8D,
23 | 0xAA, 1, 0x0F,
24 | EK79686_PON, 0,
25 | 0xFE};
26 |
27 | // clang-format on
28 |
29 | /**************************************************************************/
30 | /*!
31 | @brief constructor if using external SRAM chip and software SPI
32 | @param width the width of the display in pixels
33 | @param height the height of the display in pixels
34 | @param SID the SID pin to use
35 | @param SCLK the SCLK pin to use
36 | @param DC the data/command pin to use
37 | @param RST the reset pin to use
38 | @param CS the chip select pin to use
39 | @param SRCS the SRAM chip select pin to use
40 | @param MISO the MISO pin to use
41 | @param BUSY the busy pin to use
42 | */
43 | /**************************************************************************/
44 | Adafruit_EK79686::Adafruit_EK79686(int width, int height, int16_t SID,
45 | int16_t SCLK, int16_t DC, int16_t RST,
46 | int16_t CS, int16_t SRCS, int16_t MISO,
47 | int16_t BUSY)
48 | : Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
49 |
50 | if ((width % 8) != 0) {
51 | width += 8 - (width % 8);
52 | }
53 | buffer1_size = ((uint32_t)width * (uint32_t)height) / 8;
54 | buffer2_size = buffer1_size;
55 |
56 | if (SRCS >= 0) {
57 | use_sram = true;
58 | buffer1_addr = 0;
59 | buffer2_addr = buffer1_size;
60 | buffer1 = buffer2 = NULL;
61 | } else {
62 | buffer1 = (uint8_t *)malloc(buffer1_size);
63 | buffer2 = (uint8_t *)malloc(buffer2_size);
64 | }
65 | }
66 |
67 | // constructor for hardware SPI - we indicate DataCommand, ChipSelect, Reset
68 |
69 | /**************************************************************************/
70 | /*!
71 | @brief constructor if using on-chip RAM and hardware SPI
72 | @param width the width of the display in pixels
73 | @param height the height of the display in pixels
74 | @param DC the data/command pin to use
75 | @param RST the reset pin to use
76 | @param CS the chip select pin to use
77 | @param SRCS the SRAM chip select pin to use
78 | @param BUSY the busy pin to use
79 | */
80 | /**************************************************************************/
81 | Adafruit_EK79686::Adafruit_EK79686(int width, int height, int16_t DC,
82 | int16_t RST, int16_t CS, int16_t SRCS,
83 | int16_t BUSY, SPIClass *spi)
84 | : Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
85 |
86 | if ((height % 8) != 0) {
87 | height += 8 - (height % 8);
88 | }
89 | buffer1_size = (uint16_t)width * (uint16_t)height / 8;
90 | buffer2_size = buffer1_size;
91 |
92 | if (SRCS >= 0) {
93 | use_sram = true;
94 | buffer1_addr = 0;
95 | buffer2_addr = buffer1_size;
96 | buffer1 = buffer2 = NULL;
97 | } else {
98 | buffer1 = (uint8_t *)malloc(buffer1_size);
99 | buffer2 = (uint8_t *)malloc(buffer2_size);
100 | }
101 | }
102 |
103 | /**************************************************************************/
104 | /*!
105 | @brief wait for busy signal to end
106 | */
107 | /**************************************************************************/
108 | void Adafruit_EK79686::busy_wait(void) {
109 | if (_busy_pin >= 0) {
110 | do {
111 | EPD_command(EK79686_FLG);
112 | delay(10);
113 | } while (!digitalRead(_busy_pin));
114 | } else {
115 | delay(BUSY_WAIT);
116 | }
117 | delay(200); // additional delay
118 | }
119 |
120 | /**************************************************************************/
121 | /*!
122 | @brief begin communication with and set up the display.
123 | @param reset if true the reset pin will be toggled.
124 | */
125 | /**************************************************************************/
126 | void Adafruit_EK79686::begin(bool reset) {
127 | Adafruit_EPD::begin(reset);
128 | setBlackBuffer(0, true); // black defaults to inverted
129 | setColorBuffer(1, false); // red defaults to not-inverted
130 |
131 | powerDown();
132 | }
133 |
134 | /**************************************************************************/
135 | /*!
136 | @brief signal the display to update
137 | */
138 | /**************************************************************************/
139 | void Adafruit_EK79686::update() {
140 | EPD_command(EK79686_DRF);
141 | delay(10);
142 | busy_wait();
143 | }
144 |
145 | /**************************************************************************/
146 | /*!
147 | @brief start up the display
148 | */
149 | /**************************************************************************/
150 | void Adafruit_EK79686::powerUp() {
151 | hardwareReset();
152 | delay(10);
153 |
154 | const uint8_t *init_code = ek79686_default_init_code;
155 |
156 | if (_epd_init_code != NULL) {
157 | init_code = _epd_init_code;
158 | }
159 | EPD_commandList(init_code);
160 |
161 | if (_epd_lut_code) {
162 | EPD_commandList(_epd_lut_code);
163 | }
164 | busy_wait();
165 | }
166 |
167 | /**************************************************************************/
168 | /*!
169 | @brief wind down the display
170 | */
171 | /**************************************************************************/
172 |
173 | void Adafruit_EK79686::powerDown(void) {
174 | uint8_t buf[1];
175 |
176 | EPD_command(EK79686_POF); // power off
177 | busy_wait();
178 |
179 | buf[0] = 0xA5;
180 | EPD_command(EK79686_DSLP, buf, 1);
181 | }
182 |
183 | /**************************************************************************/
184 | /*!
185 | @brief Send the specific command to start writing to EPD display RAM
186 | @param index The index for which buffer to write (0 or 1 or tri-color
187 | displays) Ignored for monochrome displays.
188 | @returns The byte that is read from SPI at the same time as sending the
189 | command
190 | */
191 | /**************************************************************************/
192 | uint8_t Adafruit_EK79686::writeRAMCommand(uint8_t index) {
193 | if (index == 0) {
194 | return EPD_command(EK79686_DTM1, false);
195 | }
196 | if (index == 1) {
197 | return EPD_command(EK79686_DTM2, false);
198 | }
199 | return 0;
200 | }
201 |
202 | /**************************************************************************/
203 | /*!
204 | @brief Some displays require setting the RAM address pointer
205 | @param x X address counter value
206 | @param y Y address counter value
207 | */
208 | /**************************************************************************/
209 | void Adafruit_EK79686::setRAMAddress(uint16_t x, uint16_t y) {
210 | (void)x;
211 | (void)y;
212 | }
213 |
--------------------------------------------------------------------------------
/src/drivers/Adafruit_EK79686.h:
--------------------------------------------------------------------------------
1 | #ifndef LIB_ADAFRUIT_EK79686
2 | #define LIB_ADAFRUIT_EK79686
3 |
4 | #include "Adafruit_EPD.h"
5 | #include
6 |
7 | #define EK79686_PSR 0x00
8 | #define EK79686_PWR 0x01
9 | #define EK79686_POF 0x02
10 | #define EK79686_PFS 0x03
11 | #define EK79686_PON 0x04
12 | #define EK79686_PMEAS 0x05
13 | #define EK79686_BTST 0x06
14 | #define EK79686_DSLP 0x07
15 | #define EK79686_DTM1 0x10
16 | #define EK79686_DSP 0x11
17 | #define EK79686_DRF 0x12
18 | #define EK79686_DTM2 0x13
19 | #define EK79686_PDTM1 0x14
20 | #define EK79686_PDTM2 0x15
21 | #define EK79686_PDRF 0x16
22 | #define EK79686_LUT1 0x20
23 | #define EK79686_LUTWW 0x21
24 | #define EK79686_LUTBW 0x22
25 | #define EK79686_LUTWB 0x23
26 | #define EK79686_LUTBB 0x24
27 | #define EK79686_LUTC 0x25
28 | #define EK79686_SETVCOM 0x26
29 | #define EK79686_OSC 0x30
30 | #define EK79686_TSC 0x40
31 | #define EK79686_TSE 0x41
32 | #define EK79686_TSW 0x42
33 | #define EK79686_TSR 0x43
34 | #define EK79686_CDI 0x50
35 | #define EK79686_LPD 0x51
36 | #define EK79686_TCON 0x60
37 | #define EK79686_TRES 0x61
38 | #define EK79686_GSST 0x62
39 | #define EK79686_REV 0x70
40 | #define EK79686_FLG 0x71
41 | #define EK79686_AMV 0x80
42 | #define EK79686_VV 0x81
43 | #define EK79686_VDCS 0x82
44 | #define EK79686_PGM 0xA0
45 | #define EK79686_APG 0xA1
46 | #define EK79686_ROTP 0xA2
47 | #define EK79686_CCSET 0xE0
48 | #define EK79686_TSSET 0xE5
49 | #define EK79686_LVD 0xE6
50 | #define EK79686_PNLBRK 0xE7
51 | #define EK79686_PWRSAV 0xE8
52 | #define EK79686_AUTOSEQ 0xE9
53 |
54 | /**************************************************************************/
55 | /*!
56 | @brief Class for interfacing with EK79686 EPD drivers
57 | */
58 | /**************************************************************************/
59 | class Adafruit_EK79686 : public Adafruit_EPD {
60 | public:
61 | Adafruit_EK79686(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
62 | int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
63 | int16_t BUSY = -1);
64 | Adafruit_EK79686(int width, int height, int16_t DC, int16_t RST, int16_t CS,
65 | int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
66 |
67 | void begin(bool reset = true);
68 | void powerUp();
69 | void powerDown();
70 | void update();
71 |
72 | protected:
73 | uint8_t writeRAMCommand(uint8_t index);
74 | void setRAMAddress(uint16_t x, uint16_t y);
75 | void busy_wait();
76 | };
77 |
78 | #endif
79 |
--------------------------------------------------------------------------------
/src/drivers/Adafruit_IL0373.h:
--------------------------------------------------------------------------------
1 | #ifndef LIB_ADAFRUIT_IL0373
2 | #define LIB_ADAFRUIT_IL0373
3 |
4 | #include "Adafruit_EPD.h"
5 | #include
6 |
7 | #define IL0373_PANEL_SETTING 0x00
8 | #define IL0373_POWER_SETTING 0x01
9 | #define IL0373_POWER_OFF 0x02
10 | #define IL0373_POWER_OFF_SEQUENCE 0x03
11 | #define IL0373_POWER_ON 0x04
12 | #define IL0373_POWER_ON_MEASURE 0x05
13 | #define IL0373_BOOSTER_SOFT_START 0x06
14 | #define IL0373_DEEP_SLEEP 0x07
15 | #define IL0373_DTM1 0x10
16 | #define IL0373_DATA_STOP 0x11
17 | #define IL0373_DISPLAY_REFRESH 0x12
18 | #define IL0373_DTM2 0x13
19 | #define IL0373_PDTM1 0x14
20 | #define IL0373_PDTM2 0x15
21 | #define IL0373_PDRF 0x16
22 | #define IL0373_LUT1 0x20
23 | #define IL0373_LUTWW 0x21
24 | #define IL0373_LUTBW 0x22
25 | #define IL0373_LUTWB 0x23
26 | #define IL0373_LUTBB 0x24
27 | #define IL0373_PLL 0x30
28 | #define IL0373_CDI 0x50
29 | #define IL0373_RESOLUTION 0x61
30 | #define IL0373_VCM_DC_SETTING 0x82
31 | #define IL0373_PARTIAL_WINDOW 0x90
32 | #define IL0373_PARTIAL_ENTER 0x91
33 | #define IL0373_PARTIAL_EXIT 0x92
34 |
35 | /**************************************************************************/
36 | /*!
37 | @brief Class for interfacing with IL0373 EPD drivers
38 | */
39 | /**************************************************************************/
40 | class Adafruit_IL0373 : public Adafruit_EPD {
41 | private:
42 | public:
43 | Adafruit_IL0373(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
44 | int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
45 | int16_t BUSY = -1);
46 | Adafruit_IL0373(int width, int height, int16_t DC, int16_t RST, int16_t CS,
47 | int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
48 |
49 | void begin(bool reset = true);
50 | void powerUp();
51 | void powerDown();
52 | void update();
53 | void displayPartial(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
54 |
55 | protected:
56 | uint8_t writeRAMCommand(uint8_t index);
57 | void setRAMAddress(uint16_t x, uint16_t y);
58 | void busy_wait();
59 | };
60 |
61 | #endif
62 |
--------------------------------------------------------------------------------
/src/drivers/Adafruit_IL0398.cpp:
--------------------------------------------------------------------------------
1 | #include "Adafruit_IL0398.h"
2 | #include "Adafruit_EPD.h"
3 |
4 | #define EPD_RAM_BW 0x10
5 | #define EPD_RAM_RED 0x13
6 |
7 | #define BUSY_WAIT 500
8 |
9 | // clang-format off
10 |
11 | const uint8_t il0398_default_init_code[] {
12 | 0xFF, 20, // busy wait
13 | IL0398_BOOSTER_SOFT_START, 3, 0x17, 0x17, 0x17,
14 | IL0398_POWER_ON, 0,
15 | 0xFF, 20, // busy wait
16 | IL0398_PANEL_SETTING, 2, 0x1F, 0x0D, // lut from OTP & vcom = 0v
17 | IL0398_VCOM, 1, 0x97,
18 | 0xFE};
19 |
20 | // clang-format on
21 |
22 | /**************************************************************************/
23 | /*!
24 | @brief constructor if using external SRAM chip and software SPI
25 | @param width the width of the display in pixels
26 | @param height the height of the display in pixels
27 | @param SID the SID pin to use
28 | @param SCLK the SCLK pin to use
29 | @param DC the data/command pin to use
30 | @param RST the reset pin to use
31 | @param CS the chip select pin to use
32 | @param SRCS the SRAM chip select pin to use
33 | @param MISO the MISO pin to use
34 | @param BUSY the busy pin to use
35 | */
36 | /**************************************************************************/
37 | Adafruit_IL0398::Adafruit_IL0398(int width, int height, int16_t SID,
38 | int16_t SCLK, int16_t DC, int16_t RST,
39 | int16_t CS, int16_t SRCS, int16_t MISO,
40 | int16_t BUSY)
41 | : Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
42 |
43 | buffer1_size = ((uint32_t)width * (uint32_t)height) / 8;
44 | buffer2_size = buffer1_size;
45 |
46 | if (SRCS >= 0) {
47 | use_sram = true;
48 | buffer1_addr = 0;
49 | buffer2_addr = buffer1_size;
50 | buffer1 = buffer2 = NULL;
51 | } else {
52 | buffer1 = (uint8_t *)malloc(buffer1_size);
53 | buffer2 = (uint8_t *)malloc(buffer2_size);
54 | }
55 | }
56 |
57 | // constructor for hardware SPI - we indicate DataCommand, ChipSelect, Reset
58 | /**************************************************************************/
59 | /*!
60 | @brief constructor if using on-chip RAM and hardware SPI
61 | @param width the width of the display in pixels
62 | @param height the height of the display in pixels
63 | @param DC the data/command pin to use
64 | @param RST the reset pin to use
65 | @param CS the chip select pin to use
66 | @param SRCS the SRAM chip select pin to use
67 | @param BUSY the busy pin to use
68 | */
69 | /**************************************************************************/
70 | Adafruit_IL0398::Adafruit_IL0398(int width, int height, int16_t DC, int16_t RST,
71 | int16_t CS, int16_t SRCS, int16_t BUSY,
72 | SPIClass *spi)
73 | : Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
74 |
75 | buffer1_size = ((uint32_t)width * (uint32_t)height) / 8;
76 | buffer2_size = buffer1_size;
77 |
78 | if (SRCS >= 0) {
79 | use_sram = true;
80 | buffer1_addr = 0;
81 | buffer2_addr = buffer1_size;
82 | buffer1 = buffer2 = NULL;
83 | } else {
84 | buffer1 = (uint8_t *)malloc(buffer1_size);
85 | buffer2 = (uint8_t *)malloc(buffer2_size);
86 | }
87 | }
88 |
89 | /**************************************************************************/
90 | /*!
91 | @brief wait for busy signal to end
92 | */
93 | /**************************************************************************/
94 | void Adafruit_IL0398::busy_wait(void) {
95 | if (_busy_pin > -1) {
96 | do {
97 | EPD_command(IL0398_GETSTATUS);
98 | delay(10);
99 | } while (!digitalRead(_busy_pin)); // wait for busy HIGH
100 | delay(200);
101 | } else {
102 | delay(BUSY_WAIT);
103 | }
104 | }
105 |
106 | /**************************************************************************/
107 | /*!
108 | @brief begin communication with and set up the display.
109 | @param reset if true the reset pin will be toggled.
110 | */
111 | /**************************************************************************/
112 | void Adafruit_IL0398::begin(bool reset) {
113 | Adafruit_EPD::begin(reset);
114 | setBlackBuffer(0, true); // black defaults to inverted
115 | setColorBuffer(1, true); // red defaults to inverted
116 |
117 | setRotation(1);
118 | powerDown();
119 | }
120 |
121 | /**************************************************************************/
122 | /*!
123 | @brief signal the display to update
124 | */
125 | /**************************************************************************/
126 | void Adafruit_IL0398::update() {
127 | EPD_command(IL0398_DISPLAY_REFRESH);
128 | delay(100);
129 |
130 | busy_wait();
131 | if (_busy_pin <= -1) {
132 | delay(15000);
133 | }
134 | }
135 |
136 | /**************************************************************************/
137 | /*!
138 | @brief start up the display
139 | */
140 | /**************************************************************************/
141 | void Adafruit_IL0398::powerUp() {
142 | uint8_t buf[4];
143 |
144 | hardwareReset();
145 |
146 | const uint8_t *init_code = il0398_default_init_code;
147 | if (_epd_init_code != NULL) {
148 | init_code = _epd_init_code;
149 | }
150 | EPD_commandList(init_code);
151 |
152 | if (_epd_lut_code) {
153 | EPD_commandList(_epd_lut_code);
154 | }
155 |
156 | buf[0] = (HEIGHT >> 8) & 0xFF;
157 | buf[1] = HEIGHT & 0xFF;
158 | buf[2] = (WIDTH >> 8) & 0xFF;
159 | buf[3] = WIDTH & 0xFF;
160 | EPD_command(IL0398_RESOLUTION, buf, 4);
161 |
162 | delay(20);
163 | }
164 |
165 | /**************************************************************************/
166 | /*!
167 | @brief wind down the display
168 | */
169 | /**************************************************************************/
170 | void Adafruit_IL0398::powerDown() {
171 | uint8_t buf[4];
172 |
173 | // power off
174 | buf[0] = 0xF7; // border floating
175 | EPD_command(IL0398_VCOM, buf, 1);
176 | EPD_command(IL0398_POWER_OFF);
177 | busy_wait();
178 | // Only deep sleep if we can get out of it
179 | if (_reset_pin >= 0) {
180 | buf[0] = 0xA5; // deep sleep
181 | EPD_command(UC8276_DEEPSLEEP, buf, 1);
182 | }
183 | delay(100);
184 | }
185 |
186 | /**************************************************************************/
187 | /*!
188 | @brief Send the specific command to start writing to EPD display RAM
189 | @param index The index for which buffer to write (0 or 1 or tri-color
190 | displays) Ignored for monochrome displays.
191 | @returns The byte that is read from SPI at the same time as sending the
192 | command
193 | */
194 | /**************************************************************************/
195 | uint8_t Adafruit_IL0398::writeRAMCommand(uint8_t index) {
196 | if (index == 0) {
197 | return EPD_command(EPD_RAM_BW, false);
198 | }
199 | if (index == 1) {
200 | return EPD_command(EPD_RAM_RED, false);
201 | }
202 | return 0;
203 | }
204 |
205 | /**************************************************************************/
206 | /*!
207 | @brief Some displays require setting the RAM address pointer
208 | @param x X address counter value
209 | @param y Y address counter value
210 | */
211 | /**************************************************************************/
212 | void Adafruit_IL0398::setRAMAddress(uint16_t x, uint16_t y) {
213 | // on this chip we do nothing
214 | (void)x;
215 | (void)y;
216 | }
217 |
--------------------------------------------------------------------------------
/src/drivers/Adafruit_IL0398.h:
--------------------------------------------------------------------------------
1 | #ifndef LIB_ADAFRUIT_IL0398
2 | #define LIB_ADAFRUIT_IL0398
3 |
4 | #include "Adafruit_EPD.h"
5 | #include
6 |
7 | #define IL0398_PANEL_SETTING 0x00
8 | #define IL0398_POWER_SETTING 0x01
9 | #define IL0398_POWER_OFF 0x02
10 | #define IL0398_POWER_OFF_SEQUENCE 0x03
11 | #define IL0398_POWER_ON 0x04
12 | #define IL0398_POWER_ON_MEASURE 0x05
13 | #define IL0398_BOOSTER_SOFT_START 0x06
14 | #define IL0398_DEEP_SLEEP 0x07
15 | #define IL0398_DTM1 0x10
16 | #define IL0398_DATA_STOP 0x11
17 | #define IL0398_DISPLAY_REFRESH 0x12
18 | #define IL0398_DTM2 0x13
19 | #define IL0398_PDTM1 0x14
20 | #define IL0398_PDTM2 0x15
21 | #define IL0398_PDRF 0x16
22 | #define IL0398_LUT1 0x20
23 | #define IL0398_LUTWW 0x21
24 | #define IL0398_LUTBW 0x22
25 | #define IL0398_LUTWB 0x23
26 | #define IL0398_LUTBB 0x24
27 | #define IL0398_PLL 0x30
28 | #define IL0398_TEMPCALIBRATE 0x40
29 | #define IL0398_TEMPSELECT 0x41
30 | #define IL0398_TEMPWRITE 0x42
31 | #define IL0398_TEMPREAD 0x43
32 | #define IL0398_VCOM 0x50
33 | #define IL0398_LOWPOWERDETECT 0x51
34 | #define IL0398_TCON 0x60
35 | #define IL0398_RESOLUTION 0x61
36 | #define IL0398_GSSTSETTING 0x65
37 | #define IL0398_REVISION 0x70
38 | #define IL0398_GETSTATUS 0x71
39 | #define IL0398_AUTOVCOM 0x80
40 | #define IL0398_READVCOM 0x81
41 | #define IL0398_VCM_DC_SETTING 0x82
42 | #define IL0398_PARTWINDOW 0x90
43 | #define IL0398_PARTIALIN 0x91
44 | #define IL0398_PARTIALOUT 0x92
45 | #define IL0398_PROGRAMMODE 0xA0
46 | #define IL0398_ACTIVEPROGRAM 0xA1
47 | #define IL0398_READOTP 0xA2
48 | #define IL0398_CASCADESET 0xE0
49 | #define IL0398_POWERSAVING 0xE3
50 | #define IL0398_FORCETEMP 0xE5
51 |
52 | /**************************************************************************/
53 | /*!
54 | @brief Class for interfacing with IL0398 EPD drivers
55 | */
56 | /**************************************************************************/
57 | class Adafruit_IL0398 : public Adafruit_EPD {
58 | public:
59 | Adafruit_IL0398(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
60 | int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
61 | int16_t BUSY = -1);
62 | Adafruit_IL0398(int width, int height, int16_t DC, int16_t RST, int16_t CS,
63 | int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
64 |
65 | void begin(bool reset = true);
66 | void powerUp();
67 | void update();
68 | void powerDown();
69 |
70 | protected:
71 | uint8_t writeRAMCommand(uint8_t index);
72 | void setRAMAddress(uint16_t x, uint16_t y);
73 | void busy_wait();
74 | };
75 |
76 | #endif
77 |
--------------------------------------------------------------------------------
/src/drivers/Adafruit_IL91874.h:
--------------------------------------------------------------------------------
1 | #ifndef LIB_ADAFRUIT_IL91874
2 | #define LIB_ADAFRUIT_IL91874
3 |
4 | #include "Adafruit_EPD.h"
5 | #include
6 |
7 | #define IL91874_PANEL_SETTING 0x00
8 | #define IL91874_POWER_SETTING 0x01
9 | #define IL91874_POWER_OFF 0x02
10 | #define IL91874_POWER_OFF_SEQUENCE 0x03
11 | #define IL91874_POWER_ON 0x04
12 | #define IL91874_POWER_ON_MEASURE 0x05
13 | #define IL91874_BOOSTER_SOFT_START 0x06
14 | #define IL91874_DEEP_SLEEP 0x07
15 | #define IL91874_DTM1 0x10
16 | #define IL91874_DATA_STOP 0x11
17 | #define IL91874_DISPLAY_REFRESH 0x12
18 | #define IL91874_PDTM1 0x14
19 | #define IL91874_PDTM2 0x15
20 | #define IL91874_PDRF 0x16
21 | #define IL91874_LUT1 0x20
22 | #define IL91874_LUTWW 0x21
23 | #define IL91874_LUTBW 0x22
24 | #define IL91874_LUTWB 0x23
25 | #define IL91874_LUTBB 0x24
26 | #define IL91874_PLL 0x30
27 | #define IL91874_CDI 0x50
28 | #define IL91874_RESOLUTION 0x61
29 | #define IL91874_VCM_DC_SETTING 0x82
30 |
31 | /**************************************************************************/
32 | /*!
33 | @brief Class for interfacing with IL0373 EPD drivers
34 | */
35 | /**************************************************************************/
36 | class Adafruit_IL91874 : public Adafruit_EPD {
37 | public:
38 | Adafruit_IL91874(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
39 | int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
40 | int16_t BUSY = -1);
41 | Adafruit_IL91874(int width, int height, int16_t DC, int16_t RST, int16_t CS,
42 | int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
43 |
44 | void begin(bool reset = true);
45 | void powerUp();
46 | void update();
47 | void powerDown();
48 |
49 | protected:
50 | uint8_t writeRAMCommand(uint8_t index);
51 | void setRAMAddress(uint16_t x, uint16_t y);
52 | void busy_wait();
53 | };
54 |
55 | #endif
56 |
--------------------------------------------------------------------------------
/src/drivers/Adafruit_SSD1608.cpp:
--------------------------------------------------------------------------------
1 | #include "Adafruit_SSD1608.h"
2 | #include "Adafruit_EPD.h"
3 |
4 | #define EPD_RAM_BW 0x10
5 |
6 | #define BUSY_WAIT 500
7 |
8 | const unsigned char LUT_DATA[30] = {
9 | 0x02, 0x02, 0x01, 0x11, 0x12, 0x12, 0x22, 0x22, 0x66, 0x69,
10 | 0x69, 0x59, 0x58, 0x99, 0x99, 0x88, 0x00, 0x00, 0x00, 0x00,
11 | 0xF8, 0xB4, 0x13, 0x51, 0x35, 0x51, 0x51, 0x19, 0x01, 0x00};
12 |
13 | /**************************************************************************/
14 | /*!
15 | @brief constructor if using external SRAM chip and software SPI
16 | @param width the width of the display in pixels
17 | @param height the height of the display in pixels
18 | @param SID the SID pin to use
19 | @param SCLK the SCLK pin to use
20 | @param DC the data/command pin to use
21 | @param RST the reset pin to use
22 | @param CS the chip select pin to use
23 | @param SRCS the SRAM chip select pin to use
24 | @param MISO the MISO pin to use
25 | @param BUSY the busy pin to use
26 | */
27 | /**************************************************************************/
28 | Adafruit_SSD1608::Adafruit_SSD1608(int width, int height, int16_t SID,
29 | int16_t SCLK, int16_t DC, int16_t RST,
30 | int16_t CS, int16_t SRCS, int16_t MISO,
31 | int16_t BUSY)
32 | : Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
33 |
34 | if ((width % 8) != 0) {
35 | width += 8 - (width % 8);
36 | }
37 | buffer1_size = (uint16_t)width * (uint16_t)height / 8;
38 | buffer2_size = 0;
39 |
40 | if (SRCS >= 0) {
41 | use_sram = true;
42 | buffer1_addr = 0;
43 | buffer2_addr = 0;
44 | } else {
45 | buffer1 = (uint8_t *)malloc(buffer1_size);
46 | buffer2 = NULL;
47 | }
48 | }
49 |
50 | // constructor for hardware SPI - we indicate DataCommand, ChipSelect, Reset
51 |
52 | /**************************************************************************/
53 | /*!
54 | @brief constructor if using on-chip RAM and hardware SPI
55 | @param width the width of the display in pixels
56 | @param height the height of the display in pixels
57 | @param DC the data/command pin to use
58 | @param RST the reset pin to use
59 | @param CS the chip select pin to use
60 | @param SRCS the SRAM chip select pin to use
61 | @param BUSY the busy pin to use
62 | */
63 | /**************************************************************************/
64 | Adafruit_SSD1608::Adafruit_SSD1608(int width, int height, int16_t DC,
65 | int16_t RST, int16_t CS, int16_t SRCS,
66 | int16_t BUSY, SPIClass *spi)
67 | : Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
68 |
69 | if ((height % 8) != 0) {
70 | height += 8 - (height % 8);
71 | }
72 | buffer1_size = (uint16_t)width * (uint16_t)height / 8;
73 | buffer2_size = 0;
74 |
75 | if (SRCS >= 0) {
76 | use_sram = true;
77 | buffer1_addr = 0;
78 | buffer2_addr = 0;
79 | } else {
80 | buffer1 = (uint8_t *)malloc(buffer1_size);
81 | buffer2 = buffer1;
82 | }
83 | }
84 |
85 | /**************************************************************************/
86 | /*!
87 | @brief wait for busy signal to end
88 | */
89 | /**************************************************************************/
90 | void Adafruit_SSD1608::busy_wait(void) {
91 | if (_busy_pin >= 0) {
92 | while (digitalRead(_busy_pin)) { // wait for busy low
93 | delay(10);
94 | }
95 | } else {
96 | delay(BUSY_WAIT);
97 | }
98 | }
99 |
100 | /**************************************************************************/
101 | /*!
102 | @brief begin communication with and set up the display.
103 | @param reset if true the reset pin will be toggled.
104 | */
105 | /**************************************************************************/
106 | void Adafruit_SSD1608::begin(bool reset) {
107 | Adafruit_EPD::begin(reset);
108 | setBlackBuffer(0, true); // black defaults to inverted
109 | setColorBuffer(0, true); // no secondary buffer, so we'll just reuse index 0
110 |
111 | delay(100);
112 | powerDown();
113 | }
114 |
115 | /**************************************************************************/
116 | /*!
117 | @brief signal the display to update
118 | */
119 | /**************************************************************************/
120 | void Adafruit_SSD1608::update() {
121 | uint8_t buf[1];
122 |
123 | // display update sequence
124 | buf[0] = 0xC7;
125 | EPD_command(SSD1608_DISP_CTRL2, buf, 1);
126 |
127 | EPD_command(SSD1608_MASTER_ACTIVATE);
128 |
129 | busy_wait();
130 | }
131 |
132 | /**************************************************************************/
133 | /*!
134 | @brief start up the display
135 | */
136 | /**************************************************************************/
137 | void Adafruit_SSD1608::powerUp() {
138 | uint8_t buf[5];
139 |
140 | hardwareReset();
141 | busy_wait();
142 |
143 | // soft reset
144 | EPD_command(SSD1608_SW_RESET);
145 |
146 | busy_wait();
147 |
148 | // driver output control
149 | buf[0] = HEIGHT - 1;
150 | buf[1] = (HEIGHT - 1) >> 8;
151 | buf[2] = 0x00;
152 | EPD_command(SSD1608_DRIVER_CONTROL, buf, 3);
153 |
154 | // Set dummy line period
155 | buf[0] = 0x1B;
156 | EPD_command(SSD1608_WRITE_DUMMY, buf, 1);
157 |
158 | // Set gate line width
159 | buf[0] = 0x0B;
160 | EPD_command(SSD1608_WRITE_GATELINE, buf, 1);
161 |
162 | // Data entry sequence
163 | buf[0] = 0x03;
164 | EPD_command(SSD1608_DATA_MODE, buf, 1);
165 |
166 | // Set ram X start/end postion
167 | buf[0] = 0x00;
168 | buf[1] = WIDTH / 8 - 1;
169 | EPD_command(SSD1608_SET_RAMXPOS, buf, 2);
170 |
171 | // Set ram Y start/end postion
172 | buf[0] = 0x00;
173 | buf[1] = 0x00;
174 | buf[2] = HEIGHT - 1;
175 | buf[3] = (HEIGHT - 1) >> 8;
176 | EPD_command(SSD1608_SET_RAMYPOS, buf, 4);
177 |
178 | // Vcom Voltage
179 | buf[0] = 0x70;
180 | EPD_command(SSD1608_WRITE_VCOM, buf, 1);
181 |
182 | EPD_command(SSD1608_WRITE_LUT, LUT_DATA, 30);
183 |
184 | /*
185 | // border color
186 | buf[0] = 0x03;
187 | EPD_command(SSD1608_WRITE_BORDER, buf, 1);
188 |
189 | // Set gate voltage
190 | buf[0] = LUT_DATA[70];
191 | EPD_command(SSD1608_GATE_VOLTAGE, buf, 1);
192 |
193 | // Set source voltage
194 | buf[0] = LUT_DATA[71];
195 | buf[1] = LUT_DATA[72];
196 | buf[2] = LUT_DATA[73];
197 | EPD_command(SSD1608_SOURCE_VOLTAGE, buf, 3);
198 | */
199 | /*
200 |
201 | // set RAM x address count ;
202 | buf[0] = 0;
203 | EPD_command(SSD1608_SET_RAMXCOUNT, buf, 1);
204 |
205 | // set RAM y address count;
206 | buf[0] = HEIGHT - 1;
207 | buf[1] = (HEIGHT - 1) >> 8;
208 | EPD_command(SSD1608_SET_RAMYCOUNT, buf, 2);
209 | */
210 | busy_wait();
211 | }
212 |
213 | /**************************************************************************/
214 | /*!
215 | @brief wind down the display
216 | */
217 | /**************************************************************************/
218 |
219 | void Adafruit_SSD1608::powerDown(void) {
220 | uint8_t buf[2];
221 | // deep sleep
222 | buf[0] = 0x01;
223 | EPD_command(SSD1608_DEEP_SLEEP, buf, 1);
224 | delay(100);
225 | }
226 |
227 | /**************************************************************************/
228 | /*!
229 | @brief Send the specific command to start writing to EPD display RAM
230 | @param index The index for which buffer to write (0 or 1 or tri-color
231 | displays) Ignored for monochrome displays.
232 | @returns The byte that is read from SPI at the same time as sending the
233 | command
234 | */
235 | /**************************************************************************/
236 | uint8_t Adafruit_SSD1608::writeRAMCommand(uint8_t index) {
237 | (void)index;
238 | return EPD_command(SSD1608_WRITE_RAM, false);
239 | }
240 |
241 | /**************************************************************************/
242 | /*!
243 | @brief Some displays require setting the RAM address pointer
244 | @param x X address counter value
245 | @param y Y address counter value
246 | */
247 | /**************************************************************************/
248 | void Adafruit_SSD1608::setRAMAddress(uint16_t x, uint16_t y) {
249 | uint8_t buf[2];
250 |
251 | // Set RAM X address counter
252 | buf[0] = x;
253 | EPD_command(SSD1608_SET_RAMXCOUNT, buf, 1);
254 |
255 | // Set RAM Y address counter
256 | buf[0] = y >> 8;
257 | buf[1] = y;
258 | EPD_command(SSD1608_SET_RAMYCOUNT, buf, 2);
259 | }
260 |
--------------------------------------------------------------------------------
/src/drivers/Adafruit_SSD1608.h:
--------------------------------------------------------------------------------
1 | #ifndef LIB_ADAFRUIT_SSD1608
2 | #define LIB_ADAFRUIT_SSD1608
3 |
4 | #include "Adafruit_EPD.h"
5 | #include
6 |
7 | #define SSD1608_DRIVER_CONTROL 0x01
8 | #define SSD1608_GATE_VOLTAGE 0x03
9 | #define SSD1608_SOURCE_VOLTAGE 0x04
10 | #define SSD1608_DISPLAY_CONTROL 0x07
11 | #define SSD1608_NON_OVERLAP 0x0B
12 | #define SSD1608_BOOSTER_SOFT_START 0x0C
13 | #define SSD1608_GATE_SCAN_START 0x0F
14 | #define SSD1608_DEEP_SLEEP 0x10
15 | #define SSD1608_DATA_MODE 0x11
16 | #define SSD1608_SW_RESET 0x12
17 | #define SSD1608_TEMP_WRITE 0x1A
18 | #define SSD1608_TEMP_READ 0x1B
19 | #define SSD1608_TEMP_CONTROL 0x1C
20 | #define SSD1608_TEMP_LOAD 0x1D
21 | #define SSD1608_MASTER_ACTIVATE 0x20
22 | #define SSD1608_DISP_CTRL1 0x21
23 | #define SSD1608_DISP_CTRL2 0x22
24 | #define SSD1608_WRITE_RAM 0x24
25 | #define SSD1608_READ_RAM 0x25
26 | #define SSD1608_VCOM_SENSE 0x28
27 | #define SSD1608_VCOM_DURATION 0x29
28 | #define SSD1608_WRITE_VCOM 0x2C
29 | #define SSD1608_READ_OTP 0x2D
30 | #define SSD1608_WRITE_LUT 0x32
31 | #define SSD1608_WRITE_DUMMY 0x3A
32 | #define SSD1608_WRITE_GATELINE 0x3B
33 | #define SSD1608_WRITE_BORDER 0x3C
34 | #define SSD1608_SET_RAMXPOS 0x44
35 | #define SSD1608_SET_RAMYPOS 0x45
36 | #define SSD1608_SET_RAMXCOUNT 0x4E
37 | #define SSD1608_SET_RAMYCOUNT 0x4F
38 | #define SSD1608_NOP 0xFF
39 |
40 | /**************************************************************************/
41 | /*!
42 | @brief Class for interfacing with SSD1608 EPD drivers
43 | */
44 | /**************************************************************************/
45 | class Adafruit_SSD1608 : public Adafruit_EPD {
46 | public:
47 | Adafruit_SSD1608(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
48 | int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
49 | int16_t BUSY = -1);
50 | Adafruit_SSD1608(int width, int height, int16_t DC, int16_t RST, int16_t CS,
51 | int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
52 |
53 | void begin(bool reset = true);
54 | void powerUp();
55 | void powerDown();
56 | void update();
57 |
58 | protected:
59 | uint8_t writeRAMCommand(uint8_t index);
60 | void setRAMAddress(uint16_t x, uint16_t y);
61 | void busy_wait();
62 | };
63 |
64 | #endif
65 |
--------------------------------------------------------------------------------
/src/drivers/Adafruit_SSD1619.cpp:
--------------------------------------------------------------------------------
1 | #include "Adafruit_SSD1619.h"
2 | #include "Adafruit_EPD.h"
3 |
4 | #define EPD_RAM_BW 0x10
5 | #define EPD_RAM_RED 0x13
6 |
7 | #define BUSY_WAIT 500
8 |
9 | // clang-format off
10 |
11 | const uint8_t ssd1619_default_init_code[] {
12 | SSD1619_SW_RESET, 0, // soft reset
13 | 0xFF, 20, // busy wait
14 |
15 | SSD1619_SET_ANALOGBLOCK, 1, 0x54, // set analog block control
16 | SSD1619_SET_DIGITALBLOCK, 1, 0x3B, // set digital block control
17 |
18 | SSD1619_DATA_MODE, 1, 0x03, // Ram data entry mode
19 |
20 | SSD1619_WRITE_BORDER, 1, 0x01, // border color
21 | SSD1619_TEMP_CONTROL, 1, 0x80, // Temp control
22 | SSD1619_DISP_CTRL2, 1, 0xB1,
23 |
24 | SSD1619_MASTER_ACTIVATE, 0,
25 | 0xFF, 20, // busy wait
26 |
27 | 0xFE};
28 |
29 | // clang-format on
30 |
31 | /**************************************************************************/
32 | /*!
33 | @brief constructor if using external SRAM chip and software SPI
34 | @param width the width of the display in pixels
35 | @param height the height of the display in pixels
36 | @param SID the SID pin to use
37 | @param SCLK the SCLK pin to use
38 | @param DC the data/command pin to use
39 | @param RST the reset pin to use
40 | @param CS the chip select pin to use
41 | @param SRCS the SRAM chip select pin to use
42 | @param MISO the MISO pin to use
43 | @param BUSY the busy pin to use
44 | */
45 | /**************************************************************************/
46 | Adafruit_SSD1619::Adafruit_SSD1619(int width, int height, int16_t SID,
47 | int16_t SCLK, int16_t DC, int16_t RST,
48 | int16_t CS, int16_t SRCS, int16_t MISO,
49 | int16_t BUSY)
50 | : Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
51 | if ((height % 8) != 0) {
52 | height += 8 - (height % 8);
53 | }
54 |
55 | buffer1_size = width * height / 8;
56 | buffer2_size = buffer1_size;
57 |
58 | if (SRCS >= 0) {
59 | use_sram = true;
60 | buffer1_addr = 0;
61 | buffer2_addr = buffer1_size;
62 | buffer1 = buffer2 = NULL;
63 | } else {
64 | buffer1 = (uint8_t *)malloc(buffer1_size);
65 | buffer2 = (uint8_t *)malloc(buffer2_size);
66 | }
67 |
68 | singleByteTxns = true;
69 | }
70 |
71 | // constructor for hardware SPI - we indicate DataCommand, ChipSelect, Reset
72 |
73 | /**************************************************************************/
74 | /*!
75 | @brief constructor if using on-chip RAM and hardware SPI
76 | @param width the width of the display in pixels
77 | @param height the height of the display in pixels
78 | @param DC the data/command pin to use
79 | @param RST the reset pin to use
80 | @param CS the chip select pin to use
81 | @param SRCS the SRAM chip select pin to use
82 | @param BUSY the busy pin to use
83 | */
84 | /**************************************************************************/
85 | Adafruit_SSD1619::Adafruit_SSD1619(int width, int height, int16_t DC,
86 | int16_t RST, int16_t CS, int16_t SRCS,
87 | int16_t BUSY, SPIClass *spi)
88 | : Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
89 | if ((height % 8) != 0) {
90 | height += 8 - (height % 8);
91 | }
92 |
93 | buffer1_size = width * height / 8;
94 | buffer2_size = buffer1_size;
95 |
96 | if (SRCS >= 0) {
97 | use_sram = true;
98 | buffer1_addr = 0;
99 | buffer2_addr = buffer1_size;
100 | buffer1 = buffer2 = NULL;
101 | } else {
102 | buffer1 = (uint8_t *)malloc(buffer1_size);
103 | buffer2 = (uint8_t *)malloc(buffer2_size);
104 | }
105 |
106 | singleByteTxns = true;
107 | }
108 |
109 | /**************************************************************************/
110 | /*!
111 | @brief wait for busy signal to end
112 | */
113 | /**************************************************************************/
114 | void Adafruit_SSD1619::busy_wait(void) {
115 | if (_busy_pin >= 0) {
116 | while (digitalRead(_busy_pin)) { // wait for busy low
117 | delay(10);
118 | }
119 | } else {
120 | delay(BUSY_WAIT);
121 | }
122 | }
123 |
124 | /**************************************************************************/
125 | /*!
126 | @brief begin communication with and set up the display.
127 | @param reset if true the reset pin will be toggled.
128 | */
129 | /**************************************************************************/
130 | void Adafruit_SSD1619::begin(bool reset) {
131 | Adafruit_EPD::begin(reset);
132 | setBlackBuffer(0, true); // black defaults to inverted
133 | setColorBuffer(1, false); // red defaults to un inverted
134 | powerDown();
135 | }
136 |
137 | /**************************************************************************/
138 | /*!
139 | @brief signal the display to update
140 | */
141 | /**************************************************************************/
142 | void Adafruit_SSD1619::update() {
143 | uint8_t buf[1];
144 |
145 | // display update sequence
146 | // buf[0] = 0x40;
147 | // EPD_command(SSD1619_DISP_CTRL1, buf, 1);
148 | buf[0] = 0xC7;
149 | EPD_command(SSD1619_DISP_CTRL2, buf, 1);
150 |
151 | EPD_command(SSD1619_MASTER_ACTIVATE);
152 | busy_wait();
153 |
154 | if (_busy_pin <= -1) {
155 | delay(1000);
156 | }
157 | }
158 |
159 | /**************************************************************************/
160 | /*!
161 | @brief start up the display
162 | */
163 | /**************************************************************************/
164 | void Adafruit_SSD1619::powerUp() {
165 | uint8_t buf[5];
166 |
167 | hardwareReset();
168 | delay(100);
169 | busy_wait();
170 |
171 | const uint8_t *init_code = ssd1619_default_init_code;
172 |
173 | if (_epd_init_code != NULL) {
174 | init_code = _epd_init_code;
175 | }
176 | EPD_commandList(init_code);
177 |
178 | // Set display size and driver output control
179 | buf[0] = (WIDTH - 1);
180 | buf[1] = (WIDTH - 1) >> 8;
181 | buf[2] = 0x00;
182 | EPD_command(SSD1619_DRIVER_CONTROL, buf, 3);
183 |
184 | setRAMWindow(0, 0, HEIGHT - 1, WIDTH - 1);
185 | }
186 |
187 | /**************************************************************************/
188 | /*!
189 | @brief wind down the display
190 | */
191 | /**************************************************************************/
192 | void Adafruit_SSD1619::powerDown() {
193 | uint8_t buf[1];
194 | // Only deep sleep if we can get out of it
195 | if (_reset_pin >= 0) {
196 | // deep sleep
197 | buf[0] = 0x01;
198 | EPD_command(SSD1619_DEEP_SLEEP, buf, 1);
199 | delay(100);
200 | } else {
201 | EPD_command(SSD1619_SW_RESET);
202 | busy_wait();
203 | }
204 | }
205 |
206 | /**************************************************************************/
207 | /*!
208 | @brief Send the specific command to start writing to EPD display RAM
209 | @param index The index for which buffer to write (0 or 1 or tri-color
210 | displays) Ignored for monochrome displays.
211 | @returns The byte that is read from SPI at the same time as sending the
212 | command
213 | */
214 | /**************************************************************************/
215 | uint8_t Adafruit_SSD1619::writeRAMCommand(uint8_t index) {
216 | if (index == 0) {
217 | return EPD_command(SSD1619_WRITE_RAM1, false);
218 | }
219 | if (index == 1) {
220 | return EPD_command(SSD1619_WRITE_RAM2, false);
221 | }
222 | return 0;
223 | }
224 |
225 | /**************************************************************************/
226 | /*!
227 | @brief Some displays require setting the RAM address pointer
228 | @param x X address counter value
229 | @param y Y address counter value
230 | */
231 | /**************************************************************************/
232 | void Adafruit_SSD1619::setRAMAddress(uint16_t x, uint16_t y) {
233 | (void)x;
234 | (void)y;
235 |
236 | uint8_t buf[2];
237 |
238 | // set RAM x address count
239 | buf[0] = 0x00;
240 | EPD_command(SSD1619_SET_RAMXCOUNT, buf, 1);
241 |
242 | // set RAM y address count
243 | buf[0] = 0x0;
244 | buf[1] = 0x0;
245 | EPD_command(SSD1619_SET_RAMYCOUNT, buf, 2);
246 | }
247 |
248 | /**************************************************************************/
249 | /*!
250 | @brief Some displays require setting the RAM address pointer
251 | @param x X address counter value
252 | @param y Y address counter value
253 | */
254 | /**************************************************************************/
255 | void Adafruit_SSD1619::setRAMWindow(uint16_t x1, uint16_t y1, uint16_t x2,
256 | uint16_t y2) {
257 | uint8_t buf[5];
258 |
259 | // Set ram X start/end postion
260 | buf[0] = x1 / 8;
261 | buf[1] = x2 / 8;
262 | EPD_command(SSD1619_SET_RAMXPOS, buf, 2);
263 |
264 | // Set ram Y start/end postion
265 | buf[0] = y1;
266 | buf[1] = y1 >> 8;
267 | buf[2] = y2;
268 | buf[3] = y2 >> 8;
269 | EPD_command(SSD1619_SET_RAMYPOS, buf, 4);
270 | }
271 |
--------------------------------------------------------------------------------
/src/drivers/Adafruit_SSD1619.h:
--------------------------------------------------------------------------------
1 | #ifndef LIB_ADAFRUIT_SSD1619
2 | #define LIB_ADAFRUIT_SSD1619
3 |
4 | #include "Adafruit_EPD.h"
5 | #include
6 |
7 | #define SSD1619_DRIVER_CONTROL 0x01
8 | #define SSD1619_GATE_VOLTAGE 0x03
9 | #define SSD1619_SOURCE_VOLTAGE 0x04
10 | #define SSD1619_PROGOTP_INITIAL 0x08
11 | #define SSD1619_PROGREG_INITIAL 0x09
12 | #define SSD1619_READREG_INITIAL 0x0A
13 | #define SSD1619_BOOST_SOFTSTART 0x0C
14 | #define SSD1619_DEEP_SLEEP 0x10
15 | #define SSD1619_DATA_MODE 0x11
16 | #define SSD1619_SW_RESET 0x12
17 | #define SSD1619_TEMP_CONTROL 0x18
18 | #define SSD1619_TEMP_WRITE 0x1A
19 | #define SSD1619_MASTER_ACTIVATE 0x20
20 | #define SSD1619_DISP_CTRL1 0x21
21 | #define SSD1619_DISP_CTRL2 0x22
22 | #define SSD1619_WRITE_RAM1 0x24
23 | #define SSD1619_WRITE_RAM2 0x26
24 | #define SSD1619_WRITE_VCOM 0x2C
25 | #define SSD1619_READ_OTP 0x2D
26 | #define SSD1619_READ_STATUS 0x2F
27 | #define SSD1619_WRITE_LUT 0x32
28 | #define SSD1619_WRITE_BORDER 0x3C
29 | #define SSD1619_SET_RAMXPOS 0x44
30 | #define SSD1619_SET_RAMYPOS 0x45
31 | #define SSD1619_SET_RAMXCOUNT 0x4E
32 | #define SSD1619_SET_RAMYCOUNT 0x4F
33 | #define SSD1619_SET_ANALOGBLOCK 0x74
34 | #define SSD1619_SET_DIGITALBLOCK 0x7E
35 |
36 | /**************************************************************************/
37 | /*!
38 | @brief Class for interfacing with SSD1619 EPD drivers
39 | */
40 | /**************************************************************************/
41 | class Adafruit_SSD1619 : public Adafruit_EPD {
42 | public:
43 | Adafruit_SSD1619(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
44 | int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
45 | int16_t BUSY = -1);
46 | Adafruit_SSD1619(int width, int height, int16_t DC, int16_t RST, int16_t CS,
47 | int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
48 |
49 | void begin(bool reset = true);
50 | void powerUp();
51 | void update(void);
52 | void powerDown();
53 |
54 | protected:
55 | uint8_t writeRAMCommand(uint8_t index);
56 | void setRAMAddress(uint16_t x, uint16_t y);
57 | void setRAMWindow(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
58 | void busy_wait();
59 | };
60 |
61 | #endif
62 |
--------------------------------------------------------------------------------
/src/drivers/Adafruit_SSD1675.h:
--------------------------------------------------------------------------------
1 | #ifndef LIB_ADAFRUIT_SSD1675
2 | #define LIB_ADAFRUIT_SSD1675
3 |
4 | #include "Adafruit_EPD.h"
5 | #include
6 |
7 | #define SSD1675_DRIVER_CONTROL 0x01
8 | #define SSD1675_GATE_VOLTAGE 0x03
9 | #define SSD1675_SOURCE_VOLTAGE 0x04
10 | #define SSD1675_DEEP_SLEEP 0x10
11 | #define SSD1675_DATA_MODE 0x11
12 | #define SSD1675_SW_RESET 0x12
13 | #define SSD1675_HV_READY 0x14
14 | #define SSD1675_VCI_READY 0x15
15 | #define SSD1675_TEMP_WRITE 0x1A
16 | #define SSD1675_MASTER_ACTIVATE 0x20
17 | #define SSD1675_DISP_CTRL1 0x21
18 | #define SSD1675_DISP_CTRL2 0x22
19 | #define SSD1675_WRITE_RAM1 0x24
20 | #define SSD1675_WRITE_RAM2 0x26
21 | #define SSD1675_WRITE_VCOM 0x2C
22 | #define SSD1675_READ_OTP 0x2D
23 | #define SSD1675_READ_STATUS 0x2F
24 | #define SSD1675_WRITE_LUT 0x32
25 | #define SSD1675_WRITE_DUMMY 0x3A
26 | #define SSD1675_WRITE_GATELINE 0x3B
27 | #define SSD1675_WRITE_BORDER 0x3C
28 | #define SSD1675_SET_RAMXPOS 0x44
29 | #define SSD1675_SET_RAMYPOS 0x45
30 | #define SSD1675_SET_RAMXCOUNT 0x4E
31 | #define SSD1675_SET_RAMYCOUNT 0x4F
32 | #define SSD1675_SET_ANALOGBLOCK 0x74
33 | #define SSD1675_SET_DIGITALBLOCK 0x7E
34 |
35 | /**************************************************************************/
36 | /*!
37 | @brief Class for interfacing with SSD1675 EPD drivers
38 | */
39 | /**************************************************************************/
40 | class Adafruit_SSD1675 : public Adafruit_EPD {
41 | public:
42 | Adafruit_SSD1675(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
43 | int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
44 | int16_t BUSY = -1);
45 | Adafruit_SSD1675(int width, int height, int16_t DC, int16_t RST, int16_t CS,
46 | int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
47 |
48 | void begin(bool reset = true);
49 | void powerUp();
50 | void update();
51 | void powerDown();
52 |
53 | protected:
54 | uint8_t writeRAMCommand(uint8_t index);
55 | void setRAMAddress(uint16_t x, uint16_t y);
56 | void busy_wait();
57 | };
58 |
59 | #endif
60 |
--------------------------------------------------------------------------------
/src/drivers/Adafruit_SSD1675B.h:
--------------------------------------------------------------------------------
1 | #ifndef LIB_ADAFRUIT_SSD1675B
2 | #define LIB_ADAFRUIT_SSD1675B
3 |
4 | #include "Adafruit_EPD.h"
5 | #include
6 |
7 | #define SSD1675B_DRIVER_CONTROL 0x01
8 | #define SSD1675B_GATE_VOLTAGE 0x03
9 | #define SSD1675B_SOURCE_VOLTAGE 0x04
10 | #define SSD1675B_DEEP_SLEEP 0x10
11 | #define SSD1675B_DATA_MODE 0x11
12 | #define SSD1675B_SW_RESET 0x12
13 | #define SSD1675B_HV_READY 0x14
14 | #define SSD1675B_VCI_READY 0x15
15 | #define SSD1675B_TEMP_WRITE 0x1A
16 | #define SSD1675B_MASTER_ACTIVATE 0x20
17 | #define SSD1675B_DISP_CTRL1 0x21
18 | #define SSD1675B_DISP_CTRL2 0x22
19 | #define SSD1675B_WRITE_RAM1 0x24
20 | #define SSD1675B_WRITE_RAM2 0x26
21 | #define SSD1675B_WRITE_VCOM 0x2C
22 | #define SSD1675B_READ_OTP 0x2D
23 | #define SSD1675B_READ_STATUS 0x2F
24 | #define SSD1675B_WRITE_LUT 0x32
25 | #define SSD1675B_WRITE_DUMMY 0x3A
26 | #define SSD1675B_WRITE_GATELINE 0x3B
27 | #define SSD1675B_WRITE_BORDER 0x3C
28 | #define SSD1675B_SET_RAMXPOS 0x44
29 | #define SSD1675B_SET_RAMYPOS 0x45
30 | #define SSD1675B_SET_RAMXCOUNT 0x4E
31 | #define SSD1675B_SET_RAMYCOUNT 0x4F
32 | #define SSD1675B_SET_ANALOGBLOCK 0x74
33 | #define SSD1675B_SET_DIGITALBLOCK 0x7E
34 |
35 | /**************************************************************************/
36 | /*!
37 | @brief Class for interfacing with SSD1675 EPD drivers
38 | */
39 | /**************************************************************************/
40 | class Adafruit_SSD1675B : public Adafruit_EPD {
41 | public:
42 | Adafruit_SSD1675B(int width, int height, int16_t SID, int16_t SCLK,
43 | int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
44 | int16_t MISO, int16_t BUSY = -1);
45 | Adafruit_SSD1675B(int width, int height, int16_t DC, int16_t RST, int16_t CS,
46 | int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
47 |
48 | void begin(bool reset = true);
49 | void powerUp();
50 | void update();
51 | void powerDown();
52 |
53 | protected:
54 | uint8_t writeRAMCommand(uint8_t index);
55 | void setRAMAddress(uint16_t x, uint16_t y);
56 | void busy_wait();
57 | };
58 |
59 | #endif
60 |
--------------------------------------------------------------------------------
/src/drivers/Adafruit_SSD1680.cpp:
--------------------------------------------------------------------------------
1 | #include "Adafruit_SSD1680.h"
2 | #include "Adafruit_EPD.h"
3 |
4 | #define EPD_RAM_BW 0x10
5 | #define EPD_RAM_RED 0x13
6 |
7 | #define BUSY_WAIT 500
8 |
9 | // clang-format off
10 |
11 | const uint8_t ssd1680_default_init_code[] {
12 | SSD1680_SW_RESET, 0, // soft reset
13 | 0xFF, 20, // busy wait
14 | SSD1680_DATA_MODE, 1, 0x03, // Ram data entry mode
15 | SSD1680_WRITE_BORDER, 1, 0x05, // border color
16 |
17 | SSD1680_WRITE_VCOM, 1, 0x36, // Vcom Voltage
18 | SSD1680_GATE_VOLTAGE, 1, 0x17, // Set gate voltage
19 | SSD1680_SOURCE_VOLTAGE, 3, 0x41, 0x00, 0x32, // Set source voltage
20 |
21 | SSD1680_SET_RAMXCOUNT, 1, 1,
22 | SSD1680_SET_RAMYCOUNT, 2, 0, 0,
23 | 0xFE};
24 |
25 | // clang-format on
26 |
27 | /**************************************************************************/
28 | /*!
29 | @brief constructor if using external SRAM chip and software SPI
30 | @param width the width of the display in pixels
31 | @param height the height of the display in pixels
32 | @param SID the SID pin to use
33 | @param SCLK the SCLK pin to use
34 | @param DC the data/command pin to use
35 | @param RST the reset pin to use
36 | @param CS the chip select pin to use
37 | @param SRCS the SRAM chip select pin to use
38 | @param MISO the MISO pin to use
39 | @param BUSY the busy pin to use
40 | */
41 | /**************************************************************************/
42 | Adafruit_SSD1680::Adafruit_SSD1680(int width, int height, int16_t SID,
43 | int16_t SCLK, int16_t DC, int16_t RST,
44 | int16_t CS, int16_t SRCS, int16_t MISO,
45 | int16_t BUSY)
46 | : Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
47 | if ((height % 8) != 0) {
48 | height += 8 - (height % 8);
49 | }
50 |
51 | buffer1_size = width * height / 8;
52 | buffer2_size = buffer1_size;
53 |
54 | if (SRCS >= 0) {
55 | use_sram = true;
56 | buffer1_addr = 0;
57 | buffer2_addr = buffer1_size;
58 | buffer1 = buffer2 = NULL;
59 | } else {
60 | buffer1 = (uint8_t *)malloc(buffer1_size);
61 | buffer2 = (uint8_t *)malloc(buffer2_size);
62 | }
63 |
64 | singleByteTxns = true;
65 | }
66 |
67 | // constructor for hardware SPI - we indicate DataCommand, ChipSelect, Reset
68 |
69 | /**************************************************************************/
70 | /*!
71 | @brief constructor if using on-chip RAM and hardware SPI
72 | @param width the width of the display in pixels
73 | @param height the height of the display in pixels
74 | @param DC the data/command pin to use
75 | @param RST the reset pin to use
76 | @param CS the chip select pin to use
77 | @param SRCS the SRAM chip select pin to use
78 | @param BUSY the busy pin to use
79 | */
80 | /**************************************************************************/
81 | Adafruit_SSD1680::Adafruit_SSD1680(int width, int height, int16_t DC,
82 | int16_t RST, int16_t CS, int16_t SRCS,
83 | int16_t BUSY, SPIClass *spi)
84 | : Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
85 | if ((height % 8) != 0) {
86 | height += 8 - (height % 8);
87 | }
88 |
89 | buffer1_size = width * height / 8;
90 | buffer2_size = buffer1_size;
91 |
92 | if (SRCS >= 0) {
93 | use_sram = true;
94 | buffer1_addr = 0;
95 | buffer2_addr = buffer1_size;
96 | buffer1 = buffer2 = NULL;
97 | } else {
98 | buffer1 = (uint8_t *)malloc(buffer1_size);
99 | buffer2 = (uint8_t *)malloc(buffer2_size);
100 | }
101 |
102 | singleByteTxns = true;
103 | }
104 |
105 | /**************************************************************************/
106 | /*!
107 | @brief wait for busy signal to end
108 | */
109 | /**************************************************************************/
110 | void Adafruit_SSD1680::busy_wait(void) {
111 | if (_busy_pin >= 0) {
112 | while (digitalRead(_busy_pin)) { // wait for busy low
113 | delay(10);
114 | }
115 | } else {
116 | delay(BUSY_WAIT);
117 | }
118 | }
119 |
120 | /**************************************************************************/
121 | /*!
122 | @brief begin communication with and set up the display.
123 | @param reset if true the reset pin will be toggled.
124 | */
125 | /**************************************************************************/
126 | void Adafruit_SSD1680::begin(bool reset) {
127 | Adafruit_EPD::begin(reset);
128 | setBlackBuffer(0, true); // black defaults to inverted
129 | setColorBuffer(1, false); // red defaults to un inverted
130 | powerDown();
131 | }
132 |
133 | /**************************************************************************/
134 | /*!
135 | @brief signal the display to update
136 | */
137 | /**************************************************************************/
138 | void Adafruit_SSD1680::update() {
139 | uint8_t buf[1];
140 |
141 | // display update sequence
142 | buf[0] = 0xF4;
143 | EPD_command(SSD1680_DISP_CTRL2, buf, 1);
144 |
145 | EPD_command(SSD1680_MASTER_ACTIVATE);
146 | busy_wait();
147 |
148 | if (_busy_pin <= -1) {
149 | delay(1000);
150 | }
151 | }
152 |
153 | /**************************************************************************/
154 | /*!
155 | @brief start up the display
156 | */
157 | /**************************************************************************/
158 | void Adafruit_SSD1680::powerUp() {
159 | uint8_t buf[5];
160 |
161 | hardwareReset();
162 | delay(100);
163 | busy_wait();
164 |
165 | const uint8_t *init_code = ssd1680_default_init_code;
166 |
167 | if (_epd_init_code != NULL) {
168 | init_code = _epd_init_code;
169 | }
170 | EPD_commandList(init_code);
171 |
172 | uint8_t height = HEIGHT;
173 | if ((height % 8) != 0) {
174 | height += 8 - (height % 8);
175 | }
176 |
177 | // Set ram X start/end postion
178 | buf[0] = _xram_offset;
179 | buf[1] = height / 8 - 1 + _xram_offset;
180 | EPD_command(SSD1680_SET_RAMXPOS, buf, 2);
181 |
182 | // Set ram Y start/end postion
183 | buf[0] = 0x00;
184 | buf[1] = 0x00;
185 | buf[2] = (WIDTH - 1);
186 | buf[3] = (WIDTH - 1) >> 8;
187 | EPD_command(SSD1680_SET_RAMYPOS, buf, 4);
188 |
189 | // Set LUT
190 | /*
191 | buf[0] = LUT_DATA[74];
192 | EPD_command(SSD1680_WRITE_LUT, buf, 1);
193 | EPD_command(SSD1680_WRITE_LUT, LUT_DATA, 70);
194 | */
195 |
196 | // Set display size and driver output control
197 | buf[0] = (WIDTH - 1);
198 | buf[1] = (WIDTH - 1) >> 8;
199 | buf[2] = 0x00;
200 | EPD_command(SSD1680_DRIVER_CONTROL, buf, 3);
201 | }
202 |
203 | /**************************************************************************/
204 | /*!
205 | @brief wind down the display
206 | */
207 | /**************************************************************************/
208 | void Adafruit_SSD1680::powerDown() {
209 | uint8_t buf[1];
210 | // Only deep sleep if we can get out of it
211 | if (_reset_pin >= 0) {
212 | // deep sleep
213 | buf[0] = 0x01;
214 | EPD_command(SSD1680_DEEP_SLEEP, buf, 1);
215 | delay(100);
216 | } else {
217 | EPD_command(SSD1680_SW_RESET);
218 | busy_wait();
219 | }
220 | }
221 |
222 | /**************************************************************************/
223 | /*!
224 | @brief Send the specific command to start writing to EPD display RAM
225 | @param index The index for which buffer to write (0 or 1 or tri-color
226 | displays) Ignored for monochrome displays.
227 | @returns The byte that is read from SPI at the same time as sending the
228 | command
229 | */
230 | /**************************************************************************/
231 | uint8_t Adafruit_SSD1680::writeRAMCommand(uint8_t index) {
232 | if (index == 0) {
233 | return EPD_command(SSD1680_WRITE_RAM1, false);
234 | }
235 | if (index == 1) {
236 | return EPD_command(SSD1680_WRITE_RAM2, false);
237 | }
238 | return 0;
239 | }
240 |
241 | /**************************************************************************/
242 | /*!
243 | @brief Some displays require setting the RAM address pointer
244 | @param x X address counter value
245 | @param y Y address counter value
246 | */
247 | /**************************************************************************/
248 | void Adafruit_SSD1680::setRAMAddress(uint16_t x, uint16_t y) {
249 | (void)x;
250 | (void)y;
251 |
252 | uint8_t buf[2];
253 |
254 | // set RAM x address count
255 | buf[0] = _xram_offset;
256 | EPD_command(SSD1680_SET_RAMXCOUNT, buf, 1);
257 |
258 | // set RAM y address count
259 | buf[0] = 0;
260 | buf[1] = 0;
261 | EPD_command(SSD1680_SET_RAMYCOUNT, buf, 2);
262 | }
263 |
--------------------------------------------------------------------------------
/src/drivers/Adafruit_SSD1680.h:
--------------------------------------------------------------------------------
1 | #ifndef LIB_ADAFRUIT_SSD1680
2 | #define LIB_ADAFRUIT_SSD1680
3 |
4 | #include "Adafruit_EPD.h"
5 | #include
6 |
7 | #define SSD1680_DRIVER_CONTROL 0x01
8 | #define SSD1680_GATE_VOLTAGE 0x03
9 | #define SSD1680_SOURCE_VOLTAGE 0x04
10 | #define SSD1680_PROGOTP_INITIAL 0x08
11 | #define SSD1680_PROGREG_INITIAL 0x09
12 | #define SSD1680_READREG_INITIAL 0x0A
13 | #define SSD1680_BOOST_SOFTSTART 0x0C
14 | #define SSD1680_DEEP_SLEEP 0x10
15 | #define SSD1680_DATA_MODE 0x11
16 | #define SSD1680_SW_RESET 0x12
17 | #define SSD1680_TEMP_CONTROL 0x18
18 | #define SSD1680_TEMP_WRITE 0x1A
19 | #define SSD1680_MASTER_ACTIVATE 0x20
20 | #define SSD1680_DISP_CTRL1 0x21
21 | #define SSD1680_DISP_CTRL2 0x22
22 | #define SSD1680_WRITE_RAM1 0x24
23 | #define SSD1680_WRITE_RAM2 0x26
24 | #define SSD1680_WRITE_VCOM 0x2C
25 | #define SSD1680_READ_OTP 0x2D
26 | #define SSD1680_READ_STATUS 0x2F
27 | #define SSD1680_WRITE_LUT 0x32
28 | #define SSD1680_WRITE_BORDER 0x3C
29 | #define SSD1680_SET_RAMXPOS 0x44
30 | #define SSD1680_SET_RAMYPOS 0x45
31 | #define SSD1680_SET_RAMXCOUNT 0x4E
32 | #define SSD1680_SET_RAMYCOUNT 0x4F
33 |
34 | /**************************************************************************/
35 | /*!
36 | @brief Class for interfacing with SSD1680 EPD drivers
37 | */
38 | /**************************************************************************/
39 | class Adafruit_SSD1680 : public Adafruit_EPD {
40 | public:
41 | Adafruit_SSD1680(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
42 | int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
43 | int16_t BUSY = -1);
44 | Adafruit_SSD1680(int width, int height, int16_t DC, int16_t RST, int16_t CS,
45 | int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
46 |
47 | void begin(bool reset = true);
48 | void powerUp();
49 | void update();
50 | void powerDown();
51 |
52 | protected:
53 | uint8_t writeRAMCommand(uint8_t index);
54 | void setRAMAddress(uint16_t x, uint16_t y);
55 | void busy_wait();
56 |
57 | int8_t _xram_offset = 1;
58 | };
59 |
60 | #endif
61 |
--------------------------------------------------------------------------------
/src/drivers/Adafruit_SSD1681.h:
--------------------------------------------------------------------------------
1 | #ifndef LIB_ADAFRUIT_SSD1681
2 | #define LIB_ADAFRUIT_SSD1681
3 |
4 | #include "Adafruit_EPD.h"
5 | #include
6 |
7 | #define SSD1681_DRIVER_CONTROL 0x01
8 | #define SSD1681_GATE_VOLTAGE 0x03
9 | #define SSD1681_SOURCE_VOLTAGE 0x04
10 | #define SSD1681_PROGOTP_INITIAL 0x08
11 | #define SSD1681_PROGREG_INITIAL 0x09
12 | #define SSD1681_READREG_INITIAL 0x0A
13 | #define SSD1681_BOOST_SOFTSTART 0x0C
14 | #define SSD1681_DEEP_SLEEP 0x10
15 | #define SSD1681_DATA_MODE 0x11
16 | #define SSD1681_SW_RESET 0x12
17 | #define SSD1681_TEMP_CONTROL 0x18
18 | #define SSD1681_TEMP_WRITE 0x1A
19 | #define SSD1681_MASTER_ACTIVATE 0x20
20 | #define SSD1681_DISP_CTRL1 0x21
21 | #define SSD1681_DISP_CTRL2 0x22
22 | #define SSD1681_WRITE_RAM1 0x24
23 | #define SSD1681_WRITE_RAM2 0x26
24 | #define SSD1681_WRITE_VCOM 0x2C
25 | #define SSD1681_READ_OTP 0x2D
26 | #define SSD1681_READ_STATUS 0x2F
27 | #define SSD1681_WRITE_LUT 0x32
28 | #define SSD1681_WRITE_BORDER 0x3C
29 | #define SSD1681_SET_RAMXPOS 0x44
30 | #define SSD1681_SET_RAMYPOS 0x45
31 | #define SSD1681_SET_RAMXCOUNT 0x4E
32 | #define SSD1681_SET_RAMYCOUNT 0x4F
33 |
34 | /**************************************************************************/
35 | /*!
36 | @brief Class for interfacing with SSD1681 EPD drivers
37 | */
38 | /**************************************************************************/
39 | class Adafruit_SSD1681 : public Adafruit_EPD {
40 | public:
41 | Adafruit_SSD1681(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
42 | int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
43 | int16_t BUSY = -1);
44 | Adafruit_SSD1681(int width, int height, int16_t DC, int16_t RST, int16_t CS,
45 | int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
46 |
47 | void begin(bool reset = true);
48 | void powerUp();
49 | void update(void);
50 | void updatePartial(void);
51 | void powerDown();
52 | void displayPartial(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
53 |
54 | protected:
55 | uint8_t writeRAMCommand(uint8_t index);
56 | void setRAMAddress(uint16_t x, uint16_t y);
57 | void setRAMWindow(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
58 | void busy_wait();
59 | };
60 |
61 | #endif
62 |
--------------------------------------------------------------------------------
/src/drivers/Adafruit_UC8151D.h:
--------------------------------------------------------------------------------
1 | #ifndef LIB_ADAFRUIT_UC8151D
2 | #define LIB_ADAFRUIT_UC8151D
3 |
4 | #include "Adafruit_EPD.h"
5 | #include
6 |
7 | #define UC8151D_PSR 0x00
8 | #define UC8151D_PWR 0x01
9 | #define UC8151D_POF 0x02
10 | #define UC8151D_PFS 0x03
11 | #define UC8151D_PON 0x04
12 | #define UC8151D_PMEAS 0x05
13 | #define UC8151D_BTST 0x06
14 | #define UC8151D_DSLP 0x07
15 | #define UC8151D_DTM1 0x10
16 | #define UC8151D_DSP 0x11
17 | #define UC8151D_DRF 0x12
18 | #define UC8151D_DTM2 0x13
19 | #define UC8151D_AUTO 0x17
20 | #define UC8151D_LUTOPT 0x2A
21 | #define UC8151D_PLL 0x30
22 | #define UC8151D_TSC 0x40
23 | #define UC8151D_TSE 0x41
24 | #define UC8151D_TSW 0x42
25 | #define UC8151D_TSR 0x43
26 | #define UC8151D_PBC 0x44
27 | #define UC8151D_CDI 0x50
28 | #define UC8151D_LPD 0x51
29 | #define UC8151D_TRES 0x65
30 | #define UC8151D_GSST 0x70
31 | #define UC8151D_REV 0x70
32 | #define UC8151D_FLG 0x71
33 | #define UC8151D_AMV 0x80
34 | #define UC8151D_VV 0x81
35 | #define UC8151D_VDCS 0x82
36 | #define UC8151D_PTL 0x90
37 | #define UC8151D_PTIN 0x91
38 | #define UC8151D_PTOUT 0x92
39 | #define UC8151D_PGM 0xA0
40 | #define UC8151D_APG 0xA1
41 | #define UC8151D_ROTP 0xA2
42 | #define UC8151D_CCSET 0xE0
43 | #define UC8151D_PWS 0xE3
44 | #define UC8151D_LVSEL 0xE4
45 | #define UC8151D_TSSET 0xE5
46 |
47 | // clang-format off
48 |
49 | const uint8_t uc8151d_monofull_init_code[] {
50 | UC8151D_PON, 0,
51 | 0xFF, 10,
52 | UC8151D_PSR, 1, 0x1F,
53 | UC8151D_CDI, 1, 0x97,
54 | 0xFE};
55 |
56 | const uint8_t uc8151d_trifull_init_code[] {
57 | UC8151D_PON, 0,
58 | 0xFF, 10,
59 | UC8151D_PSR, 2, 0x0F, 0x89,
60 | 0x61, 3, 0x80, 0x01, 0x28,
61 | UC8151D_CDI, 1, 0x77,
62 | 0xFE};
63 |
64 |
65 | const uint8_t uc8151d_partial_init_code[] {
66 | UC8151D_PWR, 5, 0x03, 0x00, 0x2B, 0x2B, 0x03, //POWER SETTING
67 | UC8151D_BTST, 3, 0x17, 0x17, 0x17, //boost soft start
68 | UC8151D_PON, 0,
69 | 0xFF, 10,
70 | UC8151D_PSR, 1, 0xBF, //LUT from OTP 128x296
71 | UC8151D_PLL, 1, 0x3C, // 3A 100HZ 29 150Hz 39 200HZ 31 171HZ
72 | 0x61, 3, 0x80, 0x01, 0x28, //resolution setting
73 | UC8151D_VDCS, 1, 0x12, //vcom_DC setting
74 | UC8151D_CDI, 1, 0x47,
75 | 0xFE};
76 |
77 | const uint8_t uc8151d_partialmono_lut[] = {
78 | // const unsigned char lut_vcom1[]
79 | 0x20, 44,
80 | 0x00 ,0x19 ,0x01 ,0x00 ,0x00 ,0x01,
81 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
82 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
83 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
84 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
85 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
86 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00
87 | ,0x00 ,0x00,
88 |
89 | // const unsigned char lut_ww1[]
90 | 0x21, 42,
91 | 0x00 ,0x19 ,0x01 ,0x00 ,0x00 ,0x01,
92 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
93 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
94 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
95 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
96 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
97 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
98 | // const unsigned char lut_bw1[]
99 | 0x22, 42,
100 | 0x80 ,0x19 ,0x01 ,0x00 ,0x00 ,0x01,
101 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
102 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
103 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
104 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
105 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
106 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
107 | // const unsigned char lut_wb1[]
108 | 0x23, 42,
109 | 0x40 ,0x19 ,0x01 ,0x00 ,0x00 ,0x01,
110 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
111 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
112 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
113 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
114 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
115 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
116 | // const unsigned char lut_bb1[]
117 | 0x24, 42,
118 | 0x00 ,0x19 ,0x01 ,0x00 ,0x00 ,0x01,
119 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
120 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
121 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
122 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
123 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
124 | 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00,
125 |
126 | 0xFE // EOM
127 | };
128 |
129 | // clang-format on
130 |
131 | /**************************************************************************/
132 | /*!
133 | @brief Class for interfacing with UC8151D EPD drivers
134 | */
135 | /**************************************************************************/
136 | class Adafruit_UC8151D : public Adafruit_EPD {
137 | public:
138 | Adafruit_UC8151D(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
139 | int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
140 | int16_t BUSY = -1);
141 | Adafruit_UC8151D(int width, int height, int16_t DC, int16_t RST, int16_t CS,
142 | int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
143 |
144 | void begin(bool reset = true);
145 | void powerUp();
146 | void powerDown();
147 | void update();
148 |
149 | void displayPartial(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
150 |
151 | protected:
152 | uint8_t writeRAMCommand(uint8_t index);
153 | void setRAMAddress(uint16_t x, uint16_t y);
154 | void busy_wait();
155 | };
156 |
157 | #endif
158 |
--------------------------------------------------------------------------------
/src/drivers/Adafruit_UC8276.cpp:
--------------------------------------------------------------------------------
1 | #include "Adafruit_UC8276.h"
2 | #include "Adafruit_EPD.h"
3 |
4 | #define EPD_RAM_BW 0x10
5 | #define EPD_RAM_RED 0x13
6 |
7 | #define BUSY_WAIT 500
8 |
9 | // clang-format off
10 |
11 | const uint8_t uc8276_default_init_code[] {
12 | UC8276_POWERON, 0, // soft reset
13 | 0xFF, 20, // busy wait
14 | UC8276_PANELSETTING, 1, 0x0f, // LUT from OTP
15 | UC8276_WRITE_VCOM, 1, 0xD7,
16 | 0xFE};
17 |
18 | // clang-format on
19 |
20 | /**************************************************************************/
21 | /*!
22 | @brief constructor if using external SRAM chip and software SPI
23 | @param width the width of the display in pixels
24 | @param height the height of the display in pixels
25 | @param SID the SID pin to use
26 | @param SCLK the SCLK pin to use
27 | @param DC the data/command pin to use
28 | @param RST the reset pin to use
29 | @param CS the chip select pin to use
30 | @param SRCS the SRAM chip select pin to use
31 | @param MISO the MISO pin to use
32 | @param BUSY the busy pin to use
33 | */
34 | /**************************************************************************/
35 | Adafruit_UC8276::Adafruit_UC8276(int width, int height, int16_t SID,
36 | int16_t SCLK, int16_t DC, int16_t RST,
37 | int16_t CS, int16_t SRCS, int16_t MISO,
38 | int16_t BUSY)
39 | : Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
40 | if ((height % 8) != 0) {
41 | height += 8 - (height % 8);
42 | }
43 |
44 | buffer1_size = width * height / 8;
45 | buffer2_size = buffer1_size;
46 |
47 | if (SRCS >= 0) {
48 | use_sram = true;
49 | buffer1_addr = 0;
50 | buffer2_addr = buffer1_size;
51 | buffer1 = buffer2 = NULL;
52 | } else {
53 | buffer1 = (uint8_t *)malloc(buffer1_size);
54 | buffer2 = (uint8_t *)malloc(buffer2_size);
55 | }
56 |
57 | singleByteTxns = true;
58 | }
59 |
60 | // constructor for hardware SPI - we indicate DataCommand, ChipSelect, Reset
61 |
62 | /**************************************************************************/
63 | /*!
64 | @brief constructor if using on-chip RAM and hardware SPI
65 | @param width the width of the display in pixels
66 | @param height the height of the display in pixels
67 | @param DC the data/command pin to use
68 | @param RST the reset pin to use
69 | @param CS the chip select pin to use
70 | @param SRCS the SRAM chip select pin to use
71 | @param BUSY the busy pin to use
72 | */
73 | /**************************************************************************/
74 | Adafruit_UC8276::Adafruit_UC8276(int width, int height, int16_t DC, int16_t RST,
75 | int16_t CS, int16_t SRCS, int16_t BUSY,
76 | SPIClass *spi)
77 | : Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
78 | if ((height % 8) != 0) {
79 | height += 8 - (height % 8);
80 | }
81 |
82 | buffer1_size = width * height / 8;
83 | buffer2_size = buffer1_size;
84 |
85 | if (SRCS >= 0) {
86 | use_sram = true;
87 | buffer1_addr = 0;
88 | buffer2_addr = buffer1_size;
89 | buffer1 = buffer2 = NULL;
90 | } else {
91 | buffer1 = (uint8_t *)malloc(buffer1_size);
92 | buffer2 = (uint8_t *)malloc(buffer2_size);
93 | }
94 |
95 | singleByteTxns = true;
96 | }
97 |
98 | /**************************************************************************/
99 | /*!
100 | @brief wait for busy signal to end
101 | */
102 | /**************************************************************************/
103 | void Adafruit_UC8276::busy_wait(void) {
104 | if (_busy_pin >= 0) {
105 | while (!digitalRead(_busy_pin)) { // wait for busy HIGH
106 | EPD_command(UC8276_GET_STATUS);
107 | delay(100);
108 | }
109 | } else {
110 | delay(BUSY_WAIT);
111 | }
112 | delay(200);
113 | }
114 |
115 | /**************************************************************************/
116 | /*!
117 | @brief begin communication with and set up the display.
118 | @param reset if true the reset pin will be toggled.
119 | */
120 | /**************************************************************************/
121 | void Adafruit_UC8276::begin(bool reset) {
122 | Adafruit_EPD::begin(reset);
123 | setBlackBuffer(0, true); // black defaults to inverted
124 | setColorBuffer(1, false); // red defaults to un inverted
125 | powerDown();
126 | }
127 |
128 | /**************************************************************************/
129 | /*!
130 | @brief signal the display to update
131 | */
132 | /**************************************************************************/
133 | void Adafruit_UC8276::update() {
134 | EPD_command(UC8276_DISPLAYREFRESH);
135 | delay(100);
136 | busy_wait();
137 |
138 | if (_busy_pin <= -1) {
139 | delay(default_refresh_delay);
140 | }
141 | }
142 |
143 | /**************************************************************************/
144 | /*!
145 | @brief start up the display
146 | */
147 | /**************************************************************************/
148 | void Adafruit_UC8276::powerUp() {
149 | hardwareReset();
150 |
151 | const uint8_t *init_code = uc8276_default_init_code;
152 |
153 | if (_epd_init_code != NULL) {
154 | init_code = _epd_init_code;
155 | }
156 | EPD_commandList(init_code);
157 | }
158 |
159 | /**************************************************************************/
160 | /*!
161 | @brief wind down the display
162 | */
163 | /**************************************************************************/
164 | void Adafruit_UC8276::powerDown() {
165 | uint8_t buf[1];
166 | // disable VCOM
167 | buf[0] = 0xF7;
168 | EPD_command(UC8276_WRITE_VCOM, buf, 1);
169 | EPD_command(UC8276_POWEROFF);
170 | busy_wait();
171 |
172 | // Only deep sleep if we can get out of it
173 | if (_reset_pin >= 0) {
174 | buf[0] = 0xA5;
175 | EPD_command(UC8276_DEEPSLEEP, buf, 1);
176 | }
177 | }
178 |
179 | /**************************************************************************/
180 | /*!
181 | @brief Send the specific command to start writing to EPD display RAM
182 | @param index The index for which buffer to write (0 or 1 or tri-color
183 | displays) Ignored for monochrome displays.
184 | @returns The byte that is read from SPI at the same time as sending the
185 | command
186 | */
187 | /**************************************************************************/
188 | uint8_t Adafruit_UC8276::writeRAMCommand(uint8_t index) {
189 | if (index == 0) {
190 | return EPD_command(UC8276_WRITE_RAM1, false);
191 | }
192 | if (index == 1) {
193 | return EPD_command(UC8276_WRITE_RAM2, false);
194 | }
195 | return 0;
196 | }
197 |
198 | /**************************************************************************/
199 | /*!
200 | @brief Some displays require setting the RAM address pointer
201 | @param x X address counter value
202 | @param y Y address counter value
203 | */
204 | /**************************************************************************/
205 | void Adafruit_UC8276::setRAMAddress(uint16_t x, uint16_t y) {
206 | // not used in this chip!
207 | (void)x;
208 | (void)y;
209 | }
210 |
211 | /**************************************************************************/
212 | /*!
213 | @brief Some displays require setting the RAM address pointer
214 | @param x X address counter value
215 | @param y Y address counter value
216 | */
217 | /**************************************************************************/
218 | void Adafruit_UC8276::setRAMWindow(uint16_t x1, uint16_t y1, uint16_t x2,
219 | uint16_t y2) {
220 | // not used in this chip!
221 | (void)x1;
222 | (void)y1;
223 | (void)x2;
224 | (void)y2;
225 | }
226 |
--------------------------------------------------------------------------------
/src/drivers/Adafruit_UC8276.h:
--------------------------------------------------------------------------------
1 | #ifndef LIB_ADAFRUIT_UC8276
2 | #define LIB_ADAFRUIT_UC8276
3 |
4 | #include "Adafruit_EPD.h"
5 | #include
6 |
7 | #define UC8276_PANELSETTING 0x00
8 | #define UC8276_POWEROFF 0x02
9 | #define UC8276_POWERON 0x04
10 | #define UC8276_DEEPSLEEP 0x07
11 | #define UC8276_DISPLAYREFRESH 0x12
12 | #define UC8276_WRITE_RAM1 0x10
13 | #define UC8276_WRITE_RAM2 0x13
14 | #define UC8276_WRITE_VCOM 0x50
15 | #define UC8276_GET_STATUS 0x71
16 |
17 | /**************************************************************************/
18 | /*!
19 | @brief Class for interfacing with UC8276 EPD drivers
20 | */
21 | /**************************************************************************/
22 | class Adafruit_UC8276 : public Adafruit_EPD {
23 | public:
24 | Adafruit_UC8276(int width, int height, int16_t SID, int16_t SCLK, int16_t DC,
25 | int16_t RST, int16_t CS, int16_t SRCS, int16_t MISO,
26 | int16_t BUSY = -1);
27 | Adafruit_UC8276(int width, int height, int16_t DC, int16_t RST, int16_t CS,
28 | int16_t SRCS, int16_t BUSY = -1, SPIClass *spi = &SPI);
29 |
30 | void begin(bool reset = true);
31 | void powerUp();
32 | void update(void);
33 | void powerDown();
34 |
35 | protected:
36 | uint8_t writeRAMCommand(uint8_t index);
37 | void setRAMAddress(uint16_t x, uint16_t y);
38 | void setRAMWindow(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
39 | void busy_wait();
40 | };
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_154_Grayscale4_T8.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_154_GRAYSCALE4_T8_H
2 | #define _THINKINK_154_GRAYSCALE4_T8_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | // clang-format off
8 |
9 | static const uint8_t ti_154t8_gray4_init_code[] {
10 | IL0373_POWER_SETTING, 5, 0x03, 0x00, 0x2b, 0x2b, 0x13,
11 | IL0373_BOOSTER_SOFT_START, 3, 0x17, 0x17, 0x17,
12 | IL0373_POWER_ON, 0,
13 | 0xFF, 200,
14 | IL0373_PANEL_SETTING, 1, 0x3F,
15 | IL0373_PLL, 1, 0x3C,
16 | IL0373_VCM_DC_SETTING, 1, 0x12,
17 | IL0373_CDI, 1, 0x97,
18 | 0xFE // EOM
19 | };
20 |
21 | static const uint8_t ti_154t8_monopart_init_code[] {
22 | IL0373_POWER_SETTING, 5, 0x03, 0x00, 0x2b, 0x2b, 0x03,
23 | IL0373_BOOSTER_SOFT_START, 3, 0x17, 0x17, 0x17,
24 | IL0373_POWER_ON, 0,
25 | 0xFF, 200,
26 | IL0373_PANEL_SETTING, 2, 0xbF, 0x0d,
27 | IL0373_PLL, 1, 0x3C,
28 | IL0373_VCM_DC_SETTING, 1, 0x12,
29 | IL0373_CDI, 1, 0x47,
30 | 0xFE // EOM
31 | };
32 |
33 | static const uint8_t ti_154t8_monofull_init_code[] {
34 | IL0373_BOOSTER_SOFT_START, 3, 0x17, 0x17, 0x17,
35 | IL0373_POWER_ON, 0,
36 | 0xFF, 200,
37 | IL0373_PANEL_SETTING, 2, 0x1f, 0x0d,
38 | IL0373_CDI, 1, 0x97,
39 | 0xFE // EOM
40 | };
41 |
42 | static const uint8_t ti_154t8_monopart_lut_code[] = {
43 | // const unsigned char lut_vcom1[]
44 | 0x20, 44,
45 | 0x00, 0x01, 0x0E, 0x00, 0x00, 0x01,
46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
48 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
49 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
50 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
51 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
52 | 0x00, 0x00,
53 | // const unsigned char lut_ww1[]
54 | 0x21, 42,
55 | 0x00, 0x01, 0x0E, 0x00, 0x00, 0x01,
56 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
57 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
58 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
59 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
60 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
61 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
62 | // const unsigned char lut_bw1[]
63 | 0x22, 42,
64 | 0x20, 0x01, 0x0E, 0x00, 0x00, 0x01,
65 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
66 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
67 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
68 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
69 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
70 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
71 | // const unsigned char lut_wb1[]
72 | 0x23, 42,
73 | 0x10, 0x01, 0x0E, 0x00, 0x00, 0x01,
74 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
75 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
76 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
77 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
78 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
79 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
80 | // const unsigned char lut_bb1[]
81 | 0x24, 42,
82 | 0x00, 0x01, 0x0E, 0x00, 0x00, 0x01,
83 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
84 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
85 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
86 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
87 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
88 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
89 |
90 | 0xFE // EOM
91 | };
92 |
93 | static const uint8_t ti_154t8_gray4_lut_code[] = {
94 | //const unsigned char lut_vcom[] =
95 | 0x20, 42,
96 | 0x00, 0x0A, 0x00, 0x00, 0x00, 0x01,
97 | 0x60, 0x14, 0x14, 0x00, 0x00, 0x01,
98 | 0x00, 0x14, 0x00, 0x00, 0x00, 0x01,
99 | 0x00, 0x13, 0x0A, 0x01, 0x00, 0x01,
100 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
101 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
102 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
103 |
104 | //const unsigned char lut_ww[] ={
105 | 0x21, 42,
106 | 0x40, 0x0A, 0x00, 0x00, 0x00, 0x01,
107 | 0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
108 | 0x10, 0x14, 0x0A, 0x00, 0x00, 0x01,
109 | 0xA0, 0x13, 0x01, 0x00, 0x00, 0x01,
110 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
111 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
112 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
113 |
114 | //const unsigned char lut_bw[] ={
115 | 0x22, 42,
116 | 0x40, 0x0A, 0x00, 0x00, 0x00, 0x01,
117 | 0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
118 | 0x00, 0x14, 0x0A, 0x00, 0x00, 0x01,
119 | 0x99, 0x0C, 0x01, 0x03, 0x04, 0x01,
120 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
121 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
122 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
123 |
124 | //const unsigned char lut_wb[] ={
125 | 0x23, 42,
126 | 0x40, 0x0A, 0x00, 0x00, 0x00, 0x01,
127 | 0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
128 | 0x00, 0x14, 0x0A, 0x00, 0x00, 0x01,
129 | 0x99, 0x0B, 0x04, 0x04, 0x01, 0x01,
130 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
131 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
132 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
133 |
134 | //const unsigned char lut_bb[] ={
135 | 0x24, 42,
136 | 0x80, 0x0A, 0x00, 0x00, 0x00, 0x01,
137 | 0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
138 | 0x20, 0x14, 0x0A, 0x00, 0x00, 0x01,
139 | 0x50, 0x13, 0x01, 0x00, 0x00, 0x01,
140 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
141 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
142 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
143 |
144 | 0xFE // EOM
145 | };
146 |
147 | // clang-format on
148 |
149 | class ThinkInk_154_Grayscale4_T8 : public Adafruit_IL0373 {
150 | public:
151 | ThinkInk_154_Grayscale4_T8(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
152 | int16_t CS, int16_t SRCS, int16_t MISO,
153 | int16_t BUSY = -1)
154 | : Adafruit_IL0373(152, 152, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
155 |
156 | ThinkInk_154_Grayscale4_T8(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
157 | int16_t BUSY = -1, SPIClass *spi = &SPI)
158 | : Adafruit_IL0373(152, 152, DC, RST, CS, SRCS, BUSY, spi){};
159 |
160 | void begin(thinkinkmode_t mode = THINKINK_GRAYSCALE4) {
161 | Adafruit_IL0373::begin(true);
162 | setColorBuffer(0, true); // layer 0 uninverted
163 | setBlackBuffer(1, true); // layer 1 uninverted
164 |
165 | inkmode = mode; // Preserve ink mode for ImageReader or others
166 |
167 | if (mode == THINKINK_GRAYSCALE4) {
168 | _epd_init_code = ti_154t8_gray4_init_code;
169 | _epd_lut_code = ti_154t8_gray4_lut_code;
170 |
171 | layer_colors[EPD_WHITE] = 0b00;
172 | layer_colors[EPD_BLACK] = 0b11;
173 | layer_colors[EPD_RED] = 0b01;
174 | layer_colors[EPD_GRAY] = 0b10;
175 | layer_colors[EPD_LIGHT] = 0b01;
176 | layer_colors[EPD_DARK] = 0b10;
177 | } else if (mode == THINKINK_MONO) {
178 | _epd_init_code = ti_154t8_monofull_init_code;
179 | _epd_partial_init_code = ti_154t8_monopart_init_code;
180 | _epd_partial_lut_code = ti_154t8_monopart_lut_code;
181 |
182 | layer_colors[EPD_WHITE] = 0b11;
183 | layer_colors[EPD_BLACK] = 0b01;
184 | layer_colors[EPD_RED] = 0b01;
185 | layer_colors[EPD_GRAY] = 0b01;
186 | layer_colors[EPD_LIGHT] = 0b10;
187 | layer_colors[EPD_DARK] = 0b01;
188 | }
189 |
190 | default_refresh_delay = 1000;
191 | setRotation(3);
192 | powerDown();
193 | }
194 | };
195 |
196 | #endif // _THINKINK_154_GRAYSCALE4_T8_H
197 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_154_Mono_D27.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_154_MONO_D27_H
2 | #define _THINKINK_154_MONO_D27_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | class ThinkInk_154_Mono_D27 : public Adafruit_SSD1608 {
8 | public:
9 | ThinkInk_154_Mono_D27(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
10 | int16_t CS, int16_t SRCS, int16_t MISO,
11 | int16_t BUSY = -1)
12 | : Adafruit_SSD1608(200, 200, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_154_Mono_D27(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
15 | int16_t BUSY = -1, SPIClass *spi = &SPI)
16 | : Adafruit_SSD1608(200, 200, DC, RST, CS, SRCS, BUSY, spi){};
17 |
18 | void begin(thinkinkmode_t mode = THINKINK_MONO) {
19 | Adafruit_SSD1608::begin(true);
20 | setColorBuffer(0, true); // layer 0 uninverted
21 | setBlackBuffer(0, true); // only one buffer
22 |
23 | inkmode = mode; // Preserve ink mode for ImageReader or others
24 |
25 | layer_colors[EPD_WHITE] = 0b00;
26 | layer_colors[EPD_BLACK] = 0b01;
27 | layer_colors[EPD_RED] = 0b01;
28 | layer_colors[EPD_GRAY] = 0b01;
29 | layer_colors[EPD_LIGHT] = 0b00;
30 | layer_colors[EPD_DARK] = 0b01;
31 |
32 | default_refresh_delay = 1000;
33 | setRotation(3);
34 | powerDown();
35 | }
36 | };
37 |
38 | #endif // _THINKINK_154_MONO_D27_H
39 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_154_Mono_D67.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_154_MONO_D67_H
2 | #define _THINKINK_154_MONO_D67_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | class ThinkInk_154_Mono_D67 : public Adafruit_SSD1681 {
8 | public:
9 | ThinkInk_154_Mono_D67(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
10 | int16_t CS, int16_t SRCS, int16_t MISO,
11 | int16_t BUSY = -1)
12 | : Adafruit_SSD1681(200, 200, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_154_Mono_D67(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
15 | int16_t BUSY = -1, SPIClass *spi = &SPI)
16 | : Adafruit_SSD1681(200, 200, DC, RST, CS, SRCS, BUSY, spi){};
17 |
18 | void begin(thinkinkmode_t mode = THINKINK_MONO) {
19 | Adafruit_SSD1681::begin(true);
20 | setColorBuffer(0, true); // layer 0 uninverted
21 | setBlackBuffer(0, true); // only one buffer
22 |
23 | inkmode = mode; // Preserve ink mode for ImageReader or others
24 |
25 | layer_colors[EPD_WHITE] = 0b00;
26 | layer_colors[EPD_BLACK] = 0b01;
27 | layer_colors[EPD_RED] = 0b01;
28 | layer_colors[EPD_GRAY] = 0b01;
29 | layer_colors[EPD_LIGHT] = 0b00;
30 | layer_colors[EPD_DARK] = 0b01;
31 |
32 | default_refresh_delay = 1000;
33 | setRotation(3);
34 | powerDown();
35 | }
36 | };
37 |
38 | #endif // _THINKINK_154_MONO_D67_H
39 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_154_Mono_M10.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_154_MONO_M10_H
2 | #define _THINKINK_154_MONO_M10_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | class ThinkInk_154_Mono_M10 : public Adafruit_UC8151D {
8 | public:
9 | ThinkInk_154_Mono_M10(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
10 | int16_t CS, int16_t SRCS, int16_t MISO,
11 | int16_t BUSY = -1)
12 | : Adafruit_UC8151D(152, 152, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_154_Mono_M10(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
15 | int16_t BUSY = -1, SPIClass *spi = &SPI)
16 | : Adafruit_UC8151D(152, 152, DC, RST, CS, SRCS, BUSY, spi){};
17 |
18 | void begin(thinkinkmode_t mode = THINKINK_MONO) {
19 | Adafruit_UC8151D::begin(true);
20 | setColorBuffer(1, true); // layer 1 uninverted
21 | setBlackBuffer(1, true); // only one buffer
22 |
23 | inkmode = mode; // Preserve ink mode for ImageReader or others
24 |
25 | layer_colors[EPD_WHITE] = 0b00;
26 | layer_colors[EPD_BLACK] = 0b01;
27 | layer_colors[EPD_RED] = 0b01;
28 | layer_colors[EPD_GRAY] = 0b01;
29 | layer_colors[EPD_LIGHT] = 0b00;
30 | layer_colors[EPD_DARK] = 0b01;
31 |
32 | default_refresh_delay = 1000;
33 | setRotation(1);
34 | powerDown();
35 | }
36 | };
37 |
38 | #endif // _THINKINK_154_MONO_M10_H
39 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_154_Tricolor_RW.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_154_TRICOLOR_RW_H
2 | #define _THINKINK_154_TRICOLOR_RW_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | class ThinkInk_154_Tricolor_RW : public Adafruit_SSD1680 {
8 | public:
9 | ThinkInk_154_Tricolor_RW(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
10 | int16_t CS, int16_t SRCS, int16_t MISO,
11 | int16_t BUSY = -1)
12 | : Adafruit_SSD1680(152, 152, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_154_Tricolor_RW(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
15 | int16_t BUSY = -1, SPIClass *spi = &SPI)
16 | : Adafruit_SSD1680(152, 152, DC, RST, CS, SRCS, BUSY, spi){};
17 |
18 | void begin(thinkinkmode_t mode = THINKINK_MONO) {
19 | Adafruit_SSD1680::begin(true);
20 |
21 | inkmode = mode; // Preserve ink mode for ImageReader or others
22 |
23 | layer_colors[EPD_WHITE] = 0b00;
24 | layer_colors[EPD_BLACK] = 0b01;
25 | layer_colors[EPD_RED] = 0b10;
26 | layer_colors[EPD_GRAY] = 0b10;
27 | layer_colors[EPD_LIGHT] = 0b00;
28 | layer_colors[EPD_DARK] = 0b01;
29 |
30 | default_refresh_delay = 13000;
31 | setRotation(3);
32 | powerDown();
33 | }
34 | };
35 |
36 | #endif // _THINKINK_154_TRI
37 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_154_Tricolor_Z17.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_154_TRICOLOR_Z17_H
2 | #define _THINKINK_154_TRICOLOR_Z17_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | class ThinkInk_154_Tricolor_Z17 : public Adafruit_IL0373 {
8 | public:
9 | ThinkInk_154_Tricolor_Z17(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
10 | int16_t CS, int16_t SRCS, int16_t MISO,
11 | int16_t BUSY = -1)
12 | : Adafruit_IL0373(152, 152, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_154_Tricolor_Z17(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
15 | int16_t BUSY = -1, SPIClass *spi = &SPI)
16 | : Adafruit_IL0373(152, 152, DC, RST, CS, SRCS, BUSY, spi){};
17 |
18 | void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
19 | Adafruit_IL0373::begin(true);
20 | setColorBuffer(0, true); // layer 0 uninverted
21 | setBlackBuffer(1, true); // layer 1 uninverted
22 |
23 | inkmode = mode; // Preserve ink mode for ImageReader or others
24 |
25 | layer_colors[EPD_WHITE] = 0b00;
26 | layer_colors[EPD_BLACK] = 0b10;
27 | layer_colors[EPD_RED] = 0b01;
28 | layer_colors[EPD_GRAY] = 0b01;
29 | layer_colors[EPD_LIGHT] = 0b00;
30 | layer_colors[EPD_DARK] = 0b10;
31 |
32 | default_refresh_delay = 16000;
33 |
34 | setRotation(3);
35 | powerDown();
36 | }
37 | };
38 |
39 | #endif // _THINKINK_154_TRICOLOR_Z17_H
40 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_154_Tricolor_Z90.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_154_TRICOLOR_Z90_H
2 | #define _THINKINK_154_TRICOLOR_Z90_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | class ThinkInk_154_Tricolor_Z90 : public Adafruit_SSD1681 {
8 | public:
9 | ThinkInk_154_Tricolor_Z90(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
10 | int16_t CS, int16_t SRCS, int16_t MISO,
11 | int16_t BUSY = -1)
12 | : Adafruit_SSD1681(200, 200, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_154_Tricolor_Z90(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
15 | int16_t BUSY = -1, SPIClass *spi = &SPI)
16 | : Adafruit_SSD1681(200, 200, DC, RST, CS, SRCS, BUSY, spi){};
17 |
18 | void begin(thinkinkmode_t mode = THINKINK_MONO) {
19 | Adafruit_SSD1681::begin(true);
20 |
21 | inkmode = mode; // Preserve ink mode for ImageReader or others
22 |
23 | layer_colors[EPD_WHITE] = 0b00;
24 | layer_colors[EPD_BLACK] = 0b01;
25 | layer_colors[EPD_RED] = 0b10;
26 | layer_colors[EPD_GRAY] = 0b10;
27 | layer_colors[EPD_LIGHT] = 0b00;
28 | layer_colors[EPD_DARK] = 0b01;
29 |
30 | default_refresh_delay = 13000;
31 | setRotation(3);
32 | powerDown();
33 | }
34 | };
35 |
36 | #endif // _THINKINK_154_TRI
37 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_213_Grayscale4_T5.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_213_GRAYSCALE4_T5_H
2 | #define _THINKINK_213_GRAYSCALE4_T5_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | // clang-format off
8 |
9 | static const uint8_t ti_213t5_gray4_init_code[] {
10 | IL0373_POWER_SETTING, 5, 0x03, 0x00, 0x2b, 0x2b, 0x13,
11 | IL0373_BOOSTER_SOFT_START, 3, 0x17, 0x17, 0x17,
12 | IL0373_POWER_ON, 0,
13 | 0xFF, 200,
14 | IL0373_PANEL_SETTING, 1, 0x3F,
15 | IL0373_PLL, 1, 0x3C,
16 | IL0373_VCM_DC_SETTING, 1, 0x12,
17 | IL0373_CDI, 1, 0x97,
18 | 0xFE // EOM
19 | };
20 |
21 | static const uint8_t ti_213t5_monopart_init_code[] {
22 | IL0373_POWER_SETTING, 5, 0x03, 0x00, 0x2b, 0x2b, 0x03,
23 | IL0373_BOOSTER_SOFT_START, 3, 0x17, 0x17, 0x17,
24 | IL0373_POWER_ON, 0,
25 | 0xFF, 200,
26 | IL0373_PANEL_SETTING, 2, 0xbF, 0x0d,
27 | IL0373_PLL, 1, 0x3C,
28 | IL0373_VCM_DC_SETTING, 1, 0x12,
29 | IL0373_CDI, 1, 0x47,
30 | 0xFE // EOM
31 | };
32 |
33 | static const uint8_t ti_213t5_monofull_init_code[] {
34 | IL0373_BOOSTER_SOFT_START, 3, 0x17, 0x17, 0x17,
35 | IL0373_POWER_ON, 0,
36 | 0xFF, 200,
37 | IL0373_PANEL_SETTING, 2, 0x1f, 0x0d,
38 | IL0373_CDI, 1, 0x97,
39 | 0xFE // EOM
40 | };
41 |
42 | static const uint8_t ti_213t5_monopart_lut_code[] = {
43 | // const unsigned char lut_vcom1[]
44 | 0x20, 44,
45 | 0x00, 0x01, 0x0E, 0x00, 0x00, 0x01,
46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
48 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
49 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
50 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
51 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
52 | 0x00, 0x00,
53 | // const unsigned char lut_ww1[]
54 | 0x21, 42,
55 | 0x00, 0x01, 0x0E, 0x00, 0x00, 0x01,
56 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
57 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
58 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
59 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
60 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
61 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
62 | // const unsigned char lut_bw1[]
63 | 0x22, 42,
64 | 0x20, 0x01, 0x0E, 0x00, 0x00, 0x01,
65 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
66 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
67 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
68 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
69 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
70 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
71 | // const unsigned char lut_wb1[]
72 | 0x23, 42,
73 | 0x10, 0x01, 0x0E, 0x00, 0x00, 0x01,
74 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
75 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
76 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
77 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
78 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
79 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
80 | // const unsigned char lut_bb1[]
81 | 0x24, 42,
82 | 0x00, 0x01, 0x0E, 0x00, 0x00, 0x01,
83 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
84 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
85 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
86 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
87 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
88 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
89 |
90 | 0xFE // EOM
91 | };
92 |
93 | static const uint8_t ti_213t5_gray4_lut_code[] = {
94 | //const unsigned char lut_vcom[] =
95 | 0x20, 42,
96 | 0x00, 0x0A, 0x00, 0x00, 0x00, 0x01,
97 | 0x60, 0x14, 0x14, 0x00, 0x00, 0x01,
98 | 0x00, 0x14, 0x00, 0x00, 0x00, 0x01,
99 | 0x00, 0x13, 0x0A, 0x01, 0x00, 0x01,
100 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
101 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
102 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
103 |
104 | //const unsigned char lut_ww[] ={
105 | 0x21, 42,
106 | 0x40, 0x0A, 0x00, 0x00, 0x00, 0x01,
107 | 0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
108 | 0x10, 0x14, 0x0A, 0x00, 0x00, 0x01,
109 | 0xA0, 0x13, 0x01, 0x00, 0x00, 0x01,
110 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
111 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
112 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
113 |
114 | //const unsigned char lut_bw[] ={
115 | 0x22, 42,
116 | 0x40, 0x0A, 0x00, 0x00, 0x00, 0x01,
117 | 0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
118 | 0x00, 0x14, 0x0A, 0x00, 0x00, 0x01,
119 | 0x99, 0x0C, 0x01, 0x03, 0x04, 0x01,
120 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
121 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
122 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
123 |
124 | //const unsigned char lut_wb[] ={
125 | 0x23, 42,
126 | 0x40, 0x0A, 0x00, 0x00, 0x00, 0x01,
127 | 0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
128 | 0x00, 0x14, 0x0A, 0x00, 0x00, 0x01,
129 | 0x99, 0x0B, 0x04, 0x04, 0x01, 0x01,
130 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
131 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
132 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
133 |
134 | //const unsigned char lut_bb[] ={
135 | 0x24, 42,
136 | 0x80, 0x0A, 0x00, 0x00, 0x00, 0x01,
137 | 0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
138 | 0x20, 0x14, 0x0A, 0x00, 0x00, 0x01,
139 | 0x50, 0x13, 0x01, 0x00, 0x00, 0x01,
140 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
141 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
142 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
143 |
144 | 0xFE // EOM
145 | };
146 |
147 | // clang-format on
148 |
149 | class ThinkInk_213_Grayscale4_T5 : public Adafruit_IL0373 {
150 | public:
151 | ThinkInk_213_Grayscale4_T5(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
152 | int16_t CS, int16_t SRCS, int16_t MISO,
153 | int16_t BUSY = -1)
154 | : Adafruit_IL0373(212, 104, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
155 |
156 | ThinkInk_213_Grayscale4_T5(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
157 | int16_t BUSY = -1, SPIClass *spi = &SPI)
158 | : Adafruit_IL0373(212, 104, DC, RST, CS, SRCS, BUSY, spi){};
159 |
160 | void begin(thinkinkmode_t mode = THINKINK_GRAYSCALE4) {
161 | Adafruit_IL0373::begin(true);
162 | setColorBuffer(0, true); // layer 0 uninverted
163 | setBlackBuffer(1, true); // layer 1 uninverted
164 |
165 | inkmode = mode; // Preserve ink mode for ImageReader or others
166 |
167 | if (mode == THINKINK_GRAYSCALE4) {
168 | _epd_init_code = ti_213t5_gray4_init_code;
169 | _epd_lut_code = ti_213t5_gray4_lut_code;
170 |
171 | layer_colors[EPD_WHITE] = 0b00;
172 | layer_colors[EPD_BLACK] = 0b11;
173 | layer_colors[EPD_RED] = 0b01;
174 | layer_colors[EPD_GRAY] = 0b10;
175 | layer_colors[EPD_LIGHT] = 0b01;
176 | layer_colors[EPD_DARK] = 0b10;
177 | } else if (mode == THINKINK_MONO) {
178 | _epd_init_code = ti_213t5_monofull_init_code;
179 | _epd_partial_init_code = ti_213t5_monopart_init_code;
180 | _epd_partial_lut_code = ti_213t5_monopart_lut_code;
181 |
182 | layer_colors[EPD_WHITE] = 0b11;
183 | layer_colors[EPD_BLACK] = 0b01;
184 | layer_colors[EPD_RED] = 0b01;
185 | layer_colors[EPD_GRAY] = 0b01;
186 | layer_colors[EPD_LIGHT] = 0b10;
187 | layer_colors[EPD_DARK] = 0b01;
188 | }
189 |
190 | default_refresh_delay = 1000;
191 |
192 | powerDown();
193 | }
194 | };
195 |
196 | #endif // _THINKINK_213_GRAYSCALE4_T5_H
197 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_213_Mono_B72.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_213_MONO_B72_H
2 | #define _THINKINK_213_MONO_B72_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | class ThinkInk_213_Mono_B72 : public Adafruit_SSD1675 {
8 | public:
9 | ThinkInk_213_Mono_B72(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
10 | int16_t CS, int16_t SRCS, int16_t MISO,
11 | int16_t BUSY = -1)
12 | : Adafruit_SSD1675(250, 122, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_213_Mono_B72(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
15 | int16_t BUSY = -1, SPIClass *spi = &SPI)
16 | : Adafruit_SSD1675(250, 122, DC, RST, CS, SRCS, BUSY, spi){};
17 |
18 | void begin(thinkinkmode_t mode = THINKINK_MONO) {
19 | Adafruit_SSD1675::begin(true);
20 | setColorBuffer(0, true); // layer 0 uninverted
21 | setBlackBuffer(0, true); // only one buffer
22 |
23 | inkmode = mode; // Preserve ink mode for ImageReader or others
24 |
25 | layer_colors[EPD_WHITE] = 0b00;
26 | layer_colors[EPD_BLACK] = 0b01;
27 | layer_colors[EPD_RED] = 0b01;
28 | layer_colors[EPD_GRAY] = 0b01;
29 | layer_colors[EPD_LIGHT] = 0b00;
30 | layer_colors[EPD_DARK] = 0b01;
31 |
32 | default_refresh_delay = 1000;
33 | setRotation(0);
34 | powerDown();
35 | }
36 | };
37 |
38 | #endif // _THINKINK_213_MONO_B72_H
39 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_213_Mono_B73.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_213_MONO_B73_H
2 | #define _THINKINK_213_MONO_B73_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | class ThinkInk_213_Mono_B73 : public Adafruit_SSD1675B {
8 | public:
9 | ThinkInk_213_Mono_B73(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
10 | int16_t CS, int16_t SRCS, int16_t MISO,
11 | int16_t BUSY = -1)
12 | : Adafruit_SSD1675B(250, 122, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_213_Mono_B73(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
15 | int16_t BUSY = -1, SPIClass *spi = &SPI)
16 | : Adafruit_SSD1675B(250, 122, DC, RST, CS, SRCS, BUSY, spi){};
17 |
18 | void begin(thinkinkmode_t mode = THINKINK_MONO) {
19 | Adafruit_SSD1675B::begin(true);
20 | setColorBuffer(0, true); // layer 0 uninverted
21 | setBlackBuffer(0, true); // only one buffer
22 |
23 | inkmode = mode; // Preserve ink mode for ImageReader or others
24 |
25 | layer_colors[EPD_WHITE] = 0b00;
26 | layer_colors[EPD_BLACK] = 0b01;
27 | layer_colors[EPD_RED] = 0b01;
28 | layer_colors[EPD_GRAY] = 0b01;
29 | layer_colors[EPD_LIGHT] = 0b00;
30 | layer_colors[EPD_DARK] = 0b01;
31 |
32 | default_refresh_delay = 1000;
33 | setRotation(0);
34 | powerDown();
35 | }
36 | };
37 |
38 | #endif // _THINKINK_213_MONO_B73_H
39 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_213_Mono_BN.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_213_MONO_BN_H
2 | #define _THINKINK_213_MONO_BN_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | class ThinkInk_213_Mono_BN : public Adafruit_SSD1680 {
8 | public:
9 | ThinkInk_213_Mono_BN(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
10 | int16_t CS, int16_t SRCS, int16_t MISO,
11 | int16_t BUSY = -1)
12 | : Adafruit_SSD1680(250, 122, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_213_Mono_BN(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
15 | int16_t BUSY = -1, SPIClass *spi = &SPI)
16 | : Adafruit_SSD1680(250, 122, DC, RST, CS, SRCS, BUSY, spi){};
17 |
18 | void begin(thinkinkmode_t mode = THINKINK_MONO) {
19 | Adafruit_SSD1680::begin(true);
20 | setColorBuffer(0, true); // layer 0 uninverted
21 | setBlackBuffer(0, true); // only one buffer
22 |
23 | inkmode = mode; // Preserve ink mode for ImageReader or others
24 |
25 | layer_colors[EPD_WHITE] = 0b00;
26 | layer_colors[EPD_BLACK] = 0b01;
27 | layer_colors[EPD_RED] = 0b01;
28 | layer_colors[EPD_GRAY] = 0b01;
29 | layer_colors[EPD_LIGHT] = 0b00;
30 | layer_colors[EPD_DARK] = 0b01;
31 |
32 | default_refresh_delay = 1000;
33 | setRotation(0);
34 | powerDown();
35 | }
36 | };
37 |
38 | typedef ThinkInk_213_Mono_BN ThinkInk_213_Mono_B74;
39 |
40 | #endif // _THINKINK_213_MONO_BN_H
41 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_213_Mono_GDEY0213B74.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_213_MONO_GDEY0213B74_H
2 | #define _THINKINK_213_MONO_GDEY0213B74_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | class ThinkInk_213_Mono_GDEY0213B74 : public Adafruit_SSD1680 {
8 | public:
9 | ThinkInk_213_Mono_GDEY0213B74(int16_t SID, int16_t SCLK, int16_t DC,
10 | int16_t RST, int16_t CS, int16_t SRCS,
11 | int16_t MISO, int16_t BUSY = -1)
12 | : Adafruit_SSD1680(250, 122, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_213_Mono_GDEY0213B74(int16_t DC, int16_t RST, int16_t CS,
15 | int16_t SRCS, int16_t BUSY = -1,
16 | SPIClass *spi = &SPI)
17 | : Adafruit_SSD1680(250, 122, DC, RST, CS, SRCS, BUSY, spi){};
18 |
19 | void begin(thinkinkmode_t mode = THINKINK_MONO) {
20 | _xram_offset = 0;
21 |
22 | Adafruit_SSD1680::begin(true);
23 | setColorBuffer(0, true); // layer 0 uninverted
24 | setBlackBuffer(0, true); // only one buffer
25 |
26 | inkmode = mode; // Preserve ink mode for ImageReader or others
27 |
28 | layer_colors[EPD_WHITE] = 0b00;
29 | layer_colors[EPD_BLACK] = 0b01;
30 | layer_colors[EPD_RED] = 0b01;
31 | layer_colors[EPD_GRAY] = 0b01;
32 | layer_colors[EPD_LIGHT] = 0b00;
33 | layer_colors[EPD_DARK] = 0b01;
34 |
35 | default_refresh_delay = 1000;
36 | setRotation(0);
37 | powerDown();
38 | }
39 | };
40 |
41 | #endif // _THINKINK_213_MONO_GDEY0213B74_H
42 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_213_Mono_M21.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_213_MONO_M21_H
2 | #define _THINKINK_213_MONO_M21_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | class ThinkInk_213_Mono_M21 : public Adafruit_UC8151D {
8 | public:
9 | ThinkInk_213_Mono_M21(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
10 | int16_t CS, int16_t SRCS, int16_t MISO,
11 | int16_t BUSY = -1)
12 | : Adafruit_UC8151D(212, 104, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_213_Mono_M21(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
15 | int16_t BUSY = -1, SPIClass *spi = &SPI)
16 | : Adafruit_UC8151D(212, 104, DC, RST, CS, SRCS, BUSY, spi){};
17 |
18 | void begin(thinkinkmode_t mode = THINKINK_MONO) {
19 | Adafruit_UC8151D::begin(true);
20 | setColorBuffer(1, true); // layer 1 uninverted
21 | setBlackBuffer(1, true); // only one buffer
22 |
23 | inkmode = mode; // Preserve ink mode for ImageReader or others
24 |
25 | layer_colors[EPD_WHITE] = 0b00;
26 | layer_colors[EPD_BLACK] = 0b01;
27 | layer_colors[EPD_RED] = 0b01;
28 | layer_colors[EPD_GRAY] = 0b01;
29 | layer_colors[EPD_LIGHT] = 0b00;
30 | layer_colors[EPD_DARK] = 0b01;
31 |
32 | default_refresh_delay = 1000;
33 | setRotation(0);
34 | powerDown();
35 | }
36 | };
37 |
38 | #endif // _THINKINK_213_MONO_M21_H
39 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_213_Tricolor_RW.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_213_TRICOLOR_RW_H
2 | #define _THINKINK_213_TRICOLOR_RW_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | class ThinkInk_213_Tricolor_RW : public Adafruit_SSD1680 {
8 | public:
9 | ThinkInk_213_Tricolor_RW(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
10 | int16_t CS, int16_t SRCS, int16_t MISO,
11 | int16_t BUSY = -1)
12 | : Adafruit_SSD1680(250, 122, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_213_Tricolor_RW(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
15 | int16_t BUSY = -1, SPIClass *spi = &SPI)
16 | : Adafruit_SSD1680(250, 122, DC, RST, CS, SRCS, BUSY, spi){};
17 |
18 | void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
19 | Adafruit_SSD1680::begin(true);
20 | setBlackBuffer(0, true);
21 | setColorBuffer(1, false);
22 |
23 | inkmode = mode; // Preserve ink mode for ImageReader or others
24 |
25 | layer_colors[EPD_WHITE] = 0b00;
26 | layer_colors[EPD_BLACK] = 0b01;
27 | layer_colors[EPD_RED] = 0b10;
28 | layer_colors[EPD_GRAY] = 0b10;
29 | layer_colors[EPD_LIGHT] = 0b00;
30 | layer_colors[EPD_DARK] = 0b01;
31 |
32 | default_refresh_delay = 13000;
33 | setRotation(0);
34 | powerDown();
35 | }
36 | };
37 |
38 | #endif // _THINKINK_213_TRI
39 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_213_Tricolor_Z16.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_213_TRICOLOR_Z16_H
2 | #define _THINKINK_213_TRICOLOR_Z16_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | class ThinkInk_213_Tricolor_Z16 : public Adafruit_IL0373 {
8 | public:
9 | ThinkInk_213_Tricolor_Z16(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
10 | int16_t CS, int16_t SRCS, int16_t MISO,
11 | int16_t BUSY = -1)
12 | : Adafruit_IL0373(212, 104, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_213_Tricolor_Z16(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
15 | int16_t BUSY = -1, SPIClass *spi = &SPI)
16 | : Adafruit_IL0373(212, 104, DC, RST, CS, SRCS, BUSY, spi){};
17 |
18 | void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
19 | Adafruit_IL0373::begin(true);
20 | setColorBuffer(0, true); // layer 0 uninverted
21 | setBlackBuffer(1, true); // layer 1 uninverted
22 |
23 | inkmode = mode; // Preserve ink mode for ImageReader or others
24 |
25 | layer_colors[EPD_WHITE] = 0b00;
26 | layer_colors[EPD_BLACK] = 0b10;
27 | layer_colors[EPD_RED] = 0b01;
28 | layer_colors[EPD_GRAY] = 0b01;
29 | layer_colors[EPD_LIGHT] = 0b00;
30 | layer_colors[EPD_DARK] = 0b10;
31 |
32 | default_refresh_delay = 16000;
33 |
34 | powerDown();
35 | }
36 | };
37 |
38 | #endif // _THINKINK_213_TRICOLOR_Z16_H
39 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_270_Grayscale4_W3.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_270_GRAY4_W3_H
2 | #define _THINKINK_270_GRAY4_W3_H
3 |
4 | #include "Adafruit_EPD.h"
5 |
6 | // clang-format off
7 |
8 | static const uint8_t ti_270w3_gray4_init_code[] {
9 | IL91874_POWER_SETTING, 4, 0x03, 0x00, 0x2b, 0x2b,
10 | IL91874_BOOSTER_SOFT_START, 3, 0x07, 0x07, 0x17,
11 | 0xF8, 2, 0x60, 0xA5, // boost
12 | 0xF8, 2, 0x89, 0xA5, // boost
13 | 0xF8, 2, 0x90, 0x00, // boost
14 | 0xF8, 2, 0x93, 0x2A, // boost
15 | 0xF8, 2, 0xA0, 0xA5, // boost
16 | 0xF8, 2, 0xA1, 0x00, // boost
17 | 0xF8, 2, 0x73, 0x41, // boost
18 | IL91874_PDRF, 1, 0x00,
19 | IL91874_POWER_ON, 0,
20 | 0xFF, 200,
21 | IL91874_PANEL_SETTING, 1, 0xBF,
22 | IL91874_PLL, 1, 0x90,
23 | IL91874_VCM_DC_SETTING, 1, 0x12,
24 | IL91874_CDI, 1, 0x97,
25 | 0xFE // EOM
26 | };
27 |
28 |
29 | static const uint8_t ti_270w3_gray4_lut_code[] = {
30 | // const unsigned char lut_vcom[]PROGMEM =
31 | IL91874_LUT1, 44,
32 | 0x00, 0x00,
33 | 0x00 , 0x0A, 0x00, 0x00, 0x00, 0x01,
34 | 0x60, 0x14, 0x14, 0x00, 0x00, 0x01,
35 | 0x00, 0x14, 0x00, 0x00, 0x00, 0x01,
36 | 0x00, 0x13, 0x0A, 0x01, 0x00, 0x01,
37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
38 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
40 |
41 | // const unsigned char lut_ww[]PROGMEM ={
42 | IL91874_LUTWW, 42,
43 | 0x40, 0x0A, 0x00, 0x00, 0x00, 0x01,
44 | 0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
45 | 0x10, 0x14, 0x0A, 0x00, 0x00, 0x01,
46 | 0xA0, 0x13, 0x01, 0x00, 0x00, 0x01,
47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
48 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
49 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
50 |
51 | // const unsigned char lut_bw[]PROGMEM ={
52 | IL91874_LUTBW, 42,
53 | 0x40, 0x0A, 0x00, 0x00, 0x00, 0x01,
54 | 0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
55 | 0x00, 0x14, 0x0A, 0x00, 0x00, 0x01,
56 | 0x99, 0x0C, 0x01, 0x03, 0x04, 0x01,
57 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
58 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
59 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
60 |
61 | // const unsigned char lut_wb[]PROGMEM ={
62 | IL91874_LUTWB, 42,
63 | 0x40, 0x0A, 0x00, 0x00, 0x00, 0x01,
64 | 0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
65 | 0x00, 0x14, 0x0A, 0x00, 0x00, 0x01,
66 | 0x99, 0x0B, 0x04, 0x04, 0x01, 0x01,
67 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
68 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
69 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
70 |
71 | // const unsigned char lut_bb[]PROGMEM ={
72 | IL91874_LUTBB, 42,
73 | 0x80, 0x0A, 0x00, 0x00, 0x00, 0x01,
74 | 0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
75 | 0x20, 0x14, 0x0A, 0x00, 0x00, 0x01,
76 | 0x50, 0x13, 0x01, 0x00, 0x00, 0x01,
77 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
78 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
79 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
80 | };
81 |
82 | // clang-format on
83 |
84 | class ThinkInk_270_Grayscale4_W3 : public Adafruit_IL91874 {
85 | private:
86 | public:
87 | ThinkInk_270_Grayscale4_W3(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
88 | int16_t CS, int16_t SRCS, int16_t MISO,
89 | int16_t BUSY = -1)
90 | : Adafruit_IL91874(264, 176, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
91 |
92 | ThinkInk_270_Grayscale4_W3(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
93 | int16_t BUSY = -1, SPIClass *spi = &SPI)
94 | : Adafruit_IL91874(264, 176, DC, RST, CS, SRCS, BUSY, spi){};
95 |
96 | void begin(thinkinkmode_t mode = THINKINK_MONO) {
97 | Adafruit_IL91874::begin(true);
98 |
99 | setBlackBuffer(0, true); // black defaults to inverted
100 | setColorBuffer(1, true); // red defaults to not inverted
101 |
102 | if (mode == THINKINK_MONO) {
103 | _epd_init_code = NULL;
104 | _epd_lut_code = NULL;
105 | layer_colors[EPD_WHITE] = 0b00;
106 | layer_colors[EPD_BLACK] = 0b10;
107 | layer_colors[EPD_RED] = 0b10;
108 | layer_colors[EPD_GRAY] = 0b10;
109 | layer_colors[EPD_LIGHT] = 0b00;
110 | layer_colors[EPD_DARK] = 0b10;
111 | }
112 | if (mode == THINKINK_GRAYSCALE4) {
113 | _epd_init_code = ti_270w3_gray4_init_code;
114 | _epd_lut_code = ti_270w3_gray4_lut_code;
115 | layer_colors[EPD_WHITE] = 0b00;
116 | layer_colors[EPD_BLACK] = 0b11;
117 | layer_colors[EPD_RED] = 0b10;
118 | layer_colors[EPD_GRAY] = 0b10;
119 | layer_colors[EPD_LIGHT] = 0b10;
120 | layer_colors[EPD_DARK] = 0b01;
121 | }
122 |
123 | default_refresh_delay = 1000;
124 | powerDown();
125 | };
126 | };
127 |
128 | #endif // _THINKINK_270_GRAY4_W3_H
129 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_270_Tricolor_C44.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_270_TRICOLOR_C44_H
2 | #define _THINKINK_270_TRICOLOR_C44_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | // clang-format off
8 |
9 | static const uint8_t ti_270c44_tri_init_code[] {
10 | IL91874_BOOSTER_SOFT_START, 3, 0x07, 0x07, 0x17,
11 | IL91874_POWER_ON, 0,
12 | 0xFF, 200,
13 | IL91874_PANEL_SETTING, 1, 0x0F, // OTP lut
14 | IL91874_PDRF, 1, 0x00,
15 |
16 | 0xF8, 2, 0x60, 0xA5, // boost
17 | 0xF8, 2, 0x73, 0x23, // boost
18 | 0xF8, 2, 0x7C, 0x00, // boost
19 | IL91874_CDI, 1, 0x97,
20 |
21 | 0xFE // EOM
22 | };
23 |
24 | // clang-format on
25 |
26 | class ThinkInk_270_Tricolor_C44 : public Adafruit_IL91874 {
27 | public:
28 | ThinkInk_270_Tricolor_C44(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
29 | int16_t CS, int16_t SRCS, int16_t MISO,
30 | int16_t BUSY = -1)
31 | : Adafruit_IL91874(264, 176, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
32 |
33 | ThinkInk_270_Tricolor_C44(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
34 | int16_t BUSY = -1, SPIClass *spi = &SPI)
35 | : Adafruit_IL91874(264, 176, DC, RST, CS, SRCS, BUSY, spi){};
36 |
37 | void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
38 | Adafruit_IL91874::begin(true);
39 | setBlackBuffer(0, true);
40 | setColorBuffer(1, false);
41 |
42 | _epd_init_code = ti_270c44_tri_init_code;
43 | _epd_lut_code = NULL;
44 |
45 | inkmode = mode; // Preserve ink mode for ImageReader or others
46 |
47 | layer_colors[EPD_WHITE] = 0b00;
48 | layer_colors[EPD_BLACK] = 0b01;
49 | layer_colors[EPD_RED] = 0b10;
50 | layer_colors[EPD_GRAY] = 0b10;
51 | layer_colors[EPD_LIGHT] = 0b00;
52 | layer_colors[EPD_DARK] = 0b01;
53 |
54 | default_refresh_delay = 13000;
55 | powerDown();
56 | }
57 | };
58 |
59 | #endif // _THINKINK_270_TRICOLOR_C44_H
60 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_270_Tricolor_Z70.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_270_TRICOLOR_Z70_H
2 | #define _THINKINK_270_TRICOLOR_Z70_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | class ThinkInk_270_Tricolor_Z70 : public Adafruit_EK79686 {
8 | public:
9 | ThinkInk_270_Tricolor_Z70(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
10 | int16_t CS, int16_t SRCS, int16_t MISO,
11 | int16_t BUSY = -1)
12 | : Adafruit_EK79686(264, 176, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_270_Tricolor_Z70(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
15 | int16_t BUSY = -1, SPIClass *spi = &SPI)
16 | : Adafruit_EK79686(264, 176, DC, RST, CS, SRCS, BUSY, spi){};
17 |
18 | void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
19 | Adafruit_EK79686::begin(true);
20 |
21 | inkmode = mode; // Preserve ink mode for ImageReader or others
22 |
23 | layer_colors[EPD_WHITE] = 0b10;
24 | layer_colors[EPD_BLACK] = 0b01;
25 | layer_colors[EPD_RED] = 0b10;
26 | layer_colors[EPD_GRAY] = 0b10;
27 | layer_colors[EPD_LIGHT] = 0b10;
28 | layer_colors[EPD_DARK] = 0b01;
29 |
30 | default_refresh_delay = 13000;
31 | powerDown();
32 | }
33 | };
34 |
35 | #endif // _THINKINK_270_TRICOLOR_Z70_H
36 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_290_Grayscale4_T5.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_290_GRAYSCALE4_T5_H
2 | #define _THINKINK_290_GRAYSCALE4_T5_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | // clang-format off
8 |
9 | static const uint8_t ti_290t5_gray4_init_code[] {
10 | IL0373_POWER_SETTING, 5, 0x03, 0x00, 0x2b, 0x2b, 0x13,
11 | IL0373_BOOSTER_SOFT_START, 3, 0x17, 0x17, 0x17,
12 | IL0373_POWER_ON, 0,
13 | 0xFF, 200,
14 | IL0373_PANEL_SETTING, 1, 0x3F,
15 | IL0373_PLL, 1, 0x3C,
16 | IL0373_VCM_DC_SETTING, 1, 0x12,
17 | IL0373_CDI, 1, 0x97,
18 | 0xFE // EOM
19 | };
20 |
21 | static const uint8_t ti_290t5_monopart_init_code[] {
22 | IL0373_POWER_SETTING, 5, 0x03, 0x00, 0x2b, 0x2b, 0x03,
23 | IL0373_BOOSTER_SOFT_START, 3, 0x17, 0x17, 0x17,
24 | IL0373_POWER_ON, 0,
25 | 0xFF, 200,
26 | IL0373_PANEL_SETTING, 2, 0xbF, 0x0d,
27 | IL0373_PLL, 1, 0x3C,
28 | IL0373_VCM_DC_SETTING, 1, 0x12,
29 | IL0373_CDI, 1, 0x47,
30 | 0xFE // EOM
31 | };
32 |
33 | static const uint8_t ti_290t5_monofull_init_code[] {
34 | IL0373_BOOSTER_SOFT_START, 3, 0x17, 0x17, 0x17,
35 | IL0373_POWER_ON, 0,
36 | 0xFF, 200,
37 | IL0373_PANEL_SETTING, 2, 0x1f, 0x0d,
38 | IL0373_CDI, 1, 0x97,
39 | 0xFE // EOM
40 | };
41 |
42 | static const uint8_t ti_290t5_monopart_lut_code[] = {
43 | // const unsigned char lut_vcom1[]
44 | 0x20, 44,
45 | 0x00, 0x01, 0x0E, 0x00, 0x00, 0x01,
46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
48 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
49 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
50 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
51 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
52 | 0x00, 0x00,
53 | // const unsigned char lut_ww1[]
54 | 0x21, 42,
55 | 0x00, 0x01, 0x0E, 0x00, 0x00, 0x01,
56 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
57 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
58 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
59 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
60 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
61 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
62 | // const unsigned char lut_bw1[]
63 | 0x22, 42,
64 | 0x20, 0x01, 0x0E, 0x00, 0x00, 0x01,
65 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
66 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
67 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
68 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
69 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
70 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
71 | // const unsigned char lut_wb1[]
72 | 0x23, 42,
73 | 0x10, 0x01, 0x0E, 0x00, 0x00, 0x01,
74 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
75 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
76 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
77 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
78 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
79 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
80 | // const unsigned char lut_bb1[]
81 | 0x24, 42,
82 | 0x00, 0x01, 0x0E, 0x00, 0x00, 0x01,
83 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
84 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
85 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
86 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
87 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
88 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
89 |
90 | 0xFE // EOM
91 | };
92 |
93 | const uint8_t ti_290t5_gray4_lut_code[] = {
94 | //const unsigned char lut_vcom[] =
95 | 0x20, 42,
96 | 0x00, 0x0A, 0x00, 0x00, 0x00, 0x01,
97 | 0x60, 0x14, 0x14, 0x00, 0x00, 0x01,
98 | 0x00, 0x14, 0x00, 0x00, 0x00, 0x01,
99 | 0x00, 0x13, 0x0A, 0x01, 0x00, 0x01,
100 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
101 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
102 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
103 |
104 | //const unsigned char lut_ww[] ={
105 | 0x21, 42,
106 | 0x40, 0x0A, 0x00, 0x00, 0x00, 0x01,
107 | 0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
108 | 0x10, 0x14, 0x0A, 0x00, 0x00, 0x01,
109 | 0xA0, 0x13, 0x01, 0x00, 0x00, 0x01,
110 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
111 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
112 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
113 |
114 | //const unsigned char lut_bw[] ={
115 | 0x22, 42,
116 | 0x40, 0x0A, 0x00, 0x00, 0x00, 0x01,
117 | 0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
118 | 0x00, 0x14, 0x0A, 0x00, 0x00, 0x01,
119 | 0x99, 0x0C, 0x01, 0x03, 0x04, 0x01,
120 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
121 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
122 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
123 |
124 | //const unsigned char lut_wb[] ={
125 | 0x23, 42,
126 | 0x40, 0x0A, 0x00, 0x00, 0x00, 0x01,
127 | 0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
128 | 0x00, 0x14, 0x0A, 0x00, 0x00, 0x01,
129 | 0x99, 0x0B, 0x04, 0x04, 0x01, 0x01,
130 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
131 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
132 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
133 |
134 | //const unsigned char lut_bb[] ={
135 | 0x24, 42,
136 | 0x80, 0x0A, 0x00, 0x00, 0x00, 0x01,
137 | 0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
138 | 0x20, 0x14, 0x0A, 0x00, 0x00, 0x01,
139 | 0x50, 0x13, 0x01, 0x00, 0x00, 0x01,
140 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
141 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
142 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
143 |
144 | 0xFE // EOM
145 | };
146 |
147 | // clang-format on
148 |
149 | class ThinkInk_290_Grayscale4_T5 : public Adafruit_IL0373 {
150 | public:
151 | ThinkInk_290_Grayscale4_T5(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
152 | int16_t CS, int16_t SRCS, int16_t MISO,
153 | int16_t BUSY = -1)
154 | : Adafruit_IL0373(296, 128, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
155 |
156 | ThinkInk_290_Grayscale4_T5(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
157 | int16_t BUSY = -1, SPIClass *spi = &SPI)
158 | : Adafruit_IL0373(296, 128, DC, RST, CS, SRCS, BUSY, spi){};
159 |
160 | void begin(thinkinkmode_t mode = THINKINK_GRAYSCALE4) {
161 | Adafruit_IL0373::begin(true);
162 | setColorBuffer(0, true); // layer 0 uninverted
163 | setBlackBuffer(1, true); // layer 1 uninverted
164 |
165 | inkmode = mode; // Preserve ink mode for ImageReader or others
166 |
167 | if (mode == THINKINK_GRAYSCALE4) {
168 | _epd_init_code = ti_290t5_gray4_init_code;
169 | _epd_lut_code = ti_290t5_gray4_lut_code;
170 |
171 | layer_colors[EPD_WHITE] = 0b00;
172 | layer_colors[EPD_BLACK] = 0b11;
173 | layer_colors[EPD_RED] = 0b01;
174 | layer_colors[EPD_GRAY] = 0b10;
175 | layer_colors[EPD_LIGHT] = 0b01;
176 | layer_colors[EPD_DARK] = 0b10;
177 | } else if (mode == THINKINK_MONO) {
178 | _epd_init_code = ti_290t5_monofull_init_code;
179 | _epd_partial_init_code = ti_290t5_monopart_init_code;
180 | _epd_partial_lut_code = ti_290t5_monopart_lut_code;
181 |
182 | layer_colors[EPD_WHITE] = 0b11;
183 | layer_colors[EPD_BLACK] = 0b01;
184 | layer_colors[EPD_RED] = 0b01;
185 | layer_colors[EPD_GRAY] = 0b01;
186 | layer_colors[EPD_LIGHT] = 0b10;
187 | layer_colors[EPD_DARK] = 0b01;
188 | }
189 |
190 | default_refresh_delay = 800;
191 |
192 | powerDown();
193 | }
194 | };
195 |
196 | #endif // _THINKINK_290_GRAYSCALE4_T5_H
197 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_290_Mono_BN.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_290_MONO_BN_H
2 | #define _THINKINK_290_MONO_BN_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | class ThinkInk_290_Mono_BN : public Adafruit_SSD1680 {
8 | public:
9 | ThinkInk_290_Mono_BN(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
10 | int16_t CS, int16_t SRCS, int16_t MISO,
11 | int16_t BUSY = -1)
12 | : Adafruit_SSD1680(296, 128, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_290_Mono_BN(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
15 | int16_t BUSY = -1, SPIClass *spi = &SPI)
16 | : Adafruit_SSD1680(296, 128, DC, RST, CS, SRCS, BUSY, spi){};
17 |
18 | void begin(thinkinkmode_t mode = THINKINK_MONO) {
19 | Adafruit_SSD1680::begin(true);
20 | setColorBuffer(0, true); // layer 0 uninverted
21 | setBlackBuffer(0, true); // only one buffer
22 |
23 | inkmode = mode; // Preserve ink mode for ImageReader or others
24 |
25 | layer_colors[EPD_WHITE] = 0b00;
26 | layer_colors[EPD_BLACK] = 0b01;
27 | layer_colors[EPD_RED] = 0b01;
28 | layer_colors[EPD_GRAY] = 0b01;
29 | layer_colors[EPD_LIGHT] = 0b00;
30 | layer_colors[EPD_DARK] = 0b01;
31 |
32 | default_refresh_delay = 1000;
33 | setRotation(0);
34 | powerDown();
35 | }
36 | };
37 |
38 | #endif // _THINKINK_213_MONO_BN_H
39 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_290_Mono_M06.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_290_MONO_M06_H
2 | #define _THINKINK_290_MONO_M06_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | class ThinkInk_290_Mono_M06 : public Adafruit_UC8151D {
8 | public:
9 | ThinkInk_290_Mono_M06(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
10 | int16_t CS, int16_t SRCS, int16_t MISO,
11 | int16_t BUSY = -1)
12 | : Adafruit_UC8151D(296, 128, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_290_Mono_M06(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
15 | int16_t BUSY = -1, SPIClass *spi = &SPI)
16 | : Adafruit_UC8151D(296, 128, DC, RST, CS, SRCS, BUSY, spi){};
17 |
18 | void begin(thinkinkmode_t mode = THINKINK_MONO) {
19 | Adafruit_UC8151D::begin(true);
20 |
21 | setColorBuffer(1, true); // layer 1 uninverted
22 | setBlackBuffer(1, true); // only one buffer
23 |
24 | inkmode = mode; // Preserve ink mode for ImageReader or others
25 |
26 | _epd_init_code = uc8151d_monofull_init_code;
27 | _epd_partial_init_code = uc8151d_partial_init_code;
28 | _epd_partial_lut_code = uc8151d_partialmono_lut;
29 |
30 | layer_colors[EPD_WHITE] = 0b00;
31 | layer_colors[EPD_BLACK] = 0b01;
32 | layer_colors[EPD_RED] = 0b01;
33 | layer_colors[EPD_GRAY] = 0b01;
34 | layer_colors[EPD_LIGHT] = 0b00;
35 | layer_colors[EPD_DARK] = 0b01;
36 |
37 | default_refresh_delay = 1000;
38 | setRotation(0);
39 | powerDown();
40 | }
41 | };
42 |
43 | #endif // _THINKINK_290_MONO_M06_H
44 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_290_Tricolor_RH.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_290_TRICOLOR_RH_H
2 | #define _THINKINK_290_TRICOLOR_RH_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | class ThinkInk_290_Tricolor_RH : public Adafruit_SSD1680 {
8 | public:
9 | ThinkInk_290_Tricolor_RH(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
10 | int16_t CS, int16_t SRCS, int16_t MISO,
11 | int16_t BUSY = -1)
12 | : Adafruit_SSD1680(296, 128, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_290_Tricolor_RH(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
15 | int16_t BUSY = -1, SPIClass *spi = &SPI)
16 | : Adafruit_SSD1680(296, 128, DC, RST, CS, SRCS, BUSY, spi){};
17 |
18 | void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
19 | Adafruit_SSD1680::begin(true);
20 | setBlackBuffer(0, true);
21 | setColorBuffer(1, false);
22 |
23 | inkmode = mode; // Preserve ink mode for ImageReader or others
24 |
25 | layer_colors[EPD_WHITE] = 0b00;
26 | layer_colors[EPD_BLACK] = 0b01;
27 | layer_colors[EPD_RED] = 0b10;
28 | layer_colors[EPD_GRAY] = 0b10;
29 | layer_colors[EPD_LIGHT] = 0b00;
30 | layer_colors[EPD_DARK] = 0b01;
31 |
32 | default_refresh_delay = 13000;
33 | setRotation(0);
34 | powerDown();
35 | }
36 | };
37 |
38 | #endif // _THINKINK_290 RH
39 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_290_Tricolor_Z10.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_290_TRICOLOR_Z10_H
2 | #define _THINKINK_290_TRICOLOR_Z10_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | class ThinkInk_290_Tricolor_Z10 : public Adafruit_IL0373 {
8 | public:
9 | ThinkInk_290_Tricolor_Z10(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
10 | int16_t CS, int16_t SRCS, int16_t MISO,
11 | int16_t BUSY = -1)
12 | : Adafruit_IL0373(296, 128, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_290_Tricolor_Z10(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
15 | int16_t BUSY = -1, SPIClass *spi = &SPI)
16 | : Adafruit_IL0373(296, 128, DC, RST, CS, SRCS, BUSY, spi){};
17 |
18 | void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
19 | Adafruit_IL0373::begin(true);
20 | setColorBuffer(0, true); // layer 0 uninverted
21 | setBlackBuffer(1, true); // layer 1 uninverted
22 |
23 | inkmode = mode; // Preserve ink mode for ImageReader or others
24 |
25 | layer_colors[EPD_WHITE] = 0b00;
26 | layer_colors[EPD_BLACK] = 0b10;
27 | layer_colors[EPD_RED] = 0b01;
28 | layer_colors[EPD_GRAY] = 0b01;
29 | layer_colors[EPD_LIGHT] = 0b00;
30 | layer_colors[EPD_DARK] = 0b10;
31 |
32 | default_refresh_delay = 13000;
33 |
34 | powerDown();
35 | }
36 | };
37 |
38 | #endif // _THINKINK_290_TRICOLOR_H
39 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_290_Tricolor_Z13.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_290_TRI_Z13_H
2 | #define _THINKINK_290_TRI_Z13_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | class ThinkInk_290_Tricolor_Z13 : public Adafruit_UC8151D {
8 | public:
9 | ThinkInk_290_Tricolor_Z13(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
10 | int16_t CS, int16_t SRCS, int16_t MISO,
11 | int16_t BUSY = -1)
12 | : Adafruit_UC8151D(296, 128, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_290_Tricolor_Z13(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
15 | int16_t BUSY = -1, SPIClass *spi = &SPI)
16 | : Adafruit_UC8151D(296, 128, DC, RST, CS, SRCS, BUSY, spi){};
17 |
18 | void begin(thinkinkmode_t mode = THINKINK_MONO) {
19 | Adafruit_UC8151D::begin(true);
20 |
21 | setColorBuffer(0, true);
22 | setBlackBuffer(1, true);
23 |
24 | inkmode = mode; // Preserve ink mode for ImageReader or others
25 |
26 | _epd_init_code = uc8151d_trifull_init_code;
27 |
28 | layer_colors[EPD_WHITE] = 0b00;
29 | layer_colors[EPD_BLACK] = 0b10;
30 | layer_colors[EPD_RED] = 0b01;
31 | layer_colors[EPD_GRAY] = 0b01;
32 | layer_colors[EPD_LIGHT] = 0b00;
33 | layer_colors[EPD_DARK] = 0b01;
34 |
35 | default_refresh_delay = 1000;
36 | setRotation(0);
37 | powerDown();
38 | }
39 | };
40 |
41 | #endif // _THINKINK_290_TRI_Z13_H
42 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_290_Tricolor_Z94.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_290_TRICOLOR_Z94_H
2 | #define _THINKINK_290_TRICOLOR_Z94_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | class ThinkInk_290_Tricolor_Z94 : public Adafruit_SSD1680 {
8 | public:
9 | ThinkInk_290_Tricolor_Z94(int8_t SID, int8_t SCLK, int8_t DC, int8_t RST,
10 | int8_t CS, int8_t SRCS, int8_t MISO,
11 | int8_t BUSY = -1)
12 | : Adafruit_SSD1680(296, 128, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_290_Tricolor_Z94(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
15 | int8_t BUSY = -1, SPIClass *spi = &SPI)
16 | : Adafruit_SSD1680(296, 128, DC, RST, CS, SRCS, BUSY, spi){};
17 |
18 | void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
19 | _xram_offset = 0;
20 |
21 | Adafruit_SSD1680::begin(true);
22 | setBlackBuffer(0, true);
23 | setColorBuffer(1, false);
24 |
25 | inkmode = mode; // Preserve ink mode for ImageReader or others
26 |
27 | layer_colors[EPD_WHITE] = 0b00;
28 | layer_colors[EPD_BLACK] = 0b01;
29 | layer_colors[EPD_RED] = 0b10;
30 | layer_colors[EPD_GRAY] = 0b10;
31 | layer_colors[EPD_LIGHT] = 0b00;
32 | layer_colors[EPD_DARK] = 0b01;
33 |
34 | default_refresh_delay = 13000;
35 | setRotation(0);
36 | powerDown();
37 | }
38 | };
39 |
40 | #endif // _THINKINK_290 Z94
41 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_420_Grayscale4_T2.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_420_GRAY4_T2_H
2 | #define _THINKINK_420_GRAY4_T2_H
3 |
4 | #include "Adafruit_EPD.h"
5 |
6 | // clang-format off
7 |
8 | static const uint8_t ti_420t2_gray4_init_code[] {
9 | IL0398_POWER_SETTING, 5, 0x03, 0x00, 0x2b, 0x2b, 0x13,
10 | IL0398_BOOSTER_SOFT_START, 3, 0x17, 0x17, 0x17,
11 | IL0398_POWER_ON, 0,
12 | 0xFF, 200,
13 | IL0398_PANEL_SETTING, 1, 0x3F,
14 | IL0398_PLL, 1, 0x3C,
15 | IL0398_VCM_DC_SETTING, 1, 0x12,
16 | IL0398_VCOM, 1, 0x97,
17 | 0xFE // EOM
18 | };
19 |
20 | static const uint8_t ti_420t2_gray4_lut_code[] = {
21 | // const unsigned char lut_vcom[]PROGMEM =
22 | IL0398_LUT1, 42,
23 | 0x00, 0x0A, 0x00, 0x00, 0x00, 0x01,
24 | 0x60, 0x14, 0x14, 0x00, 0x00, 0x01,
25 | 0x00, 0x14, 0x00, 0x00, 0x00, 0x01,
26 | 0x00, 0x13, 0x0A, 0x01, 0x00, 0x01,
27 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
28 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
29 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
30 |
31 | // const unsigned char lut_ww[]PROGMEM ={
32 | IL0398_LUTWW, 42,
33 | 0x40, 0x0A, 0x00, 0x00, 0x00, 0x01,
34 | 0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
35 | 0x10, 0x14, 0x0A, 0x00, 0x00, 0x01,
36 | 0xA0, 0x13, 0x01, 0x00, 0x00, 0x01,
37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
38 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
40 |
41 | // const unsigned char lut_bw[]PROGMEM ={
42 | IL0398_LUTBW, 42,
43 | 0x40, 0x0A, 0x00, 0x00, 0x00, 0x01,
44 | 0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
45 | 0x00, 0x14, 0x0A, 0x00, 0x00, 0x01,
46 | 0x99, 0x0C, 0x01, 0x03, 0x04, 0x01,
47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
48 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
49 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
50 |
51 | // const unsigned char lut_wb[]PROGMEM ={
52 | IL0398_LUTWB, 42,
53 | 0x40, 0x0A, 0x00, 0x00, 0x00, 0x01,
54 | 0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
55 | 0x00, 0x14, 0x0A, 0x00, 0x00, 0x01,
56 | 0x99, 0x0B, 0x04, 0x04, 0x01, 0x01,
57 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
58 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
59 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
60 |
61 | // const unsigned char lut_bb[]PROGMEM ={
62 | IL0398_LUTBB, 42,
63 | 0x80, 0x0A, 0x00, 0x00, 0x00, 0x01,
64 | 0x90, 0x14, 0x14, 0x00, 0x00, 0x01,
65 | 0x20, 0x14, 0x0A, 0x00, 0x00, 0x01,
66 | 0x50, 0x13, 0x01, 0x00, 0x00, 0x01,
67 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
68 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
69 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
70 | };
71 |
72 | // clang-format on
73 |
74 | class ThinkInk_420_Grayscale4_T2 : public Adafruit_IL0398 {
75 | private:
76 | public:
77 | ThinkInk_420_Grayscale4_T2(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
78 | int16_t CS, int16_t SRCS, int16_t MISO,
79 | int16_t BUSY = -1)
80 | : Adafruit_IL0398(300, 400, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
81 |
82 | ThinkInk_420_Grayscale4_T2(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
83 | int16_t BUSY = -1, SPIClass *spi = &SPI)
84 | : Adafruit_IL0398(300, 400, DC, RST, CS, SRCS, BUSY, spi){};
85 |
86 | void begin(thinkinkmode_t mode = THINKINK_MONO) {
87 | Adafruit_EPD::begin(true);
88 | setColorBuffer(0, true); // layer 0 uninverted
89 | setBlackBuffer(1, true); // layer 1 uninverted
90 |
91 | if (mode == THINKINK_MONO) {
92 | _epd_init_code = NULL;
93 | _epd_lut_code = NULL;
94 |
95 | layer_colors[EPD_WHITE] = 0b00;
96 | layer_colors[EPD_BLACK] = 0b01;
97 | layer_colors[EPD_RED] = 0b01;
98 | layer_colors[EPD_GRAY] = 0b01;
99 | layer_colors[EPD_LIGHT] = 0b00;
100 | layer_colors[EPD_DARK] = 0b01;
101 | }
102 |
103 | if (mode == THINKINK_GRAYSCALE4) {
104 | _epd_init_code = ti_420t2_gray4_init_code;
105 | _epd_lut_code = ti_420t2_gray4_lut_code;
106 |
107 | layer_colors[EPD_WHITE] = 0b00;
108 | layer_colors[EPD_BLACK] = 0b11;
109 | layer_colors[EPD_RED] = 0b01;
110 | layer_colors[EPD_GRAY] = 0b10;
111 | layer_colors[EPD_LIGHT] = 0b01;
112 | layer_colors[EPD_DARK] = 0b10;
113 | }
114 |
115 | default_refresh_delay = 1000;
116 | setRotation(1);
117 | powerDown();
118 | };
119 | };
120 |
121 | #endif // _THINKINK_420_GRAY4_T2_H
122 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_420_Mono_BN.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_420_MONO_BN_H
2 | #define _THINKINK_420_MONO_BN_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | class ThinkInk_420_Mono_BN : public Adafruit_SSD1619 {
8 | public:
9 | ThinkInk_420_Mono_BN(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
10 | int16_t CS, int16_t SRCS, int16_t MISO,
11 | int16_t BUSY = -1)
12 | : Adafruit_SSD1619(300, 400, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_420_Mono_BN(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
15 | int16_t BUSY = -1, SPIClass *spi = &SPI)
16 | : Adafruit_SSD1619(300, 400, DC, RST, CS, SRCS, BUSY, spi){};
17 |
18 | void begin(thinkinkmode_t mode = THINKINK_MONO) {
19 | Adafruit_SSD1619::begin(true);
20 | setColorBuffer(0, true); // layer 0 uninverted
21 | setBlackBuffer(0, true); // only one buffer
22 |
23 | inkmode = mode; // Preserve ink mode for ImageReader or others
24 |
25 | layer_colors[EPD_WHITE] = 0b00;
26 | layer_colors[EPD_BLACK] = 0b01;
27 | layer_colors[EPD_RED] = 0b01;
28 | layer_colors[EPD_GRAY] = 0b01;
29 | layer_colors[EPD_LIGHT] = 0b00;
30 | layer_colors[EPD_DARK] = 0b01;
31 |
32 | default_refresh_delay = 1000;
33 | setRotation(1);
34 | powerDown();
35 | }
36 | };
37 |
38 | #endif // _THINKINK_420_MONO_BN_H
39 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_420_Mono_M06.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_420_MONO_M06_H
2 | #define _THINKINK_420_MONO_M06_H
3 |
4 | #include "Adafruit_EPD.h"
5 |
6 | class ThinkInk_420_Mono_M06 : public Adafruit_UC8276 {
7 | private:
8 | public:
9 | ThinkInk_420_Mono_M06(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
10 | int16_t CS, int16_t SRCS, int16_t MISO,
11 | int16_t BUSY = -1)
12 | : Adafruit_UC8276(300, 400, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_420_Mono_M06(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
15 | int16_t BUSY = -1, SPIClass *spi = &SPI)
16 | : Adafruit_UC8276(300, 400, DC, RST, CS, SRCS, BUSY, spi){};
17 |
18 | void begin(thinkinkmode_t mode = THINKINK_MONO) {
19 | Adafruit_EPD::begin(true);
20 | setColorBuffer(1, true); // layer 1 uninverted
21 | setBlackBuffer(1, true); // only one buffer
22 |
23 | layer_colors[EPD_WHITE] = 0b00;
24 | layer_colors[EPD_BLACK] = 0b01;
25 | layer_colors[EPD_RED] = 0b10;
26 | layer_colors[EPD_GRAY] = 0b10;
27 | layer_colors[EPD_LIGHT] = 0b00;
28 | layer_colors[EPD_DARK] = 0b01;
29 |
30 | default_refresh_delay = 13000;
31 | setRotation(1);
32 | powerDown();
33 | };
34 | };
35 |
36 | #endif // _THINKINK_420_MONO
37 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_420_Tricolor_RW.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_420_TRICOLOR_RW_H
2 | #define _THINKINK_420_TRICOLOR_RW_H
3 |
4 | // This file is #included by Adafruit_ThinkInk.h and does not need to
5 | // #include anything else to pick up the EPD header or ink mode enum.
6 |
7 | class ThinkInk_420_Tricolor_RW : public Adafruit_SSD1619 {
8 | public:
9 | ThinkInk_420_Tricolor_RW(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
10 | int16_t CS, int16_t SRCS, int16_t MISO,
11 | int16_t BUSY = -1)
12 | : Adafruit_SSD1619(300, 400, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_420_Tricolor_RW(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
15 | int16_t BUSY = -1, SPIClass *spi = &SPI)
16 | : Adafruit_SSD1619(300, 400, DC, RST, CS, SRCS, BUSY, spi){};
17 |
18 | void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
19 | Adafruit_SSD1619::begin(true);
20 | setBlackBuffer(0, true);
21 | setColorBuffer(1, false);
22 |
23 | inkmode = mode; // Preserve ink mode for ImageReader or others
24 |
25 | layer_colors[EPD_WHITE] = 0b00;
26 | layer_colors[EPD_BLACK] = 0b01;
27 | layer_colors[EPD_RED] = 0b10;
28 | layer_colors[EPD_GRAY] = 0b10;
29 | layer_colors[EPD_LIGHT] = 0b00;
30 | layer_colors[EPD_DARK] = 0b01;
31 |
32 | default_refresh_delay = 13000;
33 | setRotation(1);
34 | powerDown();
35 | }
36 | };
37 |
38 | #endif // _THINKINK_420_TRI
39 |
--------------------------------------------------------------------------------
/src/panels/ThinkInk_420_Tricolor_Z21.h:
--------------------------------------------------------------------------------
1 | #ifndef _THINKINK_420_TRICOLOR_Z21_H
2 | #define _THINKINK_420_TRICOLOR_Z21_H
3 |
4 | #include "Adafruit_EPD.h"
5 |
6 | class ThinkInk_420_Tricolor_Z21 : public Adafruit_UC8276 {
7 | private:
8 | public:
9 | ThinkInk_420_Tricolor_Z21(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
10 | int16_t CS, int16_t SRCS, int16_t MISO,
11 | int16_t BUSY = -1)
12 | : Adafruit_UC8276(300, 400, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13 |
14 | ThinkInk_420_Tricolor_Z21(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
15 | int16_t BUSY = -1, SPIClass *spi = &SPI)
16 | : Adafruit_UC8276(300, 400, DC, RST, CS, SRCS, BUSY, spi){};
17 |
18 | void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) {
19 | (void)mode;
20 | Adafruit_EPD::begin(true);
21 | setBlackBuffer(0, true);
22 | setColorBuffer(1, false);
23 |
24 | layer_colors[EPD_WHITE] = 0b00;
25 | layer_colors[EPD_BLACK] = 0b01;
26 | layer_colors[EPD_RED] = 0b10;
27 | layer_colors[EPD_GRAY] = 0b10;
28 | layer_colors[EPD_LIGHT] = 0b00;
29 | layer_colors[EPD_DARK] = 0b01;
30 |
31 | default_refresh_delay = 13000;
32 | setRotation(1);
33 | powerDown();
34 | };
35 | };
36 |
37 | #endif // _THINKINK_420_TRI
38 |
--------------------------------------------------------------------------------
/unsupported/Adafruit_IL0371.h:
--------------------------------------------------------------------------------
1 | #ifndef LIB_ADAFRUIT_IL0371
2 | #define LIB_ADAFRUIT_IL0371
3 |
4 | #include "Adafruit_EPD.h"
5 | #include
6 |
7 | #define EPD_RAM_BW 0x10
8 | #define EPD_RAM_RED 0x13
9 |
10 | #define IL0371_PANEL_SETTING 0x00
11 | #define IL0371_POWER_SETTING 0x01
12 | #define IL0371_POWER_OFF 0x02
13 | #define IL0371_POWER_OFF_SEQUENCE 0x03
14 | #define IL0371_POWER_ON 0x04
15 | #define IL0371_POWER_ON_MEASURE 0x05
16 | #define IL0371_BOOSTER_SOFT_START 0x06
17 | #define IL0371_DEEP_SLEEP 0x07
18 | #define IL0371_DTM1 0x10
19 | #define IL0371_DATA_STOP 0x11
20 | #define IL0371_DISPLAY_REFRESH 0x12
21 | #define IL0371_PDTM1 0x14
22 | #define IL0371_PDTM2 0x15
23 | #define IL0371_PDRF 0x16
24 | #define IL0371_LUT1 0x20
25 | #define IL0371_LUTWW 0x21
26 | #define IL0371_LUTBW 0x22
27 | #define IL0371_LUTWB 0x23
28 | #define IL0371_LUTBB 0x24
29 | #define IL0371_PLL 0x30
30 | #define IL0371_CDI 0x50
31 | #define IL0371_RESOLUTION 0x61
32 | #define IL0371_VCM_DC_SETTING 0x82
33 |
34 | /**************************************************************************/
35 | /*!
36 | @brief Class for interfacing with IL0371 EPD drivers
37 | */
38 | /**************************************************************************/
39 | class Adafruit_IL0371 : public Adafruit_EPD {
40 | public:
41 | #ifdef USE_EXTERNAL_SRAM
42 | Adafruit_IL0371(int width, int height, int8_t SID, int8_t SCLK, int8_t DC,
43 | int8_t RST, int8_t CS, int8_t SRCS, int8_t MISO,
44 | int8_t BUSY = -1);
45 | Adafruit_IL0371(int width, int height, int8_t DC, int8_t RST, int8_t CS,
46 | int8_t SRCS, int8_t BUSY = -1);
47 | #else
48 | Adafruit_IL0371(int width, int height, int8_t SID, int8_t SCLK, int8_t DC,
49 | int8_t RST, int8_t CS, int8_t BUSY = -1);
50 | Adafruit_IL0371(int width, int height, int8_t DC, int8_t RST, int8_t CS,
51 | int8_t BUSY = -1);
52 | #endif
53 |
54 | void begin(bool reset = true);
55 | void powerUp();
56 |
57 | void drawPixel(int16_t x, int16_t y, uint16_t color);
58 |
59 | void display();
60 | void update();
61 |
62 | void clearBuffer();
63 | void clearDisplay();
64 | };
65 |
66 | #endif
--------------------------------------------------------------------------------
/unsupported/Adafruit_IL0376F.h:
--------------------------------------------------------------------------------
1 | #ifndef LIB_ADAFRUIT_IL0376F
2 | #define LIB_ADAFRUIT_IL0376F
3 |
4 | #include "Adafruit_EPD.h"
5 | #include
6 |
7 | #if defined(IL0376F_200_200)
8 | #define EPD_LCDWIDTH 200
9 | #define EPD_LCDHEIGHT 200
10 | #define EPD_BUFSIZE 10000
11 | #define EPD_REDBUFSIZE 5000
12 | #endif
13 |
14 | #define EPD_RAM_BW 0x10
15 | #define EPD_RAM_RED 0x13
16 |
17 | #define IL0376F_PANEL_SETTING 0x00
18 | #define IL0376F_POWER_SETTING 0x01
19 | #define IL0376F_POWER_OFF 0x02
20 | #define IL0376F_POWER_OFF_SEQUENCE 0x03
21 | #define IL0376F_POWER_ON 0x04
22 | #define IL0376F_POWER_ON_MEASURE 0x05
23 | #define IL0376F_BOOSTER_SOFT_START 0x06
24 | #define IL0376F_DTM1 0x10
25 | #define IL0376F_DATA_STOP 0x11
26 | #define IL0376F_DISPLAY_REFRESH 0x12
27 | #define IL0376F_DTM2 0x13
28 | #define IL0376F_VCOM1_LUT 0x20
29 | #define IL0376F_WHITE_LUT 0x21
30 | #define IL0376F_BLACK_LUT 0x22
31 | #define IL0376F_GRAY1_LUT 0x23
32 | #define IL0376F_GRAY2_LUT 0x24
33 | #define IL0376F_VCOM2_LUT 0x25
34 | #define IL0376F_RED0_LUT 0x26
35 | #define IL0376F_RED1_LUT 0x27
36 | #define IL0376F_PLL 0x30
37 | #define IL0376F_CDI 0x50
38 | #define IL0376F_RESOLUTION 0x61
39 | #define IL0376F_VCM_DC_SETTING 0x82
40 |
41 | /**************************************************************************/
42 | /*!
43 | @brief Class for interfacing with IL0376F EPD drivers
44 | */
45 | /**************************************************************************/
46 | class Adafruit_IL0376F : public Adafruit_EPD {
47 | public:
48 | #ifdef USE_EXTERNAL_SRAM
49 | Adafruit_IL0376F(int width, int height, int8_t SID, int8_t SCLK, int8_t DC,
50 | int8_t RST, int8_t CS, int8_t SRCS, int8_t MISO,
51 | int8_t BUSY = -1);
52 | Adafruit_IL0376F(int width, int height, int8_t DC, int8_t RST, int8_t CS,
53 | int8_t SRCS, int8_t BUSY = -1);
54 | #else
55 | Adafruit_IL0376F(int width, int height, int8_t SID, int8_t SCLK, int8_t DC,
56 | int8_t RST, int8_t CS, int8_t BUSY = -1);
57 | Adafruit_IL0376F(int width, int height, int8_t DC, int8_t RST, int8_t CS,
58 | int8_t BUSY = -1);
59 | #endif
60 |
61 | void begin(bool reset = true);
62 | void powerUp();
63 |
64 | void drawPixel(int16_t x, int16_t y, uint16_t color);
65 |
66 | void display();
67 | void update();
68 |
69 | void clearBuffer();
70 | void clearDisplay();
71 |
72 | protected:
73 | void busy_wait();
74 | };
75 |
76 | #endif
--------------------------------------------------------------------------------
/unsupported/Adafruit_IL3897.h:
--------------------------------------------------------------------------------
1 | #ifndef LIB_ADAFRUIT_IL3897
2 | #define LIB_ADAFRUIT_IL3897
3 |
4 | #include "Adafruit_EPD.h"
5 | #include
6 |
7 | #define EPD_RAM_BW 0x10
8 |
9 | #define IL3897_DRIVER_OUT_CONTROL 0x01
10 | #define IL3897_GATE_DRIVE_VOLTAGE 0x03
11 | #define IL3897_GATE_SOURCE_VOLTAGE 0x04
12 | #define IL3897_GATE_SCAN_START 0x0F
13 | #define IL3897_DEEP_SLEEP 0x10
14 | #define IL3897_DATA_ENTRY_MODE 0x11
15 | #define IL3897_SOFT_RESET 0x12
16 | #define IL3897_MASTER_ACTIVATE 0x20
17 | #define IL3897_DISPLAY_UPDATE_CONTROL1 0x21
18 | #define IL3897_DISPLAY_UPDATE_CONTROL2 0x22
19 | #define IL3897_DISPLAY_WRITE_RAM 0x24
20 | #define IL3897_VCOM_SENSE 0x28
21 | #define IL3897_VCOM_DURATION 0x29
22 | #define IL3897_VCOM_OTP 0x2A
23 | #define IL3897_VCOM_SET 0x2C
24 | #define IL3897_STATUS_READ 0x2F
25 | #define IL3897_WRITE_LUT 0x32
26 | #define IL3897_DUMMY_LINE 0x3A
27 | #define IL3897_SET_GATE_WIDTH 0x3B
28 | #define IL3897_BORDER_WAVEFORM 0x3C
29 | #define IL3897_SET_RAM_X 0x44
30 | #define IL3897_SET_RAM_Y 0x45
31 | #define IL3897_SET_RAM_XADDR 0x4E
32 | #define IL3897_SET_RAM_YADDR 0x4F
33 | #define IL3897_SET_ANALOG_BLOCK 0x74
34 | #define IL3897_SET_DIGITAL_BLOCK 0x7E
35 |
36 | /**************************************************************************/
37 | /*!
38 | @brief Class for interfacing with IL0373 EPD drivers
39 | */
40 | /**************************************************************************/
41 | class Adafruit_IL3897 : public Adafruit_EPD {
42 | public:
43 | #ifdef USE_EXTERNAL_SRAM
44 | Adafruit_IL3897(int width, int height, int8_t SID, int8_t SCLK, int8_t DC,
45 | int8_t RST, int8_t CS, int8_t SRCS, int8_t MISO,
46 | int8_t BUSY = -1);
47 | Adafruit_IL3897(int width, int height, int8_t DC, int8_t RST, int8_t CS,
48 | int8_t SRCS, int8_t BUSY = -1);
49 | #else
50 | Adafruit_IL3897(int width, int height, int8_t SID, int8_t SCLK, int8_t DC,
51 | int8_t RST, int8_t CS, int8_t BUSY = -1);
52 | Adafruit_IL3897(int width, int height, int8_t DC, int8_t RST, int8_t CS,
53 | int8_t BUSY = -1);
54 | #endif
55 |
56 | void begin(bool reset = true);
57 | void powerUp();
58 |
59 | void drawPixel(int16_t x, int16_t y, uint16_t color);
60 | void setRAMArea(uint8_t xstart, uint8_t xend, uint16_t ystart, uint16_t yend);
61 | void setRAMPointer(uint8_t addrX, uint16_t addrY);
62 |
63 | void display();
64 | void update(bool partial = false);
65 |
66 | void deepSleep(void);
67 |
68 | void clearBuffer();
69 | void clearDisplay();
70 |
71 | protected:
72 | void busy_wait();
73 | };
74 |
75 | #endif
76 |
--------------------------------------------------------------------------------