Skip to content

Commit 7811adc

Browse files
improve display init, thanks @CDarius
Co-authored-by: CDarius <[email protected]>
1 parent ae30f51 commit 7811adc

File tree

1 file changed

+15
-28
lines changed
  • ports/espressif/boards/m5stack_cardputer

1 file changed

+15
-28
lines changed

ports/espressif/boards/m5stack_cardputer/board.c

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -37,36 +37,23 @@ fourwire_fourwire_obj_t board_display_obj;
3737

3838
#define DELAY 0x80
3939

40-
// display init sequence according to LilyGO example app
4140
uint8_t display_init_sequence[] = {
42-
// sw reset
43-
0x01, 0 | DELAY, 150,
44-
// sleep out
45-
0x11, 0 | DELAY, 255,
46-
// normal display mode on
47-
0x13, 0,
48-
// display and color format settings
49-
0x36, 1, 0x68,
50-
0xB6, 2, 0x0A, 0x82,
51-
0x3A, 1 | DELAY, 0x55, 10,
52-
// ST7789V frame rate setting
53-
0xB2, 5, 0x0C, 0x0C, 0x00, 0x33, 0x33,
54-
// voltages: VGH / VGL
55-
0xB7, 1, 0x35,
56-
// ST7789V power setting
57-
0xBB, 1, 0x28,
58-
0xC0, 1, 0x0C,
59-
0xC2, 2, 0x01, 0xFF,
60-
0xC3, 1, 0x10,
61-
0xC4, 1, 0x20,
62-
0xC6, 1, 0x0F,
63-
0xD0, 2, 0xA4, 0xA1,
64-
// ST7789V gamma setting
65-
0xE0, 14, 0xD0, 0x00, 0x02, 0x07, 0x0A, 0x28, 0x32, 0x44, 0x42, 0x06, 0x0E, 0x12, 0x14, 0x17,
66-
0xE1, 14, 0xD0, 0x00, 0x02, 0x07, 0x0A, 0x28, 0x31, 0x54, 0x47, 0x0E, 0x1C, 0x17, 0x1B, 0x1E,
41+
// SWRESET and Delay 140ms
42+
0x01, 0 | DELAY, 140,
43+
// SLPOUT and Delay 10ms
44+
0x11, 0 | DELAY, 10,
45+
// COLMOD 65k colors and 16 bit 5-6-5
46+
0x3A, 1, 0x55,
47+
// INVON Iiversion on
6748
0x21, 0,
68-
// display on
69-
0x29, 0 | DELAY, 255,
49+
// NORON normal operation (full update)
50+
0x13, 0,
51+
// MADCTL columns RTL, page/column reverse order
52+
0x36, 1, 0x60,
53+
// RAMCTRL color word little endian
54+
0xB0, 2, 0x00, 0xF8,
55+
// DIPON display on
56+
0x29, 0,
7057
};
7158

7259

0 commit comments

Comments
 (0)