Data Sheet

DocID029133 Rev 1 5/7
AN4846 Multiple VL53L0X application
7
Figure 3. I2C GPIO expander application
2.2 VL53L0X API management
See also “VL53L0X_API_Integration Guide.pdf” on www.st.com/VL53L0X in “Design
Resources” page.
In vl53L0x_platform.h API file
Set VL53L0x_SINGLE_DEVICE_DRIVER macro to 0 so that API implementation will
be automatically adapted to a multi-device context.
Define VL53L0xDev_t type as a structure pointer holding any data required for multi-
device management. A mandatory field is an instance of VL53L0xDevData containing
ST API private data.
Then
define, “N” the number of VL53L0X (Struct MyVL53L0xDev_t BoardDevs[N])
Put all devices under reset
Enable VL53L0X one after the other and set their I2C address through
VL53L0X_SetDeviceAddress (&BoardDevs[i], FinalI2cAddr)
*3,29//;>@
*3,29//;>@
*3,29//;>@
*3,29//;>@
*3,29//;>@
*3,29//;>@
*3,29//;>@
*3,29//;>@
3
3
3
3
3
3
3
3
5 N
9''
,17
6&/
6'$
$
$
$
966
+RVW,&FRQWURO
$GGUHVVPDQDJHPHQW
WR9''RU966
9
8ELWV*3,2H[SDQGHU
;6+879//;>@
;6+879//;>@
;6+879//;>@
;6+879//;>@
;6+879//;>@
;6+879//;>@
;6+879//;>@
;6+879//;>@
3
3
3
3
3
3
3
3
9''
,17
6&/
6'$
$
$
$
966
+RVW,&FRQWURO
$GGUHVVPDQDJHPHQW
WR9''RU966
9
8ELWV*3,2H[SDQGHU
,QWHUUXSWWRKRVW