Skip to content

Commit 592af1f

Browse files
committed
add:add 4.0inch E6 epaper diver support.
1 parent d51b033 commit 592af1f

File tree

4 files changed

+87
-5
lines changed

4 files changed

+87
-5
lines changed

TFT_Drivers/ED2208_Init.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,12 @@
7676
writedata(0x00);
7777

7878
writecommand(EPD_TRES);
79-
writedata(0x03);
80-
writedata(0x20);
81-
writedata(0x01);
82-
writedata(0xE0);
79+
writedata((TFT_WIDTH >> 8) & 0xFF);
80+
writedata(TFT_WIDTH & 0xFF);
81+
writedata((TFT_HEIGHT >> 8) & 0xFF);
82+
writedata(TFT_HEIGHT & 0xFF);
8383

84+
8485
writecommand(EPD_VDCS);
8586
writedata(0x1E);
8687

User_Setups/Dynamic_Setup.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,10 @@
318318
#define USE_BWRY_EPAPER
319319
#define ENABLE_EPAPER_BOARD_PIN_SETUPS
320320
#include <User_Setups/Setup513_Seeed_XIAO_EPaper_2inch13_BWRY.h>
321+
#elif BOARD_SCREEN_COMBO == 514
322+
#define USE_COLORFULL_EPAPER
323+
#define ENABLE_EPAPER_BOARD_PIN_SETUPS
324+
#include <User_Setups/Setup514_Seeed_XIAO_EPaper_4inch0_colorful.h> // Setup file for Seeed XIAO with 4.0inch colorful ePaper
321325
#elif BOARD_SCREEN_COMBO == 520
322326
#define ENABLE_EPAPER_BOARD_PIN_SETUPS
323327
#include <User_Setups/Setup520_Seeed_reTerminal_E1001.h>
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#include <Wire.h>
2+
3+
#define USER_SETUP_ID 514
4+
5+
#define ED2208_DRIVER
6+
7+
8+
#define EPAPER_ENABLE
9+
10+
#define TFT_WIDTH 400
11+
#define TFT_HEIGHT 600
12+
13+
#define EPD_WIDTH TFT_WIDTH
14+
#define EPD_HEIGHT TFT_HEIGHT
15+
16+
// #define EPD_HORIZONTAL_MIRROR
17+
18+
#ifdef ENABLE_EPAPER_BOARD_PIN_SETUPS
19+
#include "EPaper_Board_Pins_Setups.h"
20+
#else
21+
#define TFT_SCLK D8
22+
#define TFT_MISO D9
23+
#define TFT_MOSI D10
24+
#define TFT_CS D7 // Chip select control pin
25+
#define TFT_DC 10 // D16 Data Command control pin
26+
#define TFT_BUSY D3
27+
#define TFT_RST 38 // D11 Reset pin (could connect to RST pin)
28+
#endif
29+
30+
31+
32+
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
33+
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
34+
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
35+
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
36+
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-.
37+
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
38+
// #define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
39+
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
40+
41+
#define SMOOTH_FONT
42+
43+
#ifdef CONFIG_IDF_TARGET_ESP32S3
44+
#define USE_HSPI_PORT
45+
#endif
46+
47+
#if defined(SEEED_XIAO_M0)
48+
#define SPI_FREQUENCY 10000000
49+
#define SPI_READ_FREQUENCY 4000000
50+
#elif defined(ARDUINO_XIAO_ESP32S3) || defined(ARDUINO_XIAO_ESP32S3_PLUS)
51+
#define SPI_FREQUENCY 10000000
52+
#define SPI_READ_FREQUENCY 4000000
53+
#elif defined(ARDUINO_XIAO_ESP32C3)
54+
#define SPI_FREQUENCY 10000000
55+
#define SPI_READ_FREQUENCY 4000000
56+
#elif defined(ARDUINO_XIAO_ESP32C6)
57+
#define SPI_FREQUENCY 10000000
58+
#define SPI_READ_FREQUENCY 4000000
59+
#elif defined(ARDUINO_SEEED_XIAO_NRF52840) || defined(ARDUINO_SEEED_XIAO_NRF52840_SENSE) || defined(ARDUINO_Seeed_XIAO_nRF52840) || defined(ARDUINO_Seeed_XIAO_nRF52840_Sense)
60+
#define SPI_FREQUENCY 10000000
61+
#define SPI_READ_FREQUENCY 4000000
62+
#define ltoa itoa
63+
#elif defined(ARDUINO_SEEED_XIAO_RP2040) || defined(ARDUINO_SEEED_XIAO_RP2350)
64+
#define SPI_FREQUENCY 10000000
65+
#define SPI_READ_FREQUENCY 4000000
66+
#elif defined(ARDUINO_XIAO_RA4M1)
67+
#define SPI_FREQUENCY 10000000
68+
#define SPI_READ_FREQUENCY 4000000
69+
#elif defined (EFR32MG24B220F1536IM48)
70+
#define SPI_FREQUENCY 10000000
71+
#define SPI_READ_FREQUENCY 4000000
72+
#else
73+
#pragma message "Unknown board using default SPI settings (1MHz)"
74+
#define SPI_FREQUENCY 10000000
75+
#define SPI_READ_FREQUENCY 4000000
76+
#endif

index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ <h2 data-lang-key="step3_title">Final step: Copy the Generated Code</h2>
525525
options: [
526526
{ value: "502", text: "7.5 inch monochrome ePaper Screen (UC8179)" },
527527
{ value: "509", text: "7.3 inch six-color ePaper Screen(ED2208)" },
528+
{ value: "514", text: "4.0 inch six-color ePaper Screen(ED2208)" },
528529
{ value: "510", text: "13.3 inch six-color ePaper Screen(T133A01)" },
529530
{ value: "511", text: "10.3 inch monochrome ePaper Screen(ED103TC2)" },
530531
{ value: "503", text: "5.83 inch monochrome ePaper Screen (UC8179)" },
@@ -610,7 +611,7 @@ <h2 data-lang-key="step3_title">Final step: Copy the Generated Code</h2>
610611
const ePaperDiv = document.getElementById('ePaperOptions');
611612

612613
// The ePaper driver choice is for all e-papers (502-511)
613-
const isEpaperWithDriverChoice = (selectedValue >= 502 && selectedValue <= 513);
614+
const isEpaperWithDriverChoice = (selectedValue >= 502 && selectedValue <= 514);
614615

615616
if (isEpaperWithDriverChoice) {
616617
ePaperDiv.style.display = 'block';

0 commit comments

Comments
 (0)