简体   繁体   English

ArchLinux上的I2C用户空间通信

[英]I2C userspace communication on ArchLinux

I am trying to implement an application that will allow me to access the i2c bus from the user space similar to this https://www.kernel.org/doc/Documentation/i2c/dev-interface . 我正在尝试实现一个应用程序,该应用程序将允许我从类似于https://www.kernel.org/doc/Documentation/i2c/dev-interface的用户空间访问i2c总线。 Here it is stated that using smbus commands is preferred over using simple i2c read /write .Could someone please help me with why is this the case. 这里说使用smbus命令比使用简单的i2c读/写更可取。请问有人为什么会出现这种情况。

Also to use smbus commands ,I got away with simply including these files in my header https://fossies.org/linux/i2c-tools/lib/smbus.c 同样使用smbus命令,我只是简单地将这些文件包含在标题https://fossies.org/linux/i2c-tools/lib/smbus.c中
and https://fossies.org/linux/i2c-tools/include/i2c/smbus.h https://fossies.org/linux/i2c-tools/include/i2c/smbus.h

as SMBus functions are no longer defined in "linux/i2c-dev.h". 因为SMBus函数不再在“ linux / i2c-dev.h”中定义。

Reference : https://github.com/hallard/ArduiPi_OLED/issues/15 . 参考: https : //github.com/hallard/ArduiPi_OLED/issues/15
Is there a better way of achieving this functionality ? 有没有更好的方法来实现此功能?
Also why have the SMBus methods have been removed from "linux/i2c-dev.h" 同样为什么从“ linux / i2c-dev.h”中删除了SMBus方法

http://www.ti.com/lit/an/sloa132/sloa132.pdf http://www.ti.com/lit/an/sloa132/sloa132.pdf

The biggest disadvantage of using SMBus over I2C directly is the speed, the SMBus supports only up to 100KHz and if you use the I2C directly it can do up to 2MHz. 直接使用I2C而不是I2C的最大缺点是速度,SMBus仅支持高达100KHz的频率,如果直接使用I2C,则可以达到2MHz。

Had the same task on RedHat, at the end I switched to I2C and all went good. 在RedHat上完成了相同的任务,最后我切换到了I2C,一切都变好了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM