-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhd44780.h
92 lines (76 loc) · 1.84 KB
/
hd44780.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
#ifndef HD44780_H
#define HD44780_H
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#include <stdio.h>
#include <pico.h>
#include <hardware/pio.h>
/*!
* @brief initialization
*/
void hd44780_init(PIO pio, int sm, int pin, float freq);
/*!
* @brief termination
*/
void hd44780_term();
/*!
* @brief clear display
*/
void hd44780_cleardisplay();
/*!
* @brief return home
*/
void hd44780_returnhome();
/*!
* @brief return home
* @param id true: cursor moves to right and DDRAM address is increased by 1,
* false: cursor moves to left and DDRAM address is decreased by 1
* @param s TODO:
*/
void hd44780_entrymodeset(bool id, bool s);
/*!
* @brief display control
* @param d display on
* @param c cursor on
* @param b cursor blink
*/
void hd44780_displaycontrol(bool d, bool c, bool b);
/*!
* @brief cursor or display shift
* @param sc false = shift cursor, true = shift display
* @param rl false = left, true = right
*/
void hd44780_cursordisplayshift(bool sc, bool rl);
/*!
* @brief function set
* @param dl false = 4-bit mode, true = 8-bit mode
* @param n false = 1-line display mode, true = 2-line display mode
* @param f false = 5x8 font, true = 5x11 font
*/
void hd44780_functionset(bool dl, bool n, bool f);
/*!
* @brief set CGRAM address
* @param addr address (0-63)
*/
void hd44780_setcgramaddr(uint8_t addr);
/*!
* @brief set CGRAM address
* @param addr address (0-127)
*/
void hd44780_setddramaddr(uint8_t addr);
/*!
* @brief write single byte to RAM
* @param value value
*/
void hd44780_writebyte(uint8_t value);
/*!
* @brief write bytes to RAM
* @param value addr
* @param len length
*/
void hd44780_writebytes(const uint8_t *addr, int len);
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // HD44780_H