linux i2c protocol
来源:互联网 发布:rayfile软件下载 编辑:程序博客网 时间:2024/05/18 11:29
This document describes the i2c protocol. Or will, when it is finished :-)
Key to symbols
==============
S (1 bit) : Start bit
P (1 bit) : Stop bit
Rd/Wr (1 bit) : Read/Write bit. Rd equals 1, Wr equals 0.
A, NA (1 bit) : Accept and reverse accept bit.
Addr (7 bits): I2C 7 bit address. Note that this can be expanded as usual to
get a 10 bit I2C address.
Comm (8 bits): Command byte, a data byte which often selects a register on
the device.
Data (8 bits): A plain data byte. Sometimes, I write DataLow, DataHigh
for 16 bit data.
Count (8 bits): A data byte containing the length of a block operation.
[..]: Data sent by I2C device, as opposed to data sent by the host adapter.
Simple send transaction
======================
This corresponds to i2c_master_send.
S Addr Wr [A] Data [A] Data [A] ... [A] Data [A] P
Simple receive transaction
===========================
This corresponds to i2c_master_recv
S Addr Rd [A] [Data] A [Data] A ... A [Data] NA P
Combined transactions
====================
This corresponds to i2c_transfer
They are just like the above transactions, but instead of a stop bit P
a start bit S is sent and the transaction continues. An example of
a byte read, followed by a byte write:
S Addr Rd [A] [Data] NA S Addr Wr [A] Data [A] P
Modified transactions
=====================
We have found some I2C devices that needs the following modifications:
Flag I2C_M_NOSTART:
In a combined transaction, no 'S Addr Wr/Rd [A]' is generated at some
point. For example, setting I2C_M_NOSTART on the second partial message
generates something like:
S Addr Rd [A] [Data] NA Data [A] P
If you set the I2C_M_NOSTART variable for the first partial message,
we do not generate Addr, but we do generate the startbit S. This will
probably confuse all other clients on your bus, so don't try this.
Flags I2C_M_REV_DIR_ADDR
This toggles the Rd/Wr flag. That is, if you want to do a write, but
need to emit an Rd instead of a Wr, or vice versa, you set this
flag. For example:
S Addr Rd [A] Data [A] Data [A] ... [A] Data [A] P
Flags I2C_M_IGNORE_NAK
Normally message is interrupted immediately if there is [NA] from the
client. Setting this flag treats any [NA] as [A], and all of
message is sent.
These messages may still fail to SCL lo->hi timeout.
Flags I2C_M_NO_RD_ACK
In a read message, master A/NA bit is skipped.
- linux i2c protocol
- 《Essential Linux Device Drivers》 第8章 I2C Protocol
- 《Essential Linux Device Drivers》 第8章 I2C Protocol
- linux i2c
- Linux I2C
- linux i2c
- linux i2c
- linux i2c
- Linux I2C
- Linux I2C子系统分析-I2C总线驱动
- Linux I2C子系统分析-I2C设备驱动
- Linux I2C子系统分析-I2C总线驱动
- linux I2C 驱动之---- i2c 编程接口
- Linux I2C子系统分析-I2C总线驱动
- Linux I2C子系统分析-I2C总线驱动
- Linux I2C子系统分析-I2C设备驱动
- Linux I2C工具查看配置I2C设备
- Linux I2C工具查看配置I2C设备
- linux忘记密码修改策略1
- HDU 1102
- 【每日面试题】输入一字符串,输出该字符串的所有组合
- 谈谈Unicode编码,简要解释UCS、UTF、BMP、BOM等名词
- prim最小生成树模板
- linux i2c protocol
- body language
- Bingo卡片案例笔记【三】、随机生成数字并填写到表格中去
- Android IOException Permission denied 的解决方案
- 个人对继承理解以及虚析构函数的理解
- 【CSDN常见问题解答】让自己的电脑变成虚拟服务器(亲测成功)
- Prepare a DSDT
- 帧、场编码
- Linux进程描述符