i2c_transfer函数详解
时间: 2024-05-16 17:19:28 浏览: 177
I2C传输协议(超详细!!!)
i2c_transfer()函数用于进行i2c适配器和i2c设备之间的一组消息交互。该函数是i2c核心提供给设备驱动的发送方法,通过它发送的数据需要被打包成i2c_msg。这个函数最终会回调相应i2c_adapter->i2c_algorithm->master_xfer()接口将i2c_msg对象发送到i2c物理控制器进行实际的消息传输。i2c_transfer()函数本身并不具备驱动适配器物理硬件完成消息交互的能力,它只是寻找到i2c_adapter对应的i2c_algorithm,并使用i2c_algorithm的master_xfer()函数真正驱动硬件流程。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Linux i2c驱动框架分析 (二)](https://blog.csdn.net/m0_46525308/article/details/114269222)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [linux i2c驱动讲解](https://blog.csdn.net/gmq_syy/article/details/75907400)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文