7
7
import lvgl as lv # NOQA
8
8
9
9
10
- _AXS_LCD_NOP = const (0x02000000 ) # No operation (C)
11
- _AXS_LCD_SWRESET = const (0x02000100 ) # Software reset (C)
12
- _AXS_LCD_RDDID = const (0x02000400 ) # Read display (R)
13
- _AXS_LCD_RDNUMED = const (0x02000500 ) # Read Number of the Errors on DSI (R)
14
- _AXS_LCD_RDDST = const (0x02000900 ) # Read display status (R)
15
- _AXS_LCD_RDDPM = const (0x02000A00 ) # Read display power (R)
16
- _AXS_LCD_RDDMADC = const (0x02000B00 ) # Read memory data access control (R)
17
- _AXS_LCD_RDDIPF = const (0x02000C00 ) # Read Interface Pixel Format (R)
18
- _AXS_LCD_RDDIM = const (0x02000D00 ) # Read display image (R)
19
- _AXS_LCD_RDDSM = const (0x02000E00 ) # Read display signal (R)
20
- _AXS_LCD_RDDSDR = const (0x02000F00 ) # Read display self-diagnostic result (R)
21
- _AXS_LCD_SLPIN = const (0x02001000 ) # Sleep in (C)
22
- _AXS_LCD_SLPOUT = const (0x02001100 ) # Sleep out (C)
23
- _AXS_LCD_PTLON = const (0x02001200 ) # Partial mode on (C)
24
- _AXS_LCD_NORON = const (0x02001300 ) # Partial mode off(Normal) (C)
25
- _AXS_LCD_INVOFF = const (0x02002000 ) # Display inversion off (C)
26
- _AXS_LCD_INVON = const (0x02002100 ) # Display inversion on (C)
27
- _AXS_LCD_ALLPOFF = const (0x02002200 ) # All pixel off (C)
28
- _AXS_LCD_ALLPON = const (0x02002300 ) # All pixel on (C)
29
- _AXS_LCD_ALLPFILL = const (0x02002400 ) # All pixel fill given color (W)
30
- _AXS_LCD_GAMSET = const (0x02002600 ) # Gamma curve set (W)
31
- _AXS_LCD_DISPOFF = const (0x02002800 ) # Display off (C)
32
- _AXS_LCD_DISPON = const (0x02002900 ) # Display on (C)
33
- _AXS_LCD_CASET = const (0x02002A00 ) # Column address set (W)
34
- _AXS_LCD_RASET = const (0x02002B00 ) # Row address set (W)
35
- _AXS_LCD_RAMWR = const (0x02002C00 ) # Memory write any length MIPI/SPI/QSPI/DBI (W)
36
- _AXS_LCD_RAMRD = const (0x02002E00 ) # Memory read any length SPI/QSPI/DBI (R)
37
- _AXS_LCD_RAWFILL = const (0x02002F00 ) # Memory fill given color at window (W)
38
- _AXS_LCD_PTLAR = const (0x02003000 ) # Partial start/end address set (W)
39
- _AXS_LCD_PTLARC = const (0x02003100 ) # set_partial_columns (W)
40
- _AXS_LCD_VSCRDEF = const (0x02003300 ) # Vertical scrolling definition (W)
41
- _AXS_LCD_TEOFF = const (0x02003400 ) # Tearing effect line off (C)
42
- _AXS_LCD_TEON = const (0x02003500 ) # Tearing effect line on (W)
43
- _AXS_LCD_MADCTL = const (0x02003600 ) # Memory data access control (W)
44
- _AXS_LCD_VSCRSADD = const (0x02003700 ) # Vertical scrolling start address (W)
45
- _AXS_LCD_IDMOFF = const (0x02003800 ) # Idle mode off (C)
46
- _AXS_LCD_IDMON = const (0x02003900 ) # Idle mode on (C)
47
- _AXS_LCD_IPF = const (0x02003A00 ) # Interface pixel format (W)
48
- _AXS_LCD_RAMWRC = const (0x02003C00 ) # Memory write continue any length MIPI/SPI/QSPI/DBI (W)
49
- _AXS_LCD_RAMRDC = const (0x02003E00 ) # Memory read continue any length SPI/QSPI/DBI (R)
50
- _AXS_LCD_TESCAN = const (0x02004400 ) # Set tear scanline (W)
51
- _AXS_LCD_RDTESCAN = const (0x02004500 ) # Get tear scanline (R)
52
- _AXS_LCD_WRDISBV = const (0x02005100 ) # Write display brightness value (W)
53
- _AXS_LCD_RDDISBV = const (0x02005200 ) # Read display brightness value (R)
54
- _AXS_LCD_WRCTRLD = const (0x02005300 ) # Write CTRL display (W)
55
- _AXS_LCD_RDCTRLD = const (0x02005400 ) # Read CTRL dsiplay (R)
56
- _AXS_LCD_RDFCHKSU = const (0x0200AA00 ) # Read First Checksum (R)
57
- _AXS_LCD_RDCCHKSU = const (0x0200AA00 ) # Read Continue Checksum (R)
58
- _AXS_LCD_RDID1 = const (0x0200DA00 ) # Read ID1 (R)
59
- _AXS_LCD_RDID2 = const (0x0200DB00 ) # Read ID2 (R)
60
- _AXS_LCD_RDID3 = const (0x0200DC00 ) # Read ID3 (R)
61
- _AXS_LCD_DSTB = const (0x02009000 ) # Enter Deep-Standby (W)
10
+ _AXS_LCD_NOP = const (0x00 ) # No operation (C)
11
+ _AXS_LCD_SWRESET = const (0x01 ) # Software reset (C)
12
+ _AXS_LCD_RDDID = const (0x04 ) # Read display (R)
13
+ _AXS_LCD_RDNUMED = const (0x05 ) # Read Number of the Errors on DSI (R)
14
+ _AXS_LCD_RDDST = const (0x09 ) # Read display status (R)
15
+ _AXS_LCD_RDDPM = const (0x0A ) # Read display power (R)
16
+ _AXS_LCD_RDDMADC = const (0x0B ) # Read memory data access control (R)
17
+ _AXS_LCD_RDDIPF = const (0x0C ) # Read Interface Pixel Format (R)
18
+ _AXS_LCD_RDDIM = const (0x0D ) # Read display image (R)
19
+ _AXS_LCD_RDDSM = const (0x0E ) # Read display signal (R)
20
+ _AXS_LCD_RDDSDR = const (0x0F ) # Read display self-diagnostic result (R)
21
+ _AXS_LCD_SLPIN = const (0x10 ) # Sleep in (C)
22
+ _AXS_LCD_SLPOUT = const (0x11 ) # Sleep out (C)
23
+ _AXS_LCD_PTLON = const (0x12 ) # Partial mode on (C)
24
+ _AXS_LCD_NORON = const (0x13 ) # Partial mode off(Normal) (C)
25
+ _AXS_LCD_INVOFF = const (0x20 ) # Display inversion off (C)
26
+ _AXS_LCD_INVON = const (0x21 ) # Display inversion on (C)
27
+ _AXS_LCD_ALLPOFF = const (0x22 ) # All pixel off (C)
28
+ _AXS_LCD_ALLPON = const (0x23 ) # All pixel on (C)
29
+ _AXS_LCD_ALLPFILL = const (0x24 ) # All pixel fill given color (W)
30
+ _AXS_LCD_GAMSET = const (0x26 ) # Gamma curve set (W)
31
+ _AXS_LCD_DISPOFF = const (0x28 ) # Display off (C)
32
+ _AXS_LCD_DISPON = const (0x29 ) # Display on (C)
33
+ _AXS_LCD_CASET = const (0x2A ) # Column address set (W)
34
+ _AXS_LCD_RASET = const (0x2B ) # Row address set (W)
35
+ _AXS_LCD_RAMWR = const (0x2C ) # Memory write any length MIPI/SPI/QSPI/DBI (W)
36
+ _AXS_LCD_RAMRD = const (0x2E ) # Memory read any length SPI/QSPI/DBI (R)
37
+ _AXS_LCD_RAWFILL = const (0x2F ) # Memory fill given color at window (W)
38
+ _AXS_LCD_PTLAR = const (0x30 ) # Partial start/end address set (W)
39
+ _AXS_LCD_PTLARC = const (0x31 ) # set_partial_columns (W)
40
+ _AXS_LCD_VSCRDEF = const (0x33 ) # Vertical scrolling definition (W)
41
+ _AXS_LCD_TEOFF = const (0x34 ) # Tearing effect line off (C)
42
+ _AXS_LCD_TEON = const (0x35 ) # Tearing effect line on (W)
43
+ _AXS_LCD_MADCTL = const (0x36 ) # Memory data access control (W)
44
+ _AXS_LCD_VSCRSADD = const (0x37 ) # Vertical scrolling start address (W)
45
+ _AXS_LCD_IDMOFF = const (0x38 ) # Idle mode off (C)
46
+ _AXS_LCD_IDMON = const (0x39 ) # Idle mode on (C)
47
+ _AXS_LCD_IPF = const (0x3A ) # Interface pixel format (W)
48
+ _AXS_LCD_RAMWRC = const (0x3C ) # Memory write continue any length MIPI/SPI/QSPI/DBI (W)
49
+ _AXS_LCD_RAMRDC = const (0x3E ) # Memory read continue any length SPI/QSPI/DBI (R)
50
+ _AXS_LCD_TESCAN = const (0x44 ) # Set tear scanline (W)
51
+ _AXS_LCD_RDTESCAN = const (0x45 ) # Get tear scanline (R)
52
+ _AXS_LCD_WRDISBV = const (0x51 ) # Write display brightness value (W)
53
+ _AXS_LCD_RDDISBV = const (0x52 ) # Read display brightness value (R)
54
+ _AXS_LCD_WRCTRLD = const (0x53 ) # Write CTRL display (W)
55
+ _AXS_LCD_RDCTRLD = const (0x54 ) # Read CTRL dsiplay (R)
56
+ _AXS_LCD_RDFCHKSU = const (0xAA ) # Read First Checksum (R)
57
+ _AXS_LCD_RDCCHKSU = const (0xAA ) # Read Continue Checksum (R)
58
+ _AXS_LCD_RDID1 = const (0xDA ) # Read ID1 (R)
59
+ _AXS_LCD_RDID2 = const (0xDB ) # Read ID2 (R)
60
+ _AXS_LCD_RDID3 = const (0xDC ) # Read ID3 (R)
61
+ _AXS_LCD_DSTB = const (0x90 ) # Enter Deep-Standby (W)
62
62
63
63
64
64
def init (self ):
65
65
param_buf = self ._param_buf
66
66
param_mv = self ._param_mv
67
67
68
+ self .set_params (_AXS_LCD_SLPOUT )
69
+ time .sleep_ms (100 ) # NOQA
70
+
68
71
# Pixel size
69
72
color_size = lv .color_format_get_size (self ._color_space )
70
73
if color_size == 2 :
@@ -81,14 +84,96 @@ def init(self):
81
84
param_buf [0 ] = 0xD0
82
85
self .set_params (_AXS_LCD_WRDISBV , param_mv [:1 ])
83
86
84
- # # Disable Partial Display Mode (return to Normal Display Mode)
85
- self .set_params (_AXS_LCD_NORON )
86
- time .sleep_ms (10 ) # NOQA
87
+ param_buf [:8 ] = bytearray ([0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x5A , 0xA5 ])
88
+ self .set_params (0xBB , param_mv [:8 ])
89
+
90
+ param_buf [:17 ] = bytearray ([0x00 , 0x10 , 0x00 , 0x02 , 0x00 , 0x00 , 0x64 , 0x3F , 0x20 , 0x05 , 0x3F , 0x3F , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ])
91
+ self .set_params (0xA0 , param_mv [:17 ])
92
+
93
+ param_buf [:31 ] = bytearray ([0x30 , 0x04 , 0x0A , 0x3C , 0xEC , 0x54 , 0xC4 , 0x30 , 0xAC , 0x28 , 0x7F , 0x7F , 0x7F , 0x20 , 0xF8 , 0x10 , 0x02 , 0xFF , 0xFF , 0xF0 , 0x90 , 0x01 , 0x32 , 0xA0 , 0x91 , 0xC0 , 0x20 , 0x7F , 0xFF , 0x00 , 0x54 ])
94
+ self .set_params (0xA2 , param_mv [:31 ])
95
+
96
+ param_buf [:30 ] = bytearray ([0x30 , 0xAC , 0x21 , 0x24 , 0x08 , 0x09 , 0x10 , 0x01 , 0xAA , 0x14 , 0xC2 , 0x00 , 0x22 , 0x22 , 0xAA , 0x03 , 0x10 , 0x12 , 0x40 , 0x14 , 0x1E , 0x51 , 0x15 , 0x00 , 0x40 , 0x10 , 0x00 , 0x03 , 0x3D , 0x12 ])
97
+ self .set_params (0xD0 , param_mv [:30 ])
98
+
99
+ param_buf [:22 ] = bytearray ([0xA0 , 0x06 , 0xAA , 0x08 , 0x08 , 0x02 , 0x0A , 0x04 , 0x04 , 0x04 , 0x04 , 0x04 , 0x04 , 0x04 , 0x04 , 0x04 , 0x04 , 0x04 , 0x04 , 0x00 , 0x55 , 0x55 ])
100
+ self .set_params (0xA3 , param_mv [:22 ])
101
+
102
+ param_buf [:30 ] = bytearray ([0x33 , 0x04 , 0x02 , 0x02 , 0x71 , 0x05 , 0x24 , 0x55 , 0x02 , 0x00 , 0x41 , 0x00 , 0x53 , 0xFF , 0xFF , 0xFF , 0x4F , 0x52 , 0x00 , 0x4F , 0x52 , 0x00 , 0x45 , 0x3B , 0x0B , 0x02 , 0x0D , 0x00 , 0xFF , 0x40 ])
103
+ self .set_params (0xC1 , param_mv [:30 ])
104
+
105
+ param_buf [:11 ] = bytearray ([0x00 , 0x00 , 0x00 , 0x50 , 0x03 , 0x00 , 0x00 , 0x00 , 0x01 , 0x80 , 0x01 ])
106
+ self .set_params (0xC3 , param_mv [:11 ])
107
+
108
+ param_buf [:29 ] = bytearray ([0x00 , 0x24 , 0x33 , 0x90 , 0x50 , 0xea , 0x64 , 0x32 , 0xC8 , 0x64 , 0xC8 , 0x32 , 0x90 , 0x90 , 0x11 , 0x06 , 0xDC , 0xFA , 0x04 , 0x03 , 0x80 , 0xFE , 0x10 , 0x10 , 0x00 , 0x0A , 0x0A , 0x44 , 0x50 ])
109
+ self .set_params (0xC4 , param_mv [:29 ])
110
+
111
+ param_buf [:23 ] = bytearray ([0x18 , 0x00 , 0x00 , 0x03 , 0xFE , 0x78 , 0x33 , 0x20 , 0x30 , 0x10 , 0x88 , 0xDE , 0x0D , 0x08 , 0x0F , 0x0F , 0x01 , 0x78 , 0x33 , 0x20 , 0x10 , 0x10 , 0x80 ])
112
+ self .set_params (0xC5 , param_mv [:23 ])
113
+
114
+ param_buf [:20 ] = bytearray ([0x05 , 0x0A , 0x05 , 0x0A , 0x00 , 0xE0 , 0x2E , 0x0B , 0x12 , 0x22 , 0x12 , 0x22 , 0x01 , 0x00 , 0x00 , 0x3F , 0x6A , 0x18 , 0xC8 , 0x22 ])
115
+ self .set_params (0xC6 , param_mv [:20 ])
116
+
117
+ param_buf [:20 ] = bytearray ([0x50 , 0x32 , 0x28 , 0x00 , 0xa2 , 0x80 , 0x8f , 0x00 , 0x80 , 0xff , 0x07 , 0x11 , 0x9F , 0x6f , 0xff , 0x26 , 0x0c , 0x0d , 0x0e , 0x0f ])
118
+ self .set_params (0xC7 , param_mv [:20 ])
119
+
120
+ param_buf [:4 ] = bytearray ([0x33 , 0x44 , 0x44 , 0x01 ])
121
+ self .set_params (0xC9 , param_mv [:4 ])
122
+
123
+ param_buf [:27 ] = bytearray ([0x34 , 0x1E , 0x88 , 0x58 , 0x13 , 0x18 , 0x56 , 0x18 , 0x1E , 0x68 , 0xF7 , 0x00 , 0x65 , 0x0C , 0x22 , 0xC4 , 0x0C , 0x77 , 0x22 , 0x44 , 0xAA , 0x55 , 0x04 , 0x04 , 0x12 , 0xA0 , 0x08 ])
124
+ self .set_params (0xCF , param_mv [:27 ])
125
+
126
+ param_buf [:30 ] = bytearray ([0x3E , 0x3E , 0x88 , 0x00 , 0x44 , 0x04 , 0x78 , 0x33 , 0x20 , 0x78 , 0x33 , 0x20 , 0x04 , 0x28 , 0xD3 , 0x47 , 0x03 , 0x03 , 0x03 , 0x03 , 0x86 , 0x00 , 0x00 , 0x00 , 0x30 , 0x52 , 0x3f , 0x40 , 0x40 , 0x96 ])
127
+ self .set_params (0xD5 , param_mv [:30 ])
87
128
88
- # AXS_LCD_SLPOUT
129
+ param_buf [:30 ] = bytearray ([0x10 , 0x32 , 0x54 , 0x76 , 0x98 , 0xBA , 0xDC , 0xFE , 0x95 , 0x00 , 0x01 , 0x83 , 0x75 , 0x36 , 0x20 , 0x75 , 0x36 , 0x20 , 0x3F , 0x03 , 0x03 , 0x03 , 0x10 , 0x10 , 0x00 , 0x04 , 0x51 , 0x20 , 0x01 , 0x00 ])
130
+ self .set_params (0xD6 , param_mv [:30 ])
131
+
132
+ param_buf [:19 ] = bytearray ([0x0a , 0x08 , 0x0e , 0x0c , 0x1E , 0x18 , 0x19 , 0x1F , 0x00 , 0x1F , 0x1A , 0x1F , 0x3E , 0x3E , 0x04 , 0x00 , 0x1F , 0x1F , 0x1F ])
133
+ self .set_params (0xD7 , param_mv [:19 ])
134
+
135
+ param_buf [:12 ] = bytearray ([0x0B , 0x09 , 0x0F , 0x0D , 0x1E , 0x18 , 0x19 , 0x1F , 0x01 , 0x1F , 0x1A , 0x1F ])
136
+ self .set_params (0xD8 , param_mv [:12 ])
137
+
138
+ param_buf [:13 ] = bytearray ([0x00 , 0x0D , 0x0F , 0x09 , 0x0B , 0x1F , 0x18 , 0x19 , 0x1F , 0x01 , 0x1E , 0x1A , 0x1F ])
139
+ self .set_params (0xD9 , param_mv [:13 ])
140
+
141
+ param_buf [:12 ] = bytearray ([0x0C , 0x0E , 0x08 , 0x0A , 0x1F , 0x18 , 0x19 , 0x1F , 0x00 , 0x1E , 0x1A , 0x1F ])
142
+ self .set_params (0xDD , param_mv [:12 ])
143
+
144
+ param_buf [:8 ] = bytearray ([0x44 , 0x73 , 0x4B , 0x69 , 0x00 , 0x0A , 0x02 , 0x90 ])
145
+ self .set_params (0xDF , param_mv [:8 ])
146
+
147
+ param_buf [:17 ] = bytearray ([0x19 , 0x20 , 0x0A , 0x13 , 0x0E , 0x09 , 0x12 , 0x28 , 0xD4 , 0x24 , 0x0C , 0x35 , 0x13 , 0x31 , 0x36 , 0x2f , 0x03 ])
148
+ self .set_params (0xE0 , param_mv [:17 ])
149
+
150
+ param_buf [:17 ] = bytearray ([0x38 , 0x20 , 0x09 , 0x12 , 0x0E , 0x08 , 0x12 , 0x28 , 0xC5 , 0x24 , 0x0C , 0x34 , 0x12 , 0x31 , 0x36 , 0x2f , 0x27 ])
151
+ self .set_params (0xE1 , param_mv [:17 ])
152
+
153
+ param_buf [:17 ] = bytearray ([0x19 , 0x20 , 0x0A , 0x11 , 0x09 , 0x06 , 0x11 , 0x25 , 0xD4 , 0x22 , 0x0B , 0x33 , 0x12 , 0x2D , 0x32 , 0x2f , 0x03 ])
154
+ self .set_params (0xE2 , param_mv [:17 ])
155
+
156
+ param_buf [:17 ] = bytearray ([0x38 , 0x20 , 0x0A , 0x11 , 0x09 , 0x06 , 0x11 , 0x25 , 0xC4 , 0x21 , 0x0A , 0x32 , 0x11 , 0x2C , 0x32 , 0x2f , 0x27 ])
157
+ self .set_params (0xE3 , param_mv [:17 ])
158
+
159
+ param_buf [:17 ] = bytearray ([0x19 , 0x20 , 0x0D , 0x14 , 0x0D , 0x08 , 0x12 , 0x2A , 0xD4 , 0x26 , 0x0E , 0x35 , 0x13 , 0x34 , 0x39 , 0x2f , 0x03 ])
160
+ self .set_params (0xE4 , param_mv [:17 ])
161
+
162
+ param_buf [:17 ] = bytearray ([0x38 , 0x20 , 0x0D , 0x13 , 0x0D , 0x07 , 0x12 , 0x29 , 0xC4 , 0x25 , 0x0D , 0x35 , 0x12 , 0x33 , 0x39 , 0x2f , 0x27 ])
163
+ self .set_params (0xE5 , param_mv [:17 ])
164
+
165
+ param_buf [:8 ] = bytearray ([0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ])
166
+ self .set_params (0xBB , param_mv [:8 ])
167
+
168
+ self .set_params (_AXS_LCD_NORON )
89
169
self .set_params (_AXS_LCD_SLPOUT )
90
- time .sleep_ms (150 ) # NOQA
170
+ time .sleep_ms (200 ) # NOQA
91
171
92
- # AXS_LCD_DISPON
93
172
self .set_params (_AXS_LCD_DISPON )
94
- time .sleep_ms (150 ) # NOQA
173
+ time .sleep_ms (200 ) # NOQA
174
+
175
+ param_buf [:4 ] = bytearray ([0x00 , 0x00 , 0x00 , 0x00 ])
176
+ self .set_params (_AXS_LCD_RAMWR , param_mv [:4 ])
177
+
178
+ self .set_params (_AXS_LCD_ALLPOFF )
179
+ time .sleep_ms (200 ) # NOQA
0 commit comments