|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 class |
Microcontroller.InputPin
|
static class |
Microcontroller.OutputPin
|
static interface |
Microcontroller.Pin
The Pin interface encapsulates the notion of a physical pin on the microcontroller chip.
|
Method Summary | |
double |
cyclesToMillis(long cycles)
The cyclesToMillis() method converts the specified number of cycles to a time quantity in
milliseconds. |
ClockDomain |
getClockDomain()
The getClockDomain() method returns the clock domain for this microcontroller. |
long |
getHZ()
The getHZ() method returns the number of cycles per second at which this hardware device
is designed to run. |
byte |
getMode()
Deprecated. this method should no longer be used; eventually this state information should be exposed through a FiniteStateMachine object |
java.lang.String |
getModeName()
Deprecated. this method should no longer be used; eventually this state information should be exposed through a FiniteStateMachine object |
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. |
int |
getPinNumber(java.lang.String name)
The getPinNumber() method looks up the named pin and returns its number. |
Platform |
getPlatform()
The getPlatform() method gets a platform instance that contains this microcontroller. |
MicrocontrollerProperties |
getProperties()
The getProperties() method gets an object that describes the microcontroller
including the size of the RAM, EEPROM, flash, etc. |
RegisterSet |
getRegisterSet()
The getRegisterSet() method returns the register set containing all of the IO registers
for this microcontroller. |
Simulator |
getSimulator()
The getSimulator() method gets a simulator instance that is capable of emulating this
hardware device. |
boolean |
isSupported(InstrPrototype i)
The isSupported() method allows a client to query whether a particular instruction is
implemented on this hardware device. |
long |
millisToCycles(double ms)
The millisToCycles() method converts the specified number of milliseconds to a cycle
count. |
void |
setPlatform(Platform p)
The setPlatform() method sets the platform instance that contains this microcontroller. |
void |
sleep()
The sleep() method puts the microcontroller into the sleep mode defined by its
internal sleep configuration register. |
int |
wakeup()
The wakeup() method wakes the microcontroller from a sleep mode. |
Method Detail |
public Simulator getSimulator()
getSimulator()
method gets a simulator instance that is capable of emulating this
hardware device.
Simulator
instance corresponding to this devicepublic Platform getPlatform()
getPlatform()
method gets a platform instance that contains this microcontroller.
public void setPlatform(Platform p)
setPlatform()
method sets the platform instance that contains this microcontroller.
public Microcontroller.Pin getPin(java.lang.String name)
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.
name
- the name of the pin; for example "PA0" or "OC1A"
Pin
object corresponding to the named pin if it exists; null
otherwisepublic Microcontroller.Pin getPin(int num)
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.
num
- the pin number to look up
Pin
object corresponding to the named pin if it exists; null
otherwisepublic void sleep()
sleep()
method puts the microcontroller into the sleep mode defined by its
internal sleep configuration register. It may shutdown devices and disable some clocks. This
method should only be called from within the interpreter.
public int wakeup()
wakeup()
method wakes the microcontroller from a sleep mode. It may resume
devices, turn clocks back on, etc. This method is expected to return the number of cycles that
is required for the microcontroller to wake completely from the sleep state it was in.
public byte getMode()
public java.lang.String getModeName()
public long getHZ()
getHZ()
method returns the number of cycles per second at which this hardware device
is designed to run.
public ClockDomain getClockDomain()
getClockDomain()
method returns the clock domain for this microcontroller. The clock
domain contains all of the clocks attached to the microcontroller and platform, including the main clock.
ClockDomain
class representing the clock domain for this
microcontrollerpublic long millisToCycles(double ms)
millisToCycles()
method converts the specified number of milliseconds to a cycle
count. The conversion factor used is the number of cycles per second of this device. This method serves
as a utility so that clients need not do repeated work in converting milliseconds to cycles and back.
ms
- a time quantity in milliseconds as a double
public double cyclesToMillis(long cycles)
cyclesToMillis()
method converts the specified number of cycles to a time quantity in
milliseconds. The conversion factor used is the number of cycles per second of this device. This method
serves as a utility so that clients need not do repeated work in converting milliseconds to cycles and
back.
cycles
- the number of cycles
public RegisterSet getRegisterSet()
getRegisterSet()
method returns the register set containing all of the IO registers
for this microcontroller.
RegisterSet
instance which stores all of the IO registers
for this microcontroller.public boolean isSupported(InstrPrototype i)
isSupported()
method allows a client to query whether a particular instruction is
implemented on this hardware device. Older implementations of the AVR instruction set preceded the
introduction of certain instructions, and therefore did not support the new instructions.
i
- the instruction prototype of the instruction
public int getPinNumber(java.lang.String name)
getPinNumber()
method looks up the named pin and returns its number. 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.
name
- the name of the pin; for example "PA0" or "OC1A"
public MicrocontrollerProperties getProperties()
getProperties()
method gets an object that describes the microcontroller
including the size of the RAM, EEPROM, flash, etc.
MicrocontrollerProperties
class that contains all
the relevant information about this microcontroller
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |