-
Notifications
You must be signed in to change notification settings - Fork 1
/
screen.h
114 lines (91 loc) · 2.91 KB
/
screen.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
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
/**
* Include file for screen routines
*
*/
#ifndef SCREEN_H
#define SCREEN_H
/*-----------------------------------------------------------*/
/**
* Initialize the display
*/
void initDisplay (void);
/**
* Clear diplay - make white
*/
void screenClear (void);
/**
* Diplay one line of text, max 20 chars
*
* lineNo = selected Line1 to Line9 (or y-coordinates)
* textCol = text color, see file GLCD.h (not all colors work)
* text = text to print
*/
void screenOutputTextLine(unsigned short textCol, unsigned int lineNo, unsigned char text[]);
/**
* Diplay some chars somewhere on the screen (horisontal)
*
* with size of y = line number
* with size of x = number of characters from left border
* (max 20 characters on one line)
*
* y = 0 -> first line, y = 2 -> second line....
*
* In this case input x=0 means the left border
* A small distance to the right will be added to x
*
* textCol = text color, see file GLCD.h (not all colors work), 0 = black
* text = text to print
*/
void screenOutputText(int y, int x, unsigned short textCol, unsigned char text[]);
/**
* Display one line of text plus a grid with numbers
* from 0 to 9. Asking for example to "Enter Code
*
* textCol - text color, see file GLCD.h (not all colors work)
* text - a number of characters forming a text string
* numberOfDigits - maximum number of digits in response
*
* returns entered number, which can be 0
*/
int screenQueryNumber(unsigned short textCol, unsigned char text[], int numberOfDigits);
/**
* Display one line of text plus a grid with characters (qwerty...)
* asking for example to "Enter Text"
*
* textCol - text color, see file GLCD.h (not all colors work)
* text - a number of characters forming a text string
* numberOfChars - maximum number of characters in response
* (maximum characters in one line is 20)
*
* returns entered characters, which can be ' ', ended by a \0
*/
void screenQueryChars(unsigned short textCol, unsigned char text[], int numberOfChars, unsigned char textEntered[]);
/**
* Display a menu and select menu item number
* With 2 menu items
*
* text1 - text on line 1 (max 18 characters)
* text2 - text on line 2 (max 18 characters)
*
* returns selected menu alternative, 1 or 2
*/
int screenMenu2(unsigned char text1[], unsigned char text2[]);
/**
* Display a menu and select menu item number
* With 3 menu items
*
* text1 - text on line 1 (max 18 characters)
* text2 - text on line 2 (max 18 characters)
* text3 - text on line 3 (max 18 characters)
*
* returns selected menu alternative, 1, 2 or 3
*/
int screenMenu3(unsigned char text1[], unsigned char text2[], unsigned char text3[]);
/**
* Display a line with text and let the user confirm
*
* text - text on line, within rectangle max 18 characters)
*
*/
int screenTextOk(unsigned char text[] );
#endif