conio.h
Go to the documentation of this file.
1 
26 /*
27  * The contents of this file are subject to the Mozilla Public License
28  * Version 1.0 (the "License"); you may not use this file except in
29  * compliance with the License. You may obtain a copy of the License
30  * at http://www.mozilla.org/MPL/
31  *
32  * Software distributed under the License is distributed on an "AS IS"
33  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
34  * the License for the specific language governing rights and
35  * limitations under the License.
36  *
37  * The Original Code is legOS code, released October 17, 1999.
38  *
39  * The Initial Developer of the Original Code is Markus L. Noga.
40  * Portions created by Markus L. Noga are Copyright (C) 1999
41  * Markus L. Noga. All Rights Reserved.
42  *
43  * Contributor(s): Markus L. Noga <markus@noga.de>
44  */
45 
46 #ifndef __conio_h_
47 #define __conio_h_
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
53 #include <config.h>
54 
55 #ifdef CONF_CONIO
56 
57 #include <sys/lcd.h>
58 #include <dlcd.h>
59 #include <dkey.h>
60 
62 //
63 // Definitions
64 //
66 
67 #ifndef DOXYGEN_SHOULD_SKIP_INTERNALS
68 
70 
72 extern const char hex_display_codes[];
73 
74 #ifdef CONF_ASCII
75 
77 
79 extern const char ascii_display_codes[];
80 
81 #endif // CONF_ASCII
82 
83 #endif // DOXYGEN_SHOULD_SKIP_INTERNALS
84 
86 //
87 // Functions
88 //
90 
91 #endif // CONF_CONIO
92 
94 
96 extern void delay(unsigned ms);
97 
98 #ifdef CONF_CONIO
99 
100 //
101 // display native mode segment mask at fixed display position
102 //
103 // encoding: middle=1, topr=2, top=4, ... (counterclockwise)
104 // dot not included because not reliably present.
105 //
107 extern void cputc_native_0(char mask);
109 extern void cputc_native_1(char mask);
111 extern void cputc_native_2(char mask);
113 extern void cputc_native_3(char mask);
115 extern void cputc_native_4(char mask);
117 extern void cputc_native_5(char mask);
118 
120 
125 extern void cputc_native(char mask, int pos);
126 
128 extern inline void cputc_hex_0(unsigned nibble)
129 {
130  cputc_native_0(hex_display_codes[(nibble) & 0x0f]);
131 }
133 extern inline void cputc_hex_1(unsigned nibble)
134 {
135  cputc_native_1(hex_display_codes[(nibble) & 0x0f]);
136 }
138 extern inline void cputc_hex_2(unsigned nibble)
139 {
140  cputc_native_2(hex_display_codes[(nibble) & 0x0f]);
141 }
143 extern inline void cputc_hex_3(unsigned nibble)
144 {
145  cputc_native_3(hex_display_codes[(nibble) & 0x0f]);
146 }
148 extern inline void cputc_hex_4(unsigned nibble)
149 {
150  cputc_native_4(hex_display_codes[(nibble) & 0x0f]);
151 }
153 extern inline void cputc_hex_5(unsigned nibble)
154 {
155  cputc_native_5(hex_display_codes[(nibble) & 0x0f]);
156 }
157 
159 
164 extern inline void cputc_hex(char c, int pos)
165 {
166  cputc_native(hex_display_codes[(c) & 0x7f], pos);
167 }
168 
170 extern void cputw(unsigned word);
171 
172 #ifdef CONF_ASCII
173 extern inline void cputc_0(unsigned c)
175 {
176  cputc_native_0(ascii_display_codes[(c) & 0x7f]);
177 }
179 extern inline void cputc_1(unsigned c)
180 {
181  cputc_native_1(ascii_display_codes[(c) & 0x7f]);
182 }
184 extern inline void cputc_2(unsigned c)
185 {
186  cputc_native_2(ascii_display_codes[(c) & 0x7f]);
187 }
189 extern inline void cputc_3(unsigned c)
190 {
191  cputc_native_3(ascii_display_codes[(c) & 0x7f]);
192 }
194 extern inline void cputc_4(unsigned c)
195 {
196  cputc_native_4(ascii_display_codes[(c) & 0x7f]);
197 }
199 extern inline void cputc_5(unsigned c)
200 {
201  cputc_native_5(ascii_display_codes[(c) & 0x7f]);
202 }
203 
205 
210 extern inline void cputc(char c, int pos)
211 {
212  cputc_native(ascii_display_codes[(c) & 0x7f], pos);
213 }
214 
215 //
217 //
218 extern void cputs(char *s);
219 
220 //
222 //
223 extern void cls();
224 
225 #else
226 
227 #define cls() lcd_clear()
228 
229 #endif // CONF_ASCII
230 
231 #else
232 
233 #define cls() lcd_clear()
234 
235 #endif // CONF_CONIO
236 
237 #ifdef __cplusplus
238 }
239 #endif
240 
241 #endif // __conio_h__
dkey.h
Interface: debounced key driver.
cputc_native_2
void cputc_native_2(char mask)
write bit-pattern for segments at position 2 of LCD
delay
void delay(unsigned ms)
delay approximately ms mSec
cputc_4
void cputc_4(unsigned c)
write ASCII char to position 4 of LCD
Definition: conio.h:194
cputw
void cputw(unsigned word)
Write a HEX word to LCD.
cputc_native_5
void cputc_native_5(char mask)
write bit-pattern for segments at position 5 of LCD
cputc_native
void cputc_native(char mask, int pos)
Set/Clear individual segments at specified position of LCD.
cputc_hex
void cputc_hex(char c, int pos)
Write HEX digit to specified position of LCD.
Definition: conio.h:164
cputc_hex_4
void cputc_hex_4(unsigned nibble)
write HEX digit to position 4 of LCD
Definition: conio.h:148
cputc_native_0
void cputc_native_0(char mask)
write bit-pattern for segments at position 0 of LCD
cputc_1
void cputc_1(unsigned c)
write ASCII char to position 1 of LCD
Definition: conio.h:179
cputc_native_3
void cputc_native_3(char mask)
write bit-pattern for segments at position 3 of LCD
cputc_0
void cputc_0(unsigned c)
write ASCII char to position 0 of LCD
Definition: conio.h:174
cputs
void cputs(char *s)
Write string s to LCD (Only first 5 chars)
cputc_hex_5
void cputc_hex_5(unsigned nibble)
write HEX digit to position 5 of LCD
Definition: conio.h:153
cputc_hex_2
void cputc_hex_2(unsigned nibble)
write HEX digit to position 2 of LCD
Definition: conio.h:138
cputc_hex_3
void cputc_hex_3(unsigned nibble)
write HEX digit to position 3 of LCD
Definition: conio.h:143
cls
void cls()
clear user portion of LCD
cputc_native_4
void cputc_native_4(char mask)
write bit-pattern for segments at position 4 of LCD
cputc_5
void cputc_5(unsigned c)
write ASCII char to position 5 of LCD
Definition: conio.h:199
cputc
void cputc(char c, int pos)
Write ASCII character to specified position of LCD.
Definition: conio.h:210
dlcd.h
Interface: direct control of LCD display.
cputc_2
void cputc_2(unsigned c)
write ASCII char to position 2 of LCD
Definition: conio.h:184
cputc_hex_1
void cputc_hex_1(unsigned nibble)
write HEX digit to position 1 of LCD
Definition: conio.h:133
cputc_3
void cputc_3(unsigned c)
write ASCII char to position 3 of LCD
Definition: conio.h:189
cputc_hex_0
void cputc_hex_0(unsigned nibble)
write HEX digit to position 0 of LCD
Definition: conio.h:128
cputc_native_1
void cputc_native_1(char mask)
write bit-pattern for segments at position 1 of LCD

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

Generated for brickOS C++ by doxygen 1.8.16