10#ifndef M5_UNIT_ENV_UNIT_SCD41_HPP
11#define M5_UNIT_ENV_UNIT_SCD41_HPP
25constexpr uint32_t POWER_DOWN_DURATION{1};
26constexpr uint32_t GET_AUTOMATIC_SELF_CALIBRATION_INITIAL_PERIOD_DURATION{1};
27constexpr uint32_t SET_AUTOMATIC_SELF_CALIBRATION_INITIAL_PERIOD_DURATION{1};
28constexpr uint32_t GET_AUTOMATIC_SELF_CALIBRATION_STANDARD_PERIOD_DURATION{1};
29constexpr uint32_t SET_AUTOMATIC_SELF_CALIBRATION_STANDARD_PERIOD_DURATION{1};
38class UnitSCD41 :
public UnitSCD40 {
39 M5_UNIT_COMPONENT_HPP_BUILDER(UnitSCD41, 0x62);
42 explicit UnitSCD41(
const uint8_t addr = DEFAULT_ADDRESS) : UnitSCD40(addr)
44 auto ccfg = component_config();
45 ccfg.clock = 400 * 1000U;
46 component_config(ccfg);
83 bool powerDown(
const uint32_t duration = scd41::POWER_DOWN_DURATION);
105 const uint16_t hours,
const uint32_t duration = scd41::SET_AUTOMATIC_SELF_CALIBRATION_INITIAL_PERIOD_DURATION);
123 const uint16_t hours,
const uint32_t duration = scd41::SET_AUTOMATIC_SELF_CALIBRATION_STANDARD_PERIOD_DURATION);
135 virtual bool is_valid_chip()
override;
142constexpr uint16_t MEASURE_SINGLE_SHOT{0x219d};
143constexpr uint16_t MEASURE_SINGLE_SHOT_RHT_ONLY{0x2196};
144constexpr uint16_t POWER_DOWN{0x36e0};
145constexpr uint16_t WAKE_UP{0x36f6};
146constexpr uint16_t SET_AUTOMATIC_SELF_CALIBRATION_INITIAL_PERIOD{0x2445};
147constexpr uint16_t GET_AUTOMATIC_SELF_CALIBRATION_INITIAL_PERIOD{0x2340};
148constexpr uint16_t SET_AUTOMATIC_SELF_CALIBRATION_STANDARD_PERIOD{0x244e};
149constexpr uint16_t GET_AUTOMATIC_SELF_CALIBRATION_STANDARD_PERIOD{0x234b};
bool measureSingleshotRHT(scd4x::Data &d)
Request a single measurement temperature and humidity.
Definition unit_SCD41.cpp:62
bool measureSingleshot(scd4x::Data &d)
Request a single measurement.
Definition unit_SCD41.cpp:46
bool readAutomaticSelfCalibrationStandardPeriod(uint16_t &hours)
Red the standard period for ASC correction.
Definition unit_SCD41.cpp:161
bool writeAutomaticSelfCalibrationInitialPeriod(const uint16_t hours, const uint32_t duration=scd41::SET_AUTOMATIC_SELF_CALIBRATION_INITIAL_PERIOD_DURATION)
Write the duration of the initial period for ASC correction.
Definition unit_SCD41.cpp:115
bool writeAutomaticSelfCalibrationStandardPeriod(const uint16_t hours, const uint32_t duration=scd41::SET_AUTOMATIC_SELF_CALIBRATION_STANDARD_PERIOD_DURATION)
Write the standard period for ASC correction.
Definition unit_SCD41.cpp:146
bool wakeup()
Wake up.
Definition unit_SCD41.cpp:91
bool readAutomaticSelfCalibrationInitialPeriod(uint16_t &hours)
Read the duration of the initial period for ASC correction.
Definition unit_SCD41.cpp:130
bool powerDown(const uint32_t duration=scd41::POWER_DOWN_DURATION)
Power down.
Definition unit_SCD41.cpp:78
Top level namespace of M5stack.
SCD40 Unit for M5UnitUnified.