|
16 | 16 |
|
17 | 17 | #define DELAY 0x80 |
18 | 18 |
|
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. |
20 | 20 |
|
21 | 21 | const uint8_t ssd1677_display_start_sequence[] = { |
22 | 22 | // Software Reset |
23 | | - 0x12, DELAY, 0x00, 0x14, // SWRESET + wait 20ms |
| 23 | + 0x12, DELAY, 0x00, 0x14, |
24 | 24 |
|
25 | 25 | // Temperature Sensor Control (use internal sensor) |
26 | 26 | 0x18, 0x00, 0x01, 0x80, |
27 | 27 |
|
28 | 28 | // Booster Soft Start |
29 | 29 | 0x0C, 0x00, 0x05, 0xAE, 0xC7, 0xC3, 0xC0, 0x40, |
30 | 30 |
|
31 | | - // Driver Output Control: 479 gates (HEIGHT-1 = 0x01DF) |
| 31 | + // Driver Output Control: 480 gates, GD=0, SM=1, TB=0 = 0x02 |
32 | 32 | 0x01, 0x00, 0x03, 0xDF, 0x01, 0x02, |
33 | 33 |
|
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, |
36 | 36 |
|
37 | 37 | // Border Waveform Control |
38 | 38 | 0x3C, 0x00, 0x01, 0x01, |
39 | 39 |
|
40 | 40 | // Set RAM X Address Start/End: 0 to 799 |
41 | | - |
42 | | - // X start = 0 (LE: 0x00, 0x00), X end = 799 (LE: 0x1F, 0x03) |
43 | 41 | 0x44, 0x00, 0x04, 0x00, 0x00, 0x1F, 0x03, |
44 | 42 |
|
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, |
47 | 45 |
|
48 | 46 | // Set RAM X Counter to 0 |
49 | 47 | 0x4E, 0x00, 0x02, 0x00, 0x00, |
50 | 48 |
|
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, |
53 | 51 |
|
54 | 52 | // Auto Write BW RAM (clear to white) |
55 | | - 0x46, DELAY, 0x01, 0xF7, 0xFF, // + wait 255ms |
| 53 | + 0x46, DELAY, 0x01, 0xF7, 0xFF, |
56 | 54 |
|
57 | | - // Display Update Control 1: bypass RED buffer for mono mode |
| 55 | + // Display Update Control 1: bypass RED |
58 | 56 | 0x21, 0x00, 0x02, 0x40, 0x00, |
59 | 57 |
|
60 | | - // Display Update Control 2: full refresh sequence with OTP LUT |
| 58 | + // Display Update Control 2: full refresh with OTP LUT |
61 | 59 | 0x22, 0x00, 0x01, 0xF7, |
62 | 60 | }; |
63 | 61 |
|
64 | 62 | 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, |
70 | 66 | }; |
71 | 67 |
|
72 | 68 | const uint8_t ssd1677_display_refresh_sequence[] = { |
73 | | - 0x20, 0x00, 0x00 |
| 69 | + 0x20, 0x00, 0x00, |
74 | 70 | }; |
75 | 71 |
|
76 | 72 | void board_init(void) { |
@@ -104,12 +100,12 @@ void board_init(void) { |
104 | 100 | args.ram_height = 480; |
105 | 101 | args.rotation = 0; |
106 | 102 | args.write_black_ram_command = 0x24; |
107 | | - args.black_bits_inverted = true; |
| 103 | + args.black_bits_inverted = false; |
108 | 104 | args.refresh_sequence = ssd1677_display_refresh_sequence; |
109 | 105 | args.refresh_sequence_len = sizeof(ssd1677_display_refresh_sequence); |
110 | | - args.refresh_time = 1.6; // ~1600ms full refresh |
| 106 | + args.refresh_time = 1.6; |
111 | 107 | args.busy_pin = &pin_GPIO6; |
112 | | - args.busy_state = true; // BUSY is active HIGH on SSD1677 |
| 108 | + args.busy_state = true; |
113 | 109 | args.seconds_per_frame = 5.0; |
114 | 110 | args.grayscale = false; |
115 | 111 | args.two_byte_sequence_length = true; |
|
0 commit comments