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.

RTOS/TM4C1294NCPDT: GPIO function calls in Tiva C series EVK

Part Number: TM4C1294NCPDT

Tool/software: TI-RTOS

Hi,

I can find the below function in GPIO driver calls,

void GPIO_setConfig(unsigned int index, GPIO_PinConfig pinConfig)

void GPIO_toggle(unsigned int index)

Question:

1. What actually should be passed for index and pinconfig arguments?

2.Steps to configure a pin as GPIO and toggle the pin? for PORT F Pin 1?

Regards,

Manohar

  • Hello Manohar,

    For starters, have you looked through the TI RTOS Driver API's? You can find the document link for them in [Install Path]\tirtos_tivac_2_16_00_08\docs - look for Documentation_Overview_tivac.html

    In general, the index should be the Pin you are trying to configure, and PinConfig should be the settings for it. The PinConfig input should be based on the #define's in GPIO.h which start with "GPIO_CFG_"
  • Hi,
    I am still not aware of what is the argument called index, that have to be passed in every GPIO function calls.
    Whether it is a PORT base address? If it is a Pin number? what exactly should I give ?
    Example for PA3 to configure as output pin, I should give index as 3 or Microcontroller pin number 36?

    What exactly should I pass in GPIO index?




    Regards,
    Manohar.
  • Hello Manohar,

    I am not really ramped on the TI-RTOS side of Tiva yet so for the immediate moment I encourage you to look at existing examples and the documentation to see if you can find some more clarity. Another useful document may be: http://www.ti.com/lit/ug/spruhd4m/spruhd4m.pdf I will see if some more knowledge about the workings of TI-RTOS can explain what you need to do in a more layman manner than my initial attempt.

    Also consider looking into: https://training.ti.com/ti-rtos-workshop-series

    Robert - FYI the API calls listed by Manohar are for TI-RTOS supporting Tiva-C, not TivaWare, so that link won't provide any useful info when comparing it against what needs to be done for TI-RTOS.

  • The index argument to the GPIO APIs is the index into the GPIO_PinConfig array that defines the configuration of the particular GPIO pin to be operated on by the API. Each element in the array contains pin ID and configuration information to help the GPIO driver manage the pin.

    Alan