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
50extern "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
72extern const char hex_display_codes[];
73
74#ifdef CONF_ASCII
75
77
79extern 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
96extern 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//
107extern void cputc_native_0(char mask);
109extern void cputc_native_1(char mask);
111extern void cputc_native_2(char mask);
113extern void cputc_native_3(char mask);
115extern void cputc_native_4(char mask);
117extern void cputc_native_5(char mask);
118
120
125extern void cputc_native(char mask, int pos);
126
128extern inline void cputc_hex_0(unsigned nibble)
129{
130 cputc_native_0(hex_display_codes[(nibble) & 0x0f]);
131}
133extern inline void cputc_hex_1(unsigned nibble)
134{
135 cputc_native_1(hex_display_codes[(nibble) & 0x0f]);
136}
138extern inline void cputc_hex_2(unsigned nibble)
139{
140 cputc_native_2(hex_display_codes[(nibble) & 0x0f]);
141}
143extern inline void cputc_hex_3(unsigned nibble)
144{
145 cputc_native_3(hex_display_codes[(nibble) & 0x0f]);
146}
148extern inline void cputc_hex_4(unsigned nibble)
149{
150 cputc_native_4(hex_display_codes[(nibble) & 0x0f]);
151}
153extern inline void cputc_hex_5(unsigned nibble)
154{
155 cputc_native_5(hex_display_codes[(nibble) & 0x0f]);
156}
157
159
164extern inline void cputc_hex(char c, int pos)
165{
166 cputc_native(hex_display_codes[(c) & 0x7f], pos);
167}
168
170extern void cputw(unsigned word);
171
172#ifdef CONF_ASCII
174extern inline void cputc_0(unsigned c)
175{
177}
179extern inline void cputc_1(unsigned c)
180{
182}
184extern inline void cputc_2(unsigned c)
185{
187}
189extern inline void cputc_3(unsigned c)
190{
192}
194extern inline void cputc_4(unsigned c)
195{
197}
199extern inline void cputc_5(unsigned c)
200{
202}
203
205
210extern inline void cputc(char c, int pos)
211{
212 cputc_native(ascii_display_codes[(c) & 0x7f], pos);
213}
214
215//
217//
218extern void cputs(char *s);
219
220//
222//
223extern 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__
kernel configuration file
void cputc_3(unsigned c)
write ASCII char to position 3 of LCD
Definition conio.h:189
void cputc_hex_2(unsigned nibble)
write HEX digit to position 2 of LCD
Definition conio.h:138
void cputw(unsigned word)
Write a HEX word to LCD.
void cputc_hex_0(unsigned nibble)
write HEX digit to position 0 of LCD
Definition conio.h:128
void cls()
clear user portion of LCD
void cputc_native_1(char mask)
write bit-pattern for segments at position 1 of LCD
void cputc_native_5(char mask)
write bit-pattern for segments at position 5 of LCD
void cputc_0(unsigned c)
write ASCII char to position 0 of LCD
Definition conio.h:174
void cputc_hex_4(unsigned nibble)
write HEX digit to position 4 of LCD
Definition conio.h:148
void cputc_hex(char c, int pos)
Write HEX digit to specified position of LCD.
Definition conio.h:164
void cputc(char c, int pos)
Write ASCII character to specified position of LCD.
Definition conio.h:210
void cputc_5(unsigned c)
write ASCII char to position 5 of LCD
Definition conio.h:199
void cputc_4(unsigned c)
write ASCII char to position 4 of LCD
Definition conio.h:194
void cputc_hex_1(unsigned nibble)
write HEX digit to position 1 of LCD
Definition conio.h:133
void cputc_native(char mask, int pos)
Set/Clear individual segments at specified position of LCD.
const char ascii_display_codes[]
Table: list of native patterns, one for each ASCII character.
void cputc_native_0(char mask)
write bit-pattern for segments at position 0 of LCD
void cputc_native_3(char mask)
write bit-pattern for segments at position 3 of LCD
void cputc_2(unsigned c)
write ASCII char to position 2 of LCD
Definition conio.h:184
void cputc_hex_5(unsigned nibble)
write HEX digit to position 5 of LCD
Definition conio.h:153
const char hex_display_codes[]
Table: list of native patterns, one for each HEX character.
void cputc_native_4(char mask)
write bit-pattern for segments at position 4 of LCD
void cputc_1(unsigned c)
write ASCII char to position 1 of LCD
Definition conio.h:179
void cputc_hex_3(unsigned nibble)
write HEX digit to position 3 of LCD
Definition conio.h:143
void cputc_native_2(char mask)
write bit-pattern for segments at position 2 of LCD
void cputs(char *s)
Write string s to LCD (Only first 5 chars)
void delay(unsigned ms)
delay approximately ms mSec
Definition conio.c:204
Interface: debounced key driver.
Interface: direct control of LCD display.
Internal Interface: LCD control and constants.

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

Generated for brickOS Kernel Developer by doxygen 1.9.8