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.

CC2640R2F: SDK example echosinglechannel initialization code

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2642R,

Hi team,

Here's an issue from the customer may need your help:

From the perspective of board resource, ADC0 is input on DIO23 and ADC1 is input on DIO24:

Board_init() is executed first after entering main();

Board_init() also calls CC2640R2_LAUNCHXL_initGeneral();

In CC2640R2_LAUNCHXL_initGeneral(); execute Power_init(); then PIN_init();

1) What does Power_init() do?Initialize power supply related resources?But there seems to be processing of the clock again. If power management is not involved in the application, can it be called directly without modifying the content?

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
* ======== Power_init ========
*/
int_fast16_t Power_init()
{
ClockP_Params clockParams;
uint32_t ccfgLfClkSrc;
uint32_t timeout;
/* if this function has already been called, just return */
if (PowerCC26XX_module.initialized) {
return (Power_SOK);
}
#if defined(DeviceFamily_CC26X0R2)
/* check to see if the JTAG_PD is on, meaning the emulator was attached during boot and */
/* that the user is in an active debug session */
PowerCC26XX_module.emulatorAttached = (HWREG(AON_WUC_BASE + AON_WUC_O_PWRSTAT) & AON_WUC_PWRSTAT_JTAG_PD_ON) == AON_WUC_PWRSTAT_JTAG_PD_ON;
#endif
/* set module state field 'initialized' to true */
PowerCC26XX_module.initialized = true;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

2) The BoardGpioInitTable in PIN_init() does not mention ADC0 (DIO23) and ADC1 (DIO24), where is their initialization code?

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const PIN_Config BoardGpioInitTable[] = {
CC2640R2_LAUNCHXL_PIN_RLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
CC2640R2_LAUNCHXL_PIN_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
CC2640R2_LAUNCHXL_PIN_BTN1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
CC2640R2_LAUNCHXL_PIN_BTN2 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
CC2640R2_LAUNCHXL_SPI_FLASH_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MIN, /* External flash chip select */
CC2640R2_LAUNCHXL_UART_RX | PIN_INPUT_EN | PIN_PULLDOWN, /* UART RX via debugger back channel */
CC2640R2_LAUNCHXL_UART_TX | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL, /* UART TX via debugger back channel */
CC2640R2_LAUNCHXL_SPI0_MOSI | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master out - slave in */
CC2640R2_LAUNCHXL_SPI0_MISO | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master in - slave out */
CC2640R2_LAUNCHXL_SPI0_CLK | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI clock */
PIN_TERMINATE
};
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

3) Here defines the pins used by SPI0:

These pins are initialized here:

But how does IOID_8~IOID_11 map to the SPI0 peripheral?

4) The same PIN can map multiple functions such as digital IO, analogue input, etc. is there any docs on how to map it?

Could you help check this case? Thanks.

Best Regards,

