当前位置:网站首页>基于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、代码框架
待补充
边栏推荐
- 高精度室内定位技术,在智慧工厂安全管理的应用
- In the middle of the year, I have prepared a small number of automated interview questions. Welcome to the self-test
- Software testing redis database
- The highest monthly salary of 18K has a good "mentality and choice", and success is poor "seriousness and persistence"~
- Differences among norm, normalize and normalized in eigen
- Project management essence reading notes (6)
- Using activity to realize a simple inputable dialog box
- Hard goods | write all the codes as soon as you change the test steps? Why not try yaml to realize data-driven?
- 栈,单调栈,队列,单调队列
- [true question of the Blue Bridge Cup trials 44] scratch eliminate the skeleton Legion children programming explanation of the true question of the Blue Bridge Cup trials
猜你喜欢

8年测试总监的行业思考,看完后测试思维认知更深刻

2021 reading summary (continuously updating)

面试题总结(2) IO模型,集合,NIO 原理,缓存穿透,击穿雪崩

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

Software testing e-commerce projects that can be written into your resume, don't you come in and get it?

Stack, monotone stack, queue, monotone queue

Summary of interview questions (2) IO model, set, NiO principle, cache penetration, breakdown avalanche

字节跳动大裁员,测试工程师差点遭团灭:大厂招人背后的套路,有多可怕?

英特尔13代酷睿旗舰曝光,单核5.5GHz

Qt:qss custom qpprogressbar instance
随机推荐
Crawl with requests
Hard goods | write all the codes as soon as you change the test steps? Why not try yaml to realize data-driven?
My understanding of testing (summarized by senior testers)
Expandablelistview that can expand and shrink (imitating the list page of professional selection of Zhilian recruitment)
12. Nacos server service registration of source code analysis of Nacos service registration
What are the strengths of "testers"?
QT: QSS custom qtableview instance
Unique in the industry! Fada electronic contract is on the list of 36 krypton hard core technology enterprises
QT: QSS custom qsplitter instance
Overview of testing theory
2021 postgraduate entrance examination mathematics 2 linear algebra
2022-07-02: what is the output of the following go language code? A: Compilation error; B:Panic; C:NaN。 package main import “fmt“ func mai
有赞CTO崔玉松:有赞Jarvis核心目标是使产品变得更加聪明和可靠
I, a tester from a large factory, went to a state-owned enterprise with a 50% pay cut. I regret it
File upload and download test point
2021 reading summary (continuously updating)
面試題總結(2) IO模型,集合,NIO 原理,緩存穿透,擊穿雪崩
Lecture 1 number field
Error installing the specified version of pilot
AIDL