4个版本 (2个破坏性版本)
0.3.0 | 2020年10月15日 |
---|---|
0.2.1 | 2020年10月13日 |
0.2.0 | 2020年10月13日 |
0.1.0 | 2020年10月5日 |
在嵌入式开发中排名1820
58KB
1.5K SLoC
Drogue IoT BME680传感器驱动程序
BME680传感器是Bosch Sensortec生产的“低功耗气体、压力、温度和湿度传感器”。
此crate帮助与传感器接口。提供对传感器的通用访问,以及更具有意见的控制器逻辑,简化测量过程。
更多信息
简单示例
fn main() -> ! {
let i2c = create_blocking_i2c();
let mut timer = create_timer();
let bme680 = Bme680Sensor::from(i2c, Address::Secondary).unwrap();
let mut controller = Bme680Controller::new(
bme680,
&mut timer,
Configuration::standard(),
|| 25, // fixed 25 degrees Celsius as ambient temperature
).unwrap();
loop {
let result = controller.measure_default().unwrap();
log::info!("Measured: {:?}", result);
}
}
查看:examples/
BSEC
此crate可以与Bosch Sensortec环境集群(BSEC)库一起使用。
然而,由于BSEC库不是开源的,此crate不包含任何依赖项、头文件或其他相关对象。BSEC接口是drogue-bsec的一部分。
运行单元测试
您可以使用以下方式在简单主机机器上运行单元测试
cargo test --feature logging
运行示例
使用(STM32F411)运行
cargo embed --release --features stm32f4xx --target thumbv7em-none-eabihf --example simple
使用(STM32F723)运行
cargo embed --release --features stm32f7xx --target thumbv7em-none-eabihf --example simple
转储数据
您可以通过启用功能dump
,使用--features dump
来启用原始数据的记录。请注意,这需要日志实现,如rtt-logger
。请注意,这可能会对性能产生巨大负面影响。
依赖关系
~1–37MB
~894K SLoC