-
Notifications
You must be signed in to change notification settings - Fork 0
/
LCD.c
303 lines (265 loc) · 12.6 KB
/
LCD.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
#include "LCD.h"
uint8_t cur_scr[16*64];
uint8_t game[16 * 64] = {
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X39,0XCE,0X73,0X9C,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X11,0X04,0X51,0X10,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X11,0XC4,0X61,0X1C,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X11,0X04,0X51,0X04,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X11,0XC4,0X53,0X9C,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X8E,0XAE,0X80,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X88,0XA8,0X80,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X8E,0XAE,0X84,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X88,0XA8,0X80,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XEE,0X4E,0XE4,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X03,0XFF,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X97,0X57,0X04,0X00,0X20,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0XD4,0X52,0X08,0X00,0X10,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0XB7,0X22,0X08,0X00,0X10,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X94,0X52,0X08,0X00,0X10,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X97,0X52,0X08,0X70,0X10,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X08,0X50,0X10,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X08,0X70,0X10,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X08,0X70,0X10,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X08,0X50,0X10,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X08,0X70,0X10,0X00,0X00,0X00,0X00,0X00,0XEE,0XEE,0XE0,0X00,0X00,
0X00,0X00,0X00,0X08,0X7E,0X10,0X00,0X00,0X00,0X00,0X00,0X88,0XAA,0X80,0X00,0X00,
0X00,0X00,0X00,0X08,0X5A,0X10,0X00,0X00,0X00,0X00,0X00,0XE8,0XAC,0XE4,0X00,0X00,
0X00,0X00,0X00,0X08,0X7E,0X10,0X00,0X00,0X00,0X00,0X00,0X28,0XAA,0X80,0X00,0X00,
0X00,0X00,0X00,0X04,0X00,0X20,0X00,0X00,0X00,0X00,0X00,0XEE,0XEA,0XE4,0X00,0X00,
0X00,0X00,0X00,0X03,0XFF,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X20,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X05,0X17,0X50,0X07,0X76,0X70,0X00,0X00,0X00,0X00,0X00,0X02,0XA0,0XE8,0X00,0X00,
0X05,0X12,0X50,0X01,0X52,0X40,0X00,0X00,0X00,0X00,0X00,0X02,0X84,0X2C,0X4C,0X60,
0X02,0X52,0X51,0XC7,0X52,0X70,0X00,0X00,0X00,0X00,0X00,0X01,0X2A,0X4A,0XAA,0XA0,
0X05,0X52,0X50,0X04,0X52,0X10,0X00,0X00,0X00,0X00,0X00,0X02,0XAC,0X8A,0XCA,0XE0,
0X05,0X72,0X70,0X07,0X77,0X70,0X00,0X00,0X00,0X00,0X00,0X02,0XA6,0XEA,0X6A,0X20,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC0,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,};
uint8_t title[16 * 64] = {
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X01,0XFF,0XC7,0XFE,0X3F,0XF9,0XFE,0X01,0XFF,0X00,0XFA,0X00,0X00,0X00,
0X00,0X00,0X01,0X08,0X41,0X02,0X21,0X08,0X41,0X00,0X10,0X01,0X06,0X00,0X00,0X00,
0X00,0X00,0X01,0X08,0X41,0X02,0X21,0X08,0X40,0X80,0X10,0X02,0X02,0X00,0X00,0X00,
0X00,0X00,0X01,0X08,0X41,0X02,0X21,0X08,0X40,0X80,0X10,0X02,0X02,0X00,0X00,0X00,
0X00,0X00,0X01,0X08,0X41,0X12,0X21,0X08,0X40,0X80,0X10,0X02,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X08,0X01,0X10,0X01,0X00,0X40,0X80,0X10,0X01,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X08,0X01,0X10,0X01,0X00,0X41,0X00,0X10,0X00,0XC0,0X00,0X00,0X00,
0X00,0X00,0X00,0X08,0X01,0XF0,0X01,0X00,0X7E,0X00,0X10,0X00,0X30,0X00,0X00,0X00,
0X00,0X00,0X00,0X08,0X01,0X10,0X01,0X00,0X44,0X00,0X10,0X00,0X0C,0X00,0X00,0X00,
0X00,0X00,0X00,0X08,0X01,0X10,0X01,0X00,0X42,0X00,0X10,0X00,0X04,0X00,0X00,0X00,
0X00,0X00,0X00,0X08,0X01,0X00,0X01,0X00,0X42,0X00,0X10,0X02,0X02,0X00,0X00,0X00,
0X00,0X00,0X00,0X08,0X01,0X01,0X01,0X00,0X41,0X00,0X10,0X02,0X02,0X00,0X00,0X00,
0X00,0X00,0X00,0X08,0X01,0X01,0X01,0X00,0X41,0X00,0X10,0X02,0X02,0X00,0X00,0X00,
0X00,0X00,0X00,0X08,0X01,0X01,0X01,0X00,0X40,0X80,0X10,0X03,0X04,0X00,0X00,0X00,
0X00,0X00,0X00,0X7F,0X07,0XFF,0X0F,0XE1,0XF0,0X61,0XFF,0X02,0XF8,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0XA2,0XEA,0X15,0X77,0X57,0X67,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0XA2,0X4A,0X15,0X41,0X54,0X54,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X4A,0X4A,0X09,0X77,0X77,0X55,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0XAA,0X4A,0X15,0X44,0X54,0X55,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0XAE,0X4E,0X15,0X77,0X57,0X57,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X04,0X10,0X10,0X00,0X00,0X17,0X01,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X90,0X10,0X00,0X00,0X22,0X21,0X07,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X35,0XD9,0X58,0X37,0X28,0X42,0X53,0X51,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X54,0X95,0X54,0X45,0X54,0X82,0X65,0X22,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X74,0X95,0XD9,0X37,0X55,0X02,0X33,0X57,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X10,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X60,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};
void lcd_paint_scr(uint8_t* scr) {
int i, j, k=0;
for(j=0;j<32;j++)
{
write_comm((0x80+j),0);
write_comm(0x80,0);
for(i=0;i<16;i++)
{
cur_scr[k] = scr[k];
write_comm(cur_scr[k],1);
k++;
}
}
for(j=0;j<32;j++)
{
write_comm((0x80+j),0);
write_comm(0x88,0);
for(i=0;i<16;i++)
{
cur_scr[k] = scr[k];
write_comm(cur_scr[k],1);
k++;
}
}
}
void lcd_refresh(void)
{
lcd_paint_scr(cur_scr);
//lcd_paint_scr(hztab);
}
void lcd_clr_scr() {
memset(cur_scr, 0, sizeof cur_scr);
lcd_paint_scr(cur_scr);
//lcd_paint_scr(hztab);
}
void wait_free()
{
uint8_t retb;
D_PORT = 0xFF;
DDRB = 0x00;
do{
NOP();
CLR_RS();
NOP();
SET_RW();
NOP();
SET_E();
NOP();
CLR_E();
retb = PINB;
}while((retb&0x80) != 0);
}
void write_comm(uint8_t cmd_dat,uint8_t cd)
{
wait_free();
DDRB = 0xFF;
NOP();
if(cd == DATA)
SET_RS();
else
CLR_RS();
NOP();
CLR_RW();
D_PORT = cmd_dat;
NOP();
SET_E();
NOP();
CLR_E();
}
void LCD_Init()
{
CHIP_Init();
PORTB = 0x00;
DDRB = 0xFF;
PORTD &= 0x1F;
DDRD |= 0xE0;
_delay_ms(50);
write_comm(0x30,0);
_delay_us(20);
write_comm(0x30,0);
_delay_us(20);
write_comm(0x30,0);
_delay_us(100);
write_comm(0x0c,0);
_delay_us(200);
write_comm(0x01,0);
_delay_ms(10);
write_comm(0x06,0);
}
void Init()
{
LCD_Init();
write_comm(0x92,0);
write_comm(0xb0,1);
write_comm(0xa0,1);
write_comm(0xb0,1);
write_comm(0xa0,1);
write_comm(0xb0,1);
write_comm(0xa0,1);
write_comm(0xb0,1);
write_comm(0xa0,1);
write_comm(0x36,0);
lcd_clr_scr();
}
void lcd_draw_pixel(uint8_t y, uint8_t x, bool c)
{
int byte_index = x*16 + y/8;
int bit_index = 7- y % 8;
uint8_t b;
if (y < 0 || x < 0) return;
if (y > 127 || x > 64) return;
if (c == 0)
{
b = 0XFF - (1 << bit_index);
cur_scr[byte_index] &= b;
}
else
{
b = (1 << bit_index);
cur_scr[byte_index] |= b;
}
// paint_scr(cur_scr);
}
void lcd_draw_box(uint8_t x1, uint8_t x2,
uint8_t y1, uint8_t y2, bool c)
{
int i, j;
for (i = x1; i < x2; ++i)
for (j = y1; j < y2; ++j)
lcd_draw_pixel(i, j, c);
//lcd_paint_scr(cur_scr);
}