33 #ifndef Analog2Digital_h 34 #define Analog2Digital_h 41 #if defined(__AVR_ATmega2560__) 73 #define _readGpioPinAnalog( ddr, port, pin, nbr, adc, ocr, com, tccr ) readA2D( adc ) 95 #define readGpioPinAnalog( pinName ) _readGpioPinAnalog( pinName ) 193 #if defined(__AVR_ATmega2560__) uint16_t readGpioPinAnalogV(const GpioPinVariable &pinVar)
Read the analog value of the pin.
Definition: Analog2Digital.h:117
void setA2DVoltageReferenceAREF()
Set the voltage reference for the analog-to-digital system to AREF.
Definition: Analog2Digital.h:167
Reference is internal 2.56V VREF (only available on ATmega2560)
Definition: Analog2Digital.h:53
Reference is AVCC pin, internal VREF turned off.
Definition: Analog2Digital.h:51
Reference is internal 1.1V VREF.
Definition: Analog2Digital.h:52
void setA2DVoltageReferenceAVCC()
Set the voltage reference for the analog-to-digital system to AREF.
Definition: Analog2Digital.h:178
Reference is AREF pin, internal VREF turned off.
Definition: Analog2Digital.h:50
void setA2DVoltageReference11V()
Set the voltage reference for the analog-to-digital system to AREF.
Definition: Analog2Digital.h:189
int readA2D(int8_t channel)
Read an analog voltage value.
Definition: Analog2Digital.cpp:109
uint8_t adcNbr() const
Return the ADC channel number (analog-to-digital related).
Definition: GpioPinMacros.h:477
A2DVoltageReference
Constants representing voltage references.
Definition: Analog2Digital.h:48
void initA2D(uint8_t ref=kA2dReferenceAVCC)
Initialize the analog-to-digital system.
Definition: Analog2Digital.cpp:50
void turnOffA2D()
Turn off the analog-to-digital system.
Definition: Analog2Digital.cpp:92
void setA2DVoltageReference256V()
Set the voltage reference for the analog-to-digital system to AREF.
Definition: Analog2Digital.h:204
This class defines a type that can encode a GPIO pin as a variable. Read the section on GPIO Pin Vari...
Definition: GpioPinMacros.h:424
This file contains the primary macros for naming and manipulating GPIO pin names. ...
void setA2DVoltageReference(A2DVoltageReference ref)
Set the voltage reference for the analog-to-digital system.
Definition: Analog2Digital.cpp:100