ACwing Flow bridge firmware
STM32C011: PMW3901 optical flow over SPI, I2C target 0x3B
Loading...
Searching...
No Matches
pmw3901.h
Go to the documentation of this file.
1
8#ifndef PMW3901_H
9#define PMW3901_H
10
11#include <stdint.h>
12
13typedef struct {
14 uint8_t (*xfer)(uint8_t b);
15 void (*cs)(uint8_t level);
16 void (*reset)(uint8_t level);
17 void (*delay_us)(uint32_t us);
18} pmw_bus_t;
19
20typedef struct {
21 uint8_t motion, observation;
22 int16_t dx, dy;
23 uint8_t squal, raw_sum, raw_max, raw_min;
24 uint16_t shutter;
26
27int pmw_init(const pmw_bus_t *bus);
28void pmw_burst(pmw_burst_t *b);
30uint8_t pmw_valid(const pmw_burst_t *b);
31
32#endif /* PMW3901_H */
static void delay_us(uint32_t us)
Definition main.c:146
int pmw_init(const pmw_bus_t *bus)
0 = product id ok, configured
Definition pmw3901.c:59
uint8_t pmw_valid(const pmw_burst_t *b)
PixArt rule: SQUAL < 0x19 with the shutter at its maximum = no usable features.
Definition pmw3901.c:106
void pmw_burst(pmw_burst_t *b)
motion burst (register 0x16)
Definition pmw3901.c:85
uint16_t shutter
Definition pmw3901.h:24
int16_t dx
Definition pmw3901.h:22
uint8_t raw_max
Definition pmw3901.h:23
uint8_t motion
Definition pmw3901.h:21