vl53l4cd-ulp
An ultra-low-power Rust driver for the VL53L4CD time-of-flight distance sensor. This no_std
crate provides both sync and async variants that integrates with the embedded-hal ecosystem.
Getting Started
Add the dependency to your Cargo.toml:
[]
= "0.1.1"
Basic Usage
use VL53L4cd;
let i2c = /* your I2C implementation */;
let delay = /* your delay implementation */;
let mut sensor = new;
sensor.sensor_init.unwrap;
sensor.start_ranging.unwrap;
if sensor.check_for_data_ready.unwrap
Power Optimization
// Use minimum ROI for lowest power consumption
sensor.set_roi.unwrap;
// Set longer measurement intervals
sensor.set_inter_measurement_in_ms.unwrap;
// Configure interrupt thresholds
sensor.set_interrupt_configuration.unwrap;
Crate Features
The crate can be compiled with the following features:
async: Enables async I²C supportlog: Enables logging via thelogcratedefmt: Enables logging via thedefmtcrate
Error Handling
use Error;
match sensor.sensor_init
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.