M5Unit-ENV 1.2.0 git rev:d576302
Loading...
Searching...
No Matches
unit_SCD41.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_SCD41_HPP
11#define M5_UNIT_ENV_UNIT_SCD41_HPP
12
13#include "unit_SCD40.hpp"
14
15namespace m5 {
16namespace unit {
17
22class UnitSCD41 : public UnitSCD40 {
23 M5_UNIT_COMPONENT_HPP_BUILDER(UnitSCD41, 0x62);
24
25public:
26 explicit UnitSCD41(const uint8_t addr = DEFAULT_ADDRESS) : UnitSCD40(addr)
27 {
28 auto ccfg = component_config();
29 ccfg.clock = 400 * 1000U;
30 component_config(ccfg);
31 }
32
35
51};
52
57namespace scd41 {
59// Max command duration(ms)
60constexpr uint16_t MEASURE_SINGLE_SHOT_DURATION{5000};
61constexpr uint16_t MEASURE_SINGLE_SHOT_RHT_ONLY_DURATION{50};
62
63namespace command {
64// Low power single shot - SCD41 only
65constexpr uint16_t MEASURE_SINGLE_SHOT{0x219d};
66constexpr uint16_t MEASURE_SINGLE_SHOT_RHT_ONLY{0x2196};
67} // namespace command
69} // namespace scd41
70
71} // namespace unit
72} // namespace m5
73#endif
SCD40 unit component.
Definition unit_SCD40.hpp:78
SCD41 unit component.
Definition unit_SCD41.hpp:22
bool measureSingleshotRHT(scd4x::Data &d)
Request a single measurement temperature and humidity.
Definition unit_SCD41.cpp:36
bool measureSingleshot(scd4x::Data &d)
Request a single measurement.
Definition unit_SCD41.cpp:27
Top level namespace of M5stack.
For SCD41.
Unit-related namespace.
Measurement data group.
Definition unit_SCD40.hpp:38
SCD40 Unit for M5UnitUnified.