Crate vl53l1

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§

checkenable
device_sequence_config
ll
lowpower_auto
outcome
sequencestep

Structs§

AdditionalOffsetCalData
CalPeakRateMap
CalStatus
Data
Device
DeviceGpioMode
DeviceInfo
DeviceInterruptPolarity
DeviceParameters
Defines all parameters for the device.
DeviceSscArray
DriverState
GainCalibrationData
GpioInterruptConfig
LlResults
LowPowerAutoData
OffsetRangeData
OffsetRangeResults
OffsetcalConfig
OpticalCentre
RangeData
RangeResults
RangingMeasurementData
Single range measurement data.
RefspadcharConfig
SscConfig
TuningParmStorage
UserRoi
User Zone (region of interest) parameters.
UserZone
Version
XtalkConfig

Enums§

DeviceConfigLevel
DeviceDssMode
DeviceError
DeviceMeasurementMode
DevicePresetModes
DeviceReportStatus
DeviceResultsLevel
DeviceState
DeviceTestMode
DistanceMode
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.
Error
GpioInterruptMode
OffsetCalibrationMode
OffsetCorrectionMode
PresetMode
RangeStatus
StError
State
WaitMethod
Warning
Separate warnings into their own type in order to allow for handling them separately.

Constants§

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

Traits§

Delay
The set of all delays required by the API.

Functions§

clear_interrupt_and_start_measurement
The interrupt must be cleared by calling this function.
data_init
Performs device initialization.
get_device_info
Retrieve some information about the device.
get_inter_measurement_period_milli_seconds
Get the currently configured delay between two ranging operations.
get_measurement_timing_budget_micro_seconds
Get the currently configured time required by the sensor to perform one range measurement.
get_ranging_measurement_data
Used to get ranging data.
perform_ref_spad_management
Calibration that allows adjustment of the number of SPADs to optimize the device dynamic.
read_byte
Shorthand for reading a single byte from the register at the given index.
read_entry
Read the value for a single entry.
read_slice
Read the value at the given index into the given slice.
read_word
Shorthand for reading two consecutive bytes from the given index.
set_distance_mode
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.
set_inter_measurement_period_milli_seconds
set_measurement_timing_budget_micro_seconds
set_preset_mode
Undocumented, but appears to allow for choosing from a set of pre-determined distance modes and timing values.
set_user_roi
Set the region of interest by specifying the grid of SPADs to use.
set_xtalk_compensation_enable
Enable (1) or disable (0) crosstalk compensation.
software_reset
Reset the device.
start_measurement
Must be called to start a measurement.
static_init
Allows loading of the device settings that are specific for a given use case.
stop_measurement
Stops any in-progress measurement.
wait_measurement_data_ready
Polls on the device interrupt status until ranging data are ready.
write_byte
Shorthand for writing a slice with a single byte.
write_entry
Read the the given entry.
write_slice
Write given slice of data to the device at the given index.
write_word
Shorthand for writing a slice with a single word.

Type Aliases§

DeviceSequenceConfig
FixPoint1616
SequenceStepId
TuningParm