⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 proc-interface

📁 I2C总线LINUX驱动程序
💻
字号:
i2c-core is the core i2c module (surprise!) which offers general routines onwhich other modules build. You will find that all i2c-related modules dependon this module, so it will (need to) be loaded whenever another i2c-related module is loaded. Seen from the outside, the most interesting is the /proc interface. Note that there is no corresponding sysctl interface!/proc/bus/i2c=============Whenever i2c-core is loaded, you will find a file /proc/bus/i2c, which listsall currently registered I2C adapters. Each line contains exactly oneI2C adapter. Each line has the following format: "i2c-%d\t%9s\t%-32s't%-32s\n",which works out to four columns separated by tabs. Note that the filewill be empty, if no adapters are registered at all.Adapters are numbered from 0 upwards. The first column contains the numberof the adapter, for example "i2c-4" for adapter 4. The name listed is alsothe name of the /proc file which lists all devices attached to it, andof the /dev file which corresponds to this adapter.The second column documents what kind of adapter this is. Some adaptersunderstand the full I2C protocol, others only a subset called SMBus,and yet others are some kind of pseudo-adapters that do not understandi2c at all. Possible values in here are "i2c", "smbus", "i2c/smbus"and "dummy". Because the SMBus protocol can be fully emulated by i2cadapters, if you see "i2c" here, SMBus is supported too. There maybe some future adapters which support both specific SMBus commands andgeneral I2C, and they will display "i2c/smbus".The third and fourth column are respectively the algorithm and adaptername of this adapter. Each adapter is associated with an algorithm,and several adapters can share the same algorithm. The combination ofalgorithm name and adapter name should be unique for an adapter, butyou can't really count on that yet./proc/bus/i2c-*===============Each registered adapter gets its own file in /proc/bus/, which liststhe devices registered to the adapter. Each line in such a file containsone registered device. Each line has the following format:"%02x\t%-32s\t%-32s\n", which works out to three columns separated bytabs. Note that this file can be empty, if no devices are found on the adapter.The first column contains the (hexadecimal) address of the client. As only 7-bit addresses are supported at this moment, two digits areenough. The second and third column are respectively the client name and thedriver name of this client. Each client is associated with a driver,and several clients can share the same driver.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -