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

A single counter of a PIT. More...

Inheritance diagram for PitCounter:
StaticReceiver< PitCounter > Device

Public Member Functions

void read_back (unsigned char value)
void set_modus (unsigned char modus)
 Set the modus of the counter.
void set_gate (unsigned char value)
 Manipulate the gate.
bool get_out ()
unsigned char read ()
 Read from the counter port.
void write (unsigned char value)
 Write to the counter port.
bool receive (MessageIrqNotify &msg)
bool receive (MessageTimeout &msg)
 PitCounter (DBus< MessageTimer > *bus_timer, DBus< MessageIrqLines > *bus_irq, unsigned irq, Clock *clock)
 PitCounter ()
- Public Member Functions inherited from StaticReceiver< PitCounter >
 StaticReceiver ()
- Public Member Functions inherited from Device
void debug_dump ()
 Device (const char *debug_name)

Private Types

enum  Modes { BCD = 0x001, RW_LOW = 0x010, RW_HIGH = 0x020, NULL_COUNT = 0x040 }
enum  Features {
  FPERIODIC = 1 << 0, FSOFTWARE_TRIGGER = 1 << 1, FGATE_DISABLE_COUNTING = 1 << 2, FSQUARE_WAVE = 1 << 3,
  FCOUNTDOWN = 1 << 4
}

Private Member Functions

bool feature (Features f)
unsigned short s2bcd (unsigned short value)
unsigned short bcd2s (unsigned short value)
void load_counter ()
void disable_counting ()
void update_timer ()
 Rearm a new timeout.
unsigned short get_counter ()
 Get the current counter value.
void reload_counter ()

Private Attributes

unsigned short _modus
unsigned short _latch
unsigned short _new_counter
unsigned _initial
unsigned char _latched_status
struct {
   unsigned char   _read_low: 1
   unsigned char   _wrote_low: 1
   unsigned char   _stopped: 1
   unsigned char   _stopped_out: 1
   unsigned char   _gate: 1
   unsigned char   _lstatus: 1
   unsigned char   _latched: 2
}; 
timevalue _start
DBus< MessageTimer > * _bus_timer
DBus< MessageIrqLines > * _bus_irq
unsigned _irq
Clock _clock
unsigned _timer

Static Private Attributes

static const long FREQ = 1193180

Friends

class PitTest

Additional Inherited Members

- Static Public Member Functions inherited from StaticReceiver< PitCounter >
static bool receive_static (Device *o, M &msg)

Detailed Description

A single counter of a PIT.

State: stable Implementation Note: the access to the _modus variable is not SMP safe. Documentation: Intel 82c54 - intel-82c54-timer.pdf

Member Enumeration Documentation

enum PitCounter::Features
private
Enumerator:
FPERIODIC 
FSOFTWARE_TRIGGER 
FGATE_DISABLE_COUNTING 
FSQUARE_WAVE 
FCOUNTDOWN 
enum PitCounter::Modes
private
Enumerator:
BCD 
RW_LOW 
RW_HIGH 
NULL_COUNT 

Constructor & Destructor Documentation

PitCounter::PitCounter ( DBus< MessageTimer > *  bus_timer,
DBus< MessageIrqLines > *  bus_irq,
unsigned  irq,
Clock clock 
)
inline
PitCounter::PitCounter ( )
inline

Member Function Documentation

unsigned short PitCounter::bcd2s ( unsigned short  value)
inlineprivate
void PitCounter::disable_counting ( )
inlineprivate
bool PitCounter::feature ( Features  f)
inlineprivate
unsigned short PitCounter::get_counter ( )
inlineprivate

Get the current counter value.

bool PitCounter::get_out ( )
inline
void PitCounter::load_counter ( )
inlineprivate
unsigned char PitCounter::read ( )
inline

Read from the counter port.

void PitCounter::read_back ( unsigned char  value)
inline
bool PitCounter::receive ( MessageIrqNotify msg)
inline
bool PitCounter::receive ( MessageTimeout msg)
inline
void PitCounter::reload_counter ( )
inlineprivate
unsigned short PitCounter::s2bcd ( unsigned short  value)
inlineprivate
void PitCounter::set_gate ( unsigned char  value)
inline

Manipulate the gate.

void PitCounter::set_modus ( unsigned char  modus)
inline

Set the modus of the counter.

void PitCounter::update_timer ( )
inlineprivate

Rearm a new timeout.

void PitCounter::write ( unsigned char  value)
inline

Write to the counter port.

Friends And Related Function Documentation

friend class PitTest
friend

Member Data Documentation

struct { ... }
DBus<MessageIrqLines>* PitCounter::_bus_irq
private
DBus<MessageTimer>* PitCounter::_bus_timer
private
Clock PitCounter::_clock
private
unsigned char PitCounter::_gate
unsigned PitCounter::_initial
private
unsigned PitCounter::_irq
private
unsigned short PitCounter::_latch
private
unsigned char PitCounter::_latched
unsigned char PitCounter::_latched_status
private
unsigned char PitCounter::_lstatus
unsigned short PitCounter::_modus
private
unsigned short PitCounter::_new_counter
private
unsigned char PitCounter::_read_low
timevalue PitCounter::_start
private
unsigned char PitCounter::_stopped
unsigned char PitCounter::_stopped_out
unsigned PitCounter::_timer
private
unsigned char PitCounter::_wrote_low
const long PitCounter::FREQ = 1193180
staticprivate

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