Skip to content

Commit 5cec8fc

Browse files
luoyangyang1989jimmy.luo
and
jimmy.luo
authored
add lcd scripts and datasheets (#2)
* add lcd file * modify lcd/add calculate files * modify lcd file uc1628 * rename calculate chip to power_meter_chips --------- Co-authored-by: jimmy.luo <jimmy.luo@quectel.com>
1 parent 4866cee commit 5cec8fc

25 files changed

+2394
-775
lines changed
Binary file not shown.

libraries/LCD/JD9365/jd9365.py

+284
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,284 @@
1+
import utime
2+
3+
#JD9365_800*1280
4+
init_800X1280 = (
5+
0xE0,10,1,0x00,
6+
0xE1,0,1,0x93,
7+
0xE2,0,1,0x65,
8+
0xE3,0,1,0xF8,
9+
0x80,0,1,0x01,#0x03:4lane 0x02:3lane
10+
11+
0xE0,0,1,0x01,
12+
0x00,0,1,0x00,
13+
0x01,0,1,0x44,
14+
0x03,0,1,0x10,
15+
0x04,0,1,0x4B,
16+
17+
0x0C,0,1,0x74,
18+
19+
0x17,0,1,0x00,
20+
0x18,0,1,0xAF,
21+
0x19,0,1,0x00,
22+
0x1A,0,1,0x00,
23+
0x1B,0,1,0xAF,
24+
0x1C,0,1,0x00,
25+
26+
0x35,0,1,0x26,
27+
28+
0x37,0,1,0x09,
29+
30+
0x38,0,1,0x04,
31+
0x39,0,1,0x00,
32+
0x3A,0,1,0x01,
33+
0x3C,0,1,0x78,
34+
0x3D,0,1,0xFF,
35+
0x3E,0,1,0xFF,
36+
0x3F,0,1,0x7F,
37+
38+
0x40,0,1,0x06,
39+
0x41,0,1,0xA0,
40+
0x42,0,1,0x81,
41+
0x43,0,1,0x14,
42+
0x44,0,1,0x23,
43+
0x45,0,1,0x28,
44+
45+
0x55,0,1,0x02,
46+
0x57,0,1,0x69,
47+
0x59,0,1,0x0A,
48+
0x5A,0,1,0x2A,
49+
0x5B,0,1,0x17,
50+
51+
0x5D,0,1,0x7F,
52+
0x5E,0,1,0x6A,
53+
0x5F,0,1,0x5D,
54+
0x60,0,1,0x50,
55+
0x61,0,1,0x4D,
56+
0x62,0,1,0x3E,
57+
0x63,0,1,0x42,
58+
0x64,0,1,0x2C,
59+
0x65,0,1,0x45,
60+
0x66,0,1,0x44,
61+
0x67,0,1,0x44,
62+
0x68,0,1,0x63,
63+
0x69,0,1,0x52,
64+
0x6A,0,1,0x5A,
65+
0x6B,0,1,0x4C,
66+
0x6C,0,1,0x48,
67+
0x6D,0,1,0x3A,
68+
0x6E,0,1,0x27,
69+
0x6F,0,1,0x00,
70+
0x70,0,1,0x7F,
71+
0x71,0,1,0x6A,
72+
0x72,0,1,0x5D,
73+
0x73,0,1,0x50,
74+
0x74,0,1,0x4D,
75+
0x75,0,1,0x3E,
76+
0x76,0,1,0x42,
77+
0x77,0,1,0x2C,
78+
0x78,0,1,0x45,
79+
0x79,0,1,0x44,
80+
0x7A,0,1,0x44,
81+
0x7B,0,1,0x63,
82+
0x7C,0,1,0x52,
83+
0x7D,0,1,0x5A,
84+
0x7E,0,1,0x4C,
85+
0x7F,0,1,0x48,
86+
0x80,0,1,0x3A,
87+
0x81,0,1,0x27,
88+
0x82,0,1,0x00,
89+
90+
0xE0,0,1,0x02,
91+
0x00,0,1,0x02,
92+
0x01,0,1,0x02,
93+
0x02,0,1,0x00,
94+
0x03,0,1,0x00,
95+
0x04,0,1,0x1E,
96+
0x05,0,1,0x1E,
97+
0x06,0,1,0x1F,
98+
0x07,0,1,0x1F,
99+
0x08,0,1,0x1F,
100+
0x09,0,1,0x17,
101+
0x0A,0,1,0x17,
102+
0x0B,0,1,0x37,
103+
0x0C,0,1,0x37,
104+
0x0D,0,1,0x47,
105+
0x0E,0,1,0x47,
106+
0x0F,0,1,0x45,
107+
0x10,0,1,0x45,
108+
0x11,0,1,0x4B,
109+
0x12,0,1,0x4B,
110+
0x13,0,1,0x49,
111+
0x14,0,1,0x49,
112+
0x15,0,1,0x1F,
113+
114+
0x16,0,1,0x01,
115+
0x17,0,1,0x01,
116+
0x18,0,1,0x00,
117+
0x19,0,1,0x00,
118+
0x1A,0,1,0x1E,
119+
0x1B,0,1,0x1E,
120+
0x1C,0,1,0x1F,
121+
0x1D,0,1,0x1F,
122+
0x1E,0,1,0x1F,
123+
0x1F,0,1,0x17,
124+
0x20,0,1,0x17,
125+
0x21,0,1,0x37,
126+
0x22,0,1,0x37,
127+
0x23,0,1,0x46,
128+
0x24,0,1,0x46,
129+
0x25,0,1,0x44,
130+
0x26,0,1,0x44,
131+
0x27,0,1,0x4A,
132+
0x28,0,1,0x4A,
133+
0x29,0,1,0x48,
134+
0x2A,0,1,0x48,
135+
0x2B,0,1,0x1F,
136+
137+
0x2C,0,1,0x01,
138+
0x2D,0,1,0x01,
139+
0x2E,0,1,0x00,
140+
0x2F,0,1,0x00,
141+
0x30,0,1,0x1F,
142+
0x31,0,1,0x1F,
143+
0x32,0,1,0x1E,
144+
0x33,0,1,0x1E,
145+
0x34,0,1,0x1F,
146+
0x35,0,1,0x17,
147+
0x36,0,1,0x17,
148+
0x37,0,1,0x37,
149+
0x38,0,1,0x37,
150+
0x39,0,1,0x08,
151+
0x3A,0,1,0x08,
152+
0x3B,0,1,0x0A,
153+
0x3C,0,1,0x0A,
154+
0x3D,0,1,0x04,
155+
0x3E,0,1,0x04,
156+
0x3F,0,1,0x06,
157+
0x40,0,1,0x06,
158+
0x41,0,1,0x1F,
159+
160+
0x42,0,1,0x02,
161+
0x43,0,1,0x02,
162+
0x44,0,1,0x00,
163+
0x45,0,1,0x00,
164+
0x46,0,1,0x1F,
165+
0x47,0,1,0x1F,
166+
0x48,0,1,0x1E,
167+
0x49,0,1,0x1E,
168+
0x4A,0,1,0x1F,
169+
0x4B,0,1,0x17,
170+
0x4C,0,1,0x17,
171+
0x4D,0,1,0x37,
172+
0x4E,0,1,0x37,
173+
0x4F,0,1,0x09,
174+
0x50,0,1,0x09,
175+
0x51,0,1,0x0B,
176+
0x52,0,1,0x0B,
177+
0x53,0,1,0x05,
178+
0x54,0,1,0x05,
179+
0x55,0,1,0x07,
180+
0x56,0,1,0x07,
181+
0x57,0,1,0x1F,
182+
183+
0x58,0,1,0x40,
184+
0x5B,0,1,0x30,
185+
0x5C,0,1,0x16,
186+
0x5D,0,1,0x34,
187+
0x5E,0,1,0x05,
188+
0x5F,0,1,0x02,
189+
0x63,0,1,0x00,
190+
0x64,0,1,0x6A,
191+
0x67,0,1,0x73,
192+
0x68,0,1,0x1D,
193+
0x69,0,1,0x08,
194+
0x6A,0,1,0x6A,
195+
0x6B,0,1,0x08,
196+
197+
0x6C,0,1,0x00,
198+
0x6D,0,1,0x00,
199+
0x6E,0,1,0x00,
200+
0x6F,0,1,0x88,
201+
202+
0x75,0,1,0xFF,
203+
0x77,0,1,0xDD,
204+
0x78,0,1,0x3F,
205+
0x79,0,1,0x15,
206+
0x7A,0,1,0x17,
207+
0x7D,0,1,0x14,
208+
0x7E,0,1,0x82,
209+
210+
0xE0,0,1,0x04,
211+
0x00,0,1,0x0E,
212+
0x02,0,1,0xB3,
213+
0x09,0,1,0x61,
214+
215+
0x37,0,1,0x58,
216+
217+
0x0E,0,1,0x48,
218+
219+
0xE0,0,1,0x00,
220+
221+
0xE6,0,1,0x02,
222+
0xE7,0,1,0x0C,
223+
224+
0x11,0,1,0x00,
225+
226+
0x29,150,1,0x00,
227+
228+
0x35,50,1,0x00,
229+
)
230+
231+
# 常用颜色定义
232+
red = 0xF800 # 红色
233+
green = 0x07E0 # 绿色
234+
blue = 0x001F # 蓝色
235+
white = 0xFFFF # 白色
236+
black = 0x0000 # 黑色
237+
purple = 0xF81F # 紫色
238+
yellow = 0xffe0 # 黄色
239+
orange = 0xfa20 # 橙色
240+
cyan = 0x867d # 青色
241+
242+
from machine import LCD
243+
from machine import Pin
244+
245+
246+
def fill(lcd, x_s, y_s, x_e, y_e, color):
247+
tmp = color.to_bytes(2, 'little')
248+
count = (x_e - x_s + 1) * (y_e - y_s + 1)
249+
250+
color_buf = tmp * count
251+
252+
lcd.lcd_write(color_buf, x_s, y_s, x_e, y_e)
253+
254+
255+
# gpio1 = Pin(Pin.GPIO27, Pin.OUT, Pin.PULL_PU, 1)
256+
gpio2 = Pin(Pin.GPIO8, Pin.OUT, Pin.PULL_PU, 1)
257+
# gpio3 = Pin(Pin.GPIO11, Pin.OUT, Pin.PULL_PU, 1)
258+
259+
mipilcd = LCD()
260+
mipilcd.mipi_init(initbuf=bytearray(init_800X1280), width=800, hight=1280, DataLane=2, VBP=20, VFP=20, HSync=20, VSync=4, HBP=20, HFP=40)
261+
# mipilcd.mipi_init(initbuf=bytearray(init_800X1280), width=800, hight=1280)
262+
263+
def show():
264+
fill(mipilcd,0,0,800,160,white)
265+
fill(mipilcd,0,160,800,320,red)
266+
fill(mipilcd,0,320,800,480,orange)
267+
fill(mipilcd,0,480,800,640,yellow)
268+
fill(mipilcd,0,640,800,800,green)
269+
fill(mipilcd,0,800,800,960,cyan)
270+
fill(mipilcd,0,960,800,1120,blue)
271+
fill(mipilcd,0,1120,800,1280,purple)
272+
# mipilcd.lcd_clear(red)
273+
274+
while 1:
275+
# print("111111111111111")
276+
mipilcd.lcd_clear(red)
277+
utime.sleep(2)
278+
mipilcd.lcd_clear(green)
279+
utime.sleep(2)
280+
mipilcd.lcd_clear(yellow)
281+
utime.sleep(2)
282+
show()
283+
utime.sleep(2)
284+

libraries/LCD/SC7705/SC7705_10.1.pdf

7.33 MB
Binary file not shown.

libraries/LCD/SC7705/sc7705.py

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
import utime
2+
3+
#sc7705_800*1280
4+
init_800X1280 = (
5+
0xB9,0,3,0xF1,0x12,0x84,
6+
0xBA,0,27,0x31,0x81,0x05,0xF9,0x0E,0x0E,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x25,0x00,0x91,0x0A,0x00,0x00,0x00,0x4F,0x01,0x00,0x00,0x37,
7+
0xCC,0,1,0x0B,
8+
0xB8,0,1,0xA6,
9+
0xB3,0,8,0x00,0x00,0x00,0x00,0x07,0x0B,0x1E,0x1E,
10+
0xC0,0,9,0x73,0x73,0x50,0x50,0x80,0x00,0x08,0x70,0x00,
11+
0xBF,0,3,0x00,0x10,0x82,
12+
0xBC,0,1,0x46,
13+
0xB4,0,1,0x60,
14+
0xB2,0,2,0x40,0x08,
15+
0xE3,0,10,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x00,0x00,
16+
0xB1,0,10,0x22,0x65,0x23,0x1E,0x1E,0x33,0x77,0x04,0x9B,0x0C,
17+
0xB5,0,2,0x0A,0x0A,
18+
0xB6,0,2,0x02,0x02,
19+
0xE9,0,63,0x02,0x00,0x04,0x05,0x06,0x02,0xB1,0x12,0x31,0x45,0x3F,0x06,0x12,0xC1,0x3B,0x0C,0x00,0x80,0x09,0x00,0x00,0x00,
20+
0x00,0x80,0x09,0x00,0x00,0x00,0x68,0x84,0xAB,0x82,0x08,0x64,0x82,0x00,0x88,0x88,0x88,0x78,0x85,0xAB,0x83,0x18,0x75,
21+
0x83,0x11,0x88,0x88,0x88,0x00,0x00,0x00,0x01,0x00,0x12,0xC1,0x3B,0x00,0x00,0x00,0x00,0x00,
22+
0xE9,0,63,0x02,0x00,0x04,0x05,0x06,0x02,0xB1,0x12,0x31,0x45,0x3F,0x06,0x12,0xC1,0x3B,0x0C,0x00,0x80,0x09,0x00,0x00,0x00,
23+
0x00,0x80,0x09,0x00,0x00,0x00,0x68,0x84,0xAB,0x82,0x08,0x64,0x82,0x00,0x88,0x88,0x88,0x78,0x85,0xAB,0x83,0x18,0x75,
24+
0x83,0x11,0x88,0x88,0x88,0x00,0x00,0x00,0x01,0x00,0x12,0xC1,0x3B,0x00,0x00,0x00,0x00,0x00,
25+
0xEA,0,63,0x0B,0x1A,0x01,0x01,0x00,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x81,0xAB,0x81,0x38,0x13,0x85,0x75,0x88,0x88,
26+
0x88,0x68,0x80,0xAB,0x80,0x28,0x02,0x84,0x64,0x88,0x88,0x88,0x23,0x10,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x00,0x00,
27+
0x01,0x80,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x30,0x02,0xB1,0x00,0x00,0x00,0x00,0x01,0x09,
28+
0xEA,0,63,0x0B,0x1A,0x01,0x01,0x00,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x81,0xAB,0x81,0x38,0x13,0x85,0x75,0x88,0x88,
29+
0x88,0x68,0x80,0xAB,0x80,0x28,0x02,0x84,0x64,0x88,0x88,0x88,0x23,0x10,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x00,0x00,
30+
0x01,0x80,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x30,0x02,0xB1,0x00,0x00,0x00,0x00,0x01,0x09,
31+
0xE0,0,34,0x00,0x0B,0x0D,0x3A,0x3F,0x3F,0x3F,0x33,0x09,0x0D,0x0D,0x11,0x13,0x12,0x13,0x0B,0x11,
32+
0x00,0x0B,0x0D,0x3A,0x3F,0x3F,0x3F,0x33,0x09,0x0D,0x0D,0x11,0x13,0x12,0x13,0x0B,0x11,
33+
0x11,150,0,
34+
# 0x21,50,0,
35+
0x29,50,0,
36+
)
37+
#sc7705_800*1280
38+
init_800X1280_2 = (
39+
0xB9,0,3,0xF1,0x12,0x84,
40+
0xBA,0,27,0x31,0x81,0x05,0xF9,0x0E,0x0E,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x25,0x00,0x91,0x0A,0x00,0x00,0x00,0x4F,0x01,0x00,0x00,0x37,
41+
0xCC,0,1,0x0B,
42+
0xB8,0,1,0xA8,
43+
0xB3,0,8,0x00,0x00,0x00,0x00,0x07,0x0B,0x1E,0x1E,
44+
0xC0,0,9,0x73,0x73,0x50,0x50,0x80,0x00,0x08,0x70,0x00,
45+
0xBF,0,3,0x02,0x10,0x82,
46+
0xBC,0,1,0x46,
47+
0xB4,0,1,0x80,
48+
0xB2,0,2,0x40,0x08,
49+
0xE3,0,10,0x03,0x03,0x00,0x00,0x03,0x03,0x00,0x00,0x00,0xC0,
50+
0xB1,0,10,0x43,0x54,0x23,0x1E,0x1E,0x22,0x77,0x04,0xDB,0x4C,
51+
0xB5,0,2,0x0A,0x0A,
52+
0xB6,0,2,0x44,0x44,
53+
0xE9,0,63,0x02,0x00,0x04,0x05,0x06,0x02,0xB1,0x12,0x31,0x45,0x3F,0x06,0x12,0xC1,0x3B,0x0C,0x00,0x80,0x09,0x00,0x00,0x00,
54+
0x00,0x80,0x09,0x00,0x00,0x00,0x68,0x84,0xAB,0x82,0x08,0x64,0x82,0x00,0x88,0x88,0x88,0x78,0x85,0xAB,0x83,0x18,0x75,
55+
0x83,0x11,0x88,0x88,0x88,0x00,0x00,0x00,0x01,0x00,0x12,0xC1,0x3B,0x00,0x00,0x00,0x00,0x00,
56+
0xEA,0,63,0x96,0x12,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x81,0xAB,0x81,0x38,0x13,0x85,0x75,0x88,0x88,
57+
0x88,0x68,0x80,0xAB,0x80,0x28,0x02,0x84,0x64,0x88,0x88,0x88,0x23,0x10,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x00,0x00,
58+
0x01,0x80,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x30,0x02,0xB1,0x00,0x00,0x00,0x00,0x01,0x09,
59+
0xE0,0,34,0x00,0x0B,0x0D,0x3A,0x3F,0x3F,0x3F,0x33,0x09,0x0D,0x0D,0x11,0x13,0x12,0x13,0x0B,0x11,
60+
0x00,0x0B,0x0D,0x3A,0x3F,0x3F,0x3F,0x33,0x09,0x0D,0x0D,0x11,0x13,0x12,0x13,0x0B,0x11,
61+
0x11,150,0,
62+
# 0x21,50,0,
63+
0x29,50,0,
64+
)
65+
# 常用颜色定义
66+
red = 0xF800 # 红色
67+
green = 0x07E0 # 绿色
68+
blue = 0x001F # 蓝色
69+
white = 0xFFFF # 白色
70+
black = 0x0000 # 黑色
71+
purple = 0xF81F # 紫色
72+
yellow = 0xffe0 # 黄色
73+
orange = 0xfa20 # 橙色
74+
cyan = 0x867d # 青色
75+
76+
from machine import LCD
77+
from machine import Pin
78+
79+
80+
def fill(lcd, x_s, y_s, x_e, y_e, color):
81+
tmp = color.to_bytes(2, 'little')
82+
count = (x_e - x_s + 1) * (y_e - y_s + 1)
83+
84+
color_buf = tmp * count
85+
86+
lcd.lcd_write(color_buf, x_s, y_s, x_e, y_e)
87+
88+
89+
gpio1 = Pin(Pin.GPIO27, Pin.OUT, Pin.PULL_PU, 1)
90+
gpio2 = Pin(Pin.GPIO8, Pin.OUT, Pin.PULL_PU, 1)
91+
gpio3 = Pin(Pin.GPIO11, Pin.OUT, Pin.PULL_PU, 1)
92+
93+
mipilcd = LCD()
94+
mipilcd.mipi_init(initbuf=bytearray(init_800X1280), width=800, hight=1280, DataLane=2, VBP=140, VFP=156, HSync=120, VSync=113, HBP=140, HFP=140)
95+
# mipilcd.mipi_init(initbuf=bytearray(init_800X1280), width=800, hight=1280)
96+
97+
mipilcd.lcd_clear(red)
98+
# fill(mipilcd,0,0,800,160,white)
99+
# fill(mipilcd,0,160,800,320,red)
100+
# fill(mipilcd,0,320,800,480,orange)
101+
# fill(mipilcd,0,480,800,640,yellow)
102+
# fill(mipilcd,0,640,800,800,green)
103+
# fill(mipilcd,0,800,800,960,cyan)
104+
# fill(mipilcd,0,960,800,1120,blue)
105+
# fill(mipilcd,0,1120,800,1280,purple)
106+

libraries/LCD/SSD1306/SSD1306.PDF

1.8 MB
Binary file not shown.

0 commit comments

Comments
 (0)