Skip to content

Commit 2555bae

Browse files
committed
working display!
1 parent 1c481e8 commit 2555bae

1 file changed

Lines changed: 19 additions & 23 deletions

File tree

  • ports/espressif/boards/xteink_x4

ports/espressif/boards/xteink_x4/board.c

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,61 +16,57 @@
1616

1717
#define DELAY 0x80
1818

19-
// SSD1677 controller driving a GDEQ0426T82 4.26" 800x480 grayscale E-Ink display.
19+
// SSD1677 controller driving a GDEQ0426T82 4.26" 800x480 E-Ink display.
2020

2121
const uint8_t ssd1677_display_start_sequence[] = {
2222
// Software Reset
23-
0x12, DELAY, 0x00, 0x14, // SWRESET + wait 20ms
23+
0x12, DELAY, 0x00, 0x14,
2424

2525
// Temperature Sensor Control (use internal sensor)
2626
0x18, 0x00, 0x01, 0x80,
2727

2828
// Booster Soft Start
2929
0x0C, 0x00, 0x05, 0xAE, 0xC7, 0xC3, 0xC0, 0x40,
3030

31-
// Driver Output Control: 479 gates (HEIGHT-1 = 0x01DF)
31+
// Driver Output Control: 480 gates, GD=0, SM=1, TB=0 = 0x02
3232
0x01, 0x00, 0x03, 0xDF, 0x01, 0x02,
3333

34-
// Data Entry Mode: X increment, Y increment
35-
0x11, 0x00, 0x01, 0x02,
34+
// Data Entry Mode: X increment, Y decrement = 0x01
35+
0x11, 0x00, 0x01, 0x01,
3636

3737
// Border Waveform Control
3838
0x3C, 0x00, 0x01, 0x01,
3939

4040
// Set RAM X Address Start/End: 0 to 799
41-
42-
// X start = 0 (LE: 0x00, 0x00), X end = 799 (LE: 0x1F, 0x03)
4341
0x44, 0x00, 0x04, 0x00, 0x00, 0x1F, 0x03,
4442

45-
// Set RAM Y Address Start/End: 0 to 479
46-
0x45, 0x00, 0x04, 0x00, 0x00, 0xDF, 0x01,
43+
// Set RAM Y Address Start/End: 479 down to 0
44+
0x45, 0x00, 0x04, 0xDF, 0x01, 0x00, 0x00,
4745

4846
// Set RAM X Counter to 0
4947
0x4E, 0x00, 0x02, 0x00, 0x00,
5048

51-
// Set RAM Y Counter to 0
52-
0x4F, 0x00, 0x02, 0x00, 0x00,
49+
// Set RAM Y Counter to 479
50+
0x4F, 0x00, 0x02, 0xDF, 0x01,
5351

5452
// Auto Write BW RAM (clear to white)
55-
0x46, DELAY, 0x01, 0xF7, 0xFF, // + wait 255ms
53+
0x46, DELAY, 0x01, 0xF7, 0xFF,
5654

57-
// Display Update Control 1: bypass RED buffer for mono mode
55+
// Display Update Control 1: bypass RED
5856
0x21, 0x00, 0x02, 0x40, 0x00,
5957

60-
// Display Update Control 2: full refresh sequence with OTP LUT
58+
// Display Update Control 2: full refresh with OTP LUT
6159
0x22, 0x00, 0x01, 0xF7,
6260
};
6361

6462
const uint8_t ssd1677_display_stop_sequence[] = {
65-
// Power off sequence
66-
0x22, 0x00, 0x01, 0x83, // Display update control: power off
67-
0x20, 0x00, 0x00, // Master activation
68-
// Deep sleep
69-
0x10, 0x00, 0x01, 0x01, // Enter deep sleep mode
63+
0x22, 0x00, 0x01, 0x83,
64+
0x20, 0x00, 0x00,
65+
0x10, 0x00, 0x01, 0x01,
7066
};
7167

7268
const uint8_t ssd1677_display_refresh_sequence[] = {
73-
0x20, 0x00, 0x00
69+
0x20, 0x00, 0x00,
7470
};
7571

7672
void board_init(void) {
@@ -104,12 +100,12 @@ void board_init(void) {
104100
args.ram_height = 480;
105101
args.rotation = 0;
106102
args.write_black_ram_command = 0x24;
107-
args.black_bits_inverted = true;
103+
args.black_bits_inverted = false;
108104
args.refresh_sequence = ssd1677_display_refresh_sequence;
109105
args.refresh_sequence_len = sizeof(ssd1677_display_refresh_sequence);
110-
args.refresh_time = 1.6; // ~1600ms full refresh
106+
args.refresh_time = 1.6;
111107
args.busy_pin = &pin_GPIO6;
112-
args.busy_state = true; // BUSY is active HIGH on SSD1677
108+
args.busy_state = true;
113109
args.seconds_per_frame = 5.0;
114110
args.grayscale = false;
115111
args.two_byte_sequence_length = true;

0 commit comments

Comments
 (0)