ACwing FC firmware
STM32WB55: attitude IEKF, altitude Kalman filter, flight core, protocol v2
Loading...
Searching...
No Matches
vl53l1x.h
Go to the documentation of this file.
1
13#ifndef VL53L1X_H
14#define VL53L1X_H
15
16#include <stdint.h>
17
18#define VL53L1X_ADDR_7BIT 0x29u
19#define VL53L1X_MODEL_ID 0xEACCu
20
21typedef struct {
22 int32_t (*write)(void *h, uint16_t reg, const uint8_t *d, uint16_t len);
23 int32_t (*read) (void *h, uint16_t reg, uint8_t *d, uint16_t len);
24 void (*delay_ms)(uint32_t ms);
25 void *handle;
27
28typedef struct {
30 uint8_t int_pol;
31 uint8_t ok;
32} vl53_t;
33
36typedef struct {
37 uint16_t mm;
38 uint8_t status;
39 uint16_t signal_kcps;
41
43int32_t vl53_init(vl53_t *d, const vl53_bus_t *bus, uint16_t budget_ms);
45int32_t vl53_poll(vl53_t *d, vl53_sample_t *s);
46
47#endif /* VL53L1X_H */
static batt_state_t s
Definition battery.c:21
uint16_t ms
Definition log_task.c:42
void * handle
Definition vl53l1x.h:25
Range status after the ULD mapping: 0 valid, 1 sigma fail, 2 signal fail, 4 out of bounds,...
Definition vl53l1x.h:36
uint8_t status
Definition vl53l1x.h:38
uint16_t signal_kcps
peak signal rate (MCPS x 1000 / 128 x 8)
Definition vl53l1x.h:39
uint16_t mm
Definition vl53l1x.h:37
vl53_bus_t bus
Definition vl53l1x.h:29
uint8_t int_pol
data-ready level on GPIO__TIO_HV_STATUS bit 0
Definition vl53l1x.h:30
uint8_t ok
Definition vl53l1x.h:31
int32_t vl53_init(vl53_t *d, const vl53_bus_t *bus, uint16_t budget_ms)
0 = sensor found and ranging; < 0 = absent or error (the board works without it)
Definition vl53l1x.c:86
int32_t vl53_poll(vl53_t *d, vl53_sample_t *s)
1 = new sample in *s, 0 = none yet, < 0 = bus error
Definition vl53l1x.c:137