Module 1280.adc - ADC routines for the ATmega1280

ADC routines for the ATmega1280.

Index

Declarations

adc.module:31Constant VCC

VAL INT VCC

Symbolic constant for signaling the use the VCC voltage reference.

adc.module:33Constant INTERNAL

VAL INT INTERNAL

Symbolic constant for signaling the use the internal 1.1v reference.

adc.module:35Constant AREF

VAL INT AREF

Symbolic constant for signaling the use the external AREF reference.

adc.module:51Process adc.base

PROC adc.base (VAL INT avr.pin, VAL INT ref, RESULT INT v)

Perform an Analog-to-Digital Conversion on the given AVR pin, and writes out the result.

Parameters:

VAL INT avr.pin The AVR pin on which to perform the ADC.
VAL INT ref Which voltage reference to use as the comparison. Can be VCC, INTERNAL, or AREF. WARNING:drew 20100713 Is there only one AREF pin on the Mega boards?
RESULT INT v The INT that will be used to store the analog read.

adc.module:103Process adc.aref

INLINE PROC adc.aref (VAL INT avr.pin, RESULT INT v)

Helper function for performing an ADC using the AREF.

Parameters:

VAL INT avr.pin The AVR pin on which to perform the ADC.
RESULT INT v The INT that will be used to store the analog read.

adc.module:113Process adc.vcc

INLINE PROC adc.vcc (VAL INT avr.pin, RESULT INT v)

Helper function for performing an ADC using the VCC.

Parameters:

VAL INT avr.pin The AVR pin on which to perform the ADC.
RESULT INT v The INT that will be used to store the analog read.