M5Unit-ENV 1.5.0 git rev:6195a2c
Loading...
Searching...
No Matches
unit_SCD4x_detail.hpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2026 M5Stack Technology CO LTD
3 *
4 * SPDX-License-Identifier: MIT
5 */
11#ifndef M5_UNIT_ENV_UNIT_SCD4X_DETAIL_HPP
12#define M5_UNIT_ENV_UNIT_SCD4X_DETAIL_HPP
13
14#include <cstdint>
15
16namespace m5 {
17namespace unit {
18namespace scd4x {
23namespace detail {
24
26constexpr uint8_t VARIANT_NIBBLE_MASK{0xF0};
27constexpr uint8_t VARIANT_NIBBLE_SCD40{0x00};
28constexpr uint8_t VARIANT_NIBBLE_SCD41{0x10};
29constexpr uint8_t VARIANT_NIBBLE_SCD43{0x50};
30
38constexpr bool is_sensor_variant(const uint8_t variant_high_byte, const uint8_t nibble)
39{
40 return (variant_high_byte & VARIANT_NIBBLE_MASK) == nibble;
41}
42
43} // namespace detail
44} // namespace scd4x
45} // namespace unit
46} // namespace m5
47#endif
Internal helpers shared across the SCD4x family (SCD40/SCD41/SCD43)
Top level namespace of M5Stack.
For SCD40/41.
Unit-related namespace.
constexpr uint8_t VARIANT_NIBBLE_SCD43
SCD43 variant nibble (bits[15..12] == 0b0101)
Definition unit_SCD4x_detail.hpp:29
constexpr uint8_t VARIANT_NIBBLE_MASK
Mask for the variant nibble (word[0] bits[15..12]) of get_sensor_variant (0x202F)
Definition unit_SCD4x_detail.hpp:26
constexpr uint8_t VARIANT_NIBBLE_SCD41
SCD41 variant nibble (bits[15..12] == 0b0001)
Definition unit_SCD4x_detail.hpp:28
constexpr uint8_t VARIANT_NIBBLE_SCD40
SCD40 variant nibble (bits[15..12] == 0b0000)
Definition unit_SCD4x_detail.hpp:27
constexpr bool is_sensor_variant(const uint8_t variant_high_byte, const uint8_t nibble)
Does the get_sensor_variant high byte indicate the given variant?
Definition unit_SCD4x_detail.hpp:38