2023-10-15 11:35 PM
Hello all,
does the vl53l5cx ULD API (STSW-IMG023) can expose a unique device ID for the VL53L5CX ? Something similar to the VL51L1 API function call "VL53L1_Error VL53L1_GetUID(VL53L1_DEV Dev, uint64_t *pUid)" in the driver SWSW-IMG019 ?
Kind regards
Solved! Go to Solution.
2023-10-18 01:48 AM
Hello,
Thank you for your suggestion and we will consider to add this is a next driver release.
Next week, we could deliver this api function in this forum if you are interested in.
Regards
Anne
2023-10-16 11:52 AM
I think the code you want is in the API.
int32_t vl53l5_get_module_info(
struct vl53l5_dev_handle_t *p_dev,
struct vl53l5_module_info_t *p_module_info)
That function calls decode_module_funtion() which eventually gets to:
p_module_info->module_id_hi = vl53l5_decode_uint32_t(4, p_buff);
p_buff += 4;
p_module_info->module_id_lo = vl53l5_decode_uint32_t(4, p_buff);
Which are the lines you want.
- john
2023-10-17 12:12 AM
Hello John,
thank you for your fast response. Unfortunatly I can not find a function "int32_t vl53l5_get_module_info" in the driver package STSW-IMG023 v1.3.10 or the Linux Dirver STSW-IMG025 . All API functions in these driver packages are starting with "vl53l5cx_". Can you please give more details on the driver package you are refering to ? May a functional code snippet would also serve as well.
Kind regards.
2023-10-17 03:11 AM
Hello,
In the vl53l5cx_api.c file, you can find the vl53l5cx_is_alive function :
uint8_t vl53l5cx_is_alive(
VL53L5CX_Configuration *p_dev,
uint8_t *p_is_alive)
{
uint8_t status = VL53L5CX_STATUS_OK;
uint8_t device_id, revision_id;
status |= WrByte(&(p_dev->platform), 0x7fff, 0x00);
status |= RdByte(&(p_dev->platform), 0, &device_id);
status |= RdByte(&(p_dev->platform), 1, &revision_id);
status |= WrByte(&(p_dev->platform), 0x7fff, 0x02);
if((device_id == (uint8_t)0xF0) && (revision_id == (uint8_t)0x02))
{
*p_is_alive = 1;
}
else
{
*p_is_alive = 0;
}
return status;
}
2023-10-17 11:22 PM
Hello Anne,
I am looking more for a unique id different for each device to enable some sort of traceability. The device_id in the API function "vl53l5cx_is_alive()" is not sufficient for this purpose. The "vl53l5_module_info_t" mentioned by John seams to be the right direction - but unfortunatley is not available in the official driver releases. May a thing ST can consider in a next driver release ?
2023-10-18 01:48 AM
Hello,
Thank you for your suggestion and we will consider to add this is a next driver release.
Next week, we could deliver this api function in this forum if you are interested in.
Regards
Anne
2023-10-18 02:21 AM
Hello Anne,
yes please - would be great to have this function as early as possible available.
Kind regards.