00001 00026 /* 00027 * The contents of this file are subject to the Mozilla Public License 00028 * Version 1.0 (the "License"); you may not use this file except in 00029 * compliance with the License. You may obtain a copy of the License 00030 * at http://www.mozilla.org/MPL/ 00031 * 00032 * Software distributed under the License is distributed on an "AS IS" 00033 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00034 * the License for the specific language governing rights and 00035 * limitations under the License. 00036 * 00037 * The Original Code is legOS code, released October 17, 1999. 00038 * 00039 * The Initial Developer of the Original Code is Markus L. Noga. 00040 * Portions created by Markus L. Noga are Copyright (C) 1999 00041 * Markus L. Noga. All Rights Reserved. 00042 * 00043 * Contributor(s): Markus L. Noga <markus@noga.de> 00044 */ 00045 00046 #ifndef __conio_h_ 00047 #define __conio_h_ 00048 00049 #ifdef __cplusplus 00050 extern "C" { 00051 #endif 00052 00053 #include <config.h> 00054 00055 #ifdef CONF_CONIO 00056 00057 #include <sys/lcd.h> 00058 #include <dlcd.h> 00059 #include <dkey.h> 00060 00062 // 00063 // Definitions 00064 // 00066 00067 #ifndef DOXYGEN_SHOULD_SKIP_INTERNALS 00068 00070 00072 extern const char hex_display_codes[]; 00073 00074 #ifdef CONF_ASCII 00075 00077 00079 extern const char ascii_display_codes[]; 00080 00081 #endif // CONF_ASCII 00082 00083 #endif // DOXYGEN_SHOULD_SKIP_INTERNALS 00084 00086 // 00087 // Functions 00088 // 00090 00091 #endif // CONF_CONIO 00092 00094 00096 extern void delay(unsigned ms); 00097 00098 #ifdef CONF_CONIO 00099 00100 // 00101 // display native mode segment mask at fixed display position 00102 // 00103 // encoding: middle=1, topr=2, top=4, ... (counterclockwise) 00104 // dot not included because not reliably present. 00105 // 00107 extern void cputc_native_0(char mask); 00109 extern void cputc_native_1(char mask); 00111 extern void cputc_native_2(char mask); 00113 extern void cputc_native_3(char mask); 00115 extern void cputc_native_4(char mask); 00117 extern void cputc_native_5(char mask); 00118 00120 00125 extern void cputc_native(char mask, int pos); 00126 00128 extern inline void cputc_hex_0(unsigned nibble) 00129 { 00130 cputc_native_0(hex_display_codes[(nibble) & 0x0f]); 00131 } 00133 extern inline void cputc_hex_1(unsigned nibble) 00134 { 00135 cputc_native_1(hex_display_codes[(nibble) & 0x0f]); 00136 } 00138 extern inline void cputc_hex_2(unsigned nibble) 00139 { 00140 cputc_native_2(hex_display_codes[(nibble) & 0x0f]); 00141 } 00143 extern inline void cputc_hex_3(unsigned nibble) 00144 { 00145 cputc_native_3(hex_display_codes[(nibble) & 0x0f]); 00146 } 00148 extern inline void cputc_hex_4(unsigned nibble) 00149 { 00150 cputc_native_4(hex_display_codes[(nibble) & 0x0f]); 00151 } 00153 extern inline void cputc_hex_5(unsigned nibble) 00154 { 00155 cputc_native_5(hex_display_codes[(nibble) & 0x0f]); 00156 } 00157 00159 00164 extern inline void cputc_hex(char c, int pos) 00165 { 00166 cputc_native(hex_display_codes[(c) & 0x7f], pos); 00167 } 00168 00170 extern void cputw(unsigned word); 00171 00172 #ifdef CONF_ASCII 00173 00174 extern inline void cputc_0(unsigned c) 00175 { 00176 cputc_native_0(ascii_display_codes[(c) & 0x7f]); 00177 } 00179 extern inline void cputc_1(unsigned c) 00180 { 00181 cputc_native_1(ascii_display_codes[(c) & 0x7f]); 00182 } 00184 extern inline void cputc_2(unsigned c) 00185 { 00186 cputc_native_2(ascii_display_codes[(c) & 0x7f]); 00187 } 00189 extern inline void cputc_3(unsigned c) 00190 { 00191 cputc_native_3(ascii_display_codes[(c) & 0x7f]); 00192 } 00194 extern inline void cputc_4(unsigned c) 00195 { 00196 cputc_native_4(ascii_display_codes[(c) & 0x7f]); 00197 } 00199 extern inline void cputc_5(unsigned c) 00200 { 00201 cputc_native_5(ascii_display_codes[(c) & 0x7f]); 00202 } 00203 00205 00210 extern inline void cputc(char c, int pos) 00211 { 00212 cputc_native(ascii_display_codes[(c) & 0x7f], pos); 00213 } 00214 00215 // 00217 // 00218 extern void cputs(char *s); 00219 00220 // 00222 // 00223 extern void cls(); 00224 00225 #else 00226 00227 #define cls() lcd_clear() 00228 00229 #endif // CONF_ASCII 00230 00231 #else 00232 00233 #define cls() lcd_clear() 00234 00235 #endif // CONF_CONIO 00236 00237 #ifdef __cplusplus 00238 } 00239 #endif 00240 00241 #endif // __conio_h__
brickOS is released under the
Mozilla Public License.
Original code copyright 1998-2002 by the authors. |