Implementing I2C Slave on T3.2

Status
Not open for further replies.

gfvalvo

Well-known member
Hi All.

Got question about implementing an I2C slave on T3.2. One common I2C technique is for the master to start a Read transaction and then proceed to read an arbitrary number of bytes from the slave. After each read the master sends an ACK --- except after the last byte that it wants to read when it sends a NACK followed by a Stop condition.

I was looking at the Teensyduino library code for implementing an I2C slave device (WireKinetis.cpp, etc) and it doesn't seem to me to be capable of implementing this technique. I think this because the user-supplied callback function (user_onRequest) is only called when the slave device is first addressed for the read operation. So, the callback needs to know how many bytes the master is going to request ahead of time. But that doesn't work if the master can continue clocking out an arbitrary number of bytes.

Am I interpreting this correctly?

Thanks.
 
Status
Not open for further replies.
Back
Top