M5Unit-ENV 1.3.0 git rev:84dba23
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 "unit_SHT30.hpp"
15#include "unit_QMP6988.hpp"
16
17namespace m5 {
18namespace unit {
19
25class UnitENV3 : public Component {
26 // Must not be 0x00 for ensure and assign adapter to children
27 M5_UNIT_COMPONENT_HPP_BUILDER(UnitENV3, 0xFF /* Dummy address */);
28
29public:
32
33 explicit UnitENV3(const uint8_t addr = DEFAULT_ADDRESS);
34 virtual ~UnitENV3()
35 {
36 }
37
38 virtual bool begin() override
39 {
40 return _valid;
41 }
42
43protected:
44 virtual std::shared_ptr<Adapter> ensure_adapter(const uint8_t ch);
45
46private:
47 bool _valid{}; // Did the constructor correctly add the child unit?
48 Component* _children[2]{&sht30, &qmp6988};
49};
50
51} // namespace unit
52} // namespace m5
53#endif
ENV III is an environmental sensor that integrates SHT30 and QMP6988.
Definition unit_ENV3.hpp:25
UnitSHT30 sht30
SHT30 instance.
Definition unit_ENV3.hpp:30
UnitQMP6988 qmp6988
QMP6988 instance.
Definition unit_ENV3.hpp:31
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.