cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F0xx HAL_I2C Driver - Slave Functions

mrussell
Associate
Posted on July 14, 2016 at 01:38

Hello - 

I am looking for clarification on why each of the HAL_I2C_Slave_xxxx() transmit and receive functions take a Size parameter.  If I were going to call HAL_I2C_Slave_Recieve() (after being write-addressed by the master), how could I possibly ever know how many data bytes the master will end up sending me?   Specifying a Size parameter any larger or smaller than required by the master hangs the bus in various ways.

The same goes for HAL_I2C_Slave_Transmit() (after being read-addressed by the master) - There is no way to predict how many bytes the master will clock it for.

Each of the provided HAL_I2C examples are limited since they only use fixed-size transfers.

So what am I missing?  What's the Size parameter for?  Is this just a limitation of the HAL_I2C driver?

Thanks!

#i2c #hal
0 REPLIES 0