Lib SCD
LibSCD is s Rust driver implementation for SCD30, SCD40, SCD41 and SCD43 sensors
using the embedded-hal and embedded-hal-async interfaces.
Usage
Add the crate as a dependency in Cargo.toml and select the required features:
[]
= "0.5"
= ["defmt", "sync", "scd4x"]
Then we can start consuming data from SCD4x using blocking I2C communication:
async
Migrating from v0.4
Version 0.5 contains breaking changes:
- The SCD4x family of sensors are exposed via common type - SCD4x. The old structures are no longer available.
- The
scd40crate feature is renamed toscd4x - SCD4x use
HPainstead ofPafor setting/getting the ambient pressure - The
Measurementtype is no longer reexported by each sensor. The common shared type should be used instead.
Crate Feature Flags
The support for each sensor and sync/async mode is controlled by a feature:
| Feature | Description |
|---|---|
| sync | Enables the blocking driver implementation for the selected sensors |
| async | Enables the async driver implementation for the selected sensors |
| scd30 | Enables the driver for the SCD30 sensor |
| scd4x | Enables the driver for the SCD4x family of sensors |
| scd41 | Enables additional SCD4x driver features available only on the SCD41 and SCD43 sensors |
| defmt | Derive defmt::Format for the error type |
License
The project is licensed under MIT license