Cherry

  • Hi Cherry,

    1) Power_init is a function that needs to be called at startup to initialize the Power Manager state.  It should not be modified.  https://dev.ti.com/tirex/explore/node?node=ABuWLDmlwjp5FCIoK75nTA__BSEc4rl__LATEST 

    2) Board_ADCx inside Board.h is defined as CC2640R2_LAUNCHXL_ADCx which exists on the CC2640R2_LAUNCHXL_ADCName and ADC_config tables in the CC2640R2_LAUNCHXL.c/h files, finally mapping to CC2640R2_LAUNCHXL_DIO2x_ANALOG in adcCC26xxHWAttrs as well.

    3) spiCC26XXDMAHWAttrs from CC2640R2_LAUNCHXL.c 

    4) It is not recommended to multiplex a pin for both analog and digital functionality during runtime.  Pin configurations are supported in the files provided.

    Regards,
    Ryan

  • Hi Ryan,

    Thanks for your support and basically all of the questions have been well resolved. 

    The customer is wondering since many of the initialization code in the program needs to be written by the user, do we have any s/w that can automatically configure the initialization code? 

    Thanks and regards,

    Cherry

  • They could migrate to the CC2642R and use SysConfig.

    Regards,
    Ryan

  • Hi Ryan,

    How to configure an IO as output?

    The sample code provided by the SDK has two functions PIN_Config and GPIO_PinConfig, and customer are not sure how to use these two functions. Could you please help provide a sample code that contains how to configure DIO0 as a GPIO output?

    Please let me know if this question is required to create a separate thread.

    Thanks and regards,

    Cherry

  • BoardGpioInitTable in CC2640R2_LAUNCHXL.c, you should make sure that IOID_0 is not already reserved elsewhere in CC2640R2_LAUNCHXL.h
    Regards,
    Ryan
  • Hi Ryan,

    The customer is configuring DIO0 in the demo item " empty " available in the SDK:

    The BoardGpioInitTable is configured as follows:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    const PIN_Config BoardGpioInitTable[] = {
    CC2640R2_LAUNCHXL_PIN_RLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
    CC2640R2_LAUNCHXL_PIN_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
    CC2640R2_LAUNCHXL_PIN_BTN1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
    CC2640R2_LAUNCHXL_PIN_BTN2 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
    CC2640R2_LAUNCHXL_SPI_FLASH_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MIN, /* External flash chip select */
    CC2640R2_LAUNCHXL_DIO0 |PIN_GPIO_OUTPUT_EN | PIN_PUSHPULL ,
    CC2640R2_LAUNCHXL_UART_RX | PIN_INPUT_EN | PIN_PULLDOWN, /* UART RX via debugger back channel */
    CC2640R2_LAUNCHXL_UART_TX | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL, /* UART TX via debugger back channel */
    CC2640R2_LAUNCHXL_SPI0_MOSI | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master out - slave in */
    CC2640R2_LAUNCHXL_SPI0_MISO | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master in - slave out */
    CC2640R2_LAUNCHXL_SPI0_CLK | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI clock */
    PIN_TERMINATE
    };
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Where the initialization of DIO0 has been added: 

        CC2640R2_LAUNCHXL_DIO0 |PIN_GPIO_OUTPUT_EN | PIN_PUSHPULL,

    Add the following code to empty.c, but DIO0 does not show a level change through the logic analyzer:

    Fullscreen
    1
    2
    3
    4
    GPIO_setConfig(Board_DIO0 , GPIO_CFG_OUT_STD );
    GPIO_write(Board_DIO0, 0);
    GPIO_write(Board_DIO0, 1);
    GPIO_write(Board_DIO0, 0);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    you should make sure that IOID_0 is not already reserved elsewhere in CC2640R2_LAUNCHXL.h

    It's hard for them to confirm this point.

    The customer still feel unclear to the GPIO initialization process. Although the SDK provides code, the programs that reference the SDK provide code to write do not work properly: the initialization and operation of DIO0 was written with reference to Board_GPIO_LED0, but Board_GPIO_LED0 worked properly, DIO0 didn't.

    Thanks and regards,

    Cherry

  • Did they call GPIO_init before the other GPIO functions?  They may have neglected to add the correct gpioPinConfigs entry as well.  They should consider adding PIN_GPIO_LOW to the BoardGpioInitTable's CC2640R2_LAUNCHXL_DIO0 entry and set GPIO_CFG_OUT_LOW in the GPIO_setConfig parameters.  They should also try to delay between GPIO_writes, attempt other unreserved DIOs to see whether there is any change in behavior, and confirm that their hardware does not short the connection.

    Regards,
    Ryan

  • Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    void *mainThread(void *arg0)
    {
    /* 1 second delay */
    uint32_t time = 1;
    /* Call driver init functions */
    GPIO_init();
    // I2C_init();
    SPI_init();
    UART_init();
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    const PIN_Config BoardGpioInitTable[] = {
    CC2640R2_LAUNCHXL_PIN_RLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
    CC2640R2_LAUNCHXL_PIN_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
    CC2640R2_LAUNCHXL_PIN_BTN1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
    CC2640R2_LAUNCHXL_PIN_BTN2 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
    CC2640R2_LAUNCHXL_SPI_FLASH_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MIN, /* External flash chip select */
    CC2640R2_LAUNCHXL_DIO0 |PIN_GPIO_OUTPUT_EN | PIN_PUSHPULL| PIN_GPIO_LOW ,
    CC2640R2_LAUNCHXL_UART_RX | PIN_INPUT_EN | PIN_PULLDOWN, /* UART RX via debugger back channel */
    CC2640R2_LAUNCHXL_UART_TX | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL, /* UART TX via debugger back channel */
    CC2640R2_LAUNCHXL_SPI0_MOSI | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master out - slave in */
    CC2640R2_LAUNCHXL_SPI0_MISO | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master in - slave out */
    CC2640R2_LAUNCHXL_SPI0_CLK | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI clock */
    PIN_TERMINATE
    };
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Fullscreen
    1
    GPIO_setConfig(Board_GPIO_LED0, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Still can't control DIO0

  • I need a simple DEMO to configure IO0 as output

  • Hi werwer,

    You can take the gpiointerrupt example, apply your change to BoardGpioInitTable, and add on to gpioPinConfigs:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    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, /* CC2640R2_LAUNCHXL_SPI_MASTER_READY */
    GPIOCC26XX_DIO_21 | GPIO_DO_NOT_CONFIG, /* CC2640R2_LAUNCHXL_SPI_SLAVE_READY */
    /* Output pins */
    GPIOCC26XX_DIO_07 | GPIO_DO_NOT_CONFIG, /* Green LED */
    GPIOCC26XX_DIO_06 | GPIO_DO_NOT_CONFIG, /* Red LED */
    GPIOCC26XX_DIO_30 | GPIO_DO_NOT_CONFIG, /* TMP116_EN */
    GPIOCC26XX_DIO_00 | GPIO_DO_NOT_CONFIG, // LINE ADDED
    /* SPI Flash CSN */
    GPIOCC26XX_DIO_20 | GPIO_DO_NOT_CONFIG,
    /* SD CS */
    GPIOCC26XX_DIO_21 | GPIO_DO_NOT_CONFIG,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    You should then be able to use GPIO_setConfig and GPIO_write for Board_DIO0 instead of Board_GPIO_LED0.  Be sure to remove any I2S code or move the definition of CC2640R2_LAUNCHXL_I2S_ADO away from IOID_0 inside CC2640R2_LAUNCHXL.h 

    Regards,
    Ryan

  • Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    const PIN_Config BoardGpioInitTable[] = {
    CC2640R2_LAUNCHXL_PIN_RLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
    CC2640R2_LAUNCHXL_PIN_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
    CC2640R2_LAUNCHXL_PIN_BTN1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
    CC2640R2_LAUNCHXL_PIN_BTN2 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
    CC2640R2_LAUNCHXL_SPI_FLASH_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MIN, /* External flash chip select */
    CC2640R2_LAUNCHXL_DIO0 |PIN_GPIO_OUTPUT_EN | PIN_PUSHPULL| PIN_GPIO_LOW ,
    CC2640R2_LAUNCHXL_UART_RX | PIN_INPUT_EN | PIN_PULLDOWN, /* UART RX via debugger back channel */
    CC2640R2_LAUNCHXL_UART_TX | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL, /* UART TX via debugger back channel */
    CC2640R2_LAUNCHXL_SPI0_MOSI | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master out - slave in */
    CC2640R2_LAUNCHXL_SPI0_MISO | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master in - slave out */
    CC2640R2_LAUNCHXL_SPI0_CLK | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI clock */
    PIN_TERMINATE
    };
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    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, /* CC2640R2_LAUNCHXL_SPI_MASTER_READY */
    GPIOCC26XX_DIO_21 | GPIO_DO_NOT_CONFIG, /* CC2640R2_LAUNCHXL_SPI_SLAVE_READY */
    /* Output pins */
    GPIOCC26XX_DIO_07 | GPIO_DO_NOT_CONFIG, /* Green LED */
    GPIOCC26XX_DIO_06 | GPIO_DO_NOT_CONFIG, /* Red LED */
    GPIOCC26XX_DIO_30 | GPIO_DO_NOT_CONFIG, /* TMP116_EN */
    GPIOCC26XX_DIO_00 | GPIO_DO_NOT_CONFIG,
    /* 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 */
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    /* I2S */
    #define CC2640R2_LAUNCHXL_I2S_ADO IOID_22
    //#define CC2640R2_LAUNCHXL_I2S_ADO IOID_0
    #define CC2640R2_LAUNCHXL_I2S_ADI IOID_1
    #define CC2640R2_LAUNCHXL_I2S_BCLK IOID_30
    #define CC2640R2_LAUNCHXL_I2S_MCLK PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_I2S_WCLK IOID_29
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    GPIO_init();
    // I2C_init();
    SPI_init();
    UART_init();
    // Watchdog_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);
    HALUart1Init();
    HALSPIInit();
    GPIO_setConfig(Board_DIO0 , GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW);
    // NSS(0);
    GPIO_write(Board_DIO0, 0);
    GPIO_write(Board_DIO0, 1);
    GPIO_write(Board_DIO0, 0);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  •  "empty"  Example I use,But I still can't control DIO0.

  • Hi werwer,

    I have attached the files necessary to use DIO0 as an output.

    To evaluate this, please perform the following:

    1. Import a CC2640R2 SDK example, gpiointerrupt
    2. Replace the respective files in that example, with the files attached here
    3. Remove jumper on the Green LED
    4. Add a jumper wire between Green LED and DIO0 (on Green LED side, the jumper should be attached the header which is closest to the silk screen), see image below
    5. Build and flash this example onto CC2640R2F launchpad
    6. Now you can run the example as normal, and see that the Green LED is driven from DIO0 output

    4274.Board.h

    1447.CC2640R2_LAUNCHXL.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    /*
    * Copyright (c) 2016-2019, Texas Instruments Incorporated
    * All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    * * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    4162.CC2640R2_LAUNCHXL.h
    3513.gpiointerrupt.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    /*
    * Copyright (c) 2015-2019, Texas Instruments Incorporated
    * All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    * * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Thanks,
    Toby

  • CC2640R2_LAUNCHXL_GPIOName is the important part that I had forgotten, and its placement must align with the order of gpioPinConfigs.
    Regards,
    Ryan
  • dear Ryan Brown,

    thank you very much for your help.

    Referring to your code I am now able to control DIO0.But I don't understand which steps are necessary to initialize GPIO,I try to summarize how to initialize and use GPIO:

    1. Add GPIOName  to CC2640R2_LAUNCHXL_GPIOName in CC2640R2_LAUNCHXL.h:

    2.Define a GPIO name in Board.h

    3.Set  GPIOCC26XX_DIO_00 not be config:

    4.Config GPIO:

    5.Control GPIO:

    Hope to get your confirmation
    Thanks,
    TDY
  • The credit goes to Toby who discovered the missing part.  Just add the addition to BoardGpioInitTable and I believe you have a compiled list of necessary changes for GPIO control, you can further confirm this by adding another GPIO instance to test.

    Regards,
    Ryan

  • Although I can control DIO0 now, I don't see the code how DIO0 maps to Board_LAUNCHXL_GPIO_DIO_0

  • Board_LAUNCHXL_GPIO_DIO_0 = CC2640R2_LAUNCHXL_GPIO_S1 which is represented in CC2640R2_LAUNCHXL_GPIOName and thus maps to GPIOCC26XX_DIO_00 of the gpioPinConfigs, giving it the proper association in the GPIO TI Driver.

    Regards,
    Ryan

  • Dear Ryan

    You mean the GPIO PIN in CC2640R2_LAUNCHXL_GPIOName is one-to-one corresponding to the code in gpioPinConfigs?

  • Great visual, you have adequately demonstrated the concept.

    Regards,
    Ryan

  • Dear Ryan

    Does TI have documentation for these? There is no description of these in the documentation I've seen.

    Regards,

    Tdy

  • I do not know of a document which directly addresses this.  Similar questions concerning this software setup is commonly asked on the E2E forum, however documentation development is now focused on the newer SimpleLink CC13X2 / CC26X2 devices.

    Regards,
    Ryan