Class ADC

Nested Relationships

Nested Types

Inheritance Relationships

Derived Types

Class Documentation

class ADC

Generic ADC definitions.

Definition of enumerations, configuration structures and signal Ids used for ADC models, common to all architectures.

Subclassed by ArchAVR_ADC, ArchXT_ADC

Public Types

enum Channel

Enum definition for the ADC channel configuration

Values:

enumerator Channel_SingleEnded

Single-ended analog input.

enumerator Channel_Differential

Differential analog input.

enumerator Channel_Zero

Ground reference channel.

enumerator Channel_IntRef

Internal bandgap reference voltage.

enumerator Channel_Temperature

Internal temperature sensor voltage.

enumerator Channel_AcompRef

Analog comparator reference input (used on ATMega0 and ATMega1 series)

enum SignalId

Values:

enumerator Signal_ConversionStarted

Raised at the start of a conversion.

enumerator Signal_AboutToSample

Raised just before the ADC is sampling the inputs. Last chance to set the analog values for it to be taken into account by the current conversion.

enumerator Signal_ConversionComplete

Raised when the conversion is complete and the CPU is notified that the conversion result is ready.

struct channel_config_t : public base_reg_config_t

Structure for configuring one ADC channel

Public Members

Channel type

Channel type.

pin_id_t pin_p

Pin ID used for single-ended channels or as positive input for differential channels.

pin_id_t pin_n

Pin ID used as negative input for differential channels, unused for other channel types.

char per_num

Used for Channel_AcompRef, index of the ACP peripheral to get the reference value from.

union ADC::channel_config_t::[anonymous] [anonymous]
unsigned int gain

Measurement gain applied to the voltage value. Must be non-zero.