10#ifndef M5_UNIT_METER_UNIT_EEPROM_HPP
11#define M5_UNIT_METER_UNIT_EEPROM_HPP
14#include <M5UnitComponent.hpp>
15#include <m5_utility/stl/extension.hpp>
31class UnitEEPROM :
public Component {
32 M5_UNIT_COMPONENT_HPP_BUILDER(UnitEEPROM, 0x00);
35 explicit UnitEEPROM(
const uint8_t addr = DEFAULT_ADDRESS) : Component(addr)
44 return _calibration[m5::stl::to_underlying(gain)].hope;
48 return _calibration[m5::stl::to_underlying(gain)].actual;
52 return actual(gain) ? (float)hope(gain) / actual(gain) : 1.0f;
55 bool readCalibration();
65 std::array<Calibration, 8 > _calibration{};
Top level namespace of M5stack.
Base class for ADS111x families.
Gain
Programmable gain amplifier.
Definition unit_ADS111x.hpp:47