Linux I2C 学习笔记

  • 用户空间对 /dev/i2c-x 调用 open read write ioctl等函数, 最终由 i2c-dev.c 中的 i2cdev_ read write ioctl 处理.
  • ioctl 主要 参数 I2C_SLAVE, 会将client地址写入client 结构体.
  • read/write 分别使用核心传输函数 i2c_master_recv / i2c_master_send来进行数据收发.
  • i2c_master_recv / i2c_master_send 的核心都是使用 i2c_transfer() + struct i2c_msg做为参数.
  • i2c_transfer 核心函数为: master_xfer, 来自于 i2c_adapter 主控的注册.
  • 发送过程当中,还会经过 time_after来检查发送是否超时.
相关文章
相关标签/搜索