2023-07-13 09:53 AM - edited 2023-07-13 09:59 AM
Dear ST Engineers,
I am planning to port this device driver to another 8 bit MCU:
https://www.st.com/en/embedded-software/stsw-img023.html
My 8 bit MCU has I2C slave address range from 0x00 to 0x7F.
However, hint of that ST driver code insists on using uint16_t as I2C address, for example,
typedef struct
{
/* To be filled with customer's platform. At least an I2C address/descriptor
* needs to be added */
/* Example for most standard platform : I2C address of sensor */
uint16_t address;
} VL53L5CX_Platform;
How do I reconcile this conflict? Or do I misunderstand something about ARM 32 bit architect?
Please give your valuable opinions. :cowboy_hat_face:
Solved! Go to Solution.
2023-07-14 11:21 AM - edited 2023-07-14 11:21 AM
Porting 32 bit driver to 8 bit driver is not trivial.
I accomplished it by porting it to another 32 bit MCU.
2023-07-13 10:47 AM
Making a 1 bit right displacement.
If your address for STM32 is
xxxxxxx0
The address for others will be
0xxxxxxx
2023-07-13 12:28 PM
I2C has a 7-bit and 10-bit addressing mode, the register is large enough to accommodate either.
2023-07-14 11:21 AM - edited 2023-07-14 11:21 AM
Porting 32 bit driver to 8 bit driver is not trivial.
I accomplished it by porting it to another 32 bit MCU.