M5Unit-METER 0.0.3 git rev:c518ea3
Loading...
Searching...
No Matches
unit_ADS1114.hpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2024 M5Stack Technology CO LTD
3 *
4 * SPDX-License-Identifier: MIT
5 */
10#ifndef M5_UNIT_METER_UNIT_ADS1114_HPP
11#define M5_UNIT_METER_UNIT_ADS1114_HPP
12
13#include "unit_ADS111x.hpp"
14
15namespace m5 {
16namespace unit {
21class UnitADS1114 : public UnitADS111x {
22 M5_UNIT_COMPONENT_HPP_BUILDER(UnitADS1114, 0x00);
23
24public:
25 explicit UnitADS1114(const uint8_t addr = DEFAULT_ADDRESS) : UnitADS111x(addr)
26 {
27 }
28 virtual ~UnitADS1114()
29 {
30 }
31
34
35 virtual bool writeMultiplexer(const ads111x::Mux) override
36 {
37 return false;
38 }
40 virtual bool writeGain(const ads111x::Gain gain) override
41 {
42 return write_gain(gain);
43 }
45 virtual bool writeComparatorMode(const bool b) override
46 {
47 return write_comparator_mode(b);
48 }
50 virtual bool writeComparatorPolarity(const bool b) override
51 {
52 return write_comparator_polarity(b);
53 }
55 virtual bool writeLatchingComparator(const bool b) override
56 {
57 return write_latching_comparator(b);
58 }
60 virtual bool writeComparatorQueue(const ads111x::ComparatorQueue c) override
61 {
62 return write_comparator_queue(c);
63 }
65
66protected:
67 virtual bool start_periodic_measurement(const ads111x::Sampling rate, const ads111x::Mux mux,
68 const ads111x::Gain gain, const ads111x::ComparatorQueue comp_que) override;
69};
70} // namespace unit
71} // namespace m5
72#endif
ADS1114 unit.
Definition unit_ADS1114.hpp:21
virtual bool writeLatchingComparator(const bool b) override
Write the latching comparator.
Definition unit_ADS1114.hpp:55
virtual bool writeComparatorQueue(const ads111x::ComparatorQueue c) override
Write the comparator queue.
Definition unit_ADS1114.hpp:60
virtual bool writeMultiplexer(const ads111x::Mux) override
Not support.
Definition unit_ADS1114.hpp:35
virtual bool writeComparatorMode(const bool b) override
Write the comparator mode.
Definition unit_ADS1114.hpp:45
virtual bool writeGain(const ads111x::Gain gain) override
Write the programmable gain amplifier.
Definition unit_ADS1114.hpp:40
virtual bool writeComparatorPolarity(const bool b) override
Write the comparator polarity.
Definition unit_ADS1114.hpp:50
Base class for ADS111x series.
Definition unit_ADS111x.hpp:219
ads111x::Gain gain() const
Gets the programmable gain amplifier.
Definition unit_ADS111x.cpp:104
Top level namespace of M5stack.
Unit-related namespace.
Base class for ADS111x families.
Sampling
Data rate setting (samples per second)
Definition unit_ADS111x.hpp:61
Mux
Input multiplexer.
Definition unit_ADS111x.hpp:31
ComparatorQueue
the value determines the number of successive conversions exceeding the upper orlower threshold requi...
Definition unit_ADS111x.hpp:77
Gain
Programmable gain amplifier.
Definition unit_ADS111x.hpp:47