我正在使用连接到 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;
}