ATY_LIB V2_102_230218
ATY_LIB for general devices or ALGO
 
Loading...
Searching...
No Matches
pcd8544.c
Go to the documentation of this file.
1// Copyright 2021 IOsetting <iosetting(at)outlook.com>
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#include "pcd8544.h"
16#include <string.h>
17
18/* PCD8544 data buffer */
22
24{
25 PCD8544_CS = 0;
27 PCD8544_CS = 1;
28}
29
31{
32 PCD8544_CS = 0;
33 do
34 {
36 } while (--size);
37 PCD8544_CS = 1;
38}
39
41{
42 PCD8544_DC = 0;
43 PCD8544_WriteData(command);
44 PCD8544_DC = 1;
45}
46
47static void PCD8544_Transmit(const uint8_t *pDat, uint32_t size)
48{
49 PCD8544_CS = 0;
50 do
51 {
52 SPI_TxRx(*pDat++);
53 } while (--size);
54 PCD8544_CS = 1;
55}
56
57void PCD8544_Reset(void)
58{
59 PCD8544_RES = 0;
60 SYS_Delay(5);
61 PCD8544_RES = 1;
62}
63
65{
66 if (state == HAL_State_ON)
68 else
70}
71
72void PCD8544_clear(void)
73{
77}
78
80{
81 val = val & 0x07;
85}
86
88{
89 bias = bias & 0x07;
90 val = val & 0x7F;
91 // Extended instruction set
93 // Set Bias System, value can be [0x03, 0x07]
95 // Set Vop, value can be [0x01, 0x7F]
97 // Change back to basic instruction set
99}
100
102{
103 val = val & 0x03;
107}
108
110{
112}
113
115{
117}
118
120{
122}
123
125{
127}
128
129void PCD8544_Init(void)
130{
132 PCD8544_SetContrast(0x06, 0x20);
134}
135
137{
138 PCD8544_BL = (state == HAL_State_ON)? SET : RESET;
139}
140
142{
143 /* Set memory */
144 memset((uint8_t *)PCD8544_Buffer, (color == 0x00) ? 0x00 : 0xFF, sizeof(PCD8544_Buffer));
145}
146
148{
149 uint8_t i = 0, *pt = PCD8544_Buffer;
150 for (i = 0; i < PCD8544_PAGES; i++)
151 {
155 }
157}
158
160{
161 if (x >= PCD8544_WIDTH || y >= PCD8544_HEIGHT)
162 {
163 /* Error */
164 return;
165 }
166
167 if (color == 0x01)
168 {
169 PCD8544_Buffer[x + (y / 8) * PCD8544_WIDTH] |= 1 << (y % 8);
170 }
171 else
172 {
173 PCD8544_Buffer[x + (y / 8) * PCD8544_WIDTH] &= ~(1 << (y % 8));
174 }
175}
176
178{
179 int16_t dx, dy, sx, sy, err, e2, i, tmp;
180
181 /* Check for overflow */
182 if (x0 >= PCD8544_WIDTH)
183 {
184 x0 = PCD8544_WIDTH - 1;
185 }
186 if (x1 >= PCD8544_WIDTH)
187 {
188 x1 = PCD8544_WIDTH - 1;
189 }
190 if (y0 >= PCD8544_HEIGHT)
191 {
192 y0 = PCD8544_HEIGHT - 1;
193 }
194 if (y1 >= PCD8544_HEIGHT)
195 {
196 y1 = PCD8544_HEIGHT - 1;
197 }
198
199 dx = (x0 < x1) ? (x1 - x0) : (x0 - x1);
200 dy = (y0 < y1) ? (y1 - y0) : (y0 - y1);
201 sx = (x0 < x1) ? 1 : -1;
202 sy = (y0 < y1) ? 1 : -1;
203 err = ((dx > dy) ? dx : -dy) / 2;
204
205 if (dx == 0)
206 {
207 if (y1 < y0)
208 {
209 tmp = y1;
210 y1 = y0;
211 y0 = tmp;
212 }
213
214 if (x1 < x0)
215 {
216 tmp = x1;
217 x1 = x0;
218 x0 = tmp;
219 }
220
221 /* Vertical line */
222 for (i = y0; i <= y1; i++)
223 {
224 PCD8544_DrawPixel(x0, i, color);
225 }
226 return;
227 }
228
229 if (dy == 0)
230 {
231 if (y1 < y0)
232 {
233 tmp = y1;
234 y1 = y0;
235 y0 = tmp;
236 }
237
238 if (x1 < x0)
239 {
240 tmp = x1;
241 x1 = x0;
242 x0 = tmp;
243 }
244
245 /* Horizontal line */
246 for (i = x0; i <= x1; i++)
247 {
248 PCD8544_DrawPixel(i, y0, color);
249 }
250 return;
251 }
252
253 while (1)
254 {
255 PCD8544_DrawPixel(x0, y0, color);
256 if (x0 == x1 && y0 == y1)
257 {
258 break;
259 }
260 e2 = err;
261 if (e2 > -dx)
262 {
263 err -= dy;
264 x0 += sx;
265 }
266 if (e2 < dy)
267 {
268 err += dx;
269 y0 += sy;
270 }
271 }
272}
273
275{
276 /* Set write pointers */
279}
280
281char PCD8544_Putc(char ch, FontDef_t* font, uint8_t color)
282{
283 uint32_t i, b, j, k;
284
285 for (i = 0; i < font->height; i++)
286 {
287 for (j = 0; j < font->bytes; j++)
288 {
289 b = font->dat[((ch - 32) * font->height + i) * font->bytes + j];
290 if (font->order == 0)
291 {
292 for (k = 0; k < 8 && k < font->width - j * 8; k++)
293 {
294 if ((b << k) & 0x80)
295 {
296 PCD8544_DrawPixel(PCD8544_currentX + (j * 8) + k, (PCD8544_currentY + i), (uint8_t) color);
297 }
298 else
299 {
300 PCD8544_DrawPixel(PCD8544_currentX + (j * 8) + k, (PCD8544_currentY + i), (uint8_t) !color);
301 }
302 }
303 }
304 else
305 {
306 for (k = 0; k < 8 && k < font->width - j * 8; k++)
307 {
308 if (b & (0x0001 << k))
309 {
310 PCD8544_DrawPixel(PCD8544_currentX + (j * 8) + k, (PCD8544_currentY + i), (uint8_t) color);
311 }
312 else
313 {
314 PCD8544_DrawPixel(PCD8544_currentX + (j * 8) + k, (PCD8544_currentY + i), (uint8_t) !color);
315 }
316 }
317 }
318 }
319 }
320
321 /* Increase pointer */
322 PCD8544_currentX += font->width + 1;
323
324 /* Return character written */
325 return ch;
326}
327
328char PCD8544_Puts(char* str, FontDef_t* Font, uint8_t color)
329{
330 /* Write characters */
331 while (*str)
332 {
333 /* Write character by character */
334 if (PCD8544_Putc(*str, Font, color) != *str)
335 {
336 /* Return error */
337 return *str;
338 }
339
340 /* Increase string pointer */
341 str++;
342 }
343
344 /* Everything OK, zero should be returned */
345 return *str;
346}
347
348
349static __CODE uint8_t Font3x5 [] = {
3500x00, 0x00, 0x00, 0x00, 0x00, // SP
3510x02, 0x02, 0x02, 0x00, 0x02, // !
3520x05, 0x05, 0x00, 0x00, 0x00, // "
3530x05, 0x07, 0x05, 0x07, 0x05, // #
3540x06, 0x03, 0x06, 0x03, 0x02, // $
3550x01, 0x04, 0x02, 0x01, 0x04, // %
3560x03, 0x03, 0x07, 0x05, 0x06, // &
3570x02, 0x02, 0x00, 0x00, 0x00, // '
3580x04, 0x02, 0x02, 0x02, 0x04, // (
3590x01, 0x02, 0x02, 0x02, 0x01, // )
3600x05, 0x02, 0x05, 0x00, 0x00, // *
3610x00, 0x02, 0x07, 0x02, 0x00, // +
3620x00, 0x00, 0x00, 0x02, 0x01, // ,
3630x00, 0x00, 0x07, 0x00, 0x00, // -
3640x00, 0x00, 0x00, 0x00, 0x02, // .
3650x00, 0x04, 0x02, 0x01, 0x00, // /
3660x07, 0x05, 0x05, 0x05, 0x07, // 0
3670x02, 0x03, 0x02, 0x02, 0x07, // 1
3680x07, 0x04, 0x07, 0x01, 0x07, // 2
3690x07, 0x04, 0x06, 0x04, 0x07, // 3
3700x05, 0x05, 0x07, 0x04, 0x04, // 4
3710x07, 0x01, 0x07, 0x04, 0x07, // 5
3720x07, 0x01, 0x07, 0x05, 0x07, // 6
3730x07, 0x04, 0x04, 0x04, 0x04, // 7
3740x07, 0x05, 0x07, 0x05, 0x07, // 8
3750x07, 0x05, 0x07, 0x04, 0x07, // 9
3760x00, 0x02, 0x00, 0x02, 0x00, // :
3770x00, 0x02, 0x00, 0x02, 0x01, // ;
3780x04, 0x02, 0x01, 0x02, 0x04, // <
3790x00, 0x07, 0x00, 0x07, 0x00, // =
3800x01, 0x02, 0x04, 0x02, 0x01, // >
3810x07, 0x04, 0x02, 0x00, 0x02, // ?
3820x02, 0x05, 0x07, 0x01, 0x06, // @
3830x02, 0x05, 0x07, 0x05, 0x05, // A
3840x03, 0x05, 0x03, 0x05, 0x03, // B
3850x06, 0x01, 0x01, 0x01, 0x06, // C
3860x03, 0x05, 0x05, 0x05, 0x03, // D
3870x07, 0x01, 0x07, 0x01, 0x07, // E
3880x07, 0x01, 0x07, 0x01, 0x01, // F
3890x06, 0x01, 0x07, 0x05, 0x06, // G
3900x05, 0x05, 0x07, 0x05, 0x05, // H
3910x07, 0x02, 0x02, 0x02, 0x07, // I
3920x04, 0x04, 0x04, 0x05, 0x02, // J
3930x05, 0x05, 0x03, 0x05, 0x05, // K
3940x01, 0x01, 0x01, 0x01, 0x07, // L
3950x05, 0x07, 0x07, 0x05, 0x05, // M
3960x05, 0x07, 0x07, 0x07, 0x05, // N
3970x02, 0x05, 0x05, 0x05, 0x02, // O
3980x03, 0x05, 0x03, 0x01, 0x01, // P
3990x02, 0x05, 0x05, 0x05, 0x06, // Q
4000x03, 0x05, 0x07, 0x03, 0x05, // R
4010x06, 0x01, 0x02, 0x04, 0x03, // S
4020x07, 0x02, 0x02, 0x02, 0x02, // T
4030x05, 0x05, 0x05, 0x05, 0x02, // U
4040x05, 0x05, 0x05, 0x02, 0x02, // V
4050x05, 0x05, 0x07, 0x07, 0x05, // W
4060x05, 0x05, 0x02, 0x05, 0x05, // X
4070x05, 0x05, 0x02, 0x02, 0x02, // Y
4080x07, 0x04, 0x02, 0x01, 0x07, // Z
4090x03, 0x01, 0x01, 0x01, 0x03, // [
4100x00, 0x01, 0x02, 0x04, 0x00, /* \ */
4110x06, 0x04, 0x04, 0x04, 0x06, // ]
4120x02, 0x05, 0x00, 0x00, 0x00, // ^
4130x00, 0x00, 0x00, 0x00, 0x07, // _
4140x01, 0x02, 0x00, 0x00, 0x00, // `
4150x00, 0x03, 0x06, 0x05, 0x07, // a
4160x01, 0x03, 0x05, 0x05, 0x03, // b
4170x00, 0x06, 0x01, 0x01, 0x06, // c
4180x04, 0x06, 0x05, 0x05, 0x06, // d
4190x00, 0x06, 0x05, 0x03, 0x06, // e
4200x04, 0x02, 0x07, 0x02, 0x02, // f
4210x06, 0x05, 0x07, 0x04, 0x02, // g
4220x01, 0x03, 0x05, 0x05, 0x05, // h
4230x02, 0x00, 0x02, 0x02, 0x02, // i
4240x04, 0x00, 0x04, 0x04, 0x03, // j
4250x01, 0x05, 0x03, 0x03, 0x05, // k
4260x03, 0x02, 0x02, 0x02, 0x07, // l
4270x00, 0x07, 0x07, 0x07, 0x05, // m
4280x00, 0x03, 0x05, 0x05, 0x05, // n
4290x00, 0x02, 0x05, 0x05, 0x02, // o
4300x00, 0x03, 0x05, 0x03, 0x01, // p
4310x00, 0x06, 0x05, 0x06, 0x04, // q
4320x00, 0x06, 0x01, 0x01, 0x01, // r
4330x00, 0x06, 0x03, 0x06, 0x03, // s
4340x02, 0x07, 0x02, 0x02, 0x06, // t
4350x00, 0x05, 0x05, 0x05, 0x06, // u
4360x00, 0x05, 0x05, 0x05, 0x02, // v
4370x00, 0x05, 0x07, 0x07, 0x07, // w
4380x00, 0x05, 0x02, 0x02, 0x05, // x
4390x00, 0x05, 0x06, 0x04, 0x06, // y
4400x00, 0x07, 0x06, 0x03, 0x07, // z
4410x06, 0x02, 0x01, 0x02, 0x06, // {
4420x02, 0x02, 0x02, 0x02, 0x02, // |
4430x03, 0x02, 0x04, 0x02, 0x03, // }
4440x00, 0x06, 0x03, 0x00, 0x00, // ~
4450x07, 0x07, 0x07, 0x07, 0x07, // DEL
446};
447
448static __CODE uint8_t Font5x7 [] = {
4490x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
4500x04, 0x04, 0x04, 0x04, 0x00, 0x04, 0x00, // !
4510x0a, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, // "
4520x0a, 0x0a, 0x1f, 0x0a, 0x1f, 0x0a, 0x0a, // #
4530x04, 0x1e, 0x05, 0x0e, 0x14, 0x0f, 0x04, // $
4540x00, 0x19, 0x1a, 0x04, 0x0b, 0x13, 0x00, // %
4550x06, 0x09, 0x05, 0x02, 0x15, 0x09, 0x16, // &
4560x06, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, // '
4570x08, 0x04, 0x02, 0x02, 0x02, 0x04, 0x08, // (
4580x02, 0x04, 0x08, 0x08, 0x08, 0x04, 0x02, // )
4590x00, 0x04, 0x15, 0x0e, 0x15, 0x04, 0x00, // *
4600x00, 0x04, 0x04, 0x1f, 0x04, 0x04, 0x00, // +
4610x00, 0x00, 0x00, 0x00, 0x0c, 0x08, 0x04, // ,
4620x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, // -
4630x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, // .
4640x00, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00, // /
4650x0e, 0x11, 0x19, 0x15, 0x13, 0x11, 0x0e, // 0
4660x04, 0x06, 0x04, 0x04, 0x04, 0x04, 0x0e, // 1
4670x0e, 0x11, 0x10, 0x08, 0x04, 0x02, 0x1f, // 2
4680x1f, 0x08, 0x04, 0x08, 0x10, 0x11, 0x0e, // 3
4690x08, 0x0c, 0x0a, 0x09, 0x1f, 0x08, 0x08, // 4
4700x1f, 0x01, 0x0f, 0x10, 0x10, 0x11, 0x0e, // 5
4710x0c, 0x02, 0x01, 0x0f, 0x11, 0x11, 0x0e, // 6
4720x1f, 0x10, 0x08, 0x04, 0x02, 0x02, 0x02, // 7
4730x0e, 0x11, 0x11, 0x0e, 0x11, 0x11, 0x0e, // 8
4740x0e, 0x11, 0x11, 0x1e, 0x10, 0x08, 0x06, // 9
4750x00, 0x06, 0x06, 0x00, 0x06, 0x06, 0x00, // :
4760x00, 0x06, 0x06, 0x00, 0x06, 0x04, 0x02, // ;
4770x08, 0x04, 0x02, 0x01, 0x02, 0x04, 0x08, // <
4780x00, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x00, // =
4790x02, 0x04, 0x08, 0x10, 0x08, 0x04, 0x02, // >
4800x0e, 0x11, 0x10, 0x08, 0x04, 0x00, 0x04, // ?
4810x0e, 0x11, 0x10, 0x16, 0x1d, 0x11, 0x0e, // @
4820x0e, 0x11, 0x11, 0x11, 0x1f, 0x11, 0x11, // A
4830x0f, 0x11, 0x11, 0x0f, 0x11, 0x11, 0x0f, // B
4840x0e, 0x11, 0x01, 0x01, 0x01, 0x11, 0x0e, // C
4850x07, 0x09, 0x11, 0x11, 0x11, 0x09, 0x07, // D
4860x1f, 0x01, 0x01, 0x0f, 0x01, 0x01, 0x1f, // E
4870x1f, 0x01, 0x01, 0x0f, 0x01, 0x01, 0x01, // F
4880x0e, 0x11, 0x01, 0x1d, 0x11, 0x11, 0x1e, // G
4890x11, 0x11, 0x11, 0x1f, 0x11, 0x11, 0x11, // H
4900x0e, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0e, // I
4910x1c, 0x08, 0x08, 0x08, 0x08, 0x09, 0x06, // J
4920x11, 0x09, 0x05, 0x03, 0x05, 0x09, 0x11, // K
4930x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1f, // L
4940x11, 0x1b, 0x15, 0x15, 0x11, 0x11, 0x11, // M
4950x11, 0x11, 0x13, 0x15, 0x19, 0x11, 0x11, // N
4960x0e, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e, // O
4970x0f, 0x11, 0x11, 0x0f, 0x01, 0x01, 0x01, // P
4980x0e, 0x11, 0x11, 0x11, 0x15, 0x09, 0x16, // Q
4990x0f, 0x11, 0x11, 0x0f, 0x05, 0x09, 0x11, // R
5000x1e, 0x01, 0x01, 0x0e, 0x10, 0x10, 0x0f, // S
5010x1f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, // T
5020x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e, // U
5030x11, 0x11, 0x11, 0x11, 0x11, 0x0a, 0x04, // V
5040x11, 0x11, 0x11, 0x15, 0x15, 0x15, 0x0a, // W
5050x11, 0x11, 0x0a, 0x04, 0x0a, 0x11, 0x11, // X
5060x11, 0x11, 0x11, 0x0a, 0x04, 0x04, 0x04, // Y
5070x1f, 0x10, 0x08, 0x04, 0x02, 0x01, 0x1f, // Z
5080x0e, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0e, // [
5090x15, 0x0a, 0x15, 0x0a, 0x15, 0x0a, 0x15, /* \ */
5100x0e, 0x08, 0x08, 0x08, 0x08, 0x08, 0x0e, // ]
5110x04, 0x0a, 0x11, 0x00, 0x00, 0x00, 0x00, // ^
5120x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, // _
5130x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, // `
5140x00, 0x00, 0x0e, 0x10, 0x1e, 0x11, 0x1e, // a
5150x01, 0x01, 0x0d, 0x13, 0x11, 0x11, 0x0f, // b
5160x00, 0x00, 0x0e, 0x01, 0x01, 0x11, 0x0e, // c
5170x10, 0x10, 0x16, 0x19, 0x11, 0x11, 0x1e, // d
5180x00, 0x00, 0x0e, 0x11, 0x1f, 0x01, 0x0e, // e
5190x0c, 0x12, 0x02, 0x07, 0x02, 0x02, 0x02, // f
5200x00, 0x1e, 0x11, 0x11, 0x1e, 0x10, 0x0e, // g
5210x01, 0x01, 0x0d, 0x13, 0x11, 0x11, 0x11, // h
5220x04, 0x00, 0x06, 0x04, 0x04, 0x04, 0x0e, // i
5230x08, 0x00, 0x0c, 0x08, 0x08, 0x09, 0x06, // j
5240x01, 0x01, 0x09, 0x05, 0x03, 0x05, 0x09, // k
5250x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0e, // l
5260x00, 0x00, 0x0b, 0x15, 0x15, 0x11, 0x11, // m
5270x00, 0x00, 0x0d, 0x13, 0x11, 0x11, 0x11, // n
5280x00, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x0e, // o
5290x00, 0x00, 0x0f, 0x11, 0x0f, 0x01, 0x01, // p
5300x00, 0x00, 0x16, 0x19, 0x1e, 0x10, 0x10, // q
5310x00, 0x00, 0x0d, 0x13, 0x01, 0x01, 0x01, // r
5320x00, 0x00, 0x0e, 0x01, 0x0e, 0x10, 0x0f, // s
5330x02, 0x02, 0x07, 0x02, 0x02, 0x12, 0x0c, // t
5340x00, 0x00, 0x11, 0x11, 0x11, 0x19, 0x16, // u
5350x00, 0x00, 0x11, 0x11, 0x11, 0x0a, 0x04, // v
5360x00, 0x00, 0x11, 0x11, 0x15, 0x15, 0x0a, // w
5370x00, 0x00, 0x11, 0x0a, 0x04, 0x0a, 0x11, // x
5380x00, 0x00, 0x11, 0x11, 0x1e, 0x10, 0x0e, // y
5390x00, 0x00, 0x1f, 0x08, 0x04, 0x02, 0x1f, // z
5400x08, 0x04, 0x04, 0x02, 0x04, 0x04, 0x08, // {
5410x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, // |
5420x02, 0x04, 0x04, 0x08, 0x04, 0x04, 0x02, // }
5430x00, 0x00, 0x02, 0x15, 0x08, 0x00, 0x00, // ~
5440x00, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x00, //
545};
546
547__CODE FontDef_t Font_3x5 = {3, 5, 1, 1, Font3x5};
548__CODE FontDef_t Font_5x7 = {5, 7, 1, 1, Font5x7};
return ch
__CODE int8_t dat[20]
uint8_t SPI_TxRx(uint8_t dat)
Definition: fw_spi.c:20
void SYS_Delay(uint16_t t)
Definition: fw_sys.c:65
unsigned long uint32_t
Definition: fw_types.h:20
unsigned short uint16_t
Definition: fw_types.h:19
HAL_State_t
Definition: fw_types.h:69
@ HAL_State_ON
Definition: fw_types.h:71
@ RESET
Definition: fw_types.h:84
@ SET
Definition: fw_types.h:85
short int16_t
Definition: fw_types.h:24
unsigned char uint8_t
Definition: fw_types.h:18
uint8_t val[MAX7219_BLOCKS]
uint8_t __XDATA i
uint8_t PCD8544_currentY
Definition: pcd8544.c:20
char PCD8544_Putc(char ch, FontDef_t *font, uint8_t color)
Put one character to internal RAM.
Definition: pcd8544.c:281
void PCD8544_DrawPixel(uint8_t x, uint8_t y, uint8_t color)
Draws pixel at desired location.
Definition: pcd8544.c:159
uint8_t PCD8544_currentX
Definition: pcd8544.c:19
static void PCD8544_Transmit(const uint8_t *pDat, uint32_t size)
Definition: pcd8544.c:47
void PCD8544_GotoXY(uint8_t x, uint8_t y)
Sets cursor pointer to desired location for strings.
Definition: pcd8544.c:274
void PCD8544_UpdateScreen(void)
Update LCD display with changes.
Definition: pcd8544.c:147
void PCD8544_SetTemperatureCoef(uint8_t val)
Set TCx (temperature coefficient)
Definition: pcd8544.c:101
void PCD8544_DrawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint8_t color)
Draws line on LCD.
Definition: pcd8544.c:177
char PCD8544_Puts(char *str, FontDef_t *Font, uint8_t color)
Puts string to internal RAM.
Definition: pcd8544.c:328
void PCD8544_Reset(void)
Hardware reset PCD8544 LCD.
Definition: pcd8544.c:57
void PCD8544_Init(void)
Initializes PCD8544 Display.
Definition: pcd8544.c:129
void PCD8544_SetDisplayAllOn(void)
Set PCD8544 To Turn On All Segments.
Definition: pcd8544.c:109
static __CODE uint8_t Font3x5[]
Definition: pcd8544.c:349
void PCD8544_SetDisplayInverted(void)
Set PCD8544 Display Mode to Inverted.
Definition: pcd8544.c:114
void PCD8544_SetBackLightState(HAL_State_t state)
Turn PCD8544 LCD backlight on or off.
Definition: pcd8544.c:136
void PCD8544_Fill(uint8_t color)
Fills entire LCD with specified color.
Definition: pcd8544.c:141
static __CODE uint8_t Font5x7[]
Definition: pcd8544.c:448
void PCD8544_SetContrast(uint8_t bias, uint8_t val)
Set the contrast level by adjusting Vlcd.
Definition: pcd8544.c:87
void PCD8544_WriteCommand(uint8_t command)
Write a single byte command to PCD8544.
Definition: pcd8544.c:40
void PCD8544_SetPowerDownMode(HAL_State_t state)
Powerdown mode control.
Definition: pcd8544.c:64
void PCD8544_SetBias(uint8_t val)
Set bias system level.
Definition: pcd8544.c:79
__CODE FontDef_t Font_5x7
Definition: pcd8544.c:548
void PCD8544_SetDisplayBlank(void)
Set PCD8544 Display Mode to Blank.
Definition: pcd8544.c:119
static __XDATA uint8_t PCD8544_Buffer[PCD8544_WIDTH *PCD8544_HEIGHT/8]
Definition: pcd8544.c:21
void PCD8544_WriteSameData(uint8_t dat, uint32_t size)
Definition: pcd8544.c:30
void PCD8544_clear(void)
Definition: pcd8544.c:72
void PCD8544_SetDisplayNormal(void)
Set PCD8544 Display Mode to Normal.
Definition: pcd8544.c:124
void PCD8544_WriteData(uint8_t dat)
Writes single byte data to PCD8544.
Definition: pcd8544.c:23
__CODE FontDef_t Font_3x5
Definition: pcd8544.c:547
#define PCD8544_CS
Definition: pcd8544.h:30
#define PCD8544_DISPLAY_NORMAL
Definition: pcd8544.h:51
#define PCD8544_DISPLAY_BLANK
Definition: pcd8544.h:50
#define PCD8544_SET_BIAS
Definition: pcd8544.h:59
#define PCD8544_HEIGHT
Definition: pcd8544.h:40
#define PCD8544_SET_XADDR
Definition: pcd8544.h:56
#define PCD8544_SET_YADDR
Definition: pcd8544.h:55
#define PCD8544_FUNCTIONSET
Definition: pcd8544.h:44
#define PCD8544_PAGES
Definition: pcd8544.h:42
#define PCD8544_EXT_INSTRUCTION
Definition: pcd8544.h:47
#define PCD8544_DISPLAY_ALLON
Definition: pcd8544.h:52
#define PCD8544_WIDTH
Definition: pcd8544.h:38
#define PCD8544_RES
Definition: pcd8544.h:33
#define PCD8544_POWERDOWN
Definition: pcd8544.h:45
#define PCD8544_DISPLAY_CONTROL
Definition: pcd8544.h:49
#define PCD8544_BL
Definition: pcd8544.h:35
#define PCD8544_SET_TEMP
Definition: pcd8544.h:58
#define PCD8544_DC
Definition: pcd8544.h:34
#define PCD8544_SET_VOP
Definition: pcd8544.h:60
#define PCD8544_DISPLAY_INVERTED
Definition: pcd8544.h:53
volatile int16_t y
Definition: main.c:34
volatile int16_t x
Definition: main.c:34
uint8_t height
Definition: pcd8544.h:64
const uint8_t * dat
Definition: pcd8544.h:67
uint8_t order
Definition: pcd8544.h:65
uint8_t bytes
Definition: pcd8544.h:66
uint8_t width
Definition: pcd8544.h:63