cancel
Showing results for 
Search instead for 
Did you mean: 

Do you have I2C device scanner program (like the one in arduino, esp32 etc) for STM32L053R8T6 ?

ASING.91
Associate II
 
2 REPLIES 2
Pavel A.
Evangelist III

For scanning you can use the HAL library function HAL_I2C_IsDeviceReady.

This function sends start, then the specified device address and checks for ACK. Then it sends stop.

The device address for it can have the read bit (LSB) set or clear, in case the device you scan for reacts to read and write accesses differently.

-- pa

> This function sends start, then the specified device address and checks for ACK. Then it sends stop.

Or so, without Cube.

I'm not aware of any such scanner program for STM32, but it's straightforward to code.

Just address every non-broadcast I2C address, and check for an ACK.