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

#include <Serial.h>

+ Inheritance diagram for MaltaSerial:
+ Collaboration diagram for MaltaSerial:

Classes

struct  serial
 

Public Member Functions

 MaltaSerial ()
 
 ~MaltaSerial ()
 
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

 MaltaSerial (const MaltaSerial &)
 
MaltaSerialoperator= (const MaltaSerial &)
 
bool isConnected ()
 

Private Attributes

struct MaltaSerial::serial PACKED
 
const char * m_pBuffer
 
volatile serialm_pRegs
 

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/malta/Serial.h.

Constructor & Destructor Documentation

MaltaSerial::MaltaSerial ( )

Default constructor, does nothing.

Definition at line 25 of file malta/Serial.cc.

MaltaSerial::~MaltaSerial ( )

Destructor.

Definition at line 29 of file malta/Serial.cc.

Member Function Documentation

char MaltaSerial::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 46 of file malta/Serial.cc.

References m_pRegs.

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

Implements Serial.

Definition at line 33 of file malta/Serial.cc.

References m_pRegs.

void MaltaSerial::write ( char  c)
virtual

Writes a character out to the serial port.

Note
Blocking I/O.

Implements Serial.

Definition at line 39 of file malta/Serial.cc.

References m_pRegs.

Member Data Documentation

const char* MaltaSerial::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 90 of file kernel/machine/malta/Serial.h.

volatile serial* MaltaSerial::m_pRegs
private

The serial device's registers.

Definition at line 95 of file kernel/machine/malta/Serial.h.

Referenced by read(), setBase(), and write().


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