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,
"");
165 #if DEBUG_DBPRINT == 1 166 if (status != 0)
dbcritInt(
"VL53L1X_StartRanging status = ", status,
"");
173 while (dataReady != 1)
177 #if DEBUG_DBPRINT == 1 178 if (status != 0)
dbcritInt(
"VL53L1X_CheckForDataReady status = ", status,
"");
187 #if DEBUG_DBPRINT == 1 188 if (status != 0)
dbcritInt(
"VL53L1X_GetRangeStatus status = ", status,
"");
189 if (state != 0)
dbcritInt(
"VL53L1X_GetRangeStatus = ", state,
"");
195 #if DEBUG_DBPRINT == 1 196 if (status != 0)
dbcritInt(
"VL53L1X_GetDistance status = ", status,
"");
202 #if DEBUG_DBPRINT == 1 203 if (status != 0)
dbcritInt(
"VL53L1X_ClearInterrupt status = ", status,
"");
void dbinfoInt_hex(char *message1, int32_t value, char *message2)
Print an info value surrounded by two strings (char array) to USARTx.
VL53L1X_ERROR VL53L1X_StartRanging(uint16_t dev)
This function starts the ranging distance operation The ranging operation is continuous. The clear interrupt has to be done after each get data to allow the interrupt to raise when the next data is ready 1=active high (default), 0=active low, use SetInterruptPolarity() to change the interrupt polarity if required.
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...
short int16_t
Typedef defining 16 bit short type. The developer should modify this to suit the platform being deplo...
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_GetDistance(uint16_t dev, uint16_t *distance)
This function returns the distance measured by the sensor in mm.
VL53L1X_ERROR VL53L1X_GetOffset(uint16_t dev, int16_t *offset)
This function returns the programmed offset correction value in mm.
VL53L1X_ERROR VL53L1X_GetRangeStatus(uint16_t dev, uint8_t *rangeStatus)
This function returns the ranging status error (0:no error, 1:sigma failed, 2:signal failed...
Enable or disable printing to UART with dbprint.
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...
int8_t initVL53L1X(void)
Initialize the sensor.
uint16_t measureVL53L1X(void)
Get a sensor reading.
VL53L1X_ERROR VL53L1X_CheckForDataReady(uint16_t dev, uint8_t *isDataReady)
This function checks if the new ranging data is available by polling the dedicated register...
VL53L1X_ERROR VL53L1X_ClearInterrupt(uint16_t dev)
This function clears the interrupt, to be called after a ranging data reading to arm the interrupt fo...
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)