【发布时间】:2013-09-24 15:28:42
【问题描述】:
我正在使用连接到 A13 嵌入式 linux 的 i2c 设备。我试图从寄存器中获取数据,但总是得到不完整的 xfer (0x48) 错误。我在 i2c-sunxi.c 文件中找到了错误代码。
case 0x48: /* SLA+R has been transmitted; NOT ACK has been received */
err_code = 0x48;//err,wakeup the thread
我的i2c模块功能是;
unsigned char buf[1] = { 0 };
struct i2c_msg msgs[] = {
{ this_client->addr, 0, 1, buf }, /* setup read ptr */
{ this_client->addr, I2C_M_RD, 1, buf }, /* read status + date */
};
/* read registers */
if ((i2c_transfer(this_client->adapter, msgs, 2)) != 2) {
dev_err(&this_client->dev, "%s: read error\n", __func__);
return -EIO;
}
【问题讨论】:
-
你能看到 I2C 总线上的任何设备吗?总线上设备的 I2C 地址是什么?
标签: linux linux-kernel embedded i2c