avrora.sim.mcu
Class RegisterSet.MultiFieldRegister

java.lang.Object
  extended byavrora.sim.mcu.RegisterSet.MultiFieldRegister
All Implemented Interfaces:
ActiveRegister
Enclosing class:
RegisterSet

public class RegisterSet.MultiFieldRegister
extends java.lang.Object
implements ActiveRegister

The Register class implements an IO register that is directly read and written by the program. This IO register implements writes that alter multiple fields and subfields in the register set.


Method Summary
 byte read()
          The read() method reads the 8-bit value of the IO register as a byte.
 boolean readBit(int bit)
          The readBit() method reads a single bit from the IO register.
 void write(byte nval)
          The write() method writes an 8-bit value to the IO register as a byte.
 void writeBit(int bit, boolean val)
          The writeBit() method writes a single bit value into the IO register at the specified bit offset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

read

public byte read()
Description copied from interface: ActiveRegister
The read() method reads the 8-bit value of the IO register as a byte. For special IO registers, this may cause some action like device activity, or the actual value of the register may need to be fetched or computed.

Specified by:
read in interface ActiveRegister
Returns:
the value of the register as a byte

readBit

public boolean readBit(int bit)
Description copied from interface: ActiveRegister
The readBit() method reads a single bit from the IO register.

Specified by:
readBit in interface ActiveRegister
Parameters:
bit - the number of the bit to read
Returns:
the value of the bit as a boolean

write

public void write(byte nval)
Description copied from interface: ActiveRegister
The write() method writes an 8-bit value to the IO register as a byte. For special IO registers, this may cause some action like device activity, masking/unmasking of interrupts, etc.

Specified by:
write in interface ActiveRegister
Parameters:
nval - the value to write

writeBit

public void writeBit(int bit,
                     boolean val)
Description copied from interface: ActiveRegister
The writeBit() method writes a single bit value into the IO register at the specified bit offset.

Specified by:
writeBit in interface ActiveRegister
Parameters:
bit - the number of the bit to write
val - the value of the bit to write