Skip to content

Commit

Permalink
Move firmware buffer to Platform
Browse files Browse the repository at this point in the history
Allow firmware to be supplied by the platform, independently of precompiled libraries.
  • Loading branch information
Gadgetoid committed May 17, 2022
1 parent 834fa4e commit 80de451
Show file tree
Hide file tree
Showing 4 changed files with 7,175 additions and 3 deletions.
1 change: 1 addition & 0 deletions Platform/platform.h
Expand Up @@ -81,6 +81,7 @@ typedef struct
* needs to be added */
/* Example for most standard platform : I2C address of sensor */
uint16_t address;
uint8_t *firmware;

} VL53L5CX_Platform;

Expand Down
6 changes: 3 additions & 3 deletions VL53L5CX_ULD_API/src/vl53l5cx_api.c
Expand Up @@ -364,13 +364,13 @@ uint8_t vl53l5cx_init(
/* Download FW into VL53L5 */
status |= WrByte(&(p_dev->platform), 0x7fff, 0x09);
status |= WrMulti(&(p_dev->platform),0,
(uint8_t*)&VL53L5CX_FIRMWARE[0],0x8000);
(uint8_t*)p_dev->platform.firmware,0x8000);
status |= WrByte(&(p_dev->platform), 0x7fff, 0x0a);
status |= WrMulti(&(p_dev->platform),0,
(uint8_t*)&VL53L5CX_FIRMWARE[0x8000],0x8000);
(uint8_t*)(p_dev->platform.firmware + 0x8000),0x8000);
status |= WrByte(&(p_dev->platform), 0x7fff, 0x0b);
status |= WrMulti(&(p_dev->platform),0,
(uint8_t*)&VL53L5CX_FIRMWARE[0x10000],0x5000);
(uint8_t*)(p_dev->platform.firmware + 0x10000),0x5000);
status |= WrByte(&(p_dev->platform), 0x7fff, 0x01);

/* Check if FW correctly downloaded */
Expand Down
Binary file added vl53l5cx_firmware.bin
Binary file not shown.

0 comments on commit 80de451

Please sign in to comment.