miosix::Console Class Reference
[Interfaces]

#include <console.h>

List of all members.

Static Public Member Functions

static void write (const char *string)
static void write (const char *data, int length)
static bool txComplete ()
static void IRQwrite (const char *string)
static bool IRQtxComplete ()
static char readChar ()
static bool readCharNonBlocking (char &c)


Detailed Description

This is an abstraction over a character device. The kernel uses it to implement stdin/stdout/stderr I/O of the C and C++ standard library, and if bootlogs/error logs are enabled in miosix_settings.h also these logs are redirected here. The underlying implementation depends on the architecture chosen when compiling Miosix and can be for example a serial port, an USB endpoint or can also be empty (/dev/null like behaviour).

The implementation of this class is in arch/arch name/board name/interfaces-impl


Member Function Documentation

static bool miosix::Console::IRQtxComplete (  )  [static]

Can ONLY be called when the kernel is not yet started, paused or within an interrupt. Since the implementation of the Console class can use buffering, this memeber function is provided to know if all data has been sent, for example to wait until all data has been sent before performing a reboot.

Returns:
true if all write buffers are empty.

static void miosix::Console::IRQwrite ( const char *  string  )  [static]

Write a string to the Console. Can ONLY be called when the kernel is not yet started, paused or within an interrupt. If the underlying communication channel is not open this function returns without doing anything. If for some reason in an architecture Miosix is ported to it is not possible to access the underlying communication channel when the kernel is not started it is possible that this function always returns without doing anything.

Parameters:
string the string to write. The string must be NUL terminated.

static char miosix::Console::readChar (  )  [static]

Read a character from the Console. Blocking. Can be safely called by multiple threads. If the underlying communication channel is not open this function blocks until it is opened and data arrives.

Returns:
the character read.

static bool miosix::Console::readCharNonBlocking ( char &  c  )  [static]

Read a character from the Console. Nonblocking. Can be safely called by multiple threads.

Parameters:
c a reference to the character to read. If the function returns true then the read character is stored here.
Returns:
true if the underlying communication channel was open and there was data available. False otherwise.

static bool miosix::Console::txComplete (  )  [static]

Since the implementation of the Console class can use buffering, this memeber function is provided to know if all data has been sent, for example to wait until all data has been sent before performing a reboot.

Returns:
true if all write buffers are empty.

static void miosix::Console::write ( const char *  data,
int  length 
) [static]

Write data to the Console. Can be safely called by multiple threads. If the underlying communication channel is not open this function returns without doing anything.

Parameters:
data data to write
length length of data

static void miosix::Console::write ( const char *  string  )  [static]

Write a string to the Console. Can be safely called by multiple threads. If the underlying communication channel is not open this function returns without doing anything.

Parameters:
string the string to write. The string must be NUL terminated.


The documentation for this class was generated from the following file:

Generated on Mon Aug 30 00:05:00 2010 for Miosix by  doxygen 1.5.9