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/CC2640R2F: CC2640R2

Part Number: CC2640R2F

Tool/software: TI-RTOS

Hi,

Today I started meddling with the CC26040R2-LAUNCHXL and have been having difficulty in understanding how the GPIO_setConfig() API works.

I ran the empty project which seems to blink the onboard red LED connected to the DIO6. For this, the below is what was done

void *mainThread(void *arg0)
{
    /* 1 second delay */
    uint32_t time = 1;

    /* Call driver init functions */
    GPIO_init();

    /* Configure the LED pin */
    GPIO_setConfig(Board_GPIO_LED0, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW);

    /* Turn on user LED */
    GPIO_write(Board_GPIO_LED0, Board_GPIO_LED_ON);

    while (1) {
        sleep(time);
        GPIO_toggle(Board_GPIO_LED0);
    }
}

In the above code. Board_GPIO_LED0 correlates to the below:

#define Board_GPIO_LED0         CC2640R2_LAUNCHXL_GPIO_LED_RED

And again, the CC2640R2_LAUNCHXL_GPIO_LED_RED correlates to the below in the CC2640R2_LAUNCHXL.h:

/*!
 *  @def    CC2640R2_LAUNCHXL_GPIOName
 *  @brief  Enum of GPIO names
 */
typedef enum CC2640R2_LAUNCHXL_GPIOName {
    CC2640R2_LAUNCHXL_GPIO_S1 = 0,
    CC2640R2_LAUNCHXL_GPIO_S2,
    CC2640R2_LAUNCHXL_SPI_MASTER_READY,
    CC2640R2_LAUNCHXL_SPI_SLAVE_READY,
    CC2640R2_LAUNCHXL_GPIO_LED_GREEN,
    CC2640R2_LAUNCHXL_GPIO_LED_RED,
    CC2640R2_LAUNCHXL_GPIO_SPI_FLASH_CS,
    CC2640R2_LAUNCHXL_SDSPI_CS,
    CC2640R2_LAUNCHXL_GPIO_LCD_CS,
    CC2640R2_LAUNCHXL_GPIO_LCD_POWER,
    CC2640R2_LAUNCHXL_GPIO_LCD_ENABLE,
    CC2640R2_LAUNCHXL_GPIOCOUNT
} CC2640R2_LAUNCHXL_GPIOName;

So basically, we are passing a number 5(CC2640R2_LAUNCHXL_GPIO_LED_RED) as index to the GPIO_setConfig() API. So my question is, how does the number 5 correlate to address of the pin DIO6? And how does the index correlate to the MUC port and pin addresses?.

Also, I noticed another weird thing, passing an index value of 0 to the GPIO_setConfig() gives me access to controlling the DIO13. How is this possible? Also, is there any API reference guide available to understand how to use these API's?