FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
|
API that uses bandgap feature to calculate current voltage fed to the MCU. More...
#include <fastarduino/analog_input.h>
Public Member Functions | |
PowerVoltage (const PowerVoltage &)=delete | |
PowerVoltage & | operator= (const PowerVoltage &)=delete |
uint16_t | voltage_mV () |
Get the voltage, in mV, feeding the MCU. More... | |
Public Member Functions inherited from analog::AnalogInput< APIN_, SAMPLE_TYPE_, AREF_, MAXFREQ_ > | |
AnalogInput (const AnalogInput &)=delete | |
AnalogInput & | operator= (const AnalogInput &)=delete |
SAMPLE_TYPE | sample () |
Start an analog-digital conversion for this analog input pin and return sample value. More... | |
Static Public Attributes | |
static constexpr const board::AnalogPin | BANDGAP = BANDGAP_ |
The bandgap analog pin of the MCU target, used for this PowerVoltage . More... | |
Static Public Attributes inherited from analog::AnalogInput< APIN_, SAMPLE_TYPE_, AREF_, MAXFREQ_ > | |
static constexpr const board::AnalogPin | APIN = APIN_ |
The analog pin for this AnalogInput; this may also not be a real pin but an internal sensor (e.g. More... | |
static constexpr const board::AnalogReference | AREF = AREF_ |
The analog reference to use for that analog input. More... | |
static constexpr const board::AnalogClock | MAXFREQ = MAXFREQ_ |
The maximum input clock frequency of the ADC circuit; higher frequencies imply lower precision of samples. More... | |
static constexpr const uint8_t | PRESCALER = FREQ_TRAIT::PRESCALER |
The prescaler used by ADC circuitry, calculated from MAXFREQ template parameter. More... | |
Additional Inherited Members | |
Public Types inherited from analog::AnalogInput< APIN_, SAMPLE_TYPE_, AREF_, MAXFREQ_ > | |
using | SAMPLE_TYPE = SAMPLE_TYPE_ |
The type of samples returned by sample() . More... | |
using | TYPE = SAMPLE_TYPE |
The type of samples returned by sample() . More... | |
API that uses bandgap feature to calculate current voltage fed to the MCU.
BANDGAP_ | a unique bandgap analog pin for the MCU target; although the accepted type is board::AnalogPin enum, only bandgap inputs are allowed otherwise a compilation error will occur. |
Definition at line 134 of file analog_input.h.
|
inline |
Get the voltage, in mV, feeding the MCU.
Definition at line 158 of file analog_input.h.
|
staticconstexpr |
The bandgap analog pin of the MCU target, used for this PowerVoltage
.
Definition at line 141 of file analog_input.h.