Crate vl53l1_reg

source ·
Expand description

A crate for low-level access to the registers on the VL53L1X.

Provides:

  • A type for every “entry” in the register map.
  • An Entry trait for abstracting over register entries.
  • An Index type for a dynamic representation of entry indices into the register map.
  • An State type for a dynamic representation of entry state.
  • write_* and read_* functions for writing and reading to and from the VL53L1X’s registers.
  • A structs module with commonly grouped registers and generated methods for writing and reading these groups at once.

The generated code takes quite a while to compile (~7 secs) so it has been split into this separate crate and re-exported under the reg module in the main crate.

Re-exports

pub use structs::Entries;

Modules

Macros

Structs

Enums

A dynamic representation of an entry’s 16-bit index within the register map.
A dynamic representation of entry state.

Constants

The maximum amount of data that may be written to write_slice at once.
The slave address of the VL53L1X. Note that embedded-hal I2C API adds the w/r bit for us.

Traits

Implemented for all entries within the register map.

Functions

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.
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.