Loading...
Searching...
No Matches
aip31068_regs.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2020 Freie Universität Berlin
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
15
16#include "bitarithm.h"
17
18#ifdef __cplusplus
19extern "C"
20{
21#endif
22
23/* Commands (page 18, table 3) */
24
30#define AIP31068_CMD_CLEAR_DISPLAY 0x01
31
36#define AIP31068_CMD_RETURN_HOME 0x02
37
41#define AIP31068_CMD_ENTRY_MODE_SET 0x04
42
47#define AIP31068_CMD_DISPLAY_CONTROL 0x08
48
52#define AIP31068_CMD_CURSOR_DISPLAY_SHIFT 0x10
53
58#define AIP31068_CMD_FUNCTION_SET 0x20
59
63#define AIP31068_CMD_SET_CGRAM_ADDR 0x40
64
68#define AIP31068_CMD_SET_DDRAM_ADDR 0x80
69
70/* Bits for AIP31068_CMD_ENTRY_MODE_SET (page 16, section 3) */
71
76#define AIP31068_BIT_ENTRY_MODE_INCREMENT BIT1
77
82#define AIP31068_BIT_ENTRY_MODE_AUTOINCREMENT BIT0
83
84/* Bits for AIP31068_CMD_DISPLAY_CONTROL (page 16, section 4) */
85
90#define AIP31068_BIT_DISPLAY_CONTROL_DISPLAY BIT2
91
96#define AIP31068_BIT_DISPLAY_CONTROL_CURSOR BIT1
97
102#define AIP31068_BIT_DISPLAY_CONTROL_CURSOR_BLINKING BIT0
103
104/* Bits for AIP31068_CMD_CURSOR_DISPLAY_SHIFT (page 17, section 5) */
105
110#define AIP31068_BIT_CURSOR_DISPLAY_SHIFT_SELECTION BIT3
111
116#define AIP31068_BIT_CURSOR_DISPLAY_SHIFT_DIRECTION BIT2
117
118/* Bits for AIP31068_CMD_FUNCTION_SET (page 17, section 6) */
119
124#define AIP31068_BIT_FUNCTION_SET_BITMODE BIT4
125
130#define AIP31068_BIT_FUNCTION_SET_LINECOUNT BIT3
131
136#define AIP31068_BIT_FUNCTION_SET_FONTSIZE BIT2
137
138/* Bits for control byte (page 12) */
139
144#define AIP31068_BIT_CONTROL_BYTE_CO BIT7
145
150#define AIP31068_BIT_CONTROL_BYTE_RS BIT6
151
152#ifdef __cplusplus
153}
154#endif
155
Helper functions for bit arithmetic.