aip31068_regs.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Freie Universität Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
17 #ifndef AIP31068_REGS_H
18 #define AIP31068_REGS_H
19 
20 #include "bitarithm.h"
21 
22 #ifdef __cplusplus
23 extern "C"
24 {
25 #endif
26 
27 /* Commands (page 18, table 3) */
28 
34 #define AIP31068_CMD_CLEAR_DISPLAY 0x01
35 
40 #define AIP31068_CMD_RETURN_HOME 0x02
41 
45 #define AIP31068_CMD_ENTRY_MODE_SET 0x04
46 
51 #define AIP31068_CMD_DISPLAY_CONTROL 0x08
52 
56 #define AIP31068_CMD_CURSOR_DISPLAY_SHIFT 0x10
57 
62 #define AIP31068_CMD_FUNCTION_SET 0x20
63 
67 #define AIP31068_CMD_SET_CGRAM_ADDR 0x40
68 
72 #define AIP31068_CMD_SET_DDRAM_ADDR 0x80
73 
74 
75 
76 /* Bits for AIP31068_CMD_ENTRY_MODE_SET (page 16, section 3) */
77 
82 #define AIP31068_BIT_ENTRY_MODE_INCREMENT BIT1
83 
88 #define AIP31068_BIT_ENTRY_MODE_AUTOINCREMENT BIT0
89 
90 
91 
92 /* Bits for AIP31068_CMD_DISPLAY_CONTROL (page 16, section 4) */
93 
98 #define AIP31068_BIT_DISPLAY_CONTROL_DISPLAY BIT2
99 
104 #define AIP31068_BIT_DISPLAY_CONTROL_CURSOR BIT1
105 
110 #define AIP31068_BIT_DISPLAY_CONTROL_CURSOR_BLINKING BIT0
111 
112 
113 
114 /* Bits for AIP31068_CMD_CURSOR_DISPLAY_SHIFT (page 17, section 5) */
115 
120 #define AIP31068_BIT_CURSOR_DISPLAY_SHIFT_SELECTION BIT3
121 
126 #define AIP31068_BIT_CURSOR_DISPLAY_SHIFT_DIRECTION BIT2
127 
128 
129 
130 /* Bits for AIP31068_CMD_FUNCTION_SET (page 17, section 6) */
131 
136 #define AIP31068_BIT_FUNCTION_SET_BITMODE BIT4
137 
142 #define AIP31068_BIT_FUNCTION_SET_LINECOUNT BIT3
143 
148 #define AIP31068_BIT_FUNCTION_SET_FONTSIZE BIT2
149 
150 
151 
152 /* Bits for control byte (page 12) */
153 
158 #define AIP31068_BIT_CONTROL_BYTE_CO BIT7
159 
164 #define AIP31068_BIT_CONTROL_BYTE_RS BIT6
165 
166 #ifdef __cplusplus
167 }
168 #endif
169 
170 #endif /* AIP31068_REGS_H */
171 
bitarithm.h
Helper functions for bit arithmetic.