blob: c13ff97b8df01faab5b7df06e1a306a1c7bcb95f (
plain)
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
|
/**
* @file lcd.h
* A basic library for writing a 16x2 text LCD.
*
* Copyright (C) 2018 Clyne Sullivan
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef LCD_H_
#define LCD_H_
#include <stdint.h>
/**
* A handler/task to manage asyncronous LCD writes.
*/
void lcd_handler(void);
/**
* Writes a string asyncronously to the LCD.
* The lcd_handler task must be running for the string to actually be printed.
* @param s the string to write
*/
void lcd_put(const char *s);
//
// The following functions do not support asyncronous calls.
//
/**
* Initializes the LCD.
*/
void lcd_init(void);
/**
* Writes a string to the LCD.
* A cursor position is kept internally. When the end of the screen is reached,
* writing resumes at the first position.
* @param s the string to write
*/
void lcd_puts(const char *s);
/**
* Writes a base 10 integer to the screen.
* @param i the integer to print
*/
void lcd_puti(int i);
/**
* Writes a base 16 integer to the screen.
* @param h the integer to print
*/
void lcd_puth(int h);
/**
* Writes a byte in binary to the screen.
* @param b the byte to print
*/
void lcd_putb(uint8_t b);
/**
* Clears the LCD.
*/
void lcd_clear(void);
#endif // LCD_H_
|