Hi!
I’d like to use DB410c’s i2c controller to read/write the i2c device registers of the OV5645s of this adapter:
https://www.ebay.com/itm/96Boards-MIPI-Adapter-with-Dual-OV5645/253645902432?
Using i2cdetect I’ve got the following results:
linaro@linaro-developer:~$ sudo i2cdetect -l
i2c-3 i2c QUP i2c adapter i2c adapter
i2c-1 i2c QUP i2c adapter i2c adapter
i2c-4 i2c Qualcomm Camera Control Interface i2c adapter
i2c-0 i2c QUP i2c adapter i2c adapter
linaro@linaro-developer:~$ sudo i2cdetect -F 4
Functionalities implemented by /dev/i2c-4:
i2c yes
SMBus Quick Command no
SMBus Send Byte no
SMBus Receive Byte no
SMBus Write Byte no
SMBus Read Byte no
SMBus Write Word no
SMBus Read Word no
SMBus Process Call no
SMBus Block Write no
SMBus Block Read no
SMBus Block Process Call no
SMBus PEC no
i2c Block Write no
i2c Block Read no
According to the following information from the boot message:
[ 11.685499] ov5645 4-003b: OV5645 detected at address 0x3b
:
[ 12.048161] ov5645 4-003a: OV5645 detected at address 0x3a
I assume the i2c device addresses of these OV5645 are 0x3a & 0x3b.
To ensure I can actually access each of the OV5645, I tried to read the SENSOR CHIP HIGH ID BYTE located at address 0x300A. So I experimented to send the following commands:
linaro@linaro-developer:~$ sudo i2cget -y 4 0x3a 0x30 0x0a
Error: Invalid mode!
Usage: i2cget [-f] [-y] [-a] i2cBUS CHIP-ADDRESS [DATA-ADDRESS [MODE]]
i2cBUS is an integer or an i2c bus name
ADDRESS is an integer (0x03 - 0x77, or 0x00 - 0x7f if -a is given)
MODE is one of:
b (read byte data, default)
w (read word data)
c (write byte/read byte)
Append p for SMBus PEC
As the address of OV5645’s register is 16-bit, I tried to add a trailing ‘w’ but doesn’t help, either:
linaro@linaro-developer:~$ sudo i2cget -y 4 0x3b 0x30 0x0a w
Error: Invalid mode!
Usage: i2cget [-f] [-y] [-a] i2cBUS CHIP-ADDRESS [DATA-ADDRESS [MODE]]
i2cBUS is an integer or an i2c bus name
ADDRESS is an integer (0x03 - 0x77, or 0x00 - 0x7f if -a is given)
MODE is one of:
b (read byte data, default)
w (read word data)
c (write byte/read byte)
Append p for SMBus PEC
None of them worked.
I’m wondering how I can access OV5645’s reister, no matter using i2c-tools(i2cget, i2cset,…), Python, C/C++?