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.

How to use TI RTOS I2C?

I have a TM4C processor and I have been able to link in the SYS BIOS RTOS and use various peripherals. Now I want to use I2C. I looked at a TM4C123 example and copied the params_init and open routines. It compiles but won't link. It can't find the params_init and open routines.

I looked throughout the app.cfg file to find how to enable I2C but it says the drivers are always included.

In the documentation TI RTOS documentation (PDF) it says to put TIRTOS.useI2C = true; in the cfg file. If I do that, I get compile error because it does not kniow what TIRTOS is.

How do I get I2C include with the TI RTOS?

Thanks

  • Got further. I added the lines:
    var TIRTOS = xdc.useModule('ti.tirtos.TIRTOS');

    TIRTOS.supportsI2C = true;

    And that got rid of those linker errors but now it can't find I2C_config().
  • MaxPower said:
    And that got rid of those linker errors but now it can't find I2C_config().

    Looking at the example i2ctmp006_TivaTM4C1294NCPDT shows that the I2C_config array is defined in a file in the project. For this example I2C_config[] is defined in the EK_TM4C1294XL.c source file.

    Therefore, the I2C_config array needs to be defined in a source file in your project, which identifies the I2C ports and driver functions to be used by TI-RTOS.

  • Chester,

        Thank you for your response. I found that and added it to my project. I also added the init code from that file as well. Additionally, I had to include the semaphore module in app.cfg. However, on the call to open, it goes right to the exit function.

    I am getting closer. There is still a piece (or pieces) of code I am missing. I will keep digging into the example.

    Thanks

  • I got it working. I was missing a peripheral init for the port that contained the GPIO for the particular I2C peripheral I was using.

    Thanks for the help!