This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TWI use for davinci

Other Parts Discussed in Thread: TVP5146

Hello,

 

I have to interface an cmos  camera chip with Davinci and i want to know how can i use TWI  . As i have to make TWI write and TWI read functions. How to develop them . The sensor chip will act as slave.

 

waiting for reply.

 

Regards

 

chaps.

  • TWI (Two Wire Interface) is essentially the same as I2C; it is a name used by Amtel and other vendors due to trademark and licensing issues.  We do provide an I2C Linux driver for you to use, so no need to develop any driver for this.

    If you look at our V4L2 driver included with our DVSDK software ( at ../ti-davinci/drivers/media/video/davinci ), you will see examples of using I2C to talk to TVP5146 as well as MT9T001 CMOS sensor.  If you would like to use it from the user-space (not as common), we have APIs for doing that as well.

  • Yes , your absolutely correct TWI is nothing but i2c).I would like to use i2c from user space how can i use it  , is there some code example which show how to use it with cmos sensor as you ahve suggested.

    Regards

    chaps

     

  • First, I should say that any source code that directly accesses hardware should probrably be in the kernel space.  That said, user space is good for quickly prototyping software before you transfer to kernel space.  I am attaching s small program that shows you how to access i2c from user space via standardized Linux API (not a TI API).

     

    i2ctest.zip
  • hi,

    thanks for the same, what is difference between Ti api and this api.

     

    regards

     

    chaps

  • In many operating systems (e.g. windows, Linux....), there already exists standardized industry APIs for accessing common peripherals such as video, ethernet, USB...  The hardware vendors (e.g. TI) normally provide drivers that conform to these standarddized APIs; thereby allowing software developers (e.g. normally our customers) to simply write their programs to these APIs to ensure portability to other devices running that particular OS.

    That said, there are many standardized Linux APIs such as V4L2 (video capture and display), OSS (aduio), USB, I2C...  TI writes Linux drivers that conform to these APIs, but we do not define these APIs.  In a few ocassions where there is no Linux standard for a particular hardware feature (e.g. DaVinci Resizer hardware), we will create our own proprietary APIs and provide detailed documentation regarding these proprietary APIs.  We do not provide much documentation for standardized Linux APIs as these are not defined by TI and there is plenty of documentation available on the internet already.

    That said, I2C is a very common industry technology for which there are standardized APIs already.  TI has developed I2C drivers that conform to these standards and the program I sent simply shows you an example of how to use these standardized APIs.  There are no TI proprietary APIs for I2C.  Furthermore, since these are standardized APIs, you will likely find many additional exmaples by searching the Internet; this is why we do not provide examples ourselves in the DVSDK.

    I hope this helps clear things up.