Open satya-prakash-7 opened 2 years ago
Answer: smbus2 is just a wrapper for i2c and SMBus support in the kernel. Hence, 16 bit addressing is not possible as per the definition of i2c_smbus_ioctl_data struct in the kernel.
Hello,
Is there a way to use this library to interface a 32-bit armhf machine w/ a PCA9685 at a specific i2c address?
Seth
P.S. If I need to start a new thread/post, please let me know. The reason I am asking is b/c of the PCA9685 being on a i2c controlled daughter card on my particular board. I see on line 302 in the smbus2.py file, there is a call to handle i2c-{} (which is any i2c device in /dev/). I am having a complication b/c of a compatibility layer
from the BSP people. /dev/bone/i2c/2
is the file I am currently trying to handle.
Sorry for the interruption in this post. Yes, this PCA9685 chip on the daughter card for the SBC in question works w/ smbus2. Phew!
I'm trying to connect my energy measurement IC with Raspberry Pi 3B using the I2C protocol. I'm using
sudo i2cdetect -y 1
to detect the connected devices and it is correctly showing the address(7-bits) of the connected IC. The IC contains various registers of 8,16,24 and 32-bits. The register addresses are 16-bits long and I'm using the following code to access a register0x021C(24-bits)
and write registers0xFE(8-bit) and 0x0120(16-bit)
.Python Code
The output should be
[0x8D,0xXX,0xXX]
but the code is producing output as[0,0,0]