avrora.sim
Class State.RWIOReg

java.lang.Object
  extended byavrora.sim.State.RWIOReg
All Implemented Interfaces:
State.IOReg
Direct Known Subclasses:
ATMega128L.SimImpl.ADC.ADCRegister, ATMega128L.SimImpl.ADC.DataRegister, ATMega128L.SimImpl.DirectionRegister, ATMega128L.SimImpl.EEPROM.EEARHReg, ATMega128L.SimImpl.EEPROM.EECRReg, ATMega128L.SimImpl.PortRegister, ATMega128L.SimImpl.PowerManagement.ControlRegister, ATMega128L.SimImpl.SPI.SPCRReg, ATMega128L.SimImpl.Timer0.ASSRRegister, ATMega128L.SimImpl.Timer16Bit.BufferedRegister, ATMega128L.SimImpl.Timer16Bit.ControlRegister, ATMega128L.SimImpl.Timer16Bit.OCRnxTempHighRegister, ATMega128L.SimImpl.Timer16Bit.PairedRegister, ATMega128L.SimImpl.Timer16Bit.TCNTnRegister, ATMega128L.SimImpl.Timer8Bit.BufferedRegister, ATMega128L.SimImpl.Timer8Bit.ControlRegister, ATMega128L.SimImpl.Timer8Bit.TCNTnRegister, ATMega128L.SimImpl.USART.ControlRegisterC, ATMega128L.SimImpl.USART.DataRegister, ATMega128L.SimImpl.USART.UBRRnHReg, ATMega128L.SimImpl.USART.UBRRnLReg, avrora.sim.mcu.ATMegaFamily.IMRReg, CC1000Radio.FrequencyRegister, CC1000Radio.FrequencySeparationRegister, CC1000Radio.RadioRegister
Enclosing class:
State

public static class State.RWIOReg
extends java.lang.Object
implements State.IOReg

The RWIOReg class is an implementation of an IO register that has the simple, default behavior of being able to read and write just as a general purpose register or byte in SRAM.


Field Summary
protected  byte value
           
 
Constructor Summary
State.RWIOReg()
           
 
Method Summary
 byte read()
          The read() method reads the 8-bit value of the IO register as a byte.
 boolean readBit(int num)
          The readBit() method reads a single bit from the IO register.
 void write(byte val)
          The write() method writes an 8-bit value to the IO register as a byte.
 void writeBit(int num, 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
 

Field Detail

value

protected byte value
Constructor Detail

State.RWIOReg

public State.RWIOReg()
Method Detail

read

public byte read()
The read() method reads the 8-bit value of the IO register as a byte. For simple RWIOReg instances, this simply returns the internally stored value.

Specified by:
read in interface State.IOReg
Returns:
the value of the register as a byte

write

public void write(byte val)
The write() method writes an 8-bit value to the IO register as a byte. For simple RWIOReg instances, this simply writes the internally stored value.

Specified by:
write in interface State.IOReg
Parameters:
val - the value to write

readBit

public boolean readBit(int num)
The readBit() method reads a single bit from the IO register.

Specified by:
readBit in interface State.IOReg
Parameters:
num - the number of the bit to read
Returns:
the value of the bit as a boolean

writeBit

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

Specified by:
writeBit in interface State.IOReg
Parameters:
num - the number of the bit to write
val - the value of the bit to write