avrora.sim.mcu
Interface MicrocontrollerProperties

All Known Subinterfaces:
Microcontroller, MicrocontrollerFactory
All Known Implementing Classes:
ATMega128L

public interface MicrocontrollerProperties

The MicrocontrollerProperties interface represents a set of methods that get information about a particular microcontroller implementation.


Method Summary
 double cyclesToMillis(long cycles)
          The cyclesToMillis() method converts the specified number of cycles to a time quantity in milliseconds.
 int getEEPromSize()
          The getEEPromSize() method returns the size in bytes of the EEPROM on this hardware device.
 int getFlashSize()
          The method returns the size in bytes of the flash memory on this hardware device.
 int getHz()
          The getHZ() method returns the number of cycles per second at which this hardware device is designed to run.
 int getIORegSize()
          The getIORegSize() method returns the number of IO registers that are present on this hardware device.
 int getPinNumber(java.lang.String name)
          The getPinNumber() method looks up the named pin and returns its number.
 int getRamSize()
          The getRamSize() method returns the number of bytes of SRAM present on 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.
 

Method Detail

getRamSize

public int getRamSize()
The getRamSize() method returns the number of bytes of SRAM present on this hardware device. For example, on the Atmega128L, this number is 4096. On the Atmega103, this number is 4000.

Returns:
the number of bytes of SRAM on this hardware device

getIORegSize

public int getIORegSize()
The getIORegSize() method returns the number of IO registers that are present on this hardware device. For example, on the Atmega128L, this number is 224. On the Atmega103, this number is 64.

Returns:
the number of IO registers supported on this hardware device

getFlashSize

public int getFlashSize()
The method returns the size in bytes of the flash memory on this hardware device. The flash memory stores the initialized data and the machine code instructions of the program. On the Atmega128L, this number is 128K.

Returns:
the size of the flash memory in bytes

getEEPromSize

public int getEEPromSize()
The getEEPromSize() method returns the size in bytes of the EEPROM on this hardware device. On the ATmega128L, this number is 4096.

Returns:
the size of the EEPROM in bytes

getHz

public int getHz()
The getHZ() method returns the number of cycles per second at which this hardware device is designed to run.

Returns:
the number of cycles per second on this device

millisToCycles

public long millisToCycles(double ms)
The 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.

Parameters:
ms - a time quantity in milliseconds as a double
Returns:
the same time quantity in clock cycles, rounded up to the nearest integer

cyclesToMillis

public double cyclesToMillis(long cycles)
The 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.

Parameters:
cycles - the number of cycles
Returns:
the same time quantity in milliseconds

isSupported

public boolean isSupported(InstrPrototype i)
The 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.

Parameters:
i - the instruction prototype of the instruction
Returns:
true if the specified instruction is supported on this device; false otherwise

getPinNumber

public int getPinNumber(java.lang.String name)
The 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.

Parameters:
name - the name of the pin; for example "PA0" or "OC1A"
Returns:
the number of the pin if it exists; -1 otherwise