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 PCA95XX_P4
68 #define MULTI_RANGER_PIN_BACK PCA95XX_P1
69 #define MULTI_RANGER_PIN_RIGHT PCA95XX_P2
70 #define MULTI_RANGER_PIN_LEFT PCA95XX_P6
71 #define MULTI_RANGER_PIN_UP PCA95XX_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;
Main include for ABI (AirBorneInterface).
#define OBS_DETECTION_MULTI_RANGER_DECK_ID
void multi_ranger_report(void)
#define MULTI_RANGER_INTERMEASUREMENT_MS
float distance
raw distance measurement
#define MULTI_RANGER_PIN_LEFT
static const float multi_ranger_array_orientation[][2]
enum MultiRangerStatus status
void multi_ranger_init(void)
Module init.
#define MULTI_RANGER_PIN_FRONT
float bearing
bearing [rad] relative to body frame
uint8_t read_state
current reading state
static void multi_ranger_boot_device(VL53L1_Dev_t *dev UNUSED)
Boot a device.
@ MULTI_RANGER_CONF_RIGHT
@ MULTI_RANGER_CONF_FRONT
@ MULTI_RANGER_READ_RIGHT
@ MULTI_RANGER_READ_FRONT
VL53L1_Dev_t dev
sensor driver
#define MULTI_RANGER_PIN_RIGHT
static bool multi_ranger_read(struct SingleRanger *ranger UNUSED)
Read data from a device.
struct SingleRanger ranger[MULTI_RANGER_NB]
sensor array
void multi_ranger_event(void)
#define MULTI_RANGER_ARRAY_ORIENTATION
#define MULTI_RANGER_TIMINGBUDGET_MS
void multi_ranger_periodic(void)
Module periodic function.
#define MULTI_RANGER_PIN_BACK
#define MULTI_RANGER_PIN_ALL
static struct cf_deck_multi_ranger multi_ranger
#define MULTI_RANGER_DISTANCEMODE
float azimuth
azimuth [rad] relative to body frame
Common code for AP and FBW telemetry.
uint8_t slave_addr
Slave address.
void pca95xx_init(struct pca95xx *dev, struct i2c_periph *i2c_p, uint8_t addr)
Init PCA95XX.
bool pca95xx_configure(struct pca95xx *dev, uint8_t val, bool blocking)
Configure PCA95XX.
bool pca95xx_set_output(struct pca95xx *dev, uint8_t mask, bool blocking)
Set output value.
Driver for the 8-bit I/O expander based on i2c.
#define PCA95XX_DEFAULT_ADDRESS
static const struct usb_device_descriptor dev
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
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...
bool VL53L1X_NonBlocking_RequestData(VL53L1_DEV dev)
Request a new reading.
bool VL53L1X_NonBlocking_IsIdle(VL53L1_DEV dev)
Test is read status is on idle.
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...
Non-blocking runtime functions for the VL53L1X.