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.

LAUNCHXL-CC26X2R1: Pins

Part Number: LAUNCHXL-CC26X2R1
Other Parts Discussed in Thread: SYSCONFIG

Hi TI,

 I want a Command to set output high for multiple pins.

Explaination of my case.

I have configured 5 LEDs. Using a constraint X.

If X=0 i want to 1 LED high

If X=20  , 2 LEDs high

If X=40 , 3 LEDs high

If X=60 , 4 LEDs high

If X=100 , 5 LEDs high

My requirement is command for setting multiple LEDs which are configured using GPIO pins high at a time.

  • Hi,

    There is no command to set multiple GPIOs simultaneously. However, your use case can be addressed by calling 5 times the GPIO_write() function. 

    Make sure to use SysConfig to add the GPIOs you need. Then you can use code similar to the one below.

    GPIO_write(CONFIG_GPIO_LED_0, CONFIG_GPIO_LED_OFF);
    GPIO_write(CONFIG_GPIO_LED_1, CONFIG_GPIO_LED_OFF);
    GPIO_write(CONFIG_GPIO_LED_2, CONFIG_GPIO_LED_OFF);
    GPIO_write(CONFIG_GPIO_LED_3, CONFIG_GPIO_LED_OFF);
    GPIO_write(CONFIG_GPIO_LED_4, CONFIG_GPIO_LED_OFF);
    
    switch (X)
    {
      case 100:
          GPIO_write(CONFIG_GPIO_LED_4, CONFIG_GPIO_LED_ON);
      case 60:
          GPIO_write(CONFIG_GPIO_LED_3, CONFIG_GPIO_LED_ON);
      case 40:
          GPIO_write(CONFIG_GPIO_LED_2, CONFIG_GPIO_LED_ON);
      case 20:
          GPIO_write(CONFIG_GPIO_LED_1, CONFIG_GPIO_LED_ON);
      case 0:
          GPIO_write(CONFIG_GPIO_LED_0, CONFIG_GPIO_LED_ON);
    }

    I hope this will help,

    Best regards,

  • Hi Manikanth,

    The GPIO TI Driver will only set one GPIO per command, but you can use the Driverlib GPIO to write multiple GPIO with one command (i.e. GPIO_writeMultiDio).

    Regards,
    Ryan