-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathST7920_SERIAL.h
83 lines (59 loc) · 2.38 KB
/
ST7920_SERIAL.h
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
#ifndef __ST7920_SERIAL_H
#define __ST7920_SERIAL_H
#include "stdint.h"
// A replacement for SPI_TRANSMIT
void SendByteSPI(uint8_t byte);
// Send the command to the LCD
void ST7920_SendCmd (uint8_t cmd);
// send the data to the LCD
void ST7920_SendData (uint8_t data);
/* send the string to the LCD
* 'row' = starting ROW for the string (from 0 to 3)
* 'col' = starting COL for the string (from 0 to 7)
*/
void ST7920_SendString(int row, int col, char* string);
/* ENABLE or DISABLE the graphic mode
* enable =1 --> graphic mode enabled
*/
void ST7920_GraphicMode (int enable);
// clear screen in any mode
void ST7920_Clear(void);
// Draw bitmap on the display
void ST7920_DrawBitmap(const unsigned char* graphic);
// Update the display with the selected graphics
void ST7920_Update(void);
// Initialize the display
void ST7920_Init (void);
/* Common functions used
* in other LCDs also
*/
// Set a pixel on the display
void SetPixel(uint8_t x, uint8_t y);
// draw line from (X0, Y0) to (X1, Y1)
void DrawLine(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1);
// draw rectangle from (X,Y) w- width, h- height
void DrawRectangle(uint16_t x, uint16_t y, uint16_t w, uint16_t h);
// draw filled rectangle
void DrawFilledRectangle(uint16_t x, uint16_t y, uint16_t w, uint16_t h);
// draw circle with centre (X0, Y0) and radius= radius
void DrawCircle(uint8_t x0, uint8_t y0, uint8_t radius);
// Draw Filled Circle with centre (X0, Y0) and radius= r
void DrawFilledCircle(int16_t x0, int16_t y0, int16_t r);
// Draw Traingle with coordimates (x1, y1), (x2, y2), (x3, y3)
void DrawTriangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t x3, uint16_t y3);
// Draw Filled Traingle with coordimates (x1, y1), (x2, y2), (x3, y3)
void DrawFilledTriangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t x3, uint16_t y3);
//Other
void GLCD_Buf_Clear(void);
void GLCD_Font_Print(uint8_t x,uint8_t y,char * String);
void ClearPixel(uint8_t x, uint8_t y);
void TogglePixel(uint8_t x, uint8_t y);
void ClearLine(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1);
void ToggleLine(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1);
void ToggleRectangle(uint16_t x, uint16_t y, uint16_t w, uint16_t h);
void ClearPixel(uint8_t x, uint8_t y);
void ClearFilledCircle(int16_t x0, int16_t y0, int16_t r);
void GLCD_ICON_Print(uint8_t x,uint8_t y,const uint8_t * ICON);
//Debug
void GLCD_Test(void);
#endif