2024-08-07 12:12 AM - edited 2024-08-07 12:14 AM
HI
Got an I2C device connected to my p nucleo wb 55 board. currently no luck communicating.
I've been instructed to to use a repeated start condition in I2C https://www.i2c-bus.org/repeated-start-condition/
Not sure if my current HAL functions work for an I2C repeated start condition device? they are :
HAL_I2C_Mem_Write XXX
HAL_I2C_Master_Transmit XXX
Any other example I can use ?
need to achieve this :
S start
R restart
THNAKS
2024-08-07 01:36 AM
Hello @DS.4
To achieve a repeated start condition with your I2C device, you will need to use specific HAL functions that support repeated start conditions. The functions you mentioned (HAL_I2C_Mem_Write and HAL_I2C_Master_Transmit) do not support repeated start conditions.
For repeated start conditions, you should use the following HAL functions:
These functions are designed to handle sequential transmit and receive operations, which include the capability to perform repeated start conditions.
Please refer to these examples for farther more details: