cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
fpgaeng
Visitor
Visitor
237 Views
Registered: ‎07-17-2019

i2c cadence driver - multi slave

Hello, 

I don't have experience in Petalinux. I have Zynq ultrascale+ board and I want to use i2c on MIO40 and MIO41 pins. In the Vivado project I configured i2c on these pins. I want to have 4 slaves peripheral with address 0x49, 0x6d, 0x50, 0x19. Could someone help me with how to do it? I want to use the i2c cadence driver. 

All the best.

0 Kudos
1 Reply
ksloatdesignlinx
Explorer
Explorer
178 Views
Registered: ‎02-24-2020

If you want to use directly through the userspace, you'll simply use the i2c-dev character device driver from Linux. There is a package of tools called "i2c-tools" as well that you can add to your PetaLinux image that makes it super easy to use this interface directly from the terminal.

https://www.kernel.org/doc/Documentation/i2c/dev-interface

https://www.abelectronics.co.uk/kb/article/1092/i2c-part-3---i-c-tools-in-linux#:~:text=Available%20Commands%20in%20I2C%20Tools&text=i2cdump%20Examine%20and%20read%20I2C,transfer%20to%20a%20connected%20device.

 

If you want to use devices via their own kernel space device drivers (either existing drivers or you want to write your own), then you will need to add the individual devices as device tree children nodes of the i2c instance node you want to use.

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842160/Cadence+I2C+Driver

Ken Sloat - Embedded Software Engineer
https://www.designlinxhs.com
0 Kudos