picandies
Posts: 192
Joined: Wed Nov 26, 2014 5:13 pm

questions about read_i2c_block_data()

Wed Aug 22, 2018 4:10 pm

Looking at using the smbus lib on the rpi3 to read some bytes from a micro sensor: read_i2c_block_data() to read several bytes. The format is:

START Addr Wr [A] Comm [A] START Addr Rd [A] [Data] A [Data] A ... A [Data] NA STOP

However, it is not mentioned anywhere (that I can find) who generates the second START & STOP...is it the master or slave? I assume the Acks after the second start are from the master ( to tell the slave data was rcvd). I need to know, since I am creating some bit bang code for the slave (a small micro).

picandies
Posts: 192
Joined: Wed Nov 26, 2014 5:13 pm

Re: questions about read_i2c_block_data()

Wed Aug 22, 2018 4:24 pm

Well, I think I found the answer...Looking again, I noticed [A] vs A, and I thought I'd made a typo. But the [ ] actually means something.
[xxxx] means xxxx comes from the slave
xxxx means xxxx comes from the master

Return to “Interfacing (DSI, CSI, I2C, etc.)”