6static int16_t
le16(
const uint8_t *p) {
return (int16_t)((uint16_t)p[0] | ((uint16_t)p[1] << 8)); }
12 uint8_t
id[2] = { 0, 0 };
28 fr->
dt_s = (float)(uint16_t)
le16(&r[9]) * 1e-4f;
33 if (!f->
ok)
return -1;
int32_t flow_read(flow_t *f, flow_frame_t *fr)
1 = new data, 0 = none, <0 error
void flow_decode(const uint8_t r[FLOW_FRAME_LEN], flow_frame_t *fr)
pure decoder (host tests)
int32_t flow_init(flow_t *f, const sensor_bus_t *bus)
0 = bridge found
static int16_t le16(const uint8_t *p)
ACwing Flow rev A optical-flow bridge (STM32C011 at 0x3B, PMW3901 behind it).
#define FLOW_BRIDGE_WHO_AM_I
#define FLOW_REG_WHO_AM_I
void * handle
opaque context passed to read/write