当前位置:网站首页>基于I2C协议的驱动开发
基于I2C协议的驱动开发
2022-07-03 10:04:00 【sydyh43】
1、linux下的I2C协议框架
一般i2c_adapter以下的特定适配器硬件相关操作代码由芯片厂家开发完成。只需要完成在I2C协议基础上的二次开发,比方说基于I2C协议实现网络数据的传输,或者I2C外围器件的控制,或者blalalala

2、I2C协议的读写时序图
I2C设备挂载I2C总线以后,I2C设备的设备地址由硬件确定。同一条I2C总线上的不同I2C设备的设备地址不同。I2C协议传输的单元是一个字节。
写时序

一次I2C的写操作包括设备地址+写操作;寄存器地址,数据。
每次CPU发送一个字节的数据后,I2C设备把DATA线拉低,做ACK
读时序

读时序相对写时序稍微复杂一点点。分成两部分,第一步写操作,告诉I2C设备需要读寄存器的地址。第二步读操作,第二次发送I2C设备地址,等待I2C设备ACK后,完成数据读取。【此时CPU成为接收端,当完成读取一个字节的数据后,CPU可以发送ACK。假如有ACK,从设备会继续发送寄存器的数据(大部分I2C设备支持多地址读取,发送一次寄存器地址,连续接下来的多个寄存器数据);假如NOACK,I2C设备停止发送数据】
3、代码框架
待补充
边栏推荐
- Software testing redis database
- I, a tester from a large factory, went to a state-owned enterprise with a 50% pay cut. I regret it
- Commonly used discrete random distribution
- 图解网络:什么是虚拟路由器冗余协议 VRRP?
- Google Earth Engine(GEE)——当我们前后影像来弥补插值效果得时候,没有效果怎么办?
- 线性表的双链表
- 2022-07-02:以下go语言代码输出什么?A:编译错误;B:Panic;C:NaN。 package main import “fmt“ func mai
- Do you really need automated testing?
- 今晚要修稿子準備發佈。但是,仍卡在這裡,也許你需要的是一個段子。
- Qt:qss custom qgroupbox instance
猜你喜欢

进程与线程

历经一个月,终于拿到金蝶Offer!分享一下四面面经+复习资料

After 8 years of industry thinking, the test director has a deeper understanding of test thinking

【obs】obs的ini格式的ConfigFile

封装一个koa分布式锁中间件来解决幂等或重复请求的问题

Probability theory: application of convolution in calculating moving average

行业唯一!法大大电子合同上榜36氪硬核科技企业

T5 attempt

Exclusive analysis | truth about resume and interview

10. Nacos source code construction
随机推荐
Qt:qss custom qscrollbar instance
First line of code kotlin notes
Logstash backup tracks the data records reported
17K薪资要什么水平?来看看95后测试工程师的面试全过程…
【Proteus仿真】74HC154 四线转12线译码器组成的16路流水灯
如何成为一名高级数字 IC 设计工程师(1-2)Verilog 编码语法篇:Verilog 1995、2001、2005 标准
Qt:qss custom qradiobutton instance
Solution: jupyter notebook does not pop up the default browser
Static library vs shared library
VPP三层网络互联配置
php如何解决高并发问题
QT: QSS custom qtabwidget and qtabbar instances
What kind of living condition is a tester with a monthly salary of more than 10000?
Inexplicable problems in the nesting of constraintlayout and relativelayout
今晚要修稿子準備發佈。但是,仍卡在這裡,也許你需要的是一個段子。
How did I grow up in the past eight years as a test engineer of meituan? I hope technicians can gain something after reading it
2022 pinduogai 100000 sales tutorial
Google Earth Engine(GEE)——GHSL 全球人口网格数据集250米分辨率
行业唯一!法大大电子合同上榜36氪硬核科技企业
The role and necessity of implementing serializable interface