![]() |
ACwing Flow bridge firmware
STM32C011: PMW3901 optical flow over SPI, I2C target 0x3B
|
I2C register map of the ACwing Flow bridge (STM32C011 at 0x3B). More...
Go to the source code of this file.
Macros | |
| #define | FLOW_I2C_ADDR 0x3Bu |
| #define | FLOW_WHO_AM_I_VAL 0xF1u |
| #define | FLOW_FW_VERSION 0x10u |
| 1.0 | |
| #define | FLOW_R_WHO_AM_I 0x00u |
| #define | FLOW_R_VERSION 0x01u |
| #define | FLOW_R_STATUS 0x02u |
| #define | FLOW_R_COUNT 0x03u |
| #define | FLOW_R_DX 0x04u |
| #define | FLOW_R_DY 0x06u |
| #define | FLOW_R_SQUAL 0x08u |
| #define | FLOW_R_SHUTTER 0x09u |
| #define | FLOW_R_DT 0x0Bu |
| #define | FLOW_R_CTRL 0x10u |
| #define | FLOW_R_FRAME FLOW_R_STATUS |
| #define | FLOW_FRAME_BYTES 11u |
| #define | FLOW_REG_SPACE 0x20u |
| #define | FLOW_S_SENSOR_OK 0x01u |
| #define | FLOW_S_NEW 0x02u |
| #define | FLOW_S_OVERFLOW 0x04u |
| #define | FLOW_S_REJECTED 0x08u |
| #define | FLOW_CTRL_RESET 0x01u |
| #define | FLOW_CTRL_REINIT 0x02u |
I2C register map of the ACwing Flow bridge (STM32C011 at 0x3B).
The SAME map is used by the flight controller driver (00 - FC_FW/App/drivers/flow_bridge/flow_bridge.h); the host test checks that the two agree.
addr name access content 0x00 WHO_AM_I R 0xF1 0x01 VERSION R bridge firmware version (major << 4 | minor) 0x02 STATUS R bit0 PMW3901 ok, bit1 new data since the last FRAME read, bit2 overflow (DX or DY saturated), bit3 the last sample was rejected (no surface features) 0x03 COUNT R u8, +1 per PMW3901 sample accumulated (wraps) 0x04 DX R i16, counts accumulated since the last FRAME read 0x06 DY R i16 0x08 SQUAL R u8, surface quality of the last sample 0x09 SHUTTER R u16, shutter of the last sample 0x0B DT R u16, time covered by DX/DY, units of 100 us 0x10 CTRL W bit0 soft reset of the bridge, bit1 re-init PMW3901
FRAME = 0x02..0x0C (11 bytes) read in ONE transaction: the frame is latched when a read starts at 0x02, and DX, DY, DT and STATUS.bit1 are cleared. Little-endian, auto-increment; unmapped addresses read 0x00 (0xFF past 0x1F).
Definition in file flow_regs.h.
| #define FLOW_I2C_ADDR 0x3Bu |
Definition at line 30 of file flow_regs.h.
| #define FLOW_WHO_AM_I_VAL 0xF1u |
Definition at line 31 of file flow_regs.h.
| #define FLOW_FW_VERSION 0x10u |
1.0
Definition at line 32 of file flow_regs.h.
| #define FLOW_R_WHO_AM_I 0x00u |
Definition at line 33 of file flow_regs.h.
| #define FLOW_R_VERSION 0x01u |
Definition at line 34 of file flow_regs.h.
| #define FLOW_R_STATUS 0x02u |
Definition at line 35 of file flow_regs.h.
| #define FLOW_R_COUNT 0x03u |
Definition at line 36 of file flow_regs.h.
| #define FLOW_R_DX 0x04u |
Definition at line 37 of file flow_regs.h.
| #define FLOW_R_DY 0x06u |
Definition at line 38 of file flow_regs.h.
| #define FLOW_R_SQUAL 0x08u |
Definition at line 39 of file flow_regs.h.
| #define FLOW_R_SHUTTER 0x09u |
Definition at line 40 of file flow_regs.h.
| #define FLOW_R_DT 0x0Bu |
Definition at line 41 of file flow_regs.h.
| #define FLOW_R_CTRL 0x10u |
Definition at line 42 of file flow_regs.h.
| #define FLOW_R_FRAME FLOW_R_STATUS |
Definition at line 43 of file flow_regs.h.
| #define FLOW_FRAME_BYTES 11u |
Definition at line 44 of file flow_regs.h.
| #define FLOW_REG_SPACE 0x20u |
Definition at line 45 of file flow_regs.h.
| #define FLOW_S_SENSOR_OK 0x01u |
Definition at line 47 of file flow_regs.h.
| #define FLOW_S_NEW 0x02u |
Definition at line 48 of file flow_regs.h.
| #define FLOW_S_OVERFLOW 0x04u |
Definition at line 49 of file flow_regs.h.
| #define FLOW_S_REJECTED 0x08u |
Definition at line 50 of file flow_regs.h.
| #define FLOW_CTRL_RESET 0x01u |
Definition at line 52 of file flow_regs.h.
| #define FLOW_CTRL_REINIT 0x02u |
Definition at line 53 of file flow_regs.h.