fix: 对不支持weak的bsp, luat_http_client_onevent报重复定义了
[LuatOS.git] / components / lcd / luat_lcd_st7789.c
blob03f0447ebb30ed2464637719a7e78e82b7fcd297
1 #include "luat_base.h"
2 #include "luat_lcd.h"
4 #define LUAT_LOG_TAG "st7789"
5 #include "luat_log.h"
7 static const uint16_t st7789_init_cmds[] = {
8 /* RGB 5-6-5-bit */
9 0x023A,0x0305,
10 /* Porch Setting */
11 0x02B2,0x030C,0x030C,0x0300,0x0333,0x0333,
12 /* Gate Control */
13 0x02B7,0x0335,
14 /* VCOM Setting */
15 0x02BB,0x0332,
16 /* LCM Control */
17 // 0x02C0,
18 // 0x032C,
19 /* VDV and VRH Command Enable */
20 0x02C2,0x0301,
21 /* VRH Set */
22 0x02C3,0x0315,
23 /* VDV Set */
24 0x02C4,0x0320,
25 /* Frame Rate Control in Normal Mode */
26 0x02C6,0x030F,
27 /* Power Control 1 */
28 0x02D0,0x03A4,0x03A1,
29 /* Positive Voltage Gamma Control */
30 0x02E0,0x03D0,0x0308,0x030E,0x0309,0x0309,0x0305,0x0331,0x0333,0x0348,0x0317,0x0314,0x0315,0x0331,0x0334,
31 /* Negative Voltage Gamma Control */
32 0x02E1,0x03D0,0x0308,0x030E,0x0309,0x0309,0x0315,0x0331,0x0333,0x0348,0x0317,0x0314,0x0315,0x0331,0x0334,
33 0x0221,
36 luat_lcd_opts_t lcd_opts_st7789 = {
37 .name = "st7789",
38 .init_cmds_len = sizeof(st7789_init_cmds)/sizeof(st7789_init_cmds[0]),
39 .init_cmds = st7789_init_cmds,
40 .direction0 = 0x00,
41 .direction90 = 0xC0,
42 .direction180 = 0x70,
43 .direction270 = 0xA0