dlcd.h
Go to the documentation of this file.
1
11/*
12 * The contents of this file are subject to the Mozilla Public License
13 * Version 1.0 (the "License"); you may not use this file except in
14 * compliance with the License. You may obtain a copy of the License
15 * at http://www.mozilla.org/MPL/
16 *
17 * Software distributed under the License is distributed on an "AS IS"
18 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
19 * the License for the specific language governing rights and
20 * limitations under the License.
21 *
22 * The Original Code is legOS code, released October 17, 1999.
23 *
24 * The Initial Developer of the Original Code is Markus L. Noga.
25 * Portions created by Markus L. Noga are Copyright (C) 1999
26 * Markus L. Noga. All Rights Reserved.
27 *
28 * Contributor(s): Markus L. Noga <markus@noga.de>
29 */
30
31#ifndef __dlcd_h__
32#define __dlcd_h__
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38#include <sys/bitops.h>
39
41//
42// Definitions
43//
45
46// LCD segment control byte and bit locations
47// 0xNNNN,0xM => Mth bit (value 1<<M) of byte 0xNNNN
48// overall memory range: 0xef43-0xef4b (9 bytes)
49//
50
51// the man
52//
53#define LCD_ARMS 0xef43,0x0
54#define LCD_BODY 0xef43,0x1
55#define LCD_1LEG 0xef43,0x2
56#define LCD_2LEGS 0xef43,0x3
57
58// the digits
59// numbered right to left
60// dots are associated with the digit to their left
61// only digit 2,3,4 have dots
62// digit 5 can only be used as a minus sign
63//
64#define LCD_0_TOP 0xef44,0x4
65#define LCD_0_MID 0xef44,0x5
66#define LCD_0_BOT 0xef44,0x7
67#define LCD_0_TOPR 0xef45,0x5
68#define LCD_0_BOTR 0xef45,0x7
69#define LCD_0_TOPL 0xef47,0x5
70#define LCD_0_BOTL 0xef47,0x7
71
72#define LCD_1_TOP 0xef43,0x4
73#define LCD_1_MID 0xef43,0x5
74#define LCD_1_BOT 0xef43,0x7
75#define LCD_1_TOPR 0xef47,0x1
76#define LCD_1_BOTR 0xef47,0x3
77#define LCD_1_TOPL 0xef48,0x5
78#define LCD_1_BOTL 0xef48,0x7
79
80#define LCD_2_TOP 0xef44,0x0
81#define LCD_2_MID 0xef44,0x1
82#define LCD_2_BOT 0xef44,0x3
83#define LCD_2_TOPR 0xef48,0x1
84#define LCD_2_BOTR 0xef48,0x3
85#define LCD_2_TOPL 0xef49,0x5
86#define LCD_2_BOTL 0xef49,0x7
87#define LCD_2_DOT 0xef48,0x6
88
89#define LCD_3_TOP 0xef46,0x0
90#define LCD_3_MID 0xef46,0x1
91#define LCD_3_BOT 0xef46,0x3
92#define LCD_3_TOPR 0xef4b,0x1
93#define LCD_3_BOTR 0xef4b,0x3
94#define LCD_3_TOPL 0xef4b,0x5
95#define LCD_3_BOTL 0xef4b,0x7
96#define LCD_3_DOT 0xef49,0x6
97
98#define LCD_4_TOP 0xef46,0x4
99#define LCD_4_MID 0xef46,0x5
100#define LCD_4_BOT 0xef46,0x7
101#define LCD_4_TOPR 0xef4a,0x1
102#define LCD_4_BOTR 0xef4a,0x3
103#define LCD_4_TOPL 0xef4a,0x5
104#define LCD_4_BOTL 0xef4a,0x7
105#define LCD_4_DOT 0xef4b,0x6
106
107#define LCD_5_MID 0xef4a,0x6
108
109// the motor displays
110//
111#define LCD_A_SELECT 0xef4a,0x2
112#define LCD_A_LEFT 0xef46,0x6
113#define LCD_A_RIGHT 0xef46,0x2
114
115#define LCD_B_SELECT 0xef43,0x6
116#define LCD_B_LEFT 0xef44,0x2
117#define LCD_B_RIGHT 0xef47,0x2
118
119#define LCD_C_SELECT 0xef44,0x6
120#define LCD_C_LEFT 0xef47,0x6
121#define LCD_C_RIGHT 0xef45,0x6
122
123// the sensor displays
124//
125#define LCD_S1_SELECT 0xef49,0x0
126#define LCD_S1_ACTIVE 0xef49,0x1
127
128#define LCD_S2_SELECT 0xef48,0x4
129#define LCD_S2_ACTIVE 0xef48,0x0
130
131#define LCD_S3_SELECT 0xef47,0x4
132#define LCD_S3_ACTIVE 0xef45,0x4
133
134// the quartered circle
135// quarter nubering is counterclockwise
136// starts at top right
137//
138#define LCD_CIRCLE_0 0xef45,0x0
139#define LCD_CIRCLE_1 0xef45,0x1
140#define LCD_CIRCLE_2 0xef45,0x3
141#define LCD_CIRCLE_3 0xef45,0x2
142
143// the dotted line
144// dots numbered right to left
145//
146#define LCD_DOT_0 0xef49,0x4
147#define LCD_DOT_1 0xef4b,0x0
148#define LCD_DOT_2 0xef4b,0x4
149#define LCD_DOT_3 0xef4a,0x0
150#define LCD_DOT_4 0xef4a,0x4
151
152// the IR display
153//
154#define LCD_IR_LOWER 0xef49,0x2
155#define LCD_IR_UPPER 0xef49,0x3
156
157// the crossed out battery
158//
159#define LCD_BATTERY_X 0xef47,0x0
160
161// two empty bits
162//
163#define LCD_EMPTY_1 0xef48,0x2
164#define LCD_EMPTY_2 0xef4b,0x2
165
167//
168// Functions
169//
171
173
175#define dlcd_show(a) bit_set(BYTE_OF(a),BIT_OF(a))
176
178
180#define dlcd_hide(a) bit_clear(BYTE_OF(a),BIT_OF(a))
181
183
187#define dlcd_store(a) bit_store(BYTE_OF(a),BIT_OF(a))
188
190//
191#define BYTE_OF(a,b) a
192#define BIT_OF(a,b) b
193
194#ifdef __cplusplus
195}
196#endif
197
198#endif // __dlcd_h__

brickOS is released under the Mozilla Public License.
Original code copyright 1998-2005 by the authors.

Generated for brickOS C++ by doxygen 1.9.4