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
13
typedef
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
20
typedef
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
;
25
}
pmw_burst_t
;
26
27
int
pmw_init
(
const
pmw_bus_t
*bus);
28
void
pmw_burst
(
pmw_burst_t
*b);
30
uint8_t
pmw_valid
(
const
pmw_burst_t
*b);
31
32
#endif
/* PMW3901_H */
delay_us
static void delay_us(uint32_t us)
Definition
main.c:146
pmw_init
int pmw_init(const pmw_bus_t *bus)
0 = product id ok, configured
Definition
pmw3901.c:59
pmw_valid
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
pmw_burst
void pmw_burst(pmw_burst_t *b)
motion burst (register 0x16)
Definition
pmw3901.c:85
pmw_burst_t
Definition
pmw3901.h:20
pmw_burst_t::shutter
uint16_t shutter
Definition
pmw3901.h:24
pmw_burst_t::dx
int16_t dx
Definition
pmw3901.h:22
pmw_burst_t::raw_max
uint8_t raw_max
Definition
pmw3901.h:23
pmw_burst_t::motion
uint8_t motion
Definition
pmw3901.h:21
pmw_bus_t
Definition
pmw3901.h:13
Inc
pmw3901.h
Generated by
1.9.8