M5Unit-ENV 1.5.0 git rev:6195a2c
Loading...
Searching...
No Matches
unit_SCD4x_detail.hpp File Reference

Internal helpers shared by SCD40/SCD41 (and future SCD43) More...

#include <cstdint>

Go to the source code of this file.

Namespaces

namespace  m5
 Top level namespace of M5Stack.
 
namespace  detail
 Internal helpers shared across the SCD4x family (SCD40/SCD41/SCD43)
 

Functions

constexpr bool m5::unit::scd4x::detail::is_sensor_variant (const uint8_t variant_high_byte, const uint8_t nibble)
 Does the get_sensor_variant high byte indicate the given variant?
 

Variables

constexpr uint8_t m5::unit::scd4x::detail::VARIANT_NIBBLE_MASK {0xF0}
 Mask for the variant nibble (word[0] bits[15..12]) of get_sensor_variant (0x202F)
 
constexpr uint8_t m5::unit::scd4x::detail::VARIANT_NIBBLE_SCD40 {0x00}
 SCD40 variant nibble (bits[15..12] == 0b0000)
 
constexpr uint8_t m5::unit::scd4x::detail::VARIANT_NIBBLE_SCD41 {0x10}
 SCD41 variant nibble (bits[15..12] == 0b0001)
 
constexpr uint8_t m5::unit::scd4x::detail::VARIANT_NIBBLE_SCD43 {0x50}
 SCD43 variant nibble (bits[15..12] == 0b0101)
 

Detailed Description

Internal helpers shared by SCD40/SCD41 (and future SCD43)

Not part of the public API. Included by the SCD4x unit implementations.

Function Documentation

◆ is_sensor_variant()

bool m5::unit::scd4x::detail::is_sensor_variant ( const uint8_t variant_high_byte,
const uint8_t nibble )
constexpr

Does the get_sensor_variant high byte indicate the given variant?

Parameters
variant_high_byteHigh byte (word[0] bits[15..8]) read from get_sensor_variant (0x202F)
nibbleExpected variant nibble (e.g. VARIANT_NIBBLE_SCD41)

Only bits[15..12] identify the variant; bits[11..0] may differ per unit (datasheet CD_DS_SCD4x ยง3.10.6, issue #38), so compare the high nibble only.