![]() |
ACwing Flow bridge firmware
STM32C011: PMW3901 optical flow over SPI, I2C target 0x3B
|
PixArt PMW3901MB optical flow sensor over SPI (mode 3, <= 2 MHz). More...
#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | pmw_bus_t |
| struct | pmw_burst_t |
Functions | |
| int | pmw_init (const pmw_bus_t *bus) |
| 0 = product id ok, configured | |
| void | pmw_burst (pmw_burst_t *b) |
| motion burst (register 0x16) | |
| uint8_t | pmw_valid (const pmw_burst_t *b) |
| PixArt rule: SQUAL < 0x19 with the shutter at its maximum = no usable features. | |
PixArt PMW3901MB optical flow sensor over SPI (mode 3, <= 2 MHz).
Register sequences from the Bitcraze PMW3901 driver (MIT licence, see pmw3901.c). The bus is given as callbacks: no registers here, host-testable.
Definition in file pmw3901.h.
| int pmw_init | ( | const pmw_bus_t * | bus | ) |
0 = product id ok, configured
Definition at line 59 of file pmw3901.c.
References pmw_bus_t::cs, pmw_bus_t::delay_us, k_init1, k_init2, PMW_INV_PRODUCT_ID, PMW_PRODUCT_ID, rd(), pmw_bus_t::reset, s_b, and wr().
Referenced by main().
| void pmw_burst | ( | pmw_burst_t * | b | ) |
motion burst (register 0x16)
Definition at line 85 of file pmw3901.c.
References pmw_bus_t::cs, pmw_bus_t::delay_us, pmw_burst_t::dx, pmw_burst_t::dy, pmw_burst_t::motion, pmw_burst_t::observation, PMW_REG_MOTION_BURST, pmw_burst_t::raw_max, pmw_burst_t::raw_min, pmw_burst_t::raw_sum, s_b, pmw_burst_t::shutter, pmw_burst_t::squal, and pmw_bus_t::xfer.
Referenced by main().
| uint8_t pmw_valid | ( | const pmw_burst_t * | b | ) |
PixArt rule: SQUAL < 0x19 with the shutter at its maximum = no usable features.
Definition at line 106 of file pmw3901.c.
References pmw_burst_t::shutter, and pmw_burst_t::squal.
Referenced by main().