Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## avrora.sim
Class State.RWIOReg

    java.lang.Object
      avrora.sim.State.RWIOReg

All Implemented Interfaces:
  State.IOReg

Direct Known Subclasses:
  ATMega128L.SimImpl.DirectionRegister, ATMega128L.SimImpl.PortRegister, ATMega128L.SimImpl.Timer0.ControlRegister, avrora.sim.Simulator.IMRReg

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
`void` | `clearBit(int num)` The `clearBit()` method clears a single bit in the IO register.
`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` | `setBit(int num)` The `setBit()` method sets a single bit in the IO register.
`void` | `write(byte val)` The `write()` method writes an 8-bit value to the IO register as a byte.

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

### clearBit

    public void clearBit(int num)

  The `clearBit()` method clears a single bit in the IO register.

  Specified by:
    `clearBit` in interface `State.IOReg`
  Parameters:
    `num` - the number of the bit to clear

### setBit

    public void setBit(int num)

  The `setBit()` method sets a single bit in the IO register.

  Specified by:
    `setBit` in interface `State.IOReg`
  Parameters:
    `num` - the number of the bit to clear

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD