-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I2C Repeated Start Conditions #7
Comments
A typical I2C read situation that resembles reading from mpu6050 chip: The Pointer Byter from Master byte you mentioned resembles the Reg Address byte shown above, and they were both followed by a Repeat Start signal from the master device (CH347). And the whole process may break down to two seperated steps: write 1 byte and read couple of bytes (2 bytes in your specific situation). To perform a Repeat Start and Word Read (that your document called Repeat Start and Word Read) using this libraray, the code may look like this:
I hope this would help :) |
I tired you code but I found it doesn't work. I am currently using the following code:
It seems i2c.read only generates the pattern for addr + register_addr and read two bytes as shown in the following code. It is different from the pattern you showed: addr(write) +register_addr + addr(read) and read two bytes.
I will show you the waveform I captured from the ouput of CH347 later. |
I am trying use this library with some TI chip. Could you please explain how to use i2c.read(reg,length) to do Pointer Byte Set Followed by a Repeat Start and Word (Two Byte) Read as showing in the following figure? Now I can only use i2c.read and i2c.write seprately.
The text was updated successfully, but these errors were encountered: