-
Notifications
You must be signed in to change notification settings - Fork 0
/
glcd_spi.h
64 lines (56 loc) · 2.06 KB
/
glcd_spi.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
/* ========================================================================== */
/* */
/* glcd_spi.h */
/* (c) 2017 VNGIoTLab */
/* */
/* Description: Only Text mode */
/* Thanks to SangTaoClub
/* http://sangtaoclub.net/m/bai-viet/236-share-code-giao-tiep-graphic-lcd-12864-spi-cua-may-gphone-zte.html
/* ========================================================================== */
#ifndef __GLCD_SPI_H
#define __GLCD_SPI_H
/*-------------------------------------------------------------------------------------------------------------*/
/*
* @brief Init for SPI GLCD
* @params CS_: CS pin on VBLUno
* @params SCK_: SCK pin on VBLUno
* @params SDA_: SDA pin on VBLUno
* @params AO_: AO pin on VBLUno
* @params GRAPHIC_MODE_: GLCD Mode
* 0: Text mode
* 1: Graphic mode (not support in this library)
*/
void InitLcd(int CS_, int SCK_, int SDA_, int AO_, int GRAPHIC_MODE_);
/*
* @brief Test function
*/
void TestLcd(void);
/*
* @brief Clear all screen
*/
void ClearLcd(void);
/*
* @brief Print a string on screen
* @params row: 0-7
* @params col: 0-20
* @params stringdata: a string (1 to 21 character)
* @note Size of stringdata is not greater than 21 character
*/
void PrintLcd(int row, int col, char* stringdata);
/*
* @brief Print a string on screen
* @params row: 0-7
* @params col: 0-20
* @params num: integer number
*/
void PrintIntLcd(int row, int col, int num);
/*
* @brief Print a string on screen
* @params row: 0-7
* @params col: 0-20
* @params doublenum: double number
* @note precision is %0.4f
*/
void PrintFloatLcd(int row, int col, double doublenum);
/*-------------------------------------------------------------------------------------------------------------*/
#endif /* __GLCD_SPI_H */