AnsweredAssumed Answered

i2c slave address dependency

Question asked by trifunovic.nikola on Jun 5, 2017
Latest reply on Jun 5, 2017 by trifunovic.nikola


I want to use a STM32L100 as I2C slave with two addresses. The master will receive different size of data and different data depending on the used address. This means that the slave address also includes a command.

I tried to use the HAL_I2C_AddrCallback() to check the address and then to respond with HAL_I2C_Slave_Transmit but it didn’t work.

I also tried to use HAL_I2C_Slave_Transmit_DMA() and then to change data in the data buffer in the HAL_I2C_AddrCallback() routine.

I would like to use the HAL libs for this problem to have a clean code. But I think that I have to make my own functions for that.

Does anybody have experience with this kind of I2C task?

Many thanks in advance!