avrora.sim.mcu
Class ADC

java.lang.Object
  extended byavrora.sim.mcu.AtmelInternalDevice
      extended byavrora.sim.mcu.ADC

public class ADC
extends AtmelInternalDevice

The ADC class represents an on-chip device on the ATMega series of microcontroller that is capable of converting an analog voltage value into a 10-bit digital value.


Nested Class Summary
static interface ADC.ADCInput
          The ADCInput interface is used by inputs into the analog to digital converter.
protected  class ADC.ADCRegister
          Abstract class grouping together registers related to the ADC.
protected  class ADC.ControlRegister
          ControlRegister defines the behavior of the ADC control register,
protected  class ADC.DataRegister
          DataRegister defines the behavior of the ADC's 10-bit data register.
protected  class ADC.MUXRegister
          MUXRegister defines the behavior of the ADMUX register.
 
Field Summary
static int ACSR
           
static int ADCH
           
static int ADCL
           
static int ADCSRA
           
static int ADMUX
           
static int GND_LEVEL
           
static int VBG_LEVEL
           
 
Fields inherited from class avrora.sim.mcu.AtmelInternalDevice
devicePrinter, interpreter, mainClock, microcontroller, name, simulator
 
Constructor Summary
ADC(AtmelMicrocontroller m, int channels)
           
 
Method Summary
 void connectADCInput(ADC.ADCInput input, int num)
          The connectADCInput() method connects an ADCInput object to the specified input port on the ADC chip.
 
Methods inherited from class avrora.sim.mcu.AtmelInternalDevice
getClock, getIORegs, installIOReg, read16, write16
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VBG_LEVEL

public static final int VBG_LEVEL
See Also:
Constant Field Values

GND_LEVEL

public static final int GND_LEVEL
See Also:
Constant Field Values

ACSR

public static final int ACSR
See Also:
Constant Field Values

ADMUX

public static final int ADMUX
See Also:
Constant Field Values

ADCSRA

public static final int ADCSRA
See Also:
Constant Field Values

ADCH

public static final int ADCH
See Also:
Constant Field Values

ADCL

public static final int ADCL
See Also:
Constant Field Values
Constructor Detail

ADC

public ADC(AtmelMicrocontroller m,
           int channels)
Method Detail

connectADCInput

public void connectADCInput(ADC.ADCInput input,
                            int num)
The connectADCInput() method connects an ADCInput object to the specified input port on the ADC chip.

Parameters:
input - the ADCInput object to attach to the input
num - the input port number to attach the device to