using i2c-imx.c driver in imx7 Sabre

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

using i2c-imx.c driver in imx7 Sabre

1,588 Views
econote_vikrant
Contributor III

Greetings!

I'm interfacing EMR sensor with imx7 sabre board.
I have installed Yocto built Linux 4.9.88, now I'm trying to interface my device using .c programming. But I'm not getting any reference how to write a program in which I can generate Start condition, Stop condition, read Ack and read Data Byte, so that I can read x and y coordinate measured in the sensor.

I don't know how to use i2c-imx.c driver to execute a simple program, it will be great if anyone explains me step by step process. However, i2c-imx.c was missing in my kernel so I added it from an external source.

Labels (3)
0 Kudos
3 Replies

1,022 Views
igorpadykov
NXP Employee
NXP Employee

Hi Vikrant

description of linux i2c driver can be found in sect.4.7 Inter-IC (I2C)

attached Linux Manual, more documentation can be found on

i.MX Software|NXP 

May be more simple to test i2c with freertos examples:

i.MX 7Dual/Solo FreeRTOS BSP for Cortex-M4

https://www.nxp.com/webapp/Download?colCode=FreeRTOS_iMX7D_1.0.1_WIN&appType=license&location=null&P... 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,022 Views
econote_vikrant
Contributor III

Hello Igor,
 I tried to execute user space application in the .c file for i2c interfacing, but I'm still not getting how to use i2c-imx.c driver file in my .c file in which I need to read sensor data for all available byte addresses.
Expecting the reply soon!

0 Kudos

1,022 Views
econote_vikrant
Contributor III

Hi Igor,
Thanks for valuable reply, but I already read description of linux i2c driver from Linux Ref. Manual.

I want to know how to use /drivers/i2c/busses/ i2c-lp-imx.c file, like compile or build .ko file.
Can you please tell me the process of doing so?

I am using Yocto built Linux 4.9.88 cause I need to connect EPD also.But still I will try with FreeRTOS BSP

0 Kudos