Initialize the sensor.
This method wait until the sensor is booted, initializes it and gets offset values.
78 while ((bootState != 1) && (exitWhile < 5))
82 #if DEBUG_DBPRINT == 1 83 if (status != 0)
dbcritInt(
"VL53L1X_BootState status = ", status,
"");
84 dbinfoInt(
"VL53L1X_BootState = ", bootState,
"");
97 #if DEBUG_DBPRINT == 1 98 if (status != 0)
dbcritInt(
"VL53L1X_SensorInit status = ", status,
"");
104 #if DEBUG_DBPRINT == 1 105 if (status != 0)
dbcritInt(
"VL53L1X_GetOffset status = ", status,
"");
112 #if DEBUG_DBPRINT == 1 113 if (status != 0)
dbcritInt(
"VL53L1X_GetXtalk status = ", status,
"");
120 #if DEBUG_DBPRINT == 1 121 #if DBPRINT_VERBOSE == 1 122 if (status != 0)
dbcritInt(
"VL53L1X_SetDistanceMode status = ", status,
"");
129 #if DEBUG_DBPRINT == 1 130 if (status != 0)
dbcritInt(
"VL53L1X_SetInterMeasurementInMs status = ", status,
"");
136 #if DEBUG_DBPRINT == 1 137 if (status != 0)
dbcritInt(
"VL53L1X_SetTimingBudgetInMs status = ", status,
"");
144 #if DEBUG_DBPRINT == 1 145 if (status != 0)
dbcritInt(
"VL53L1X_GetSensorId status = ", status,
"");
void dbinfoInt_hex(char *message1, int32_t value, char *message2)
Print an info value surrounded by two strings (char array) to USARTx.
void dbinfoInt(char *message1, int32_t value, char *message2)
Print an info value surrounded by two strings (char array) to USARTx.
signed char int8_t
Typedef defining 8 bit char type. The developer should modify this to suit the platform being deploye...
void dbcritInt(char *message1, int32_t value, char *message2)
Print a critical value surrounded by two strings (char array) to USARTx.
void dbwarnInt(char *message1, int32_t value, char *message2)
Print a warning value surrounded by two strings (char array) to USARTx.
VL53L1X_ERROR VL53L1X_GetXtalk(uint16_t dev, uint16_t *xtalk)
This function returns the current programmed xtalk correction value in cps.
VL53L1X_ERROR VL53L1X_SetDistanceMode(uint16_t dev, uint16_t DM)
This function programs the distance mode (1=short, 2=long(default)). Short mode max distance is limit...
VL53L1X_ERROR VL53L1X_GetOffset(uint16_t dev, int16_t *offset)
This function returns the programmed offset correction value in mm.
VL53L1X_ERROR VL53L1X_GetSensorId(uint16_t dev, uint16_t *sensorId)
This function returns the sensor id, sensor Id must be 0xEEAC.
void delay(uint32_t msDelay)
Wait for a certain amount of milliseconds in EM2/3.
VL53L1X_ERROR VL53L1X_SensorInit(uint16_t dev)
This function loads the 135 bytes default values to initialize the sensor.
VL53L1X_ERROR VL53L1X_SetTimingBudgetInMs(uint16_t dev, uint16_t TimingBudgetInMs)
This function programs the timing budget in ms. Predefined values = 15, 20, 33, 50, 100(default), 200, 500.
VL53L1X_ERROR VL53L1X_SetInterMeasurementInMs(uint16_t dev, uint32_t InterMeasMs)
This function programs the Intermeasurement period in ms Intermeasurement period must be >/= timing b...
unsigned short uint16_t
Typedef defining 16 bit unsigned short type. The developer should modify this to suit the platform be...
unsigned char uint8_t
Typedef defining 8 bit unsigned char type. The developer should modify this to suit the platform bein...
VL53L1X_ERROR VL53L1X_BootState(uint16_t dev, uint8_t *state)
This function returns the boot state of the device (1:booted, 0:not booted)