Crate vl53l1

source ·
Expand description

A pure-Rust port of the official ST VL53L1X ToF sensor C API.

The majority of the documentation within this crate is directly ported from the original source and user manual. Reading the VL53L1X API User Manual (by ST) is highly recommended in order to gain an understanding of how to use the API.

While much of the code has been Rust-ified, the function tree and overall architecture are still very much a direct port of the original C code. Feel free to submit PRs or issues related to rustifying the library further!

Re-exports

pub use outcome::Outcome;
pub use vl53l1_reg as reg;

Modules

Structs

Enums

Distance mode is a parameter provided to optimize the internal settings and tunings to get the best ranging performances depending on the ranging distance required by the application and ambient light conditions.
Separate warnings into their own type in order to allow for handling them separately.

Constants

The estimated boot time for the device.
The delay duration when resetting the software.

Traits

The set of all delays required by the API.

Functions

The interrupt must be cleared by calling this function.
Performs device initialization.
Retrieve some information about the device.
Get the currently configured delay between two ranging operations.
Get the currently configured time required by the sensor to perform one range measurement.
Used to get ranging data.
Calibration that allows adjustment of the number of SPADs to optimize the device dynamic.
Shorthand for reading a single byte from the register at the given index.
Read the value for a single entry.
Read the value at the given index into the given slice.
Shorthand for reading two consecutive bytes from the given index.
Distance mode is a parameter provided to optimize the internal settings and tunings to get the best ranging performances depending on the ranging distance required by the application and ambient light conditions.
Undocumented, but appears to allow for choosing from a set of pre-determined distance modes and timing values.
Set the region of interest by specifying the grid of SPADs to use.
Enable (1) or disable (0) crosstalk compensation.
Reset the device.
Must be called to start a measurement.
Allows loading of the device settings that are specific for a given use case.
Stops any in-progress measurement.
Polls on the device interrupt status until ranging data are ready.
Shorthand for writing a slice with a single byte.
Read the the given entry.
Write given slice of data to the device at the given index.
Shorthand for writing a slice with a single word.

Type Definitions