Repository navigation
Expand file tree
/
Copy pathAPI
More file actions
103 lines (61 loc) · 2.66 KB
/
Copy pathAPI
File metadata and controls
103 lines (61 loc) · 2.66 KB
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
int i2copen(int controller, int device);
Initialize display I2C interface
controller - I2c controller
device - I2c address of device
Returs file descriptor to opened connection.
void lcdinit(int fdlcd, int rows, int cols);
Initialize the display.
fdlcd - file descriptor returned by i2copen()
Perform controller initialization
Turn on the backlight
Turn on the display
Disable the cursor
Store display geometry (rows, columns)
Number of rows and columns are stored in dispdef structure (see lcdi2c.h)
void lcdSet(int fdlcd, int disp, int cur, int blin, int back);
fdlcd - file descriptor returned by i2copen()
Set display on/off, cursor on/off cursor blinking on/off, backlight on/off
1 - ON, 0 - OFF, 99 - unchanged
void lcdLoc(int fdlcd, int col, int line);
Move cursor to position line, column
fdlcd - file descriptor returned by i2copen()
void lcdClr(int fdlcd);
Clear the screen, move cursor to line 0, column 0
fdlcd - file descriptor returned by i2copen()
void lcdChar(int fdlcd, char val);
Display character val in current cursor position
fdlcd - file descriptor returned by i2copen()
void lcdLine(int fdlcd, int x, int y, char* text);
Display the line of text, truncated on the right if necessary
fdlcd - file descriptor returned by i2copen()
x - column to start displaying text
y - line to display text
text - text to display
void lcdBlock(int fdlcd, int x, int y, char* text);
Display block of text, wrap lines, truncated on the
end of display if necessary
fdlcd - file descriptor returned by i2copen()
x, y - start column / line of the displayed text
y - line to display text
text - text to display
void lcdRun(int fdlcd, int mode, int speed, int line, char* text);
Start animation of text.
the animation is done in the thread, you can do other tasks,
to stop animation use lcdStop(int fdlcd)
You can animate text up to 200 characters long.
fdlcd - file descriptor returned by i2copen()
speed - speed of animation, in in 1/10 sec increments
line - line of display to show animated text (200 charactersi max)
text - string to display and animate
mode:
0 - at end of displayed text start from begining
1 - append begining of text to end of text
void lcdStop(int fdlcd);
Finish animation of text
fdlcd - file descriptor returned by i2copen()
void lcdDefc(int fdlcd, int addr, unsigned char* matrix)
Define custom character
You can define up to 8 characters, 5x8 pixels
fdlcd - file descriptor returned by i2copen()
addr - address of character, 0 - 8
Matrix - bitmap of character, 8 bytes