NOVA User-Level Environment  Version testbox/changed-memory-timing-317-g320d8b5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SerialDevice Class Reference

Implements a 16550 UART. More...

Inheritance diagram for SerialDevice:
StaticReceiver< SerialDevice > DiscoveryHelper< SerialDevice > Device

Public Member Functions

bool receive (MessageSerial &msg)
bool receive (MessageIOIn &msg)
bool receive (MessageIOOut &msg)
void discovery ()
 SerialDevice (Motherboard &mb, unsigned short base, unsigned char irq, unsigned hostserial)
- Public Member Functions inherited from StaticReceiver< SerialDevice >
 StaticReceiver ()
- Public Member Functions inherited from Device
void debug_dump ()
 Device (const char *debug_name)

Public Attributes

Motherboard_mb

Private Types

enum  {
  RBR = 0, THR = 0, IER, FCR,
  IIR = FCR, LCR, MCR, LSR,
  MSR, SCR, DLL, DLM,
  MAX
}

Private Member Functions

unsigned char get_iir ()
 Returns the IIR and thereby prioritize the interrupts.
void update_irq ()

Private Attributes

unsigned short _base
unsigned char _irq
unsigned _hostserial
unsigned char _regs [MAX]
unsigned char _rfifo [FIFOSIZE]
unsigned char _rfpos
unsigned char _rfcount
unsigned char _triggerlevel
unsigned char _sendmask

Static Private Attributes

static const unsigned FIFOSIZE = 16

Additional Inherited Members

- Static Public Member Functions inherited from StaticReceiver< SerialDevice >
static bool receive_static (Device *o, M &msg)
- Static Public Member Functions inherited from DiscoveryHelper< SerialDevice >
static bool discover (Device *o, MessageDiscovery &msg)
- Protected Member Functions inherited from DiscoveryHelper< SerialDevice >
bool discovery_write_st (const char *resource, unsigned offset, const void *value, unsigned count)
bool discovery_write_dw (const char *resource, unsigned offset, unsigned value, unsigned count=4)
 Write a dword or less than it.
bool discovery_read_dw (const char *resource, unsigned offset, unsigned &value)
 Read a dword.
unsigned discovery_length (const char *resource, unsigned minlen)
 Return the length of an ACPI table or minlen if it is smaller.

Detailed Description

Implements a 16550 UART.

State: stable Missing Features:

  • no write fifo
  • no transmission effect of stopbit+parity+divisor
  • no character timeout indication -> need a timer for that
  • no MSR setting via client
  • no HW reset support Ignored bits: FCR2-3, LCR2-6, LSR2-4,7 Documentation: NSC 16550D - PC16550D.pdf

Member Enumeration Documentation

anonymous enum
private
Enumerator:
RBR 
THR 
IER 
FCR 
IIR 
LCR 
MCR 
LSR 
MSR 
SCR 
DLL 
DLM 
MAX 

Constructor & Destructor Documentation

SerialDevice::SerialDevice ( Motherboard mb,
unsigned short  base,
unsigned char  irq,
unsigned  hostserial 
)
inline

Member Function Documentation

void SerialDevice::discovery ( )
inline
unsigned char SerialDevice::get_iir ( )
inlineprivate

Returns the IIR and thereby prioritize the interrupts.

bool SerialDevice::receive ( MessageSerial msg)
inline
bool SerialDevice::receive ( MessageIOIn msg)
inline
bool SerialDevice::receive ( MessageIOOut msg)
inline
void SerialDevice::update_irq ( )
inlineprivate

Member Data Documentation

unsigned short SerialDevice::_base
private
unsigned SerialDevice::_hostserial
private
unsigned char SerialDevice::_irq
private
Motherboard& SerialDevice::_mb
unsigned char SerialDevice::_regs[MAX]
private
unsigned char SerialDevice::_rfcount
private
unsigned char SerialDevice::_rfifo[FIFOSIZE]
private
unsigned char SerialDevice::_rfpos
private
unsigned char SerialDevice::_sendmask
private
unsigned char SerialDevice::_triggerlevel
private
const unsigned SerialDevice::FIFOSIZE = 16
staticprivate

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