pmw3901 1.0.0

Library for the PMW3901 optical flow sensor.
Documentation
  • Coverage
  • 78.57%
    11 out of 14 items documented0 out of 9 items with examples
  • Size
  • Source code size: 14.39 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 840.72 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 14s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • braincore/pmw3901-rs
    4 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • braincore

PMW3901 Library for Rust Latest Version Documentation

A library for the PMW3901 optical flow sensor.

Intended to be deployed in a linux environment with spidev.

Usage

See examples/scan.rs.

Limitations

The datasheet for the PMW3901 is sparse. The list of registers comes with little explanation. This library does the bare minimum to read pixel velocity.

In addition, the initialization write sequence is opaque and is simply copied from Bitcraze.

Testing

Use environment variables to specify the SPI bus and chip select:

PMW3901_SPI_BUS=0 PMW3901_SPI_CS=0 cargo test

Tested on the breakout board by Pesky Product.

Todo

  • Control over the EN pin. Currently assumes it's pulled up.
  • Motion detection interrupt pin.
  • Control over the NRESET pin. Currently assumes it's pulled up.