cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeF4: I2C Slave

budde
Associate II
Posted on April 22, 2014 at 14:26

Hi,

I have just started my first project using the new STM32CubeF firmware library (on an STM32F4-Discovery board).

I do not understand how to implement a normal I2C slave using the I2C HAL. Why are there two functions: one for slave transmitter and one for slave receiver?

As an I2C slave I do not know the direction before the transfer has been started by the I2C master. Normally I would expect a function, which receives a TX and a RX buffer.

The examples do not really help to implement a real world I2C slave.

How can I implement an I2C slave supporting both directions (e.g. an I2C RAM).

#i2c-sla
1 REPLY 1
Posted on April 22, 2014 at 16:15

Well, the Cube thing, being inflated, mostly undocumented, and obviously not fitting your purpose, does not suit your needs - so why don't you simply forget the whole ''library'' thing and roll out your own?

You can read it to grab some of the implementation details, though.

JW