Altera_Forum
Honored Contributor
20 years agoProblem about i2c driver and test
I add opencore i2c to Nios II, and tested by i2ctools under uClinux( Microtronix nios2linux 1.4)
1. 3 chips in /dev/i2c-0 _________ typical read (they are different) EEPROM_: S Addr Wr [A] Reg_addr [A]______________S Addr Rd [A] [Data] A.......[Data] NA P FRAM___: S Addr Wr [A] Reg_addr_H [A] Reg_addr_L [A] S Addr Rd [A] [Data] A.......[Data] NA P Realtime : S Addr Rd [A] _____________________________________[Data] A.......[Data] NA P 2. Here is the result of i2cdetect 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: XX XX XX XX XX XX XX XX XX XX XX XX XX 10: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX 20: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX 30: 30 31 32 33 34 35 36 37 XX XX XX XX XX XX XX XX 40: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX 50: 50 51 XX XX XX XX XX XX XX XX XX XX XX XX XX XX 60: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX 70: XX XX XX XX XX XX XX XX which indicates the adress of them correctly: EEPROM : 50 FRAM : 51 Realtimer : 30---37 3. problem 3.1 I see only "ioctl" in i2ctools. Could I using "read" "write" method? (As the compiler tells me errors in :#include <linux/i2c.h># include <linux/i2c-dev.h> 3.2 How can I access 3-different types of i2c chips via oc-i2c drivers?