avrora.sim.mcu
Class ATMegaFamily
java.lang.Object
avrora.sim.mcu.AtmelMicrocontroller
avrora.sim.mcu.ATMegaFamily
- All Implemented Interfaces:
- Microcontroller
- Direct Known Subclasses:
- ATMega128, ATMega16, ATMega32
- public abstract class ATMegaFamily
- extends AtmelMicrocontroller
The ATMegaFamily class encapsulates much of the common functionality among the
ATMega family microcontrollers from Atmel.
| Fields inherited from class avrora.sim.mcu.AtmelMicrocontroller |
clockDomain, devices, HZ, interpreter, mainClock, MODE_ACTIVE, pinPrinter, pins, platform, properties, registers, simulator, sleepState |
|
Method Summary |
protected ATMegaFamily.FlagRegister |
buildInterruptRange(boolean increasing,
java.lang.String maskRegNum,
java.lang.String flagRegNum,
int baseVect,
int numVects)
The buildInterruptRange() method creates the IO registers and MaskableInterrupt
instances corresponding to a complete range of interrupts. |
protected void |
buildPort(char p)
The buildPort() method builds the IO registers corresponding to a general purpose IO port.
|
ATMegaFamily.FlagRegister |
getEIFR_reg()
The getEIFR_reg() method is used to access the external interrupt flag register. |
long |
getHZ()
The getHZ() method returns the number of cycles per second at which this hardware device
is designed to run. |
| Methods inherited from class avrora.sim.mcu.AtmelMicrocontroller |
addDevice, addInterrupt, addPin, addPin, addPin, cyclesToMillis, getClock, getClockDomain, getDevice, getFSM, getIOReg, getMode, getModeName, getPin, getPin, getPinNumber, getPlatform, getProperties, getRegisterSet, getSimulator, getSleepMode, installIOReg, millisToCycles, setPlatform, sleep, wakeup |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
periods0
protected static final int[] periods0
periods2
protected static final int[] periods2
periods1
protected static final int[] periods1
periods3
protected static final int[] periods3
EIFR_reg
protected ATMegaFamily.FlagRegister EIFR_reg
TIFR_reg
protected ATMegaFamily.FlagRegister TIFR_reg
TIMSK_reg
protected ATMegaFamily.MaskRegister TIMSK_reg
ETIFR_reg
protected ATMegaFamily.FlagRegister ETIFR_reg
ETIMSK_reg
protected ATMegaFamily.MaskRegister ETIMSK_reg
ATMegaFamily
protected ATMegaFamily(ClockDomain cd,
MicrocontrollerProperties p,
FiniteStateMachine fsm)
getHZ
public long 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
buildPort
protected void buildPort(char p)
- The
buildPort() method builds the IO registers corresponding to a general purpose IO port.
These ports are named A-G, and each consist of a PORT register (for writing), a PIN register (for reading),
and a direction register for setting whether each pin in the port is input or output. This method
is a utility to build these registers for each port given the last character of the name (e.g. 'A' in
PORTA).
- Parameters:
p - the last character of the port name
buildInterruptRange
protected ATMegaFamily.FlagRegister buildInterruptRange(boolean increasing,
java.lang.String maskRegNum,
java.lang.String flagRegNum,
int baseVect,
int numVects)
- The
buildInterruptRange() method creates the IO registers and MaskableInterrupt
instances corresponding to a complete range of interrupts.
- Parameters:
increasing - a flag indicating that the vector numbers increase with bit number of the IO registermaskRegNum - the IO register number of the mask registerflagRegNum - the IO register number of the flag registerbaseVect - the beginning vector of this range of interruptsnumVects - the number of vectors in this range
- Returns:
- a flag register that corresponds to the interrupt range
getEIFR_reg
public ATMegaFamily.FlagRegister getEIFR_reg()
- The getEIFR_reg() method is used to access the external interrupt flag register.
- Returns:
- the
ActiveRegister object corresponding to the EIFR IO register