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.mcu
Interface Microcontroller

All Superinterfaces:
  MicrocontrollerProperties

All Known Implementing Classes:
  ATMega128L, ATMegaFamily

public interface Microcontroller
extends MicrocontrollerProperties

The `Microcontroller` interface corresponds to a hardware device that implements the AVR instruction set. This interface contains methods that get commonly needed information about the particular hardware device and and can load programs onto this virtual device.

Nested Class Summary
`static interface` | `Microcontroller.Pin` The `Pin` interface encapsulates the notion of a physical pin on the microcontroller chip.

Method Summary
`byte` | `getMode()` get the current mode of the mcu
`java.lang.String` | `getModeName()` get the name of the current mode
`Microcontroller.Pin` | `getPin(int num)` The `getPin()` method looks up the specified pin by its number and returns a reference to that pin.
`Microcontroller.Pin` | `getPin(java.lang.String name)` The `getPin()` method looks up the named pin and returns a reference to that pin.
`Radio` | `getRadio()`
`Simulator` | `getSimulator()` The `getSimulator()` method gets a simulator instance that is capable of emulating this hardware device.
`void` | `setRadio(Radio r)`
`void` | `sleep()` send to mcu to sleep
`int` | `wakeup()` wake the mcu up

Methods inherited from interface avrora.sim.mcu.MicrocontrollerProperties
`cyclesToMillis, getEEPromSize, getFlashSize, getHz, getIORegSize, getPinNumber, getRamSize, isSupported, millisToCycles`

Method Detail

### getSimulator

    public Simulator getSimulator()

  The `getSimulator()` method gets a simulator instance that is capable of emulating this hardware device.

  Returns:
    a `Simulator` instance corresponding to this device

### getPin

    public Microcontroller.Pin getPin(java.lang.String name)

  The `getPin()` method looks up the named pin and returns a reference to that pin. Names of pins should be UPPERCASE. The intended users of this method are external device implementors which connect their devices to the microcontroller through the pins.

  Parameters:
    `name` - the name of the pin; for example "PA0" or "OC1A"
  Returns:
    a reference to the `Pin` object corresponding to the named pin if it exists; null otherwise

### getPin

    public Microcontroller.Pin getPin(int num)

  The `getPin()` method looks up the specified pin by its number and returns a reference to that pin. The intended users of this method are external device implementors which connect their devices to the microcontroller through the pins.

  Parameters:
    `num` - the pin number to look up
  Returns:
    a reference to the `Pin` object corresponding to the named pin if it exists; null otherwise

### setRadio

    public void setRadio(Radio r)

### getRadio

    public Radio getRadio()

### sleep

    public void sleep()

  send to mcu to sleep

### wakeup

    public int wakeup()

  wake the mcu up

  Returns:
    cycles it takes to wake up

### getMode

    public byte getMode()

  get the current mode of the mcu

  Returns:
    current mode

### getModeName

    public java.lang.String getModeName()

  get the name of the current mode

  Returns:
    name of the current mode

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