关于I2C 传输前,通常会遇到这样的设置:
struct i2c_client * client;
client->ext_flag = client->ext_flag | I2C_DMA_FLAG;
ret = i2c_master_send(client,pData,lens);
......
i2c传输前需要对 client->ext_flag 做设定,或上相关标志,各个flag解释如下:
遇到标志:
client->ext_flag = client->ext_flag | I2C_A_FILTER_MSG;
其中该标记作用是移除i2c ack error。定义路径:工程代码/kernel/include/linux/i2c.h
#define I2C_A_FILTER_MSG 0x8000 /* filer out error messages */
#define I2C_A_CHANGE_TIMING 0x4000 /* change timing paramters */
#define I2C_MASK_FLAG (0x00ff)
#define I2C_DMA_FLAG (0x2000)
#define I2C_WR_FLAG (0x1000)
#define I2C_RS_FLAG (0x0800)
#define I2C_HS_FLAG (0x0400)
#define I2C_ENEXT_FLAG (0x0200)
#define I2C_DISEXT_FLAG (0x0000)
#define I2C_POLL_FLAG (0x4000)
#define I2C_CH2_FLAG (0x8000)
#define I2C_POLLING_FLAG (0x00000001)
#define I2C_PUSHPULL_FLAG (0x00000002)
#define I2C_3DCAMERA_FLAG (0x00000004)
#define I2C_DIRECTION_FLAG (0x00000008)