2 stable releases
Uses new Rust 2024
new 1.1.0 | Apr 28, 2025 |
---|---|
1.0.0 | Apr 28, 2025 |
#235 in Embedded development
125KB
2K
SLoC
SEN66 Driver
A driver for interacting with Sensirion's SEN66 environment sensing platform via I2C. The driver is based on the embedded-hal traits and offers a synchronous and asynchronous interface.
Provides a full implementation of the SEN66 features:
- Measure environment parameters:
- Configure VOC, NOx, CO2 and Temperature determination
- Perform forced CO2 recalibration, SHT heating and fan cleaning
- Read out device information
- Serial Number
- Product Name
- Device Status
Example
This example showcases how to use the SEN66 with a ESP32-C6-DevKitM-1 using embassy.
use sen66_interface::asynch::Sen66;
#[esp_hal_embassy::main]
async fn main(spawner: Spawner) {
let config = esp_hal::Config::default().with_cpu_clock(CpuClock::max());
let peripherals = esp_hal::init(config);
let timer0 = esp_hal::timer::systimer::SystemTimer::new(peripherals.SYSTIMER);
esp_hal_embassy::init(timer0.alarm0);
let i2c = esp_hal::i2c::master::I2c::new(
peripherals.I2C0,
esp_hal::i2c::master::Config::default()
).unwrap()
.into_async()
.with_sda(peripherals.GPIO22)
.with_scl(peripherals.GPIO23);
let mut sensor = Sen66::new(embassy_time::Delay, i2c);
// Provide enough time to start up after power-on
embassy_time::Timer::after(embassy_time::Duration::from_millis(100)).await;
sensor.get_product_name().await.unwrap()
}
Feature Flags
async
: Provides an async interface, enabled by default.blocking
: Provides a blocking interface.defmt
: Provides support for defmt.
Contributing
If you want to contribute, open a Pull Request with your suggested changes and ensure that the integration pipeline runs.
- Commits should adhere to the Conventional Commits specification
- The integration pipeline must pass.
- Test coverage should not degrade.
- At least one review is required
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT licenses (LICENSE-MIT or http://opensource.org/licenses/MIT)
SPDX-License-Identifier: Apache-2.0 OR MIT
Dependencies
~0.7–1.3MB
~27K SLoC