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);
104 const uint16_t hours,
const uint32_t duration = scd41::SET_AUTOMATIC_SELF_CALIBRATION_INITIAL_PERIOD_DURATION);
121 const uint16_t hours,
const uint32_t duration = scd41::SET_AUTOMATIC_SELF_CALIBRATION_STANDARD_PERIOD_DURATION);
132 virtual bool is_valid_chip()
override;
139constexpr uint16_t MEASURE_SINGLE_SHOT{0x219d};
140constexpr uint16_t MEASURE_SINGLE_SHOT_RHT_ONLY{0x2196};
141constexpr uint16_t POWER_DOWN{0x36e0};
142constexpr uint16_t WAKE_UP{0x36f6};
143constexpr uint16_t SET_AUTOMATIC_SELF_CALIBRATION_INITIAL_PERIOD{0x2445};
144constexpr uint16_t GET_AUTOMATIC_SELF_CALIBRATION_INITIAL_PERIOD{0x2340};
145constexpr uint16_t SET_AUTOMATIC_SELF_CALIBRATION_STANDARD_PERIOD{0x244e};
146constexpr 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:67
bool measureSingleshot(scd4x::Data &d)
Request a single measurement.
Definition unit_SCD41.cpp:51
bool readAutomaticSelfCalibrationStandardPeriod(uint16_t &hours)
Read the standard period for ASC correction.
Definition unit_SCD41.cpp:166
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:120
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:151
bool wakeup()
Wake up.
Definition unit_SCD41.cpp:96
bool readAutomaticSelfCalibrationInitialPeriod(uint16_t &hours)
Read the duration of the initial period for ASC correction.
Definition unit_SCD41.cpp:135
bool powerDown(const uint32_t duration=scd41::POWER_DOWN_DURATION)
Power down.
Definition unit_SCD41.cpp:83
Top level namespace of M5Stack.
SCD40 Unit for M5UnitUnified.