This is a cache of https://discuss.96boards.org/t/i2c-programming-using-cross-compile-tool-chain/2658. It is a snapshot of the page at 2024-09-19T06:29:35.771+0000.
<strong>i2c</strong> programming using cross compile tool-chain - DragonBoard410c - 96Boards Forum

i2c programming using cross compile tool-chain

Hi guys!

I received my DragonBoard410C a few days ago, following the guide LinuxUserGuide I installed Linux and also programmed the 3 applications successfully. At the moment I know how to use the user LEDs and the GPIOs.

Now I would like to use the i2c. Where I can find documentation to make a program for i2c peripheral in the same way (programming in a host PC with my IDE and the cross compile tool-chain) as I did for LED and GPIOs? I mean, I would like to understand the files of the different peripherals (allocated in /sys/class) in order to create programs for interface with SPI, i2c, etc… devices

I have taken a look at the Qualcomm document: Peripherals Programming Guide Linux Android from the developer Qualcomm web page. But i find it’s a different way of programming these peripherals. Am I right?

So I would find so helpful documentation explaining how to use the low-speed port SPI, i2c, UART, etc…

Thank you so much guys!

Hi,

You want to create a user-space i2c device driver.
Kernel exposes i2c adapters/devices to user via device files in /dev/i2c-*.

The first step is to have a look at https://www.kernel.org/doc/Documentation/i2c/dev-interface

1 Like

Thank you @Loic, that’s exactly what I need! I’m totally new with Linux, and I don’t have so much of the needed concepts (I have just bought “Embedded Linux primer” and I hope this book helps me), but now, referring to questions like this, I know where I can get the info → Index of /doc/Documentation/.

I prefer to keep the post opened in case I had any doubt more related to this question.