ATY_LIB V2_102_230218
ATY_LIB for general devices or ALGO
 
Loading...
Searching...
No Matches
st7567.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 "st7567.h"
16#include <string.h>
17
18/* Absolute value */
19#define ABS(x) ((x) > 0 ? (x) : -(x))
20
21/* ST7567 data buffer */
26
28{
29 ST7567_CS = 0;
31 ST7567_CS = 1;
32}
33
35{
36 ST7567_CS = 0;
37 do
38 {
40 } while (--size);
41 ST7567_CS = 1;
42}
43
45{
46 ST7567_DC = 0;
47 ST7567_WriteData(command);
48 ST7567_DC = 1;
49}
50
51static void ST7567_Transmit(const uint8_t *pDat, uint32_t size)
52{
53 ST7567_CS = 0;
54 do
55 {
56 SPI_TxRx(*pDat++);
57 } while (--size);
58 ST7567_CS = 1;
59}
60
61void ST7567_Reset(void)
62{
63 ST7567_RES = 0;
64 SYS_Delay(5);
65 ST7567_RES = 1;
66}
67
68void ST7567_Init(void)
69{
72
74 // adjust contrast
77 // adjust regular voltage. LCD may fail to display if it is set too low.
83 // Start from line 0
85 // Start from page 0
87 // Start from column 0
90 // power control, LCD may fail to display if it is not properly set.
91 // recommend to set them all
98}
99
101{
102#if (ST7567_MODEL == ST7567_MODEL_ST7565)
103 if (state == HAL_State_ON)
104 ST7567_WriteCommand(ST7567_MODE_SLEEP);
105 else
106 ST7567_WriteCommand(ST7567_MODE_NORMAL);
107#else
108 if (state == HAL_State_ON)
109 {
112 }
113 else
114 {
117 }
118#endif
119}
120
122{
123 ST7567_BL = (state == HAL_State_ON)? SET : RESET;
124}
125
127{
130}
131
133{
134 uint8_t i = 0, *pt = ST7567_Buffer_all;
135 for (i = 0; i < ST7567_PAGES; i++)
136 {
141 }
142}
143
145{
146 /* Toggle invert */
149 {
151 }
152 else
153 {
155 }
156}
157
159{
160 /* Set memory */
161 memset((uint8_t *)ST7567_Buffer_all, (color == ST7567_COLOR_BACK) ? 0x00 : 0xFF, sizeof(ST7567_Buffer_all));
162}
163
165{
166 uint8_t page, column;
167 if (x >= ST7567_WIDTH || y >= ST7567_HEIGHT)
168 {
169 /* Error */
170 return;
171 }
172
173 if (color == ST7567_COLOR_FRONT)
174 {
175 ST7567_Buffer_all[x + (y / 8) * ST7567_WIDTH] |= 1 << (y % 8);
176 }
177 else
178 {
179 ST7567_Buffer_all[x + (y / 8) * ST7567_WIDTH] &= ~(1 << (y % 8));
180 }
181}
182
184{
185 /* Set write pointers */
188}
189
190char ST7567_Putc(char ch, FontDef_t* font, uint8_t color)
191{
192 uint32_t i, b, j, k;
193
194 for (i = 0; i < font->height; i++)
195 {
196 for (j = 0; j < font->bytes; j++)
197 {
198 b = font->dat[((ch - 32) * font->height + i) * font->bytes + j];
199 if (font->order == 0)
200 {
201 for (k = 0; k < 8 && k < font->width - j * 8; k++)
202 {
203 if ((b << k) & 0x80)
204 {
205 ST7567_DrawPixel(ST7567_currentX + (j * 8) + k, (ST7567_currentY + i), (uint8_t) color);
206 }
207 else
208 {
209 ST7567_DrawPixel(ST7567_currentX + (j * 8) + k, (ST7567_currentY + i), (uint8_t) !color);
210 }
211 }
212 }
213 else
214 {
215 for (k = 0; k < 8 && k < font->width - j * 8; k++)
216 {
217 if (b & (0x0001 << k))
218 {
219 ST7567_DrawPixel(ST7567_currentX + (j * 8) + k, (ST7567_currentY + i), (uint8_t) color);
220 }
221 else
222 {
223 ST7567_DrawPixel(ST7567_currentX + (j * 8) + k, (ST7567_currentY + i), (uint8_t) !color);
224 }
225 }
226 }
227 }
228 }
229
230 /* Increase pointer */
231 ST7567_currentX += font->width + 1;
232
233 /* Return character written */
234 return ch;
235}
236
237char ST7567_Puts(char* str, FontDef_t* Font, uint8_t color)
238{
239 /* Write characters */
240 while (*str)
241 {
242 /* Write character by character */
243 if (ST7567_Putc(*str, Font, color) != *str)
244 {
245 /* Return error */
246 return *str;
247 }
248
249 /* Increase string pointer */
250 str++;
251 }
252
253 /* Everything OK, zero should be returned */
254 return *str;
255}
256
258{
259 int16_t dx, dy, sx, sy, err, e2, i, tmp;
260
261 /* Check for overflow */
262 if (x0 >= ST7567_WIDTH)
263 {
264 x0 = ST7567_WIDTH - 1;
265 }
266 if (x1 >= ST7567_WIDTH)
267 {
268 x1 = ST7567_WIDTH - 1;
269 }
270 if (y0 >= ST7567_HEIGHT)
271 {
272 y0 = ST7567_HEIGHT - 1;
273 }
274 if (y1 >= ST7567_HEIGHT)
275 {
276 y1 = ST7567_HEIGHT - 1;
277 }
278
279 dx = (x0 < x1) ? (x1 - x0) : (x0 - x1);
280 dy = (y0 < y1) ? (y1 - y0) : (y0 - y1);
281 sx = (x0 < x1) ? 1 : -1;
282 sy = (y0 < y1) ? 1 : -1;
283 err = ((dx > dy) ? dx : -dy) / 2;
284
285 if (dx == 0)
286 {
287 if (y1 < y0)
288 {
289 tmp = y1;
290 y1 = y0;
291 y0 = tmp;
292 }
293
294 if (x1 < x0)
295 {
296 tmp = x1;
297 x1 = x0;
298 x0 = tmp;
299 }
300
301 /* Vertical line */
302 for (i = y0; i <= y1; i++)
303 {
304 ST7567_DrawPixel(x0, i, c);
305 }
306
307 /* Return from function */
308 return;
309 }
310
311 if (dy == 0)
312 {
313 if (y1 < y0)
314 {
315 tmp = y1;
316 y1 = y0;
317 y0 = tmp;
318 }
319
320 if (x1 < x0)
321 {
322 tmp = x1;
323 x1 = x0;
324 x0 = tmp;
325 }
326
327 /* Horizontal line */
328 for (i = x0; i <= x1; i++)
329 {
330 ST7567_DrawPixel(i, y0, c);
331 }
332
333 /* Return from function */
334 return;
335 }
336
337 while (1)
338 {
339 ST7567_DrawPixel(x0, y0, c);
340 if (x0 == x1 && y0 == y1)
341 {
342 break;
343 }
344 e2 = err;
345 if (e2 > -dx)
346 {
347 err -= dy;
348 x0 += sx;
349 }
350 if (e2 < dy)
351 {
352 err += dx;
353 y0 += sy;
354 }
355 }
356}
357
358static __CODE uint8_t Font3x5 [] = {
3590x00, 0x00, 0x00, 0x00, 0x00, // SP
3600x02, 0x02, 0x02, 0x00, 0x02, // !
3610x05, 0x05, 0x00, 0x00, 0x00, // "
3620x05, 0x07, 0x05, 0x07, 0x05, // #
3630x06, 0x03, 0x06, 0x03, 0x02, // $
3640x01, 0x04, 0x02, 0x01, 0x04, // %
3650x03, 0x03, 0x07, 0x05, 0x06, // &
3660x02, 0x02, 0x00, 0x00, 0x00, // '
3670x04, 0x02, 0x02, 0x02, 0x04, // (
3680x01, 0x02, 0x02, 0x02, 0x01, // )
3690x05, 0x02, 0x05, 0x00, 0x00, // *
3700x00, 0x02, 0x07, 0x02, 0x00, // +
3710x00, 0x00, 0x00, 0x02, 0x01, // ,
3720x00, 0x00, 0x07, 0x00, 0x00, // -
3730x00, 0x00, 0x00, 0x00, 0x02, // .
3740x00, 0x04, 0x02, 0x01, 0x00, // /
3750x07, 0x05, 0x05, 0x05, 0x07, // 0
3760x02, 0x03, 0x02, 0x02, 0x07, // 1
3770x07, 0x04, 0x07, 0x01, 0x07, // 2
3780x07, 0x04, 0x06, 0x04, 0x07, // 3
3790x05, 0x05, 0x07, 0x04, 0x04, // 4
3800x07, 0x01, 0x07, 0x04, 0x07, // 5
3810x07, 0x01, 0x07, 0x05, 0x07, // 6
3820x07, 0x04, 0x04, 0x04, 0x04, // 7
3830x07, 0x05, 0x07, 0x05, 0x07, // 8
3840x07, 0x05, 0x07, 0x04, 0x07, // 9
3850x00, 0x02, 0x00, 0x02, 0x00, // :
3860x00, 0x02, 0x00, 0x02, 0x01, // ;
3870x04, 0x02, 0x01, 0x02, 0x04, // <
3880x00, 0x07, 0x00, 0x07, 0x00, // =
3890x01, 0x02, 0x04, 0x02, 0x01, // >
3900x07, 0x04, 0x02, 0x00, 0x02, // ?
3910x02, 0x05, 0x07, 0x01, 0x06, // @
3920x02, 0x05, 0x07, 0x05, 0x05, // A
3930x03, 0x05, 0x03, 0x05, 0x03, // B
3940x06, 0x01, 0x01, 0x01, 0x06, // C
3950x03, 0x05, 0x05, 0x05, 0x03, // D
3960x07, 0x01, 0x07, 0x01, 0x07, // E
3970x07, 0x01, 0x07, 0x01, 0x01, // F
3980x06, 0x01, 0x07, 0x05, 0x06, // G
3990x05, 0x05, 0x07, 0x05, 0x05, // H
4000x07, 0x02, 0x02, 0x02, 0x07, // I
4010x04, 0x04, 0x04, 0x05, 0x02, // J
4020x05, 0x05, 0x03, 0x05, 0x05, // K
4030x01, 0x01, 0x01, 0x01, 0x07, // L
4040x05, 0x07, 0x07, 0x05, 0x05, // M
4050x05, 0x07, 0x07, 0x07, 0x05, // N
4060x02, 0x05, 0x05, 0x05, 0x02, // O
4070x03, 0x05, 0x03, 0x01, 0x01, // P
4080x02, 0x05, 0x05, 0x05, 0x06, // Q
4090x03, 0x05, 0x07, 0x03, 0x05, // R
4100x06, 0x01, 0x02, 0x04, 0x03, // S
4110x07, 0x02, 0x02, 0x02, 0x02, // T
4120x05, 0x05, 0x05, 0x05, 0x02, // U
4130x05, 0x05, 0x05, 0x02, 0x02, // V
4140x05, 0x05, 0x07, 0x07, 0x05, // W
4150x05, 0x05, 0x02, 0x05, 0x05, // X
4160x05, 0x05, 0x02, 0x02, 0x02, // Y
4170x07, 0x04, 0x02, 0x01, 0x07, // Z
4180x03, 0x01, 0x01, 0x01, 0x03, // [
4190x00, 0x01, 0x02, 0x04, 0x00, /* \ */
4200x06, 0x04, 0x04, 0x04, 0x06, // ]
4210x02, 0x05, 0x00, 0x00, 0x00, // ^
4220x00, 0x00, 0x00, 0x00, 0x07, // _
4230x01, 0x02, 0x00, 0x00, 0x00, // `
4240x00, 0x03, 0x06, 0x05, 0x07, // a
4250x01, 0x03, 0x05, 0x05, 0x03, // b
4260x00, 0x06, 0x01, 0x01, 0x06, // c
4270x04, 0x06, 0x05, 0x05, 0x06, // d
4280x00, 0x06, 0x05, 0x03, 0x06, // e
4290x04, 0x02, 0x07, 0x02, 0x02, // f
4300x06, 0x05, 0x07, 0x04, 0x02, // g
4310x01, 0x03, 0x05, 0x05, 0x05, // h
4320x02, 0x00, 0x02, 0x02, 0x02, // i
4330x04, 0x00, 0x04, 0x04, 0x03, // j
4340x01, 0x05, 0x03, 0x03, 0x05, // k
4350x03, 0x02, 0x02, 0x02, 0x07, // l
4360x00, 0x07, 0x07, 0x07, 0x05, // m
4370x00, 0x03, 0x05, 0x05, 0x05, // n
4380x00, 0x02, 0x05, 0x05, 0x02, // o
4390x00, 0x03, 0x05, 0x03, 0x01, // p
4400x00, 0x06, 0x05, 0x06, 0x04, // q
4410x00, 0x06, 0x01, 0x01, 0x01, // r
4420x00, 0x06, 0x03, 0x06, 0x03, // s
4430x02, 0x07, 0x02, 0x02, 0x06, // t
4440x00, 0x05, 0x05, 0x05, 0x06, // u
4450x00, 0x05, 0x05, 0x05, 0x02, // v
4460x00, 0x05, 0x07, 0x07, 0x07, // w
4470x00, 0x05, 0x02, 0x02, 0x05, // x
4480x00, 0x05, 0x06, 0x04, 0x06, // y
4490x00, 0x07, 0x06, 0x03, 0x07, // z
4500x06, 0x02, 0x01, 0x02, 0x06, // {
4510x02, 0x02, 0x02, 0x02, 0x02, // |
4520x03, 0x02, 0x04, 0x02, 0x03, // }
4530x00, 0x06, 0x03, 0x00, 0x00, // ~
4540x07, 0x07, 0x07, 0x07, 0x07, // DEL
455};
456
457static __CODE uint8_t Font5x7 [] = {
4580x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
4590x04, 0x04, 0x04, 0x04, 0x00, 0x04, 0x00, // !
4600x0a, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, // "
4610x0a, 0x0a, 0x1f, 0x0a, 0x1f, 0x0a, 0x0a, // #
4620x04, 0x1e, 0x05, 0x0e, 0x14, 0x0f, 0x04, // $
4630x00, 0x19, 0x1a, 0x04, 0x0b, 0x13, 0x00, // %
4640x06, 0x09, 0x05, 0x02, 0x15, 0x09, 0x16, // &
4650x06, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, // '
4660x08, 0x04, 0x02, 0x02, 0x02, 0x04, 0x08, // (
4670x02, 0x04, 0x08, 0x08, 0x08, 0x04, 0x02, // )
4680x00, 0x04, 0x15, 0x0e, 0x15, 0x04, 0x00, // *
4690x00, 0x04, 0x04, 0x1f, 0x04, 0x04, 0x00, // +
4700x00, 0x00, 0x00, 0x00, 0x0c, 0x08, 0x04, // ,
4710x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, // -
4720x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, // .
4730x00, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00, // /
4740x0e, 0x11, 0x19, 0x15, 0x13, 0x11, 0x0e, // 0
4750x04, 0x06, 0x04, 0x04, 0x04, 0x04, 0x0e, // 1
4760x0e, 0x11, 0x10, 0x08, 0x04, 0x02, 0x1f, // 2
4770x1f, 0x08, 0x04, 0x08, 0x10, 0x11, 0x0e, // 3
4780x08, 0x0c, 0x0a, 0x09, 0x1f, 0x08, 0x08, // 4
4790x1f, 0x01, 0x0f, 0x10, 0x10, 0x11, 0x0e, // 5
4800x0c, 0x02, 0x01, 0x0f, 0x11, 0x11, 0x0e, // 6
4810x1f, 0x10, 0x08, 0x04, 0x02, 0x02, 0x02, // 7
4820x0e, 0x11, 0x11, 0x0e, 0x11, 0x11, 0x0e, // 8
4830x0e, 0x11, 0x11, 0x1e, 0x10, 0x08, 0x06, // 9
4840x00, 0x06, 0x06, 0x00, 0x06, 0x06, 0x00, // :
4850x00, 0x06, 0x06, 0x00, 0x06, 0x04, 0x02, // ;
4860x08, 0x04, 0x02, 0x01, 0x02, 0x04, 0x08, // <
4870x00, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x00, // =
4880x02, 0x04, 0x08, 0x10, 0x08, 0x04, 0x02, // >
4890x0e, 0x11, 0x10, 0x08, 0x04, 0x00, 0x04, // ?
4900x0e, 0x11, 0x10, 0x16, 0x1d, 0x11, 0x0e, // @
4910x0e, 0x11, 0x11, 0x11, 0x1f, 0x11, 0x11, // A
4920x0f, 0x11, 0x11, 0x0f, 0x11, 0x11, 0x0f, // B
4930x0e, 0x11, 0x01, 0x01, 0x01, 0x11, 0x0e, // C
4940x07, 0x09, 0x11, 0x11, 0x11, 0x09, 0x07, // D
4950x1f, 0x01, 0x01, 0x0f, 0x01, 0x01, 0x1f, // E
4960x1f, 0x01, 0x01, 0x0f, 0x01, 0x01, 0x01, // F
4970x0e, 0x11, 0x01, 0x1d, 0x11, 0x11, 0x1e, // G
4980x11, 0x11, 0x11, 0x1f, 0x11, 0x11, 0x11, // H
4990x0e, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0e, // I
5000x1c, 0x08, 0x08, 0x08, 0x08, 0x09, 0x06, // J
5010x11, 0x09, 0x05, 0x03, 0x05, 0x09, 0x11, // K
5020x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1f, // L
5030x11, 0x1b, 0x15, 0x15, 0x11, 0x11, 0x11, // M
5040x11, 0x11, 0x13, 0x15, 0x19, 0x11, 0x11, // N
5050x0e, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e, // O
5060x0f, 0x11, 0x11, 0x0f, 0x01, 0x01, 0x01, // P
5070x0e, 0x11, 0x11, 0x11, 0x15, 0x09, 0x16, // Q
5080x0f, 0x11, 0x11, 0x0f, 0x05, 0x09, 0x11, // R
5090x1e, 0x01, 0x01, 0x0e, 0x10, 0x10, 0x0f, // S
5100x1f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, // T
5110x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e, // U
5120x11, 0x11, 0x11, 0x11, 0x11, 0x0a, 0x04, // V
5130x11, 0x11, 0x11, 0x15, 0x15, 0x15, 0x0a, // W
5140x11, 0x11, 0x0a, 0x04, 0x0a, 0x11, 0x11, // X
5150x11, 0x11, 0x11, 0x0a, 0x04, 0x04, 0x04, // Y
5160x1f, 0x10, 0x08, 0x04, 0x02, 0x01, 0x1f, // Z
5170x0e, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0e, // [
5180x15, 0x0a, 0x15, 0x0a, 0x15, 0x0a, 0x15, /* \ */
5190x0e, 0x08, 0x08, 0x08, 0x08, 0x08, 0x0e, // ]
5200x04, 0x0a, 0x11, 0x00, 0x00, 0x00, 0x00, // ^
5210x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, // _
5220x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, // `
5230x00, 0x00, 0x0e, 0x10, 0x1e, 0x11, 0x1e, // a
5240x01, 0x01, 0x0d, 0x13, 0x11, 0x11, 0x0f, // b
5250x00, 0x00, 0x0e, 0x01, 0x01, 0x11, 0x0e, // c
5260x10, 0x10, 0x16, 0x19, 0x11, 0x11, 0x1e, // d
5270x00, 0x00, 0x0e, 0x11, 0x1f, 0x01, 0x0e, // e
5280x0c, 0x12, 0x02, 0x07, 0x02, 0x02, 0x02, // f
5290x00, 0x1e, 0x11, 0x11, 0x1e, 0x10, 0x0e, // g
5300x01, 0x01, 0x0d, 0x13, 0x11, 0x11, 0x11, // h
5310x04, 0x00, 0x06, 0x04, 0x04, 0x04, 0x0e, // i
5320x08, 0x00, 0x0c, 0x08, 0x08, 0x09, 0x06, // j
5330x01, 0x01, 0x09, 0x05, 0x03, 0x05, 0x09, // k
5340x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0e, // l
5350x00, 0x00, 0x0b, 0x15, 0x15, 0x11, 0x11, // m
5360x00, 0x00, 0x0d, 0x13, 0x11, 0x11, 0x11, // n
5370x00, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x0e, // o
5380x00, 0x00, 0x0f, 0x11, 0x0f, 0x01, 0x01, // p
5390x00, 0x00, 0x16, 0x19, 0x1e, 0x10, 0x10, // q
5400x00, 0x00, 0x0d, 0x13, 0x01, 0x01, 0x01, // r
5410x00, 0x00, 0x0e, 0x01, 0x0e, 0x10, 0x0f, // s
5420x02, 0x02, 0x07, 0x02, 0x02, 0x12, 0x0c, // t
5430x00, 0x00, 0x11, 0x11, 0x11, 0x19, 0x16, // u
5440x00, 0x00, 0x11, 0x11, 0x11, 0x0a, 0x04, // v
5450x00, 0x00, 0x11, 0x11, 0x15, 0x15, 0x0a, // w
5460x00, 0x00, 0x11, 0x0a, 0x04, 0x0a, 0x11, // x
5470x00, 0x00, 0x11, 0x11, 0x1e, 0x10, 0x0e, // y
5480x00, 0x00, 0x1f, 0x08, 0x04, 0x02, 0x1f, // z
5490x08, 0x04, 0x04, 0x02, 0x04, 0x04, 0x08, // {
5500x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, // |
5510x02, 0x04, 0x04, 0x08, 0x04, 0x04, 0x02, // }
5520x00, 0x00, 0x02, 0x15, 0x08, 0x00, 0x00, // ~
5530x00, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x00, //
554};
555
556__CODE FontDef_t Font_3x5 = {3, 5, 1, 1, Font3x5};
557__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
volatile int16_t y
Definition: main.c:34
volatile int16_t x
Definition: main.c:34
void ST7567_SetContrast(uint8_t val)
Turn ST7567 LCD backlight off.
Definition: st7567.c:126
void ST7567_WriteCommand(uint8_t command)
Write a single byte command to ST7567.
Definition: st7567.c:44
void ST7567_GotoXY(uint16_t x, uint16_t y)
Sets cursor pointer to desired location for strings.
Definition: st7567.c:183
void ST7567_WriteSameData(uint8_t dat, uint32_t size)
Definition: st7567.c:34
uint8_t ST7567_currentY
Definition: st7567.c:24
void ST7567_Fill(uint8_t color)
Fills entire LCD with specified color.
Definition: st7567.c:158
static __XDATA uint8_t ST7567_Buffer_all[ST7567_WIDTH *ST7567_PAGES]
Definition: st7567.c:25
void ST7567_SetPowerSaveMode(HAL_State_t state)
Powersave mode control.
Definition: st7567.c:100
static __CODE uint8_t Font3x5[]
Definition: st7567.c:358
void ST7567_DrawPixel(uint8_t x, uint8_t y, uint8_t color)
Draws pixel at desired location.
Definition: st7567.c:164
void ST7567_DrawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint8_t c)
Draws line on LCD.
Definition: st7567.c:257
void ST7567_ToggleInvert(void)
Toggles pixels invertion inside internal RAM.
Definition: st7567.c:144
char ST7567_Puts(char *str, FontDef_t *Font, uint8_t color)
Puts string to internal RAM.
Definition: st7567.c:237
static void ST7567_Transmit(const uint8_t *pDat, uint32_t size)
Definition: st7567.c:51
__BIT ST7567_colorInverted
Definition: st7567.c:22
void ST7567_Reset(void)
Hardware reset ST7567 LCD.
Definition: st7567.c:61
static __CODE uint8_t Font5x7[]
Definition: st7567.c:457
void ST7567_SetBackLightState(HAL_State_t state)
Turn ST7567 LCD backlight on or off.
Definition: st7567.c:121
void ST7567_Init(void)
Initializes ST7567 LCD.
Definition: st7567.c:68
void ST7567_WriteData(uint8_t dat)
Write a single byte data to ST7567.
Definition: st7567.c:27
__CODE FontDef_t Font_5x7
Definition: st7567.c:557
char ST7567_Putc(char ch, FontDef_t *font, uint8_t color)
Puts character to internal RAM.
Definition: st7567.c:190
uint8_t ST7567_currentX
Definition: st7567.c:23
__CODE FontDef_t Font_3x5
Definition: st7567.c:556
void ST7567_UpdateScreen(void)
Update LCD display with buffer changes.
Definition: st7567.c:132
#define ST7567_DISPLAY_ON
Definition: st7567.h:55
#define ST7567_REGULATION_RATIO_5_0
Definition: st7567.h:110
#define ST7567_BL
Definition: st7567.h:35
#define ST7567_DC
Definition: st7567.h:34
#define ST7567_INVERSE_DISPLAY_ON
Definition: st7567.h:76
#define ST7567_PAGES
Definition: st7567.h:44
#define ST7567_RES
Definition: st7567.h:33
#define ST7567_POWER_CONTROL
Definition: st7567.h:94
#define ST7567_X_ORIENT
Definition: st7567.h:46
#define ST7567_POWER_CONTROL_VR
Definition: st7567.h:96
#define ST7567_SET_PAGE_ADDRESS
Definition: st7567.h:60
#define ST7567_COLOR_FRONT
Definition: st7567.h:143
#define ST7567_Y_ORIENT
Definition: st7567.h:48
#define ST7567_SET_START_LINE_MASK
Definition: st7567.h:58
#define ST7567_REGULATION_RATIO
Definition: st7567.h:105
#define ST7567_SET_PAGE_ADDRESS_MASK
Definition: st7567.h:61
#define ST7567_ALL_PIXEL_NORMAL
Definition: st7567.h:79
#define ST7567_SET_COLUMN_ADDRESS_MSB
Definition: st7567.h:63
#define ST7567_WIDTH
Definition: st7567.h:38
#define ST7567_POWER_CONTROL_VF
Definition: st7567.h:95
#define ST7567_CS
Definition: st7567.h:30
#define ST7567_SET_COLUMN_ADDRESS_MSB_MASK
Definition: st7567.h:64
#define ST7567_DISPLAY_OFF
Definition: st7567.h:54
#define ST7567_BIAS_1_9
Definition: st7567.h:82
#define ST7567_ALL_PIXEL_ON
Definition: st7567.h:78
#define ST7567_SET_EV_MASK
Definition: st7567.h:122
#define ST7567_SET_EV
Definition: st7567.h:121
#define ST7567_SET_COLUMN_ADDRESS_LSB_MASK
Definition: st7567.h:67
#define ST7567_RESET
Definition: st7567.h:88
#define ST7567_POWER_CONTROL_VB
Definition: st7567.h:97
#define ST7567_COLOR_BACK
Definition: st7567.h:145
#define ST7567_SET_START_LINE
Definition: st7567.h:57
#define ST7567_INVERSE_DISPLAY_OFF
Definition: st7567.h:75
#define ST7567_SET_COLUMN_ADDRESS_LSB
Definition: st7567.h:66
#define ST7567_HEIGHT
Definition: st7567.h:40
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