|
|
|
|
|
|
|
||
|
||
|
|
||
May 1999 |
Revision 1.03 |
|
Persistor Instruments Inc. |
© 1998 All rights reserved. |
|
|
cdrain |
cgetc |
cgetq |
cgets |
chexdump |
ciflush |
coflush |
cprintf |
cputc |
cputs |
Legacy/Compatability Macro Functions
|
getstr |
hexdump |
The Console I/O functions provide patchable low level access to your routines that interact with a user through a console interface. By default, all of these functions work through the onboard 68338 SCI (Serial Controller Interface), and all the PicoDOS command shell functions work through CIO functions, as do the default standard library console functions.
This function will wait for and retrieve the next incoming byte on the main UART.
|
Prototype: |
short getch(void); |
|
Definition: |
#include <cf1bios.h> |
|
Returns: |
The character gotten from the UART is returned in the low byte of the short and the high byte contains error codes. |
|
Notes: |
getch() is a macro to
SCIRxGetChar() |
|
Timing: |
Dependent on the serial line and buffer conditions. |
kbflush() will empty the receive buffer and return immediately regardless of buffer contents or buffering mode.
|
Prototype: |
void kbflush(void); |
|
Definition: |
#include <cf1bios.h> |
|
Notes: |
kbflush() is a macro to
(SCIRxGetCharWaitIdle(1) != 1) |
|
Timing: |
Dependent on the serial line and buffer conditions. |
This function returns nonzero if there is a character available to receive on the main serial port. It's behavior depends also on the buffering mode currently in effect. In interrupt-driven mode, kbhit() should return the number of characters available. In polled mode, kbhit() will return either 0 or non zero if there is a character available.
|
Prototype: |
short kbhit(void); |
|
Definition: |
#include <cf1bios.h> |
|
Returns: |
Returns true if there is a character available, false if there is not. (see notes) |
|
Notes: |
kbhit() is a macro to
SCIRxQueuedCount() |
|
Timing: |
approx. 6 µsec @ 16MHz |
This command takes the LSB of data and puts it in the transmit queue of the main UART. If the SCI is in polled mode, putch() will wait for the transmit queue to be empty and then write the LSB of data to the main UART. The MSB of data is always ignored.
|
Prototype: |
void putch(ushort data); |
|
Definition: |
#include <cf1bios.h> |
|
Inputs: |
data is a ushort, the LSB of which is the character you wish to transmit. |
|
Notes: |
putch(c) is a macro to
SCITxPutChar(c) |
|
Timing: |
Depends upon baud rate. |
This will wait for the transmit buffer to be empty and then return. Behavior is the same regardless of buffering mode, however timing may vary.
|
Prototype: |
void putflush (void); |
|
Definition: |
#include <cf1bios.h> |
|
Notes: |
putflush() is a macro to
SCITxWaitCompletion() |
|
Timing: |
Depends on buffering mode, buffer conditions, and baud rate. |
Writes the NULL terminated string pointed to by str to the transmit queue of the main UART. putstr() will not append any characters to the end of any string passed to it, however it will replace any "newline" characters (/n) already in the string with CRLF sequences before inserting it into the buffer.
|
Prototype: |
void putstr (const char *str); |
|
Definition: |
#include <cf1bios.h> |
|
Inputs: |
str is a pointer to a NULL terminated string. |
|
Notes: |
putstr(s) is a macro to
SCITxPutStr(s) |
|
Timing: |
Depends on baud rate and buffering mode. |
Provides the same functionality as the ANSI C library function printf() with respect to the main UART, excepting floating point number display support. The types float, double and long long, cannot be output by uprintf(). Full documentation of the printf() function and its many format specifiers and conventions is beyond the scope of this BIOS manual, please see an ANSI function reference for a more detailed description of printf() usage.
|
Prototype: |
void uprintf (const char *format, ...); |
|
Definition: |
#include <cf1bios.h> |
|
Inputs: |
See ANSI C documentation of printf function arguments and behavior. |
|
Notes: |
uprintf() is a macro to SCITxPrintf
() |
|
Timing: |
Depends on arguments, buffering mode, buffer conditions and baud rate. |
|
|
|
|
|
|
Tel: 508-759-6434 |
|
Fax: 508-759-6436 |
|
|
||