当前位置:网站首页>基于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、代码框架
待补充
边栏推荐
- 字节跳动大裁员,测试工程师差点遭团灭:大厂招人背后的套路,有多可怕?
- The role and necessity of implementing serializable interface
- Stack, monotone stack, queue, monotone queue
- Imread change image display size
- 公司测试部门来了个00后卷王之王,老油条感叹真干不过,但是...
- QT: QSS custom qtabwidget and qtabbar instances
- 如何让让别人畏惧你
- 项目管理精华读书笔记(七)
- Qt:qss custom qmenubar instance
- Kotlin's use of the no Arg compiler plug-in in gradle
猜你喜欢

"Core values of testing" and "super complete learning guide for 0 basic software testing" summarized by test engineers for 8 years

Clion debug

反正切熵(Arctangent entropy):2022.7月最新SCI论文

What are the strengths of "testers"?

Unity移动端游戏性能优化简谱之 画面表现与GPU压力的权衡
![[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](/img/e0/c2b1fbe99939d44201401abf1b5a72.png)
[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

Résumé des questions d'entrevue (2) Modèle io, ensemble, principe NiO, pénétration du cache, avalanche de rupture

Hal - General

12. Nacos server service registration of source code analysis of Nacos service registration

如何清理v$rman_backup_job_details视图 报错ORA-02030
随机推荐
2022 pinduogai 100000 sales tutorial
进程与线程
Typescript learning summary
【Proteus仿真】74HC154 四线转12线译码器组成的16路流水灯
Stack, monotone stack, queue, monotone queue
8年测试工程师总结出来的《测试核心价值》与《0基础转行软件测试超全学习指南》
Game test related tests a hero's skills (spring moves are asked more questions)
"Core values of testing" and "super complete learning guide for 0 basic software testing" summarized by test engineers for 8 years
Using activity to realize a simple inputable dialog box
Unity移动端游戏性能优化简谱之 画面表现与GPU压力的权衡
My understanding of testing (summarized by senior testers)
How can UI automated testing get out of trouble? How to embody the value?
Google Earth Engine(GEE)——当我们前后影像来弥补插值效果得时候,没有效果怎么办?
I have been doing software testing for three years, and my salary is less than 20K. Today, I put forward my resignation
帝国cms 无缩略图 灵动标签(e:loop)判断有无标题图片(titlepic)的两种写法
表空间创建管理及控制文件管理
大厂技术专家:工程师如何提升沟通能力?
如何让让别人畏惧你
搭建ADG后,实例2无法启动 ORA-29760: instance_number parameter not specified
IIS修改配置信息后不生效