当前位置:网站首页>基于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、代码框架
待补充
边栏推荐
- Oracle收回权限 & 创建角色
- What is the salary level of 17k? Let's take a look at the whole interview process of post-95 Test Engineers
- QT: QSS custom qtoolbar and qtoolbox instances
- QT: QSS custom qsplitter instance
- Qt:qss custom QSlider instance
- QT: QSS custom qtabwidget and qtabbar instances
- Communication software development and Application
- Comment réaliser des tests automatisés pour les tests logiciels embarqués?
- 触摸与屏幕自动旋转调试
- Is pinduogai's sales safe in 2022?
猜你喜欢

. Net core - a queuing system for wechat official account
The normal one inch is 25.4 cm, and the image field is 16 cm

I have been doing software testing for three years, and my salary is less than 20K. Today, I put forward my resignation

Encapsulation attempt of network request framework of retro + kotlin + MVVM

Multiple IO transfer - preamble

如何清理v$rman_backup_job_details视图 报错ORA-02030

Do you really need automated testing?

Cause: org. apache. ibatis. builder. Builderexception: error parsing SQL mapper configuration problem analysis

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

公司测试部门来了个00后卷王之王,老油条感叹真干不过,但是...
随机推荐
如何让让别人畏惧你
Static library vs shared library
Do you really need automated testing?
封装一个koa分布式锁中间件来解决幂等或重复请求的问题
ExecutorException: Statement returned more than one row, where no more than one was expected.
php如何解决高并发问题
在职美团测试工程师的这八年,我是如何成长的,愿技术人看完都有收获
Matlab memory variable management command
Unique in the industry! Fada electronic contract is on the list of 36 krypton hard core technology enterprises
Internet Socket (非)阻塞write/read n个字节
11. Provider service registration of Nacos service registration source code analysis
Exclusive analysis | truth about resume and interview
Lecture 1 number field
【obs】封装obs实现采集的基础流程
项目管理精华读书笔记(七)
表空间创建管理及控制文件管理
(二)进制
Project management essence reading notes (6)
Qt:qss custom QSlider instance
Qt:qss custom qmenubar instance