The Pedigree Project  0.1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PPCSerial Class Reference

#include <Serial.h>

+ Inheritance diagram for PPCSerial:
+ Collaboration diagram for PPCSerial:

Public Member Functions

 PPCSerial ()
 
 ~PPCSerial ()
 
virtual void setBase (uintptr_t nBaseAddr)
 
virtual void write (char c)
 
virtual char read ()
 
virtual char readNonBlock ()
 
- Public Member Functions inherited from Serial
void write (const char *c)
 

Private Member Functions

 PPCSerial (const PPCSerial &)
 
PPCSerialoperator= (const PPCSerial &)
 
bool isConnected ()
 

Private Attributes

const char * m_pBuffer
 

Detailed Description

Implements a driver for the Serial connection of the malta's UART.

Base for UART registers: 0x1F000900 Register offsets: RXTX: 0x00 Receive/Transmit char register. INTEN: 0x08 Interrupt enable register. IIFIFO: 0x10 Read: Interrupt identification, Write: FIFO control. LCTRL: 0x18 Line control register. MCTRL: 0x20 Modem control register. LSTAT: 0x28 Line status register. MSTAT: 0x30 Modem status register. SCRATCH: 0x38 Scratch register.

Definition at line 41 of file kernel/machine/ppc_common/Serial.h.

Constructor & Destructor Documentation

PPCSerial::PPCSerial ( )

Default constructor, does nothing.

Definition at line 26 of file ppc_common/Serial.cc.

PPCSerial::~PPCSerial ( )

Destructor.

Definition at line 30 of file ppc_common/Serial.cc.

Member Function Documentation

bool PPCSerial::isConnected ( )
private

The serial device's registers.

Definition at line 52 of file ppc_common/Serial.cc.

char PPCSerial::read ( )
virtual

Reads a character in from the serial port.

Note
Blocking I/O.
Returns
Zero on a non-printable character without a hardcoded VT100 string, the next character in the buffer otherwise.

Implements Serial.

Definition at line 42 of file ppc_common/Serial.cc.

void PPCSerial::setBase ( uintptr_t  nBaseAddr)
virtual
Todo:
make this generic for Mmaped and port IO.

Implements Serial.

Definition at line 34 of file ppc_common/Serial.cc.

void PPCSerial::write ( char  c)
virtual

Writes a character out to the serial port.

Note
Blocking I/O.

Implements Serial.

Definition at line 38 of file ppc_common/Serial.cc.

Member Data Documentation

const char* PPCSerial::m_pBuffer
private

If we're returning a VT100 string (more than one char), this buffer pointer can be set to the current location in the string. If it is NULL, the next character is pulled from the port.

Definition at line 79 of file kernel/machine/ppc_common/Serial.h.


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