M5Unit-ENV 1.2.0 git rev:d576302
Loading...
Searching...
No Matches
unit_ENV3.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_ENV_UNIT_ENV3_HPP
11#define M5_UNIT_ENV_UNIT_ENV3_HPP
12
13#include <M5UnitComponent.hpp>
14#include <array>
15#include "unit_SHT30.hpp"
16#include "unit_QMP6988.hpp"
17
18namespace m5 {
19namespace unit {
20
26class UnitENV3 : public Component {
27 // Must not be 0x00 for ensure and assign adapter to children
28 M5_UNIT_COMPONENT_HPP_BUILDER(UnitENV3, 0xFF /* Dummy address */);
29
30public:
33
34 explicit UnitENV3(const uint8_t addr = DEFAULT_ADDRESS);
35 virtual ~UnitENV3()
36 {
37 }
38
39 virtual bool begin() override
40 {
41 return _valid;
42 }
43
44protected:
45 virtual Adapter* duplicate_adapter(const uint8_t ch) override;
46
47private:
48 bool _valid{}; // Did the constructor correctly add the child unit?
49 Component* _children[2]{&sht30, &qmp6988};
50};
51
52} // namespace unit
53} // namespace m5
54#endif
ENV III is an environmental sensor that integrates SHT30 and QMP6988.
Definition unit_ENV3.hpp:26
UnitSHT30 sht30
SHT30 instance.
Definition unit_ENV3.hpp:31
UnitQMP6988 qmp6988
QMP6988 instance.
Definition unit_ENV3.hpp:32
Barometric pressure sensor to measure atmospheric pressure and altitude estimation.
Definition unit_QMP6988.hpp:131
Temperature and humidity, sensor unit.
Definition unit_SHT30.hpp:111
Top level namespace of M5stack.
Unit-related namespace.
QMP6988 Unit for M5UnitUnified.
SHT30 Unit for M5UnitUnified.