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.

CC2652R: Trying to Understand the GPIO structures in example code

Part Number: CC2652R

Dear Support:

Currently I am using SDK v2.30, but my question is not specific to an SDK.  Seems to occur across all the CC26xx and CC13xx devices.  In the example projects for these devices there is this structure in the CC26X2R1_LAUNCHXL.C flle:

GPIO_PinConfig gpioPinConfigs[] = {
/* Input pins */
GPIOCC26XX_DIO_13 | GPIO_DO_NOT_CONFIG, /* Button 0 */
GPIOCC26XX_DIO_14 | GPIO_DO_NOT_CONFIG, /* Button 1 */

GPIOCC26XX_DIO_15 | GPIO_DO_NOT_CONFIG, /* CC26X2R1_LAUNCHXL_SPI_MASTER_READY */
GPIOCC26XX_DIO_21 | GPIO_DO_NOT_CONFIG, /* CC26X2R1_LAUNCHXL_SPI_SLAVE_READY */

/* Output pins */
GPIOCC26XX_DIO_07 | GPIO_DO_NOT_CONFIG, /* Green LED */
GPIOCC26XX_DIO_06 | GPIO_DO_NOT_CONFIG, /* Red LED */

/* SPI Flash CSN */
GPIOCC26XX_DIO_20 | GPIO_DO_NOT_CONFIG,

/* SD CS */
GPIOCC26XX_DIO_21 | GPIO_DO_NOT_CONFIG,

/* Sharp Display - GPIO configurations will be done in the Display files */
GPIOCC26XX_DIO_24 | GPIO_DO_NOT_CONFIG, /* SPI chip select */
GPIOCC26XX_DIO_22 | GPIO_DO_NOT_CONFIG, /* LCD power control */
GPIOCC26XX_DIO_23 | GPIO_DO_NOT_CONFIG, /*LCD enable */

};

Notice that there 11 entries in this structure.  Also in this same file, there is this structure:

const PIN_Config BoardGpioInitTable[] = {

CC26X2R1_LAUNCHXL_PIN_RLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
CC26X2R1_LAUNCHXL_PIN_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
CC26X2R1_LAUNCHXL_PIN_BTN1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
CC26X2R1_LAUNCHXL_PIN_BTN2 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
CC26X2R1_LAUNCHXL_SPI_FLASH_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MIN, /* External flash chip select */
CC26X2R1_LAUNCHXL_UART0_RX | PIN_INPUT_EN | PIN_PULLDOWN, /* UART RX via debugger back channel */
CC26X2R1_LAUNCHXL_UART0_TX | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL, /* UART TX via debugger back channel */
CC26X2R1_LAUNCHXL_SPI0_MOSI | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master out - slave in */
CC26X2R1_LAUNCHXL_SPI0_MISO | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master in - slave out */
CC26X2R1_LAUNCHXL_SPI0_CLK | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI clock */

PIN_TERMINATE
};

Notice that there are 10 entries.  So why do you have these 2 structures in this file with different numbers of entries in them?  It looks like you are using the 2nd structure and not the 1st.  And if that is the case, why do you have the 1st structure in this file since you are not using it, or are you?

And this is different from the way the CC322x guys define the GPIO pins - they use the 1st structure only and don't have this 2nd structure.  So why is that?  Why not use the same way of doing things across all devices?  I thought that was one of the objectives of the Simplelink architecture.  Please advise as to why the difference.

Thanks,
Tim