com.dalsemi.system
Class BitPort

java.lang.Object
  |
  +--com.dalsemi.system.BitPort

public class BitPort
extends java.lang.Object

This class allows bit manipulation of available processor port pins and provides abstracted methods of manipulating bits in memory mapped IO addresses through the DataPort class.


Field Summary
 int latchValue
           
static byte Port3Bit0
           
static byte Port3Bit1
           
static byte Port3Bit2
           
static byte Port3Bit3
           
static byte Port3Bit4
           
static byte Port3Bit5
           
static byte Port5Bit0
           
static byte Port5Bit1
           
static byte Port5Bit2
           
static byte Port5Bit3
           
 
Constructor Summary
BitPort(byte bitname)
          Create a BitPort object using the bitname specified.
BitPort(DataPort port)
          Create a BitPort object using the DataPort object specified.
 
Method Summary
 void clear()
          Clear the port pin.
 void clear(int bitpos)
          Clear the specified bit.
 int read()
          Read the port pin.
 int readBit(int bitpos)
          Read the specified pin Side effect: Will update all bits in the byte.
 int readLatch()
          Read the latch value
 int readLatch(int bitpos)
          Read the latch of the specified pin
 void set()
          Set the port pin.
 void set(int bitpos)
          Set the specified bit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Port5Bit0

public static final byte Port5Bit0

Port5Bit1

public static final byte Port5Bit1

Port5Bit2

public static final byte Port5Bit2

Port5Bit3

public static final byte Port5Bit3

Port3Bit0

public static final byte Port3Bit0

Port3Bit1

public static final byte Port3Bit1

Port3Bit2

public static final byte Port3Bit2

Port3Bit3

public static final byte Port3Bit3

Port3Bit4

public static final byte Port3Bit4

Port3Bit5

public static final byte Port3Bit5

latchValue

public int latchValue
Constructor Detail

BitPort

public BitPort(byte bitname)
Create a BitPort object using the bitname specified.
Parameters:
bitname - Descriptor of bit to twiddle
See Also:

BitPort

public BitPort(DataPort port)
Create a BitPort object using the DataPort object specified.
Parameters:
port - An eight bit wide field of bits to twiddle
See Also:
Method Detail

set

public void set()
Set the port pin.

clear

public void clear()
Clear the port pin.

read

public int read()
Read the port pin.
Returns:
bit port pin value

readLatch

public int readLatch()
Read the latch value
Returns:
bit latch value

set

public void set(int bitpos)
Set the specified bit.
Parameters:
bitpos - Value 0-7 of bit to set

clear

public void clear(int bitpos)
Clear the specified bit.
Parameters:
bitpos - Value 0-7 of bit to clear

readBit

public int readBit(int bitpos)
Read the specified pin Side effect: Will update all bits in the byte.
Parameters:
bitpos - Value 0-7 of bit to read.
Returns:
bit port pin value

readLatch

public int readLatch(int bitpos)
Read the latch of the specified pin
Parameters:
bitpos - Value 0-7 of bit to read.
Returns:
bit latch value