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.

I2C, SPI drivers?

Other Parts Discussed in Thread: 66AK2L06

Not sure if this belongs here or in the Sys/Bios forum, so please excuse me if I am posting in the wrong place.

We are starting new development on the 66AK2L06 with Sys/Bios on the C66x.  We will need to use I2C and SPI interfaces.  I'd rather not reinvent wheel here, but I can't find any drivers for Initialization and the Read/Write from these devices.  Hopefully I am just not looking in the right places.  So, if they exist, could someone please point me to them?  If not, then I guess I get the data sheet out and start writing code.

We will also have a Linux based process running on the ARMs. It has been discussed that since the peripherals are a shared resource, we could potentially use the ARMs running Linux to setup the I2C and SPI then have the DSP do the Read/Writes.  That seems complicated to me, so for now I'd like to avoid that route if possible.

  • Hi,
    You can get SPI and I2C drivers in the following MCSDK installed location.

    C:\ti\pdk_keystone2_3_01_03_06\packages\ti\platform\evmk2l\platform_lib\src

    evm66x_i2c.c
    evmc66x_spi.c

    Latest MCSDK:

    C:\ti\pdk_keystone2_3_01_04_07\packages\ti\platform\evmk2l\platform_lib\src
  • As Titus mentioned above, you can refer the platform lib source from PDK(part of MCSDK 3.x). These source files are developed and tested on K2L EVM's.

    Please find the latest MCSDK 3.x and user guide link below my signature. Thank you.
  • Thanks for pointing out the newer version of the MSDSK than I had. I now have the latest version.

    However, in the evm66x_i2c.c file I only see one function evmI2CInit(). I'm pretty sure there is more to setting up and using the I2C than is offered by the one function. Also, there are no read or write functions. Maybe what I want is in the CSL library someplace?

    Looking at the evmc66x_spi.c now that is a much more complete set of functions that should either do what I need or at least provide a great starting point.
  • Just noticed the file evmc66x_i2c_eeprom.c. That will get me pretty close. Still kind of surprised there are not more generic driver type functions available.
  • Hi,
    You can find the CSL layer which is more generic for development.

    PATH: ~\ti\pdk_keystone2_3_01_04_07\packages\ti\csl

    Files: cslr_i2c.h, cslr_spi.h

    As I mentioned earlier, platform files are more specific to EVM's. You can refer them to update according to your design.

    Thank you.
  • So, those cslr_ files are just register definitions. I guess I was hoping for some functions like,

    CSL_I2C_Initialize(port, interrupt,...)
    CSL_I2C_Read(handle)
    CSL_I2C_Write(handle, data)

    Time to start writing some low level drivers I guess.
  • Hi ,
    No. We do not have such functions/APIs for SPI & I2C as these peripherals are used for boot purpose(mostly).
    The platform lib directory also has the functions to enable SPI NOR, I2C EEPROM to store boot loaders on EVM's.

    Thank you.
  • Christopher,
    Please install the latest MCSDK 2.x from the link below my signature. Please go through the IBL source for the low level drivers for i2c and spi which may help to save your time in development.

    PATH: ~\ti\mcsdk_2_00_xx_xx\tools\boot_loader\ibl\src\hw\

    Thank you.