sht4x-rs 0.1.0

Sensirion SHT4x temperature & humidity sensor driver (embedded-hal 1.0, no_std, blocking + async)
Documentation
//! SHT4x command bytes and timings (see Sensirion datasheet, v7.1).

/// Measure T & RH, high precision (~8.2 ms typ, 8.3 ms max).
pub const MEASURE_HIGH: u8 = 0xFD;
/// Measure T & RH, medium precision (~4.5 ms typ, 4.5 ms max).
pub const MEASURE_MEDIUM: u8 = 0xF6;
/// Measure T & RH, low precision (~1.6 ms typ, 1.7 ms max).
pub const MEASURE_LOW: u8 = 0xE0;

/// Read 32-bit serial number (returns 2 words + CRC each, 6 bytes total).
pub const READ_SERIAL: u8 = 0x89;
/// Soft reset (recovery ~1 ms).
pub const SOFT_RESET: u8 = 0x94;

/// Heater 200 mW for 1 s, then high-precision measurement.
pub const HEATER_200MW_1S: u8 = 0x39;
/// Heater 200 mW for 0.1 s, then high-precision measurement.
pub const HEATER_200MW_100MS: u8 = 0x32;
/// Heater 110 mW for 1 s, then high-precision measurement.
pub const HEATER_110MW_1S: u8 = 0x2F;
/// Heater 110 mW for 0.1 s, then high-precision measurement.
pub const HEATER_110MW_100MS: u8 = 0x24;
/// Heater 20 mW for 1 s, then high-precision measurement.
pub const HEATER_20MW_1S: u8 = 0x1E;
/// Heater 20 mW for 0.1 s, then high-precision measurement.
pub const HEATER_20MW_100MS: u8 = 0x15;

/// Maximum measurement durations (datasheet, in microseconds).
pub mod duration_us {
    /// High-precision measurement worst-case (µs).
    pub const HIGH: u32 = 8_300;
    /// Medium-precision measurement worst-case (µs).
    pub const MEDIUM: u32 = 4_500;
    /// Low-precision measurement worst-case (µs).
    pub const LOW: u32 = 1_700;
    /// Serial-number read wait (µs).
    pub const SERIAL: u32 = 1_000;
    /// Soft-reset recovery (µs).
    pub const SOFT_RESET: u32 = 1_000;
    /// Heater-on-for-1-second + measurement total (µs).
    pub const HEATER_1S: u32 = 1_100_000;
    /// Heater-on-for-0.1-second + measurement total (µs).
    pub const HEATER_100MS: u32 = 110_000;
}