我正在将I2C驱动程序移植到Linux-4上。该设备同时为不同功能提供多个I2C地址。
例如:
address 0xAA is for access of SPI flash.
address 0xA0 is for access of EEPROM.
address 0x60 is for normal access (control purpose).
是否可以在单个I2C设备驱动程序中支持对不同I2C地址的访问?
感谢您的帮助,谢谢
我在i2c线路上将一个硬件连接到一个嵌入式linux板上。我可以在/dev/i2c-1上看到这个设备
filename = "/dev/i2c-1"
filehandle = open(filename,O_RDWR);
write(filehandle, <buffer to be written>, <number of Bytes>)
(similiarly for read = read(filehandle, <buffer to be read in an array>, <number of
查看,我确实看到I2C的一个实例使用var名称i2c_bus传入,以创建PCA9685类的一个实例。i2c_bus变量用于创建I2CDevice ()的实例。但后来我迷路了。在某个时候,这个PWM驱动程序应该调用I2CDevice类的I2CDevice。但这从来没有发生过!(FAFAIK)我还检查了PWMChannel类和PCAChannels类,但它们都没有执行与i2c相关的操作。然后我检查了文件并看到了以下代码:
# Set the PWM duty cycle for channel zero to 50%. duty_cycle is 16 bits to match other PW