|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnl.kbna.dioscuri.module.pit.Counter
public class Counter
A single counter of the PIT based on the Intel 82C54 chipset. This counter works following the convention rules of the PIT: 1. For each counter, the control word must be written before the initial count is written. 2. The initial count must follow the count format specified in the Control Word (LSB, MSB, etc.)
| Field Summary | |
|---|---|
protected boolean |
bcd
|
private static boolean |
BCD
|
private static boolean |
BINARY
|
protected byte[] |
ce
|
protected int |
counterMode
|
private static int |
COUNTERMODE_0
|
private static int |
COUNTERMODE_1
|
private static int |
COUNTERMODE_2
|
private static int |
COUNTERMODE_3
|
private static int |
COUNTERMODE_4
|
private static int |
COUNTERMODE_5
|
private int |
counterNumber
|
protected byte[] |
cr
|
private static boolean |
EVEN
|
private boolean |
isEnabled
|
private boolean |
isGateRising
|
private boolean |
isLatched
|
private boolean |
isTriggered
|
private static java.util.logging.Logger |
logger
|
protected static int |
LSB
|
private boolean |
lsbRead
|
private boolean |
lsbWritten
|
protected static int |
MSB
|
private boolean |
newCount
|
private static boolean |
ODD
|
protected byte[] |
ol
|
private boolean |
parity
|
private PIT |
pit
|
protected boolean |
readBackCmd
|
protected int |
rwMode
|
private static int |
RWMODE_0
|
private static int |
RWMODE_1
|
private static int |
RWMODE_2
|
private static int |
RWMODE_3
|
private boolean |
signalClock
|
private boolean |
signalGate
|
private boolean |
signalOut
|
| Constructor Summary | |
|---|---|
Counter(PIT pit,
int counterNumber)
Constructor of the counter class |
|
| Method Summary | |
|---|---|
void |
clockPulse()
Performs counter action on one clockpulse. |
protected boolean |
getBCD()
Return if this counter is in BCD mode |
protected int |
getCounterNumber()
Return the counter number (ID) |
protected byte |
getCounterValue()
Returns the counter value depending on the R/W mode |
protected boolean |
getGateSignal()
Retrieves the GATE signal |
protected boolean |
getOutSignal()
Retrieves the OUT signal |
protected boolean |
getParity()
Return the parity of the count value |
protected boolean |
isEnabled()
Return if this counter has been enabled |
protected void |
latchCounter()
Latch this counter (read back current count value) Note: this function only works if the counter is in latchmode. |
private void |
loadCounter()
Load counter with new value Note: new value is stored in register cr. |
protected void |
setCounterMode(int mode)
Set counter mode |
protected void |
setCounterValue(byte data)
Set counter value depending on the R/W mode Note: it is assumed that data is always loaded in LSB, MSB order. |
protected void |
setEnabled(boolean status)
Enable/disable the counter |
protected void |
setGateSignal(boolean status)
Sets the GATE signal to given status GATE signal is compared with its previous state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private PIT pit
private int counterNumber
private boolean signalClock
private boolean signalGate
private boolean signalOut
protected int counterMode
protected int rwMode
protected boolean bcd
protected byte[] ce
protected byte[] cr
protected byte[] ol
private boolean isEnabled
private boolean parity
private boolean lsbWritten
private boolean lsbRead
private boolean isLatched
private boolean newCount
private boolean isTriggered
private boolean isGateRising
protected boolean readBackCmd
private static java.util.logging.Logger logger
protected static final int LSB
protected static final int MSB
private static final boolean ODD
private static final boolean EVEN
private static final boolean BINARY
private static final boolean BCD
private static final int RWMODE_0
private static final int RWMODE_1
private static final int RWMODE_2
private static final int RWMODE_3
private static final int COUNTERMODE_0
private static final int COUNTERMODE_1
private static final int COUNTERMODE_2
private static final int COUNTERMODE_3
private static final int COUNTERMODE_4
private static final int COUNTERMODE_5
| Constructor Detail |
|---|
public Counter(PIT pit,
int counterNumber)
| Method Detail |
|---|
public void clockPulse()
protected boolean getGateSignal()
protected void setGateSignal(boolean status)
boolean - status, containing the new value for GATEprotected boolean getOutSignal()
protected byte getCounterValue()
protected void setCounterValue(byte data)
byte - data containing the LSB/MSB for counterprotected void setCounterMode(int mode)
int - mode ranging from 0 to 5protected void latchCounter()
private void loadCounter()
protected boolean getParity()
protected boolean getBCD()
protected void setEnabled(boolean status)
boolean - status defining the status of this counter (true=enabled, false=disabled)protected boolean isEnabled()
protected int getCounterNumber()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||