M5Unit-ENV 1.2.0 git rev:d576302
Loading...
Searching...
No Matches
unit_ENV4.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_ENV4_HPP
11#define M5_UNIT_ENV_UNIT_ENV4_HPP
12
13#include <M5UnitComponent.hpp>
14#include <array>
15#include "unit_SHT40.hpp"
16#include "unit_BMP280.hpp"
17
18namespace m5 {
19namespace unit {
20
26class UnitENV4 : public Component {
27 // Must not be 0x00 for ensure and assign adapter to children
28 M5_UNIT_COMPONENT_HPP_BUILDER(UnitENV4, 0xFF /* Dummy address */);
29
30public:
33
34 explicit UnitENV4(const uint8_t addr = DEFAULT_ADDRESS);
35 virtual ~UnitENV4()
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]{&sht40, &bmp280};
50};
51
52} // namespace unit
53} // namespace m5
54#endif
Pressure and temperature sensor unit.
Definition unit_BMP280.hpp:150
ENV IV is an environmental sensor that integrates SHT40 and BMP280.
Definition unit_ENV4.hpp:26
UnitSHT40 sht40
SHT40 instance.
Definition unit_ENV4.hpp:31
UnitBMP280 bmp280
BMP280 instance.
Definition unit_ENV4.hpp:32
Temperature and humidity, sensor unit.
Definition unit_SHT40.hpp:70
For BMP280.
Top level namespace of M5stack.
Unit-related namespace.
BMP280 Unit for M5UnitUnified.
SHT40 Unit for M5UnitUnified.