37 #ifndef MULTI_RANGER_EARLY_INIT
38 #define MULTI_RANGER_EARLY_INIT TRUE
45 #ifndef MULTI_RANGER_TIMINGBUDGET_MS
46 #define MULTI_RANGER_TIMINGBUDGET_MS 100
51 #ifndef MULTI_RANGER_DISTANCEMODE
52 #define MULTI_RANGER_DISTANCEMODE 2
59 #ifndef MULTI_RANGER_INTERMEASUREMENT_MS
60 #define MULTI_RANGER_INTERMEASUREMENT_MS MULTI_RANGER_TIMINGBUDGET_MS
62 #if MULTI_RANGER_INTERMEASUREMENT_MS < MULTI_RANGER_TIMINGBUDGET_MS
63 #warning MULTI_RANGER_INTERMEASUREMENT_MS should be greater than or equal to MULTI_RANGER_TIMINGBUDGET_MS
67 #define MULTI_RANGER_PIN_FRONT PCA95X4_P4
68 #define MULTI_RANGER_PIN_BACK PCA95X4_P1
69 #define MULTI_RANGER_PIN_RIGHT PCA95X4_P2
70 #define MULTI_RANGER_PIN_LEFT PCA95X4_P6
71 #define MULTI_RANGER_PIN_UP PCA95X4_P0
72 #define MULTI_RANGER_PIN_ALL (MULTI_RANGER_PIN_FRONT | MULTI_RANGER_PIN_BACK | MULTI_RANGER_PIN_RIGHT | MULTI_RANGER_PIN_LEFT | MULTI_RANGER_PIN_UP)
77 #ifdef MULTI_RANGER_EXTRA_DEV
78 MULTI_RANGER_CONF_EXTRA,
102 #ifndef MULTI_RANGER_ARRAY_ORIENTATION
103 #define MULTI_RANGER_ARRAY_ORIENTATION {{0.f, 0.f}, {0.f, M_PI}, {0.f, M_PI_2}, {0.f, -M_PI_2}, {M_PI_2, 0.f}}
144 #if MULTI_RANGER_EARLY_INIT
168 bool new_data =
false;
bool VL53L1X_NonBlocking_ReadDataEvent(VL53L1_DEV dev, uint16_t *distance_mm, bool *new_data)
Implement non-blocking read sequence The data reading actually starts when the read_state is set to V...
Driver for the 8-bit I/O expander based on i2c.
#define MULTI_RANGER_PIN_ALL
bool pca95x4_set_output(struct pca95x4 *dev, uint8_t mask, bool blocking)
Set output value.
static bool multi_ranger_read(struct SingleRanger *ranger UNUSED)
Read data from a device.
Main include for ABI (AirBorneInterface).
void multi_ranger_event(void)
#define MULTI_RANGER_PIN_FRONT
void pca95x4_init(struct pca95x4 *dev, struct i2c_periph *i2c_p, uint8_t addr)
Init PCA95X4.
#define OBS_DETECTION_MULTI_RANGER_DECK_ID
VL53L1_Dev_t dev
sensor driver
float azimuth
azimuth [rad] relative to body frame
#define MULTI_RANGER_TIMINGBUDGET_MS
float bearing
bearing [rad] relative to body frame
#define PCA95X4_DEFAULT_ADDRESS
#define MULTI_RANGER_INTERMEASUREMENT_MS
bool VL53L1X_NonBlocking_RequestData(VL53L1_DEV dev)
Request a new reading.
void multi_ranger_init(void)
Module init.
#define MULTI_RANGER_PIN_BACK
float distance
raw distance measurement
uint8_t read_state
current reading state
bool VL53L1X_NonBlocking_IsIdle(VL53L1_DEV dev)
Test is read status is on idle.
#define MULTI_RANGER_PIN_LEFT
void multi_ranger_periodic(void)
Module periodic function.
static const struct usb_device_descriptor dev
struct SingleRanger ranger[MULTI_RANGER_NB]
sensor array
uint8_t slave_addr
Slave address.
bool pca95x4_configure(struct pca95x4 *dev, uint8_t val, bool blocking)
Configure PCA95X4.
static const float multi_ranger_array_orientation[][2]
Common code for AP and FBW telemetry.
void multi_ranger_report(void)
static struct cf_deck_multi_ranger multi_ranger
#define MULTI_RANGER_PIN_RIGHT
void VL53L1X_BootDevice(VL53L1_DEV dev, uint16_t TimingBudgetInMs, uint16_t DistanceMode, uint32_t InterMeasurementInMs)
Implement boot sequence of VL53L1 device as described in documentation See VL53L1X_SetTimingBudgetInM...
static void multi_ranger_boot_device(VL53L1_Dev_t *dev UNUSED)
Boot a device.
#define MULTI_RANGER_DISTANCEMODE
#define MULTI_RANGER_ARRAY_ORIENTATION
Non-blocking runtime functions for the VL53L1X.
enum MultiRangerStatus status