Linux I2C reads and writes to 16-bit register addresses __linux

Source: Internet
Author: User
The premise is that the driver of the I2C controller must have been running normally, the standard I2C tool can only read and write to 8-bit address, but the EEPROM of this 16-bit address will be powerless
So this kind of 16-bit address for read and write support, in the embedded domain is still very common
The main use of standard Linux I2C interface, struct i2c_msg; I2C message data structure
First, the I2C sequence diagram (from the network)

Read, need two messages: first, confirm register address, length is 2, because register address is 16bit, second, is to send read and write instruction, length is 2, read is 16bit length
Write, a message can be, because do not need to restart, you will be more than 8bit register address, as the first byte of data

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.