19#ifndef VOLTAGE_REFERENCE_H_
20#define VOLTAGE_REFERENCE_H_
24#define ANALOG_MAX_VALUE 0x3FF
25#define DEFAULT_REFERENCE_CALIBRATION 1126400L
26#define INVALID_REFERENCE_CALIBRATION 0xFFFFFFL
28#define getHiByte(calibration) (calibration >> 16)
29#define getMidByte(calibration) (calibration >> 8)
30#define getLowByte(calibration) (calibration & 0xFF)
31#define mergeBytes(hi, mid, low) ((((long)hi) << 16) | ((mid << 8) | ((low & 0xFF) & 0xFFFF)))
40 uint16_t readInternalRef();
47 void begin(uint32_t reference = DEFAULT_REFERENCE_CALIBRATION);
53 void begin(uint8_t hi, uint8_t mid, uint8_t low);
Definition: VoltageReference.h:33
void begin(uint32_t reference=DEFAULT_REFERENCE_CALIBRATION)
Definition: VoltageReference.cpp:22
uint16_t readVcc()
Definition: VoltageReference.cpp:52
uint32_t calibrate(uint16_t milliVolt)
Definition: VoltageReference.cpp:61
uint16_t internalValue()
Definition: VoltageReference.cpp:56