36 #ifndef SONAR_VL53L1X_I2C_ADDR
37 #define SONAR_VL53L1X_I2C_ADDR VL53L1_DEFAULT_ADDRESS
41 #ifndef SONAR_VL53L1X_OFFSET
42 #define SONAR_VL53L1X_OFFSET 0
50 #ifndef SONAR_VL53L1X_TIMINGBUDGET_MS
51 #define SONAR_VL53L1X_TIMINGBUDGET_MS 100
56 #ifndef SONAR_VL53L1X_DISTANCEMODE
57 #define SONAR_VL53L1X_DISTANCEMODE 2
64 #ifndef SONAR_VL53L1X_INTERMEASUREMENT_MS
65 #define SONAR_VL53L1X_INTERMEASUREMENT_MS SONAR_VL53L1X_TIMINGBUDGET_MS
67 #if SONAR_VL53L1X_INTERMEASUREMENT_MS < SONAR_VL53L1X_TIMINGBUDGET_MS
68 #warning SONAR_VL53L1X_INTERMEASUREMENT_MS should be greater than or equal to SONAR_VL53L1X_TIMINGBUDGET_MS
83 #ifdef SENSOR_SYNC_SEND_SONAR
112 if (range_mm > 0.0f && range_mm < 5.0f) {
122 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...
void sonar_vl53l1x_event(void)
Main include for ABI (AirBorneInterface).
#define SONAR_VL53L1X_DISTANCEMODE
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
struct sonar_vl53l1x_dev sonar_vl53l1x
static void sonar_vl53l1x_publish(uint16_t range_mm)
#define SONAR_VL53L1X_TIMINGBUDGET_MS
bool VL53L1X_NonBlocking_RequestData(VL53L1_DEV dev)
Request a new reading.
void sonar_vl53l1x_read(void)
bool VL53L1X_NonBlocking_IsIdle(VL53L1_DEV dev)
Test is read status is on idle.
#define SONAR_VL53L1X_I2C_ADDR
uint8_t slave_addr
Slave address.
void sonar_vl53l1x_init(void)
API to get/set the generic vehicle states.
#define SONAR_VL53L1X_INTERMEASUREMENT_MS
Common code for AP and FBW telemetry.
#define SONAR_VL53L1X_OFFSET
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...
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
Non-blocking runtime functions for the VL53L1X.
Architecture independent I2C (Inter-Integrated Circuit Bus) API.