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: ProjectZero not working for Custom 4x4 Board

Part Number: CC2640R2F
Other Parts Discussed in Thread: TMP116, , CC2650

Hello,

I am working on a Custom Board project with the following components for BLE:

- CC2640R2FRSMR 4x4 MCU

- 32.768 kHz Crystal

- 48 MHz crystal

- Johanson 2450AT14A0100 50 Ohm Antenna

- Johanson 2450BM14G0011 Balun IC (which I believe is Internal Bias, Differential RF)

I have referred CC13xx/CC26xx Hardware Configuration and PCB Design Considerations before designing the antenna and selecting the components, and wanted to test the working of BLE on my custom board using ProjectZero example, however I was not able to view it on BLEScanner.

Here are the troubleshooting steps I followed:

1. I tried toggling the LED I have on one of the DIO using the gpiointerrupt example - The LED toggles successfully, this verifies my custom board config files.

gpiointerrupt.c

#include <stdint.h>
#include <stddef.h>

/* Driver Header files */
#include <ti/drivers/GPIO.h>

/* Example/Board Header files */
#include "Board.h"

/*
 *  ======== mainThread ========
 */
void *mainThread(void *arg0)
{
    /* Call driver init functions */
    GPIO_init();

    /* Configure the LED and button pins */
    GPIO_setConfig(CC2640R2_LAUNCHXL_DIO0, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW);

    while(1)
    {
        /* Turn on user LED */
       GPIO_toggle(CC2640R2_LAUNCHXL_DIO0);
       sleep(1);
    }
}

board.h

#ifndef __BOARD_H
#define __BOARD_H

#define Board_CC2640R2_LAUNCHXL

#ifdef __cplusplus
extern "C" {
#endif

#include <ti/drivers/Board.h>

#define Board_initGeneral()     Board_init()  /* deprecated */

#include "CC2640R2_LAUNCHXL.h"

#define Board_shutDownExtFlash() CC2640R2_LAUNCHXL_shutDownExtFlash()
#define Board_wakeUpExtFlash() CC2640R2_LAUNCHXL_wakeUpExtFlash()

/* These #defines allow us to reuse TI-RTOS across other device families */

#define Board_ADC0              CC2640R2_LAUNCHXL_ADC0
#define Board_ADC1              CC2640R2_LAUNCHXL_ADC1

#define Board_ADCBUF0           CC2640R2_LAUNCHXL_ADCBUF0
#define Board_ADCBUF0CHANNEL0   CC2640R2_LAUNCHXL_ADCBUF0CHANNEL0
#define Board_ADCBUF0CHANNEL1   CC2640R2_LAUNCHXL_ADCBUF0CHANNEL1

#define Board_CRYPTO0           CC2640R2_LAUNCHXL_CRYPTO0
#define Board_AESCCM0           CC2640R2_LAUNCHXL_AESCCM0
#define Board_AESGCM0           CC2640R2_LAUNCHXL_AESGCM0
#define Board_AESCBC0           CC2640R2_LAUNCHXL_AESCBC0
#define Board_AESCTR0           CC2640R2_LAUNCHXL_AESCTR0
#define Board_AESECB0           CC2640R2_LAUNCHXL_AESECB0
#define Board_AESCTRDRBG0       CC2640R2_LAUNCHXL_AESCTRDRBG0
#define Board_TRNG0             CC2640R2_LAUNCHXL_TRNG0

#define Board_DIO0              CC2640R2_LAUNCHXL_DIO0
#define Board_DIO1_RFSW         CC2640R2_LAUNCHXL_DIO1_CUSTOM_LED
#define Board_DIO12             CC2640R2_LAUNCHXL_DIO12
#define Board_DIO15             CC2640R2_LAUNCHXL_DIO15
#define Board_DIO16_TDO         CC2640R2_LAUNCHXL_DIO16_TDO
#define Board_DIO17_TDI         CC2640R2_LAUNCHXL_DIO17_TDI
#define Board_DIO21             CC2640R2_LAUNCHXL_DIO21
#define Board_DIO22             CC2640R2_LAUNCHXL_DIO22

#define Board_DIO23_ANALOG      CC2640R2_LAUNCHXL_DIO23_ANALOG
#define Board_DIO24_ANALOG      CC2640R2_LAUNCHXL_DIO24_ANALOG
#define Board_DIO25_ANALOG      CC2640R2_LAUNCHXL_DIO25_ANALOG
#define Board_DIO26_ANALOG      CC2640R2_LAUNCHXL_DIO26_ANALOG
#define Board_DIO27_ANALOG      CC2640R2_LAUNCHXL_DIO27_ANALOG
#define Board_DIO28_ANALOG      CC2640R2_LAUNCHXL_DIO28_ANALOG
#define Board_DIO29_ANALOG      CC2640R2_LAUNCHXL_DIO29_ANALOG
#define Board_DIO30_ANALOG      CC2640R2_LAUNCHXL_DIO30_ANALOG

#define Board_GPIO_BUTTON0      CC2640R2_LAUNCHXL_GPIO_S1
#define Board_GPIO_BUTTON1      CC2640R2_LAUNCHXL_GPIO_S2
#define Board_GPIO_BTN1         CC2640R2_LAUNCHXL_GPIO_S1
#define Board_GPIO_BTN2         CC2640R2_LAUNCHXL_GPIO_S2
#define Board_GPIO_LED0         CC2640R2_LAUNCHXL_GPIO_LED_RED
#define Board_GPIO_LED1         CC2640R2_LAUNCHXL_GPIO_LED_GREEN
#define Board_GPIO_LED2         CC2640R2_LAUNCHXL_GPIO_LED_RED
#define Board_GPIO_RLED         CC2640R2_LAUNCHXL_GPIO_LED_RED
#define Board_GPIO_GLED         CC2640R2_LAUNCHXL_GPIO_LED_GREEN
#define Board_GPIO_LED_ON       CC2640R2_LAUNCHXL_GPIO_LED_ON
#define Board_GPIO_LED_OFF      CC2640R2_LAUNCHXL_GPIO_LED_OFF
#define Board_GPIO_TMP116_EN    CC2640R2_LAUNCHXL_GPIO_TMP116_EN

#define Board_GPTIMER0A         CC2640R2_LAUNCHXL_GPTIMER0A
#define Board_GPTIMER0B         CC2640R2_LAUNCHXL_GPTIMER0B
#define Board_GPTIMER1A         CC2640R2_LAUNCHXL_GPTIMER1A
#define Board_GPTIMER1B         CC2640R2_LAUNCHXL_GPTIMER1B
#define Board_GPTIMER2A         CC2640R2_LAUNCHXL_GPTIMER2A
#define Board_GPTIMER2B         CC2640R2_LAUNCHXL_GPTIMER2B
#define Board_GPTIMER3A         CC2640R2_LAUNCHXL_GPTIMER3A
#define Board_GPTIMER3B         CC2640R2_LAUNCHXL_GPTIMER3B

#define Board_I2C0              CC2640R2_LAUNCHXL_I2C0
#define Board_I2C_TMP           Board_I2C0

#define Board_I2S0              CC2640R2_LAUNCHXL_I2S0
#define Board_I2S_ADO           CC2640R2_LAUNCHXL_I2S_ADO
#define Board_I2S_ADI           CC2640R2_LAUNCHXL_I2S_ADI
#define Board_I2S_BCLK          CC2640R2_LAUNCHXL_I2S_BCLK
#define Board_I2S_MCLK          CC2640R2_LAUNCHXL_I2S_MCLK
#define Board_I2S_WCLK          CC2640R2_LAUNCHXL_I2S_WCLK

#define Board_NVSINTERNAL       CC2640R2_LAUNCHXL_NVSCC26XX0
#define Board_NVSEXTERNAL       CC2640R2_LAUNCHXL_NVSSPI25X0

#define Board_PIN_BUTTON0       CC2640R2_LAUNCHXL_PIN_BTN1
#define Board_PIN_BUTTON1       CC2640R2_LAUNCHXL_PIN_BTN2
#define Board_PIN_BTN1          CC2640R2_LAUNCHXL_PIN_BTN1
#define Board_PIN_BTN2          CC2640R2_LAUNCHXL_PIN_BTN2
#define Board_PIN_LED0          CC2640R2_LAUNCHXL_PIN_RLED
#define Board_PIN_LED1          CC2640R2_LAUNCHXL_PIN_GLED
#define Board_PIN_LED2          CC2640R2_LAUNCHXL_PIN_RLED
#define Board_PIN_RLED          CC2640R2_LAUNCHXL_PIN_RLED
#define Board_PIN_GLED          CC2640R2_LAUNCHXL_PIN_GLED

#define Board_PWM0              CC2640R2_LAUNCHXL_PWM0
#define Board_PWM1              CC2640R2_LAUNCHXL_PWM1
#define Board_PWM2              CC2640R2_LAUNCHXL_PWM2
#define Board_PWM3              CC2640R2_LAUNCHXL_PWM3
#define Board_PWM4              CC2640R2_LAUNCHXL_PWM4
#define Board_PWM5              CC2640R2_LAUNCHXL_PWM5
#define Board_PWM6              CC2640R2_LAUNCHXL_PWM6
#define Board_PWM7              CC2640R2_LAUNCHXL_PWM7

#define Board_SD0               CC2640R2_LAUNCHXL_SDSPI0

#define Board_SPI0              CC2640R2_LAUNCHXL_SPI0
#define Board_SPI1              CC2640R2_LAUNCHXL_SPI1
#define Board_SPI_FLASH_CS      CC2640R2_LAUNCHXL_SPI_FLASH_CS
#define Board_FLASH_CS_ON       0
#define Board_FLASH_CS_OFF      1

#define Board_SPI_MASTER        CC2640R2_LAUNCHXL_SPI0
#define Board_SPI_SLAVE         CC2640R2_LAUNCHXL_SPI0
#define Board_SPI_MASTER_READY  CC2640R2_LAUNCHXL_SPI_MASTER_READY
#define Board_SPI_SLAVE_READY   CC2640R2_LAUNCHXL_SPI_SLAVE_READY

#define Board_UART0             CC2640R2_LAUNCHXL_UART0

#define Board_WATCHDOG0         CC2640R2_LAUNCHXL_WATCHDOG0

#ifdef __cplusplus
}
#endif

#endif /* __BOARD_H */

launch.h

/** ============================================================================
 *  @file       CC2640R2_LAUNCHXL.h
 *
 *  @brief      CC2640R2 LaunchPad Board Specific header file.
 *
 *  This file is responsible for setting up the board specific items for the
 *  CC2640R2_LAUNCHXL board.
 *
 *  This board file is made for the 7x7 mm QFN package, to convert this board
 *  file to use for other smaller device packages(5x5 mm and 4x4 mm QFN), the
 *  board will need to be modified since all the IO pins are not available for
 *  smaller packages. Note that the 2.7 x 2.7 mm WCSP package should use a
 *  separate board file also included within the SDK.
 *
 *  Refer to the datasheet for all the package options and IO descriptions:
 *  http://www.ti.com/lit/ds/symlink/cc2640r2f.pdf
 *
 *  For example, to change to the 4x4 package, remove all defines for all IOs
 *  not available (IOID_10 and higher) since the 4x4 package
 *  has only 10 DIO pins as listed in the datasheet. Remove the modules/pins
 *  not used including ADC, Display, SPI1, LED, and PIN due to limited pins.
 *  ============================================================================
 */
#ifndef __CC2640R2_LAUNCHXL_BOARD_H__
#define __CC2640R2_LAUNCHXL_BOARD_H__

#ifdef __cplusplus
extern "C" {
#endif

/* Includes */
#include <ti/drivers/PIN.h>
#include <ti/devices/cc26x0r2/driverlib/ioc.h>

/* Externs */
extern const PIN_Config BoardGpioInitTable[];

/* Defines */
#define CC2650EM_7ID

/* Mapping of pins to board signals using general board aliases
 *      <board signal alias>                  <pin mapping>
 */

/* Analog Capable DIOs */
#define CC2640R2_LAUNCHXL_DIO23_ANALOG          PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_DIO24_ANALOG          PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_DIO25_ANALOG          PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_DIO26_ANALOG          PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_DIO27_ANALOG          PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_DIO28_ANALOG          PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_DIO29_ANALOG          PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_DIO30_ANALOG          PIN_UNASSIGNED

/* Digital IOs */
#define CC2640R2_LAUNCHXL_DIO0                  IOID_0
#define CC2640R2_LAUNCHXL_DIO1_CUSTOM_LED             IOID_1
#define CC2640R2_LAUNCHXL_DIO12                 PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_DIO15                 PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_DIO16_TDO             PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_DIO17_TDI             PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_DIO21                 PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_DIO22                 PIN_UNASSIGNED

/* Discrete Inputs */
#define CC2640R2_LAUNCHXL_PIN_BTN1              PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_PIN_BTN2              PIN_UNASSIGNED

/* GPIO */
#define CC2640R2_LAUNCHXL_GPIO_LED_ON           1
#define CC2640R2_LAUNCHXL_GPIO_LED_OFF          0

/* I2C */
#define CC2640R2_LAUNCHXL_I2C0_SCL0             IOID_4
#define CC2640R2_LAUNCHXL_I2C0_SDA0             IOID_5

/* I2S */
#define CC2640R2_LAUNCHXL_I2S_ADO               IOID_0
#define CC2640R2_LAUNCHXL_I2S_ADI               IOID_1
#define CC2640R2_LAUNCHXL_I2S_BCLK              PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_I2S_MCLK              PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_I2S_WCLK              PIN_UNASSIGNED

/* LEDs */
#define CC2640R2_LAUNCHXL_PIN_LED_ON            1
#define CC2640R2_LAUNCHXL_PIN_LED_OFF           0
#define CC2640R2_LAUNCHXL_PIN_RLED              IOID_6
#define CC2640R2_LAUNCHXL_PIN_GLED              IOID_7

/* PWM Outputs */
#define CC2640R2_LAUNCHXL_PWMPIN0               CC2640R2_LAUNCHXL_PIN_RLED
#define CC2640R2_LAUNCHXL_PWMPIN1               CC2640R2_LAUNCHXL_PIN_GLED
#define CC2640R2_LAUNCHXL_PWMPIN2               PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_PWMPIN3               PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_PWMPIN4               PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_PWMPIN5               PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_PWMPIN6               PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_PWMPIN7               PIN_UNASSIGNED

/* SPI */
#define CC2640R2_LAUNCHXL_SPI_FLASH_CS          PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_FLASH_CS_ON           0
#define CC2640R2_LAUNCHXL_FLASH_CS_OFF          1

/* SPI Board */
#define CC2640R2_LAUNCHXL_SPI0_MISO             IOID_8          /* RF1.20 */
#define CC2640R2_LAUNCHXL_SPI0_MOSI             IOID_9          /* RF1.18 */
#define CC2640R2_LAUNCHXL_SPI0_CLK              PIN_UNASSIGNED         /* RF1.16 */
#define CC2640R2_LAUNCHXL_SPI0_CSN              PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_SPI1_MISO             PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_SPI1_MOSI             PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_SPI1_CLK              PIN_UNASSIGNED
#define CC2640R2_LAUNCHXL_SPI1_CSN              PIN_UNASSIGNED

/* UART Board */
#define CC2640R2_LAUNCHXL_UART_RX               IOID_2          /* RXD */
#define CC2640R2_LAUNCHXL_UART_TX               IOID_3          /* TXD */
#define CC2640R2_LAUNCHXL_UART_CTS              PIN_UNASSIGNED         /* CTS */
#define CC2640R2_LAUNCHXL_UART_RTS              PIN_UNASSIGNED         /* RTS */

/*!
 *  @brief  Initialize the general board specific settings
 *
 *  This function initializes the general board specific settings.
 */
void CC2640R2_LAUNCHXL_initGeneral(void);

/*!
 *  @brief  Turn off the external flash on LaunchPads
 *
 */
void CC2640R2_LAUNCHXL_shutDownExtFlash(void);

/*!
 *  @brief  Wake up the external flash present on the board files
 *
 *  This function toggles the chip select for the amount of time needed
 *  to wake the chip up.
 */
void CC2640R2_LAUNCHXL_wakeUpExtFlash(void);

/*!
 *  @def    CC2640R2_LAUNCHXL_ADCBufName
 *  @brief  Enum of ADCs
 */
typedef enum CC2640R2_LAUNCHXL_ADCBufName {
    CC2640R2_LAUNCHXL_ADCBUF0 = 0,

    CC2640R2_LAUNCHXL_ADCBUFCOUNT
} CC2640R2_LAUNCHXL_ADCBufName;

/*!
 *  @def    CC2640R2_LAUNCHXL_ADCBuf0SourceName
 *  @brief  Enum of ADCBuf channels
 */
typedef enum CC2640R2_LAUNCHXL_ADCBuf0ChannelName {
    CC2640R2_LAUNCHXL_ADCBUF0CHANNEL0 = 0,
    CC2640R2_LAUNCHXL_ADCBUF0CHANNEL1,
    CC2640R2_LAUNCHXL_ADCBUF0CHANNEL2,
    CC2640R2_LAUNCHXL_ADCBUF0CHANNEL3,
    CC2640R2_LAUNCHXL_ADCBUF0CHANNEL4,
    CC2640R2_LAUNCHXL_ADCBUF0CHANNEL5,
    CC2640R2_LAUNCHXL_ADCBUF0CHANNEL6,
    CC2640R2_LAUNCHXL_ADCBUF0CHANNEL7,
    CC2640R2_LAUNCHXL_ADCBUF0CHANNELVDDS,
    CC2640R2_LAUNCHXL_ADCBUF0CHANNELDCOUPL,
    CC2640R2_LAUNCHXL_ADCBUF0CHANNELVSS,

    CC2640R2_LAUNCHXL_ADCBUF0CHANNELCOUNT
} CC2640R2_LAUNCHXL_ADCBuf0ChannelName;

/*!
 *  @def    CC2640R2_LAUNCHXL_ADCName
 *  @brief  Enum of ADCs
 */
typedef enum CC2640R2_LAUNCHXL_ADCName {
    CC2640R2_LAUNCHXL_ADC0 = 0,
    CC2640R2_LAUNCHXL_ADC1,
    CC2640R2_LAUNCHXL_ADC2,
    CC2640R2_LAUNCHXL_ADC3,
    CC2640R2_LAUNCHXL_ADC4,
    CC2640R2_LAUNCHXL_ADC5,
    CC2640R2_LAUNCHXL_ADC6,
    CC2640R2_LAUNCHXL_ADC7,
    CC2640R2_LAUNCHXL_ADCDCOUPL,
    CC2640R2_LAUNCHXL_ADCVSS,
    CC2640R2_LAUNCHXL_ADCVDDS,

    CC2640R2_LAUNCHXL_ADCCOUNT
} CC2640R2_LAUNCHXL_ADCName;

/*!
 *  @def    CC2640R2_LAUNCHXL_CryptoName
 *  @brief  Enum of Crypto names
 */
typedef enum CC2640R2_LAUNCHXL_CryptoName {
    CC2640R2_LAUNCHXL_CRYPTO0 = 0,

    CC2640R2_LAUNCHXL_CRYPTOCOUNT
} CC2640R2_LAUNCHXL_CryptoName;

/*!
 *  @def    CC2640R2_LAUNCHXL_AESCCMName
 *  @brief  Enum of AESCCM names
 */
typedef enum CC2640R2_LAUNCHXL_AESCCMName {
    CC2640R2_LAUNCHXL_AESCCM0 = 0,

    CC2640R2_LAUNCHXL_AESCCMCOUNT
} CC2640R2_LAUNCHXL_AESCCMName;

/*!
 *  @def    CC2640R2_LAUNCHXL_AESGCMName
 *  @brief  Enum of AESGCM names
 */
typedef enum CC2640R2_LAUNCHXL_AESGCMName {
    CC2640R2_LAUNCHXL_AESGCM0 = 0,

    CC2640R2_LAUNCHXL_AESGCMCOUNT
} CC2640R2_LAUNCHXL_AESGCMName;

/*!
 *  @def    CC2640R2_LAUNCHXL_AESCBCName
 *  @brief  Enum of AESCBC names
 */
typedef enum CC2640R2_LAUNCHXL_AESCBCName {
    CC2640R2_LAUNCHXL_AESCBC0 = 0,

    CC2640R2_LAUNCHXL_AESCBCCOUNT
} CC2640R2_LAUNCHXL_AESCBCName;

/*!
 *  @def    CC2640R2_LAUNCHXL_AESCTRName
 *  @brief  Enum of AESCTR names
 */
typedef enum CC2640R2_LAUNCHXL_AESCTRName {
    CC2640R2_LAUNCHXL_AESCTR0 = 0,

    CC2640R2_LAUNCHXL_AESCTRCOUNT
} CC2640R2_LAUNCHXL_AESCTRName;

/*!
 *  @def    CC2640R2_LAUNCHXL_AESECBName
 *  @brief  Enum of AESECB names
 */
typedef enum CC2640R2_LAUNCHXL_AESECBName {
    CC2640R2_LAUNCHXL_AESECB0 = 0,

    CC2640R2_LAUNCHXL_AESECBCOUNT
} CC2640R2_LAUNCHXL_AESECBName;

/*!
 *  @def    CC2640R2_LAUNCHXL_AESCTRDRBGName
 *  @brief  Enum of AESCTRDRBG names
 */
typedef enum CC2640R2_LAUNCHXL_AESCTRDRBGName {
    CC2640R2_LAUNCHXL_AESCTRDRBG0 = 0,

    CC2640R2_LAUNCHXL_AESCTRDRBGCOUNT
} CC2640R2_LAUNCHXL_AESCTRDRBGName;

/*!
 *  @def    CC2640R2_LAUNCHXL_TRNGName
 *  @brief  Enum of TRNG names
 */
typedef enum CC2640R2_LAUNCHXL_TRNGName {
    CC2640R2_LAUNCHXL_TRNG0 = 0,

    CC2640R2_LAUNCHXL_TRNGCOUNT
} CC2640R2_LAUNCHXL_TRNGName;

/*!
 *  @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_TMP116_EN,
    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;

/*!
 *  @def    CC2640R2_LAUNCHXL_GPTimerName
 *  @brief  Enum of GPTimer parts
 */
typedef enum CC2640R2_LAUNCHXL_GPTimerName {
    CC2640R2_LAUNCHXL_GPTIMER0A = 0,
    CC2640R2_LAUNCHXL_GPTIMER0B,
    CC2640R2_LAUNCHXL_GPTIMER1A,
    CC2640R2_LAUNCHXL_GPTIMER1B,
    CC2640R2_LAUNCHXL_GPTIMER2A,
    CC2640R2_LAUNCHXL_GPTIMER2B,
    CC2640R2_LAUNCHXL_GPTIMER3A,
    CC2640R2_LAUNCHXL_GPTIMER3B,

    CC2640R2_LAUNCHXL_GPTIMERPARTSCOUNT
} CC2640R2_LAUNCHXL_GPTimerName;

/*!
 *  @def    CC2640R2_LAUNCHXL_GPTimers
 *  @brief  Enum of GPTimers
 */
typedef enum CC2640R2_LAUNCHXL_GPTimers {
    CC2640R2_LAUNCHXL_GPTIMER0 = 0,
    CC2640R2_LAUNCHXL_GPTIMER1,
    CC2640R2_LAUNCHXL_GPTIMER2,
    CC2640R2_LAUNCHXL_GPTIMER3,

    CC2640R2_LAUNCHXL_GPTIMERCOUNT
} CC2640R2_LAUNCHXL_GPTimers;

/*!
 *  @def    CC2640R2_LAUNCHXL_I2CName
 *  @brief  Enum of I2C names
 */
typedef enum CC2640R2_LAUNCHXL_I2CName {
    CC2640R2_LAUNCHXL_I2C0 = 0,

    CC2640R2_LAUNCHXL_I2CCOUNT
} CC2640R2_LAUNCHXL_I2CName;

/*!
 *  @def    CC2640R2_LAUNCHXL_I2SName
 *  @brief  Enum of I2S names
 */
typedef enum CC2640R2_LAUNCHXL_I2SName {
    CC2640R2_LAUNCHXL_I2S0 = 0,

    CC2640R2_LAUNCHXL_I2SCOUNT
} CC2640R2_LAUNCHXL_I2SName;

/*!
 *  @def    CC2640R2_LAUNCHXL_NVSName
 *  @brief  Enum of NVS names
 */
typedef enum CC2640R2_LAUNCHXL_NVSName {
#ifndef Board_EXCLUDE_NVS_INTERNAL_FLASH
    CC2640R2_LAUNCHXL_NVSCC26XX0 = 0,
#endif
#ifndef Board_EXCLUDE_NVS_EXTERNAL_FLASH
    CC2640R2_LAUNCHXL_NVSSPI25X0,
#endif

    CC2640R2_LAUNCHXL_NVSCOUNT
} CC2640R2_LAUNCHXL_NVSName;

/*!
 *  @def    CC2640R2_LAUNCHXL_PWM
 *  @brief  Enum of PWM outputs
 */
typedef enum CC2640R2_LAUNCHXL_PWMName {
    CC2640R2_LAUNCHXL_PWM0 = 0,
    CC2640R2_LAUNCHXL_PWM1,
    CC2640R2_LAUNCHXL_PWM2,
    CC2640R2_LAUNCHXL_PWM3,
    CC2640R2_LAUNCHXL_PWM4,
    CC2640R2_LAUNCHXL_PWM5,
    CC2640R2_LAUNCHXL_PWM6,
    CC2640R2_LAUNCHXL_PWM7,

    CC2640R2_LAUNCHXL_PWMCOUNT
} CC2640R2_LAUNCHXL_PWMName;

/*!
 *  @def    CC2640R2_LAUNCHXL_SDName
 *  @brief  Enum of SD names
 */
typedef enum CC2640R2_LAUNCHXL_SDName {
    CC2640R2_LAUNCHXL_SDSPI0 = 0,

    CC2640R2_LAUNCHXL_SDCOUNT
} CC2640R2_LAUNCHXL_SDName;

/*!
 *  @def    CC2640R2_LAUNCHXL_SPIName
 *  @brief  Enum of SPI names
 */
typedef enum CC2640R2_LAUNCHXL_SPIName {
    CC2640R2_LAUNCHXL_SPI0 = 0,
    CC2640R2_LAUNCHXL_SPI1,

    CC2640R2_LAUNCHXL_SPICOUNT
} CC2640R2_LAUNCHXL_SPIName;

/*!
 *  @def    CC2640R2_LAUNCHXL_UARTName
 *  @brief  Enum of UARTs
 */
typedef enum CC2640R2_LAUNCHXL_UARTName {
    CC2640R2_LAUNCHXL_UART0 = 0,

    CC2640R2_LAUNCHXL_UARTCOUNT
} CC2640R2_LAUNCHXL_UARTName;

/*!
 *  @def    CC2640R2_LAUNCHXL_UDMAName
 *  @brief  Enum of DMA buffers
 */
typedef enum CC2640R2_LAUNCHXL_UDMAName {
    CC2640R2_LAUNCHXL_UDMA0 = 0,

    CC2640R2_LAUNCHXL_UDMACOUNT
} CC2640R2_LAUNCHXL_UDMAName;

/*!
 *  @def    CC2640R2_LAUNCHXL_WatchdogName
 *  @brief  Enum of Watchdogs
 */
typedef enum CC2640R2_LAUNCHXL_WatchdogName {
    CC2640R2_LAUNCHXL_WATCHDOG0 = 0,

    CC2640R2_LAUNCHXL_WATCHDOGCOUNT
} CC2640R2_LAUNCHXL_WatchdogName;

#ifdef __cplusplus
}
#endif

#endif /* __CC2640R2_LAUNCHXL_BOARD_H__ */

2. Then I modified ProjectZero example based on the custom config files.

Modified projectzero.c

/*******************************************************************************
 * INCLUDES
 */
#include <string.h>

//#define xdc_runtime_Log_DISABLE_ALL 1  // Add to disable logs from this file

#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/knl/Event.h>
#include <ti/sysbios/knl/Queue.h>
#include <ti/sysbios/knl/Clock.h>

#include <ti/drivers/PIN.h>
#include <ti/display/Display.h>

#include <xdc/runtime/Diags.h>
#include <uartlog/UartLog.h>

/* This Header file contains all BLE API and icall structure definition */
#include "icall_ble_api.h"
#include <icall.h>

#include <osal_snv.h>
#include <peripheral.h>
#include <devinfoservice.h>

#include "util.h"

#include "Board.h"
#include "project_zero.h"

// Bluetooth Developer Studio services
#include "led_service.h"
#include "data_service.h"

/*********************************************************************
 * CONSTANTS
 */

// Advertising interval when device is discoverable (units of 625us, 160=100ms)
#define DEFAULT_ADVERTISING_INTERVAL          160

// Limited discoverable mode advertises for 30.72s, and then stops
// General discoverable mode advertises indefinitely
#define DEFAULT_DISCOVERABLE_MODE             GAP_ADTYPE_FLAGS_GENERAL

// Default pass-code used for pairing.
#define DEFAULT_PASSCODE                      000000

// Task configuration
#define PRZ_TASK_PRIORITY                     1

#ifndef PRZ_TASK_STACK_SIZE
#define PRZ_TASK_STACK_SIZE                   800
#endif

// Internal Events for RTOS application
#define PRZ_ICALL_EVT                         ICALL_MSG_EVENT_ID  // Event_Id_31
#define PRZ_QUEUE_EVT                         UTIL_QUEUE_EVENT_ID // Event_Id_30
#define PRZ_STATE_CHANGE_EVT                  Event_Id_00
#define PRZ_CHAR_CHANGE_EVT                   Event_Id_01
#define PRZ_PERIODIC_EVT                      Event_Id_02
#define PRZ_APP_MSG_EVT                       Event_Id_03

#define PRZ_ALL_EVENTS                       (PRZ_ICALL_EVT        | \
                                              PRZ_QUEUE_EVT        | \
                                              PRZ_STATE_CHANGE_EVT | \
                                              PRZ_CHAR_CHANGE_EVT  | \
                                              PRZ_PERIODIC_EVT     | \
                                              PRZ_APP_MSG_EVT)

// Set the register cause to the registration bit-mask
#define CONNECTION_EVENT_REGISTER_BIT_SET(registerCause) (connectionEventRegisterCauseBitMap |= registerCause )

// Remove the register cause from the registration bit-mask
#define CONNECTION_EVENT_REGISTER_BIT_REMOVE(registerCause) (connectionEventRegisterCauseBitMap &= (~registerCause) )

// Gets whether the current App is registered to the receive connection events
#define CONNECTION_EVENT_IS_REGISTERED (connectionEventRegisterCauseBitMap > 0)

// Gets whether the registerCause was registered to recieve connection event
#define CONNECTION_EVENT_REGISTRATION_CAUSE(registerCause) (connectionEventRegisterCauseBitMap & registerCause )

/*********************************************************************
 * TYPEDEFS
 */
// Types of messages that can be sent to the user application task from other
// tasks or interrupts. Note: Messages from BLE Stack are sent differently.
typedef enum
{
  APP_MSG_SERVICE_WRITE = 0,   /* A characteristic value has been written     */
  APP_MSG_SERVICE_CFG,         /* A characteristic configuration has changed  */
  APP_MSG_UPDATE_CHARVAL,      /* Request from ourselves to update a value    */
  APP_MSG_GAP_STATE_CHANGE,    /* The GAP / connection state has changed      */
  APP_MSG_SEND_PASSCODE,       /* A pass-code/PIN is requested during pairing */
  APP_MSG_PRZ_CONN_EVT,        /* Connection Event finished report            */
} app_msg_types_t;

// Struct for messages sent to the application task
typedef struct
{
  Queue_Elem       _elem;
  app_msg_types_t  type;
  uint8_t          pdu[];
} app_msg_t;

// Struct for messages about characteristic data
typedef struct
{
  uint16_t svcUUID; // UUID of the service
  uint16_t dataLen; //
  uint8_t  paramID; // Index of the characteristic
  uint8_t  data[];  // Flexible array member, extended to malloc - sizeof(.)
} char_data_t;

// Struct for message about sending/requesting passcode from peer.
typedef struct
{
  uint16_t connHandle;
  uint8_t  uiInputs;
  uint8_t  uiOutputs;
  uint32   numComparison;
} passcode_req_t;

// Struct for message about button state
typedef struct
{
  PIN_Id   pinId;
  uint8_t  state;
} button_state_t;

/*********************************************************************
 * LOCAL VARIABLES
 */

// Entity ID globally used to check for source and/or destination of messages
static ICall_EntityID selfEntity;

// Event globally used to post local events and pend on system and
// local events.
static ICall_SyncHandle syncEvent;

// Queue object used for application messages.
static Queue_Struct applicationMsgQ;
static Queue_Handle hApplicationMsgQ;

// Task configuration
Task_Struct przTask;
Char przTaskStack[PRZ_TASK_STACK_SIZE];


// GAP - SCAN RSP data (max size = 31 bytes)
static uint8_t scanRspData[] =
{
  // No scan response data provided.
  0x00 // Placeholder to keep the compiler happy.
};

// GAP - Advertisement data (max size = 31 bytes, though this is
// best kept short to conserve power while advertisting)
static uint8_t advertData[] =
{
  // Flags; this sets the device to use limited discoverable
  // mode (advertises for 30 seconds at a time) or general
  // discoverable mode (advertises indefinitely), depending
  // on the DEFAULT_DISCOVERY_MODE define.
  0x02,   // length of this data
  GAP_ADTYPE_FLAGS,
  DEFAULT_DISCOVERABLE_MODE | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED,

  // complete name
  16,
  GAP_ADTYPE_LOCAL_NAME_COMPLETE,
  'P', 'r', 'o', 'j', 'e', 'c', 't', ' ', 'Z', 'e', 'r', 'o', ' ','R','2',

};

// GAP GATT Attributes
static uint8_t attDeviceName[GAP_DEVICE_NAME_LEN] = "Project Zero R2";

// Globals used for ATT Response retransmission
static gattMsgEvent_t *pAttRsp = NULL;
static uint8_t rspTxRetry = 0;


/* Pin driver handles */
static PIN_Handle ledPinHandle;

/* Global memory storage for a PIN_Config table */
static PIN_State ledPinState;

/*
 * Initial LED pin configuration table
 *   - LEDs Board_LED0 & Board_LED1 are off.
 */
PIN_Config ledPinTable[] = {
  Board_RLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
  Board_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
  PIN_TERMINATE
};

// Global display handle
Display_Handle dispHandle;

/*********************************************************************
 * LOCAL FUNCTIONS
 */

static void ProjectZero_init( void );
static void ProjectZero_taskFxn(UArg a0, UArg a1);

static void user_processApplicationMessage(app_msg_t *pMsg);
static uint8_t ProjectZero_processStackMsg(ICall_Hdr *pMsg);
static uint8_t ProjectZero_processGATTMsg(gattMsgEvent_t *pMsg);

static void ProjectZero_sendAttRsp(void);
static uint8_t ProjectZero_processGATTMsg(gattMsgEvent_t *pMsg);
static void ProjectZero_freeAttRsp(uint8_t status);

static void ProjectZero_connEvtCB(Gap_ConnEventRpt_t *pReport);
static void ProjectZero_processConnEvt(Gap_ConnEventRpt_t *pReport);

static void user_processGapStateChangeEvt(gaprole_States_t newState);
static void user_gapStateChangeCB(gaprole_States_t newState);
static void user_gapBondMgr_passcodeCB(uint8_t *deviceAddr, uint16_t connHandle,
                                       uint8_t uiInputs, uint8_t uiOutputs, uint32_t numComparison);
static void user_gapBondMgr_pairStateCB(uint16_t connHandle, uint8_t state,
                                        uint8_t status);

// Generic callback handlers for value changes in services.
static void user_service_ValueChangeCB( uint16_t connHandle, uint16_t svcUuid, uint8_t paramID, uint8_t *pValue, uint16_t len );
static void user_service_CfgChangeCB( uint16_t connHandle, uint16_t svcUuid, uint8_t paramID, uint8_t *pValue, uint16_t len );

// Task context handlers for generated services.
static void user_LedService_ValueChangeHandler(char_data_t *pCharData);
static void user_DataService_ValueChangeHandler(char_data_t *pCharData);
static void user_DataService_CfgChangeHandler(char_data_t *pCharData);

// Task handler for sending notifications.
static void user_updateCharVal(char_data_t *pCharData);

// Utility functions
static void user_enqueueRawAppMsg(app_msg_types_t appMsgType, uint8_t *pData, uint16_t len );
static void user_enqueueCharDataMsg(app_msg_types_t appMsgType, uint16_t connHandle,
                                    uint16_t serviceUUID, uint8_t paramID,
                                    uint8_t *pValue, uint16_t len);

static char *Util_convertArrayToHexString(uint8_t const *src, uint8_t src_len,
                                          uint8_t *dst, uint8_t dst_len);
#if defined(UARTLOG_ENABLE)
static char *Util_getLocalNameStr(const uint8_t *data);
#endif
/*********************************************************************
 * EXTERN FUNCTIONS
 */
extern void AssertHandler(uint8 assertCause, uint8 assertSubcause);

/*********************************************************************
 * PROFILE CALLBACKS
 */

// GAP Role Callbacks
static gapRolesCBs_t user_gapRoleCBs =
{
  user_gapStateChangeCB     // Profile State Change Callbacks
};

// GAP Bond Manager Callbacks
static gapBondCBs_t user_bondMgrCBs =
{
  user_gapBondMgr_passcodeCB, // Passcode callback
  user_gapBondMgr_pairStateCB // Pairing / Bonding state Callback
};

/*
 * Callbacks in the user application for events originating from BLE services.
 */
// LED Service callback handler.
// The type LED_ServiceCBs_t is defined in led_service.h
static LedServiceCBs_t user_LED_ServiceCBs =
{
  .pfnChangeCb    = user_service_ValueChangeCB, // Characteristic value change callback handler
  .pfnCfgChangeCb = NULL, // No notification-/indication enabled chars in LED Service
};

// Data Service callback handler.
// The type Data_ServiceCBs_t is defined in data_service.h
static DataServiceCBs_t user_Data_ServiceCBs =
{
  .pfnChangeCb    = user_service_ValueChangeCB, // Characteristic value change callback handler
  .pfnCfgChangeCb = user_service_CfgChangeCB, // Noti/ind configuration callback handler
};

/*********************************************************************
 * The following typedef and global handle the registration to connection event
 */
typedef enum
{
   NONE_REGISTERED    = 0,
   FOR_ATT_RSP        = 1,
} connectionEventRegisterCause_u;

// Handle the registration and un-registration for the connection event, since only one can be registered.
uint32_t connectionEventRegisterCauseBitMap = NONE_REGISTERED; // See connectionEventRegisterCause_u


/*
 * @brief  Register to receive connection event reports for all the connections
 *
 * @param  connectionEventRegisterCause  Represents the reason for registration
 *
 * @return @ref SUCCESS
 */
bStatus_t ProjectZero_RegistertToAllConnectionEvent(connectionEventRegisterCause_u connectionEventRegisterCause)
{
  bStatus_t status = SUCCESS;

  // In case  there is no registration for the connection event, register for report
  if (!CONNECTION_EVENT_IS_REGISTERED)
  {
    status = GAP_RegisterConnEventCb(ProjectZero_connEvtCB, GAP_CB_REGISTER, LINKDB_CONNHANDLE_ALL);
  }
  
  if(status == SUCCESS)
  {
    // Add the reason bit to the bitamap.
    CONNECTION_EVENT_REGISTER_BIT_SET(connectionEventRegisterCause);
  }

  return(status);
}

/*
 * @brief   Unregister connection events
 *
 * @param connectionEventRegisterCause represents the reason for registration
 *
 * @return @ref SUCCESS
 *
 */
bStatus_t ProjectZero_UnRegistertToAllConnectionEvent (connectionEventRegisterCause_u connectionEventRegisterCause)
{
  bStatus_t status = SUCCESS;

  CONNECTION_EVENT_REGISTER_BIT_REMOVE(connectionEventRegisterCause);
  
  // In case there are no more subscribers for the connection event then unregister for report
  if (!CONNECTION_EVENT_IS_REGISTERED)
  {
    GAP_RegisterConnEventCb(ProjectZero_connEvtCB, GAP_CB_UNREGISTER, LINKDB_CONNHANDLE_ALL);
  }

  return(status);
}

/*********************************************************************
 * PUBLIC FUNCTIONS
 */

/*
 * @brief   Task creation function for the user task.
 *
 * @param   None.
 *
 * @return  None.
 */
void ProjectZero_createTask(void)
{
  Task_Params taskParams;

  // Configure task
  Task_Params_init(&taskParams);
  taskParams.stack = przTaskStack;
  taskParams.stackSize = PRZ_TASK_STACK_SIZE;
  taskParams.priority = PRZ_TASK_PRIORITY;

  Task_construct(&przTask, ProjectZero_taskFxn, &taskParams, NULL);
}

/*
 * @brief   Called before the task loop and contains application-specific
 *          initialization of the BLE stack, hardware setup, power-state
 *          notification if used, and BLE profile/service initialization.
 *
 * @param   None.
 *
 * @return  None.
 */
static void ProjectZero_init(void)
{
  // ******************************************************************
  // NO STACK API CALLS CAN OCCUR BEFORE THIS CALL TO ICall_registerApp
  // ******************************************************************
  // Register the current thread as an ICall dispatcher application
  // so that the application can send and receive messages via ICall to Stack.
  ICall_registerApp(&selfEntity, &syncEvent);

  Log_info0("Initializing the user task, hardware, BLE stack and services.");

  // Open display. By default this is disabled via the predefined symbol Display_DISABLE_ALL.
  dispHandle = Display_open(Display_Type_UART, NULL);

  // Initialize queue for application messages.
  // Note: Used to transfer control to application thread from e.g. interrupts.
  Queue_construct(&applicationMsgQ, NULL);
  hApplicationMsgQ = Queue_handle(&applicationMsgQ);

  // ******************************************************************
  // Hardware initialization
  // ******************************************************************

  // Open LED pins
  ledPinHandle = PIN_open(&ledPinState, ledPinTable);
  if(!ledPinHandle) {
    Log_error0("Error initializing board LED pins");
    Task_exit();
  }

  // ******************************************************************
  // BLE Stack initialization
  // ******************************************************************

  // Setup the GAP Peripheral Role Profile
  uint8_t initialAdvertEnable = TRUE;  // Advertise on power-up

  // By setting this to zero, the device will go into the waiting state after
  // being discoverable. Otherwise wait this long [ms] before advertising again.
  uint16_t advertOffTime = 0; // miliseconds

  // Set advertisement enabled.
  GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t),
                       &initialAdvertEnable);

  // Configure the wait-time before restarting advertisement automatically
  GAPRole_SetParameter(GAPROLE_ADVERT_OFF_TIME, sizeof(uint16_t),
                       &advertOffTime);

  // Initialize Scan Response data
  GAPRole_SetParameter(GAPROLE_SCAN_RSP_DATA, sizeof(scanRspData), scanRspData);

  // Initialize Advertisement data
  GAPRole_SetParameter(GAPROLE_ADVERT_DATA, sizeof(advertData), advertData);

  Log_info1("Name in advertData array: \x1b[33m%s\x1b[0m",
            (IArg)Util_getLocalNameStr(advertData));

  // Set advertising interval
  uint16_t advInt = DEFAULT_ADVERTISING_INTERVAL;

  GAP_SetParamValue(TGAP_LIM_DISC_ADV_INT_MIN, advInt);
  GAP_SetParamValue(TGAP_LIM_DISC_ADV_INT_MAX, advInt);
  GAP_SetParamValue(TGAP_GEN_DISC_ADV_INT_MIN, advInt);
  GAP_SetParamValue(TGAP_GEN_DISC_ADV_INT_MAX, advInt);

  // Set duration of advertisement before stopping in Limited adv mode.
  GAP_SetParamValue(TGAP_LIM_ADV_TIMEOUT, 30); // Seconds

  // ******************************************************************
  // BLE Bond Manager initialization
  // ******************************************************************
  uint32_t passkey = 0; // passkey "000000"
  uint8_t pairMode = GAPBOND_PAIRING_MODE_WAIT_FOR_REQ;
  uint8_t mitm = TRUE;
  uint8_t ioCap = GAPBOND_IO_CAP_DISPLAY_ONLY;
  uint8_t bonding = TRUE;

  GAPBondMgr_SetParameter(GAPBOND_DEFAULT_PASSCODE, sizeof(uint32_t),
                          &passkey);
  GAPBondMgr_SetParameter(GAPBOND_PAIRING_MODE, sizeof(uint8_t), &pairMode);
  GAPBondMgr_SetParameter(GAPBOND_MITM_PROTECTION, sizeof(uint8_t), &mitm);
  GAPBondMgr_SetParameter(GAPBOND_IO_CAPABILITIES, sizeof(uint8_t), &ioCap);
  GAPBondMgr_SetParameter(GAPBOND_BONDING_ENABLED, sizeof(uint8_t), &bonding);

  // ******************************************************************
  // BLE Service initialization
  // ******************************************************************

  // Add services to GATT server
  GGS_AddService(GATT_ALL_SERVICES);           // GAP
  GATTServApp_AddService(GATT_ALL_SERVICES);   // GATT attributes
  DevInfo_AddService();                        // Device Information Service

  // Set the device name characteristic in the GAP Profile
  GGS_SetParameter(GGS_DEVICE_NAME_ATT, GAP_DEVICE_NAME_LEN, attDeviceName);

  // Add services to GATT server and give ID of this task for Indication acks.
  LedService_AddService( selfEntity );
  DataService_AddService( selfEntity );

  // Register callbacks with the generated services that
  // can generate events (writes received) to the application
  LedService_RegisterAppCBs( &user_LED_ServiceCBs );
  DataService_RegisterAppCBs( &user_Data_ServiceCBs );

  // Placeholder variable for characteristic intialization
  uint8_t initVal[40] = {0};
  uint8_t initString[] = "This is a pretty long string, isn't it!";

  // Initalization of characteristics in LED_Service that can provide data.
  LedService_SetParameter(LS_LED0_ID, LS_LED0_LEN, initVal);
  LedService_SetParameter(LS_LED1_ID, LS_LED1_LEN, initVal);

  // Initalization of characteristics in Data_Service that can provide data.
  DataService_SetParameter(DS_STRING_ID, sizeof(initString), initString);
  DataService_SetParameter(DS_STREAM_ID, DS_STREAM_LEN, initVal);

  // Start the stack in Peripheral mode.
  VOID GAPRole_StartDevice(&user_gapRoleCBs);

  // Start Bond Manager
  VOID GAPBondMgr_Register(&user_bondMgrCBs);

  // Register with GAP for HCI/Host messages
  GAP_RegisterForMsgs(selfEntity);

  // Register for GATT local events and ATT Responses pending for transmission
  GATT_RegisterForMsgs(selfEntity);
}


/*
 * @brief   Application task entry point.
 *
 *          Invoked by TI-RTOS when BIOS_start is called. Calls an init function
 *          and enters an infinite loop waiting for messages.
 *
 *          Messages can be either directly from the BLE stack or from user code
 *          like Hardware Interrupt (Hwi) or a callback function.
 *
 *          The reason for sending messages to this task from e.g. Hwi's is that
 *          some RTOS and Stack APIs are not available in callbacks and so the
 *          actions that may need to be taken is dispatched to this Task.
 *
 * @param   a0, a1 - not used.
 *
 * @return  None.
 */
static void ProjectZero_taskFxn(UArg a0, UArg a1)
{
  // Initialize application
  ProjectZero_init();

  // Application main loop
  for (;;)
  {
    uint32_t events;

    // Waits for an event to be posted associated with the calling thread.
    // Note that an event associated with a thread is posted when a
    // message is queued to the message receive queue of the thread
    events = Event_pend(syncEvent, Event_Id_NONE, PRZ_ALL_EVENTS,
                        ICALL_TIMEOUT_FOREVER);

    if (events)
    {
      ICall_EntityID dest;
      ICall_ServiceEnum src;
      ICall_HciExtEvt *pMsg = NULL;

      // Check if we got a signal because of a stack message
      if (ICall_fetchServiceMsg(&src, &dest,
                                (void **)&pMsg) == ICALL_ERRNO_SUCCESS)
      {
        uint8 safeToDealloc = TRUE;

        if ((src == ICALL_SERVICE_CLASS_BLE) && (dest == selfEntity))
        {
          ICall_Stack_Event *pEvt = (ICall_Stack_Event *)pMsg;

          if (pEvt->signature != 0xffff)
          {
            // Process inter-task message
            safeToDealloc = ProjectZero_processStackMsg((ICall_Hdr *)pMsg);
          }
        }

        if (pMsg && safeToDealloc)
        {
          ICall_freeMsg(pMsg);
        }
      }

      // Process messages sent from another task or another context.
      while (!Queue_empty(hApplicationMsgQ))
      {
        app_msg_t *pMsg = Queue_dequeue(hApplicationMsgQ);

        // Process application-layer message probably sent from ourselves.
        user_processApplicationMessage(pMsg);

        // Free the received message.
        ICall_free(pMsg);
      }
    }
  }
}


/*
 * @brief   Handle application messages
 *
 *          These are messages not from the BLE stack, but from the
 *          application itself.
 *
 *          For example, in a Software Interrupt (Swi) it is not possible to
 *          call any BLE APIs, so instead the Swi function must send a message
 *          to the application Task for processing in Task context.
 *
 * @param   pMsg  Pointer to the message of type app_msg_t.
 *
 * @return  None.
 */
static void user_processApplicationMessage(app_msg_t *pMsg)
{
  char_data_t *pCharData = (char_data_t *)pMsg->pdu;

  switch (pMsg->type)
  {
    case APP_MSG_SERVICE_WRITE: /* Message about received value write */
      /* Call different handler per service */
      switch(pCharData->svcUUID) {
        case LED_SERVICE_SERV_UUID:
          user_LedService_ValueChangeHandler(pCharData);
          break;
        case DATA_SERVICE_SERV_UUID:
          user_DataService_ValueChangeHandler(pCharData);
          break;
      }
      break;

    case APP_MSG_SERVICE_CFG: /* Message about received CCCD write */
      /* Call different handler per service */
      switch(pCharData->svcUUID) {
        case DATA_SERVICE_SERV_UUID:
          user_DataService_CfgChangeHandler(pCharData);
          break;
      }
      break;

   case HCI_BLE_HARDWARE_ERROR_EVENT_CODE:
     AssertHandler(HAL_ASSERT_CAUSE_HARDWARE_ERROR,0);
     break;

    case APP_MSG_UPDATE_CHARVAL: /* Message from ourselves to send  */
      user_updateCharVal(pCharData);
      break;

    case APP_MSG_GAP_STATE_CHANGE: /* Message that GAP state changed  */
      user_processGapStateChangeEvt( *(gaprole_States_t *)pMsg->pdu );
      break;

    case APP_MSG_SEND_PASSCODE: /* Message about pairing PIN request */
      {
        passcode_req_t *pReq = (passcode_req_t *)pMsg->pdu;
        Log_info2("BondMgr Requested passcode. We are %s passcode %06d",
                  (IArg)(pReq->uiInputs?"Sending":"Displaying"),
                  DEFAULT_PASSCODE);
        // Send passcode response.
        GAPBondMgr_PasscodeRsp(pReq->connHandle, SUCCESS, DEFAULT_PASSCODE);
      }
      break;

    case APP_MSG_PRZ_CONN_EVT:
    {
        ProjectZero_processConnEvt((Gap_ConnEventRpt_t *)pMsg->pdu);
        break;
    }
  }
}


/******************************************************************************
 *****************************************************************************
 *
 *  Handlers of system/application events deferred to the user Task context.
 *  Invoked from the application Task function above.
 *
 *  Further down you can find the callback handler section containing the
 *  functions that defer their actions via messages to the application task.
 *
 ****************************************************************************
 *****************************************************************************/


/*
 * @brief   Process a pending GAP Role state change event.
 *
 * @param   newState - new state
 *
 * @return  None.
 */
static void user_processGapStateChangeEvt(gaprole_States_t newState)
{
  switch ( newState )
  {
    case GAPROLE_STARTED:
      {
        uint8_t ownAddress[B_ADDR_LEN];
        uint8_t systemId[DEVINFO_SYSTEM_ID_LEN];

        GAPRole_GetParameter(GAPROLE_BD_ADDR, ownAddress);

        // use 6 bytes of device address for 8 bytes of system ID value
        systemId[0] = ownAddress[0];
        systemId[1] = ownAddress[1];
        systemId[2] = ownAddress[2];

        // set middle bytes to zero
        systemId[4] = 0x00;
        systemId[3] = 0x00;

        // shift three bytes up
        systemId[7] = ownAddress[5];
        systemId[6] = ownAddress[4];
        systemId[5] = ownAddress[3];

        DevInfo_SetParameter(DEVINFO_SYSTEM_ID, DEVINFO_SYSTEM_ID_LEN, systemId);

        // Display device address
        char *cstr_ownAddress = Util_convertBdAddr2Str(ownAddress);
        Log_info1("GAP is started. Our address: \x1b[32m%s\x1b[0m", (IArg)cstr_ownAddress);
      }
      break;

    case GAPROLE_ADVERTISING:
      Log_info0("Advertising");
      break;

    case GAPROLE_CONNECTED:
      {
        uint8_t peerAddress[B_ADDR_LEN];

        GAPRole_GetParameter(GAPROLE_CONN_BD_ADDR, peerAddress);

        char *cstr_peerAddress = Util_convertBdAddr2Str(peerAddress);
        Log_info1("Connected. Peer address: \x1b[32m%s\x1b[0m", (IArg)cstr_peerAddress);
       }
      break;

    case GAPROLE_CONNECTED_ADV:
      Log_info0("Connected and advertising");
      break;

    case GAPROLE_WAITING:
      Log_info0("Disconnected / Idle");
      break;

    case GAPROLE_WAITING_AFTER_TIMEOUT:
      Log_info0("Connection timed out");
      break;

    case GAPROLE_ERROR:
      Log_info0("Error");
      break;

    default:
      break;
  }
}


/*
 * @brief   Handle a write request sent from a peer device.
 *
 *          Invoked by the Task based on a message received from a callback.
 *
 *          When we get here, the request has already been accepted by the
 *          service and is valid from a BLE protocol perspective as well as
 *          having the correct length as defined in the service implementation.
 *
 * @param   pCharData  pointer to malloc'd char write data
 *
 * @return  None.
 */
void user_LedService_ValueChangeHandler(char_data_t *pCharData)
{
  static uint8_t pretty_data_holder[16]; // 5 bytes as hex string "AA:BB:CC:DD:EE"
  Util_convertArrayToHexString(pCharData->data, pCharData->dataLen,
                               pretty_data_holder, sizeof(pretty_data_holder));

  switch (pCharData->paramID)
  {
    case LS_LED0_ID:
      Log_info3("Value Change msg: %s %s: %s",
                (IArg)"LED Service",
                (IArg)"LED0",
                (IArg)pretty_data_holder);

      // Do something useful with pCharData->data here
      // -------------------------
      // Set the output value equal to the received value. 0 is off, not 0 is on
      PIN_setOutputValue(ledPinHandle, Board_RLED, pCharData->data[0]);
      Log_info2("Turning %s %s",
                (IArg)"\x1b[31mLED0\x1b[0m",
                (IArg)(pCharData->data[0]?"on":"off"));
      break;

    case LS_LED1_ID:
      Log_info3("Value Change msg: %s %s: %s",
                (IArg)"LED Service",
                (IArg)"LED1",
                (IArg)pretty_data_holder);

      // Do something useful with pCharData->data here
      // -------------------------
      // Set the output value equal to the received value. 0 is off, not 0 is on
      PIN_setOutputValue(ledPinHandle, Board_GLED, pCharData->data[0]);
      Log_info2("Turning %s %s",
                (IArg)"\x1b[32mLED1\x1b[0m",
                (IArg)(pCharData->data[0]?"on":"off"));
      break;

  default:
    return;
  }
}

/*
 * @brief   Handle a write request sent from a peer device.
 *
 *          Invoked by the Task based on a message received from a callback.
 *
 *          When we get here, the request has already been accepted by the
 *          service and is valid from a BLE protocol perspective as well as
 *          having the correct length as defined in the service implementation.
 *
 * @param   pCharData  pointer to malloc'd char write data
 *
 * @return  None.
 */
void user_DataService_ValueChangeHandler(char_data_t *pCharData)
{
  // Value to hold the received string for printing via Log, as Log printouts
  // happen in the Idle task, and so need to refer to a global/static variable.
  static uint8_t received_string[DS_STRING_LEN] = {0};

  switch (pCharData->paramID)
  {
    case DS_STRING_ID:
      // Do something useful with pCharData->data here
      // -------------------------
      // Copy received data to holder array, ensuring NULL termination.
      memset(received_string, 0, DS_STRING_LEN);
      memcpy(received_string, pCharData->data, DS_STRING_LEN-1);
      // Needed to copy before log statement, as the holder array remains after
      // the pCharData message has been freed and reused for something else.
      Log_info3("Value Change msg: %s %s: %s",
                (IArg)"Data Service",
                (IArg)"String",
                (IArg)received_string);
      break;

    case DS_STREAM_ID:
      Log_info3("Value Change msg: Data Service Stream: %02x:%02x:%02x...",
                (IArg)pCharData->data[0],
                (IArg)pCharData->data[1],
                (IArg)pCharData->data[2]);
      // -------------------------
      // Do something useful with pCharData->data here
      break;

  default:
    return;
  }
}

/*
 * @brief   Handle a CCCD (configuration change) write received from a peer
 *          device. This tells us whether the peer device wants us to send
 *          Notifications or Indications.
 *
 * @param   pCharData  pointer to malloc'd char write data
 *
 * @return  None.
 */
void user_DataService_CfgChangeHandler(char_data_t *pCharData)
{
#if defined(UARTLOG_ENABLE)
  // Cast received data to uint16, as that's the format for CCCD writes.
  uint16_t configValue = *(uint16_t *)pCharData->data;
  char *configValString;

  // Determine what to tell the user
  switch(configValue)
  {
  case GATT_CFG_NO_OPERATION:
    configValString = "Noti/Ind disabled";
    break;
  case GATT_CLIENT_CFG_NOTIFY:
    configValString = "Notifications enabled";
    break;
  case GATT_CLIENT_CFG_INDICATE:
    configValString = "Indications enabled";
    break;
  }
#endif
  switch (pCharData->paramID)
  {
    case DS_STREAM_ID:
      Log_info3("CCCD Change msg: %s %s: %s",
                (IArg)"Data Service",
                (IArg)"Stream",
                (IArg)configValString);
      // -------------------------
      // Do something useful with configValue here. It tells you whether someone
      // wants to know the state of this characteristic.
      // ...
      break;
  }
}


/*
 * @brief   Process an incoming BLE stack message.
 *
 *          This could be a GATT message from a peer device like acknowledgement
 *          of an Indication we sent, or it could be a response from the stack
 *          to an HCI message that the user application sent.
 *
 * @param   pMsg - message to process
 *
 * @return  TRUE if safe to deallocate incoming message, FALSE otherwise.
 */
static uint8_t ProjectZero_processStackMsg(ICall_Hdr *pMsg)
{
  uint8_t safeToDealloc = TRUE;

  switch (pMsg->event)
  {
    case GATT_MSG_EVENT:
      // Process GATT message
      safeToDealloc = ProjectZero_processGATTMsg((gattMsgEvent_t *)pMsg);
      break;

    case HCI_GAP_EVENT_EVENT:
      {
        // Process HCI message
        switch(pMsg->status)
        {
          case HCI_COMMAND_COMPLETE_EVENT_CODE:
            // Process HCI Command Complete Event
            Log_info0("HCI Command Complete Event received");
            break;

          default:
            break;
        }
      }
      break;

    default:
      // do nothing
      break;
  }

  return (safeToDealloc);
}


/*
 * @brief   Process GATT messages and events.
 *
 * @return  TRUE if safe to deallocate incoming message, FALSE otherwise.
 */
static uint8_t ProjectZero_processGATTMsg(gattMsgEvent_t *pMsg)
{
  // See if GATT server was unable to transmit an ATT response
  if (pMsg->hdr.status == blePending)
  {
    Log_warning1("Outgoing RF FIFO full. Re-schedule transmission of msg with opcode 0x%02x",
      pMsg->method);

    // No HCI buffer was available. Let's try to retransmit the response
    // on the next connection event.
    if(ProjectZero_RegistertToAllConnectionEvent(FOR_ATT_RSP) == SUCCESS)
    {
      // First free any pending response
      ProjectZero_freeAttRsp(FAILURE);

      // Hold on to the response message for retransmission
      pAttRsp = pMsg;

      // Don't free the response message yet
      return (FALSE);
    }
  }
  else if (pMsg->method == ATT_FLOW_CTRL_VIOLATED_EVENT)
  {
    // ATT request-response or indication-confirmation flow control is
    // violated. All subsequent ATT requests or indications will be dropped.
    // The app is informed in case it wants to drop the connection.

    // Log the opcode of the message that caused the violation.
    Log_error1("Flow control violated. Opcode of offending ATT msg: 0x%02x",
      pMsg->msg.flowCtrlEvt.opcode);
  }
  else if (pMsg->method == ATT_MTU_UPDATED_EVENT)
  {
    // MTU size updated
    Log_info1("MTU Size change: %d bytes", pMsg->msg.mtuEvt.MTU);
  }
  else
  {
    // Got an expected GATT message from a peer.
    Log_info1("Recevied GATT Message. Opcode: 0x%02x", pMsg->method);
  }

  // Free message payload. Needed only for ATT Protocol messages
  GATT_bm_free(&pMsg->msg, pMsg->method);

  // It's safe to free the incoming message
  return (TRUE);
}

/*********************************************************************
 * @fn      ProjectZero_processConnEvt
 *
 * @brief   Process connection event.
 *
 * @param pReport pointer to connection event report
 */
static void ProjectZero_processConnEvt(Gap_ConnEventRpt_t *pReport)
{

  if( CONNECTION_EVENT_REGISTRATION_CAUSE(FOR_ATT_RSP))
  {
    // The GATT server might have returned a blePending as it was trying
    // to process an ATT Response. Now that we finished with this
    // connection event, let's try sending any remaining ATT Responses
    // on the next connection event.
    // Try to retransmit pending ATT Response (if any)
    ProjectZero_sendAttRsp();
  }

}



/*
 *  Application error handling functions
 *****************************************************************************/

/*
 * @brief   Send a pending ATT response message.
 *
 *          The message is one that the stack was trying to send based on a
 *          peer request, but the response couldn't be sent because the
 *          user application had filled the TX queue with other data.
 *
 * @param   none
 *
 * @return  none
 */
static void ProjectZero_sendAttRsp(void)
{
  // See if there's a pending ATT Response to be transmitted
  if (pAttRsp != NULL)
  {
    uint8_t status;

    // Increment retransmission count
    rspTxRetry++;

    // Try to retransmit ATT response till either we're successful or
    // the ATT Client times out (after 30s) and drops the connection.
    status = GATT_SendRsp(pAttRsp->connHandle, pAttRsp->method, &(pAttRsp->msg));
    if ((status != blePending) && (status != MSG_BUFFER_NOT_AVAIL))
    {
      // Disable connection event end notice
      ProjectZero_UnRegistertToAllConnectionEvent (FOR_ATT_RSP);

      // We're done with the response message
      ProjectZero_freeAttRsp(status);
    }
    else
    {
      // Continue retrying
      Log_warning2("Retrying message with opcode 0x%02x. Attempt %d",
        pAttRsp->method, rspTxRetry);
    }
  }
}

/*
 * @brief   Free ATT response message.
 *
 * @param   status - response transmit status
 *
 * @return  none
 */
static void ProjectZero_freeAttRsp(uint8_t status)
{
  // See if there's a pending ATT response message
  if (pAttRsp != NULL)
  {
    // See if the response was sent out successfully
    if (status == SUCCESS)
    {
      Log_info2("Sent message with opcode 0x%02x. Attempt %d",
        pAttRsp->method, rspTxRetry);
    }
    else
    {
      Log_error2("Gave up message with opcode 0x%02x. Status: %d",
        pAttRsp->method, status);

      // Free response payload
      GATT_bm_free(&pAttRsp->msg, pAttRsp->method);
    }

    // Free response message
    ICall_freeMsg(pAttRsp);

    // Reset our globals
    pAttRsp = NULL;
    rspTxRetry = 0;
  }
}


/******************************************************************************
 *****************************************************************************
 *
 *  Handlers of direct system callbacks.
 *
 *  Typically enqueue the information or request as a message for the
 *  application Task for handling.
 *
 ****************************************************************************
 *****************************************************************************/

/*********************************************************************
 * @fn      ProjectZero_connEvtCB
 *
 * @brief   Connection event callback.
 *
 * @param pReport pointer to connection event report
 */
static void ProjectZero_connEvtCB(Gap_ConnEventRpt_t *pReport)
{
  // Enqueue the event for processing in the app context.
  user_enqueueRawAppMsg(APP_MSG_PRZ_CONN_EVT, (uint8_t *)pReport, sizeof(pReport));
  ICall_free(pReport);
}

/*
 *  Callbacks from the Stack Task context (GAP or Service changes)
 *****************************************************************************/

/**
 * Callback from GAP Role indicating a role state change.
 */
static void user_gapStateChangeCB(gaprole_States_t newState)
{
  Log_info1("(CB) GAP State change: %d, Sending msg to app.", (IArg)newState);
  user_enqueueRawAppMsg( APP_MSG_GAP_STATE_CHANGE, (uint8_t *)&newState, sizeof(newState) );
}

/*
 * @brief   Passcode callback.
 *
 * @param   connHandle - connection handle
 * @param   uiInputs   - input passcode?
 * @param   uiOutputs  - display passcode?
 * @param   numComparison - numeric comparison value
 *
 * @return  none
 */
static void user_gapBondMgr_passcodeCB(uint8_t *deviceAddr, uint16_t connHandle,
                                       uint8_t uiInputs, uint8_t uiOutputs, uint32_t numComparison)
{
  passcode_req_t req =
  {
    .connHandle = connHandle,
    .uiInputs = uiInputs,
    .uiOutputs = uiOutputs,
    .numComparison = numComparison
  };

  // Defer handling of the passcode request to the application, in case
  // user input is required, and because a BLE API must be used from Task.
  user_enqueueRawAppMsg(APP_MSG_SEND_PASSCODE, (uint8_t *)&req, sizeof(req));
}

/*
 * @brief   Pairing state callback.
 *
 * @param   connHandle - connection handle
 * @param   state      - pairing state
 * @param   status     - pairing status
 *
 * @return  none
 */
static void user_gapBondMgr_pairStateCB(uint16_t connHandle, uint8_t state,
                                        uint8_t status)
{
  if (state == GAPBOND_PAIRING_STATE_STARTED)
  {
    Log_info0("Pairing started");
  }
  else if (state == GAPBOND_PAIRING_STATE_COMPLETE)
  {
    if (status == SUCCESS)
    {
      Log_info0("Pairing completed successfully.");
    }
    else
    {
      Log_error1("Pairing failed. Error: %02x", status);
    }
  }
  else if (state == GAPBOND_PAIRING_STATE_BONDED)
  {
    if (status == SUCCESS)
    {
     Log_info0("Re-established pairing from stored bond info.");
    }
  }
}

/**
 * Callback handler for characteristic value changes in services.
 */
static void user_service_ValueChangeCB( uint16_t connHandle, uint16_t svcUuid,
                                        uint8_t paramID, uint8_t *pValue,
                                        uint16_t len )
{
  // See the service header file to compare paramID with characteristic.
  Log_info2("(CB) Characteristic value change: svc(0x%04x) paramID(%d). "
            "Sending msg to app.", (IArg)svcUuid, (IArg)paramID);
  user_enqueueCharDataMsg(APP_MSG_SERVICE_WRITE, connHandle, svcUuid, paramID,
                          pValue, len);
}

/**
 * Callback handler for characteristic configuration changes in services.
 */
static void user_service_CfgChangeCB( uint16_t connHandle, uint16_t svcUuid,
                                      uint8_t paramID, uint8_t *pValue,
                                      uint16_t len )
{
  Log_info2("(CB) Char config change: svc(0x%04x) paramID(%d). "
            "Sending msg to app.", (IArg)svcUuid, (IArg)paramID);
  user_enqueueCharDataMsg(APP_MSG_SERVICE_CFG, connHandle, svcUuid,
                          paramID, pValue, len);
}

/******************************************************************************
 *****************************************************************************
 *
 *  Utility functions
 *
 ****************************************************************************
 *****************************************************************************/

/*
 * @brief  Generic message constructor for characteristic data.
 *
 *         Sends a message to the application for handling in Task context where
 *         the message payload is a char_data_t struct.
 *
 *         From service callbacks the appMsgType is APP_MSG_SERVICE_WRITE or
 *         APP_MSG_SERVICE_CFG, and functions running in another context than
 *         the Task itself, can set the type to APP_MSG_UPDATE_CHARVAL to
 *         make the user Task loop invoke user_updateCharVal function for them.
 *
 * @param  appMsgType    Enumerated type of message being sent.
 * @param  connHandle    GAP Connection handle of the relevant connection
 * @param  serviceUUID   16-bit part of the relevant service UUID
 * @param  paramID       Index of the characteristic in the service
 * @oaram  *pValue       Pointer to characteristic value
 * @param  len           Length of characteristic data
 */
static void user_enqueueCharDataMsg( app_msg_types_t appMsgType,
                                     uint16_t connHandle,
                                     uint16_t serviceUUID, uint8_t paramID,
                                     uint8_t *pValue, uint16_t len )
{
  // Called in Stack's Task context, so can't do processing here.
  // Send message to application message queue about received data.
  uint16_t readLen = len; // How much data was written to the attribute

  // Allocate memory for the message.
  // Note: The pCharData message doesn't have to contain the data itself, as
  //       that's stored in a variable in the service implementation.
  //
  //       However, to prevent data loss if a new value is received before the
  //       service's container is read out via the GetParameter API is called,
  //       we copy the characteristic's data now.
  app_msg_t *pMsg = ICall_malloc( sizeof(app_msg_t) + sizeof(char_data_t) +
                                  readLen );

  if (pMsg != NULL)
  {
    pMsg->type = appMsgType;

    char_data_t *pCharData = (char_data_t *)pMsg->pdu;
    pCharData->svcUUID = serviceUUID; // Use 16-bit part of UUID.
    pCharData->paramID = paramID;
    // Copy data from service now.
    memcpy(pCharData->data, pValue, readLen);
    // Update pCharData with how much data we received.
    pCharData->dataLen = readLen;
    // Enqueue the message using pointer to queue node element.
    Queue_enqueue(hApplicationMsgQ, &pMsg->_elem);
  // Let application know there's a message.
  Event_post(syncEvent, PRZ_APP_MSG_EVT);
  }
}

/*
 * @brief  Generic message constructor for application messages.
 *
 *         Sends a message to the application for handling in Task context.
 *
 * @param  appMsgType    Enumerated type of message being sent.
 * @oaram  *pValue       Pointer to characteristic value
 * @param  len           Length of characteristic data
 */
static void user_enqueueRawAppMsg(app_msg_types_t appMsgType, uint8_t *pData,
                                  uint16_t len)
{
  // Allocate memory for the message.
  app_msg_t *pMsg = ICall_malloc( sizeof(app_msg_t) + len );

  if (pMsg != NULL)
  {
    pMsg->type = appMsgType;

    // Copy data into message
    memcpy(pMsg->pdu, pData, len);

    // Enqueue the message using pointer to queue node element.
    Queue_enqueue(hApplicationMsgQ, &pMsg->_elem);
//    // Let application know there's a message.
    Event_post(syncEvent, PRZ_APP_MSG_EVT);
  }
}


/*
 * @brief  Convenience function for updating characteristic data via char_data_t
 *         structured message.
 *
 * @note   Must run in Task context in case BLE Stack APIs are invoked.
 *
 * @param  *pCharData  Pointer to struct with value to update.
 */
static void user_updateCharVal(char_data_t *pCharData)
{
  switch(pCharData->svcUUID) {
    case LED_SERVICE_SERV_UUID:
      LedService_SetParameter(pCharData->paramID, pCharData->dataLen,
                              pCharData->data);
    break;
  }
}

/*
 * @brief   Convert {0x01, 0x02} to "01:02"
 *
 * @param   src - source byte-array
 * @param   src_len - length of array
 * @param   dst - destination string-array
 * @param   dst_len - length of array
 *
 * @return  array as string
 */
static char *Util_convertArrayToHexString(uint8_t const *src, uint8_t src_len,
                                          uint8_t *dst, uint8_t dst_len)
{
  char        hex[] = "0123456789ABCDEF";
  uint8_t     *pStr = dst;
  uint8_t     avail = dst_len-1;

  memset(dst, 0, avail);

  while (src_len && avail > 3)
  {
    if (avail < dst_len-1) { *pStr++ = ':'; avail -= 1; };
    *pStr++ = hex[*src >> 4];
    *pStr++ = hex[*src++ & 0x0F];
    avail -= 2;
    src_len--;
  }

  if (src_len && avail)
    *pStr++ = ':'; // Indicate not all data fit on line.

  return (char *)dst;
}

#if defined(UARTLOG_ENABLE)
/*
 * @brief   Extract the LOCALNAME from Scan/AdvData
 *
 * @param   data - Pointer to the advertisement or scan response data
 *
 * @return  Pointer to null-terminated string with the adv local name.
 */
static char *Util_getLocalNameStr(const uint8_t *data) {
  uint8_t nuggetLen = 0;
  uint8_t nuggetType = 0;
  uint8_t advIdx = 0;

  static char localNameStr[32] = { 0 };
  memset(localNameStr, 0, sizeof(localNameStr));

  for (advIdx = 0; advIdx < 32;) {
    nuggetLen = data[advIdx++];
    nuggetType = data[advIdx];
    if ( (nuggetType == GAP_ADTYPE_LOCAL_NAME_COMPLETE ||
          nuggetType == GAP_ADTYPE_LOCAL_NAME_SHORT) && nuggetLen < 31) {
      memcpy(localNameStr, &data[advIdx + 1], nuggetLen - 1);
      break;
    } else {
      advIdx += nuggetLen;
    }
  }

  return localNameStr;
}
#endif

/*********************************************************************
*********************************************************************/

The code gets uploaded successfully but the custom board doesn't show advertisement on the BLEScanner. In debug mode, the code executes successfully.

3. In order to find the cause, I tried using SmartRF in the Proprietary and the BLE modes to check Tx and Rx between 2 Launchpads and upon its success went to replace one of the Launch Pads with my custom board. However even after playing with all the RF parameters, I'm still not able to figure out if the problem lies somewhere within the Hardware, the design of the board or the parameter settings.

a. Connection between 2 launchpads (BLE mode):

b. Failed attempt at Tx-Rx data from custom board (left) to Launch Pad (right) in the Proprietary mode:

Note: I am using custom target config setting as VQFN 4x4 and Internal Bias, Diff. RF based on the Balun IC

The microcontroller works fine as far as uploading and working of a simple code in CCS is concerned.

I have made this version of board after submitting my schematic for review to TI experts for the antenna section and incorporating their suggestions wrt antenna design and matching pi network, however I'd be glad if you are able to point out any mistakes.

I am attaching the schematic and layout for your reference:

1. MCU connections

2. Crystals and JTAG connectors

3. Passives around MCU

4. Antenna Section

Edu_IITB_V3.2.brd

Please help me in figuring out that if the custom board working, why is it not able to advertise on the BLE scanner, nor shows any trace on SmartRF?

Thanks.

Regards,

Ritoo

  • I would like to add that in SmartRF studio, my custom board is being detected but the CMD_RADIO_SETUP is IDLE upon transmission.

    This is in BLE mode, both for the Transmitter(Custom Board) and the Receiver( CC2640R2F LP)

    Please help me identify the source of the problem

    Thanks

  • Hi,

    As a quick test, could you try another BLE examples? Such as simple_peripheral?

    Best Regards,

    Jan

  • Hi, I tried Simple_peripheral by following the steps mentioned here, but some errors arose, so I followed the steps mentioned by Markel here but for ble instead of ble5, however even after successful compilation I am still not able to see anything on BLEScanner. Kindly suggest the next course of action.

    Here are my files:

    board.h

    /*
     * Copyright (c) 2016-2017, 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.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    
    #ifndef __BOARD_H
    #define __BOARD_H
    
    #define Board_CC2640R2_LAUNCHXL
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    #include <ti/drivers/ADC.h>
    #include <ti/drivers/ADCBuf.h>
    #include <ti/drivers/PWM.h>
    #include <ti/drivers/SPI.h>
    #include <ti/drivers/UART.h>
    #include <ti/drivers/Watchdog.h>
    
    #include <ti/drivers/Board.h>
    
    #define Board_initGeneral()     Board_init()  /* deprecated */
    
    #include "CC2640R2_LAUNCHXL.h"
    
    #define Board_shutDownExtFlash() CC2640R2_LAUNCHXL_shutDownExtFlash()
    #define Board_wakeUpExtFlash() CC2640R2_LAUNCHXL_wakeUpExtFlash()
    
    /* These #defines allow us to reuse TI-RTOS across other device families */
    
    #define Board_ADC0              CC2640R2_LAUNCHXL_ADC0
    #define Board_ADC1              CC2640R2_LAUNCHXL_ADC1
    
    #define Board_ADCBUF0           CC2640R2_LAUNCHXL_ADCBUF0
    #define Board_ADCBUF0CHANNEL0   CC2640R2_LAUNCHXL_ADCBUF0CHANNEL0
    #define Board_ADCBUF0CHANNEL1   CC2640R2_LAUNCHXL_ADCBUF0CHANNEL1
    
    #define Board_CRYPTO0           CC2640R2_LAUNCHXL_CRYPTO0
    #define Board_AESCCM0           CC2640R2_LAUNCHXL_AESCCM0
    #define Board_AESGCM0           CC2640R2_LAUNCHXL_AESGCM0
    #define Board_AESCBC0           CC2640R2_LAUNCHXL_AESCBC0
    #define Board_AESCTR0           CC2640R2_LAUNCHXL_AESCTR0
    #define Board_AESECB0           CC2640R2_LAUNCHXL_AESECB0
    #define Board_AESCTRDRBG0       CC2640R2_LAUNCHXL_AESCTRDRBG0
    
    #define Board_DIO0              CC2640R2_LAUNCHXL_DIO0
    #define Board_DIO1_RFSW         CC2640R2_LAUNCHXL_DIO1_RFSW
    #define Board_DIO12             CC2640R2_LAUNCHXL_DIO12
    #define Board_DIO15             CC2640R2_LAUNCHXL_DIO15
    #define Board_DIO16_TDO         CC2640R2_LAUNCHXL_DIO16_TDO
    #define Board_DIO17_TDI         CC2640R2_LAUNCHXL_DIO17_TDI
    #define Board_DIO21             CC2640R2_LAUNCHXL_DIO21
    #define Board_DIO22             CC2640R2_LAUNCHXL_DIO22
    
    #define Board_DIO23_ANALOG      CC2640R2_LAUNCHXL_DIO23_ANALOG
    #define Board_DIO24_ANALOG      CC2640R2_LAUNCHXL_DIO24_ANALOG
    #define Board_DIO25_ANALOG      CC2640R2_LAUNCHXL_DIO25_ANALOG
    #define Board_DIO26_ANALOG      CC2640R2_LAUNCHXL_DIO26_ANALOG
    #define Board_DIO27_ANALOG      CC2640R2_LAUNCHXL_DIO27_ANALOG
    #define Board_DIO28_ANALOG      CC2640R2_LAUNCHXL_DIO28_ANALOG
    #define Board_DIO29_ANALOG      CC2640R2_LAUNCHXL_DIO29_ANALOG
    #define Board_DIO30_ANALOG      CC2640R2_LAUNCHXL_DIO30_ANALOG
    
    #define Board_GPIO_BUTTON0      CC2640R2_LAUNCHXL_GPIO_S1
    #define Board_GPIO_BUTTON1      CC2640R2_LAUNCHXL_GPIO_S2
    #define Board_GPIO_BTN1         CC2640R2_LAUNCHXL_GPIO_S1
    #define Board_GPIO_BTN2         CC2640R2_LAUNCHXL_GPIO_S2
    #define Board_GPIO_LED0         CC2640R2_LAUNCHXL_GPIO_LED_RED
    #define Board_GPIO_LED1         CC2640R2_LAUNCHXL_GPIO_LED_GREEN
    #define Board_GPIO_LED2         CC2640R2_LAUNCHXL_GPIO_LED_RED
    #define Board_GPIO_RLED         CC2640R2_LAUNCHXL_GPIO_LED_RED
    #define Board_GPIO_GLED         CC2640R2_LAUNCHXL_GPIO_LED_GREEN
    #define Board_GPIO_LED_ON       CC2640R2_LAUNCHXL_GPIO_LED_ON
    #define Board_GPIO_LED_OFF      CC2640R2_LAUNCHXL_GPIO_LED_OFF
    #define Board_GPIO_TMP116_EN    CC2640R2_LAUNCHXL_GPIO_TMP116_EN
    
    #define Board_GPTIMER0A         CC2640R2_LAUNCHXL_GPTIMER0A
    #define Board_GPTIMER0B         CC2640R2_LAUNCHXL_GPTIMER0B
    #define Board_GPTIMER1A         CC2640R2_LAUNCHXL_GPTIMER1A
    #define Board_GPTIMER1B         CC2640R2_LAUNCHXL_GPTIMER1B
    #define Board_GPTIMER2A         CC2640R2_LAUNCHXL_GPTIMER2A
    #define Board_GPTIMER2B         CC2640R2_LAUNCHXL_GPTIMER2B
    #define Board_GPTIMER3A         CC2640R2_LAUNCHXL_GPTIMER3A
    #define Board_GPTIMER3B         CC2640R2_LAUNCHXL_GPTIMER3B
    
    #define Board_I2C0              CC2640R2_LAUNCHXL_I2C0
    #define Board_I2C_TMP           Board_I2C0
    
    #define Board_I2S0              CC2640R2_LAUNCHXL_I2S0
    #define Board_I2S_ADO           CC2640R2_LAUNCHXL_I2S_ADO
    #define Board_I2S_ADI           CC2640R2_LAUNCHXL_I2S_ADI
    #define Board_I2S_BCLK          CC2640R2_LAUNCHXL_I2S_BCLK
    #define Board_I2S_MCLK          CC2640R2_LAUNCHXL_I2S_MCLK
    #define Board_I2S_WCLK          CC2640R2_LAUNCHXL_I2S_WCLK
    
    #define Board_NVSINTERNAL       CC2640R2_LAUNCHXL_NVSCC26XX0
    #define Board_NVSEXTERNAL       CC2640R2_LAUNCHXL_NVSSPI25X0
    
    #define Board_PIN_BUTTON0       CC2640R2_LAUNCHXL_PIN_BTN1
    #define Board_PIN_BUTTON1       CC2640R2_LAUNCHXL_PIN_BTN2
    #define Board_PIN_BTN1          CC2640R2_LAUNCHXL_PIN_BTN1
    #define Board_PIN_BTN2          CC2640R2_LAUNCHXL_PIN_BTN2
    #define Board_PIN_LED0          CC2640R2_LAUNCHXL_PIN_RLED
    #define Board_PIN_LED1          CC2640R2_LAUNCHXL_PIN_GLED
    #define Board_PIN_LED2          CC2640R2_LAUNCHXL_PIN_RLED
    #define Board_PIN_RLED          CC2640R2_LAUNCHXL_PIN_RLED
    #define Board_PIN_GLED          CC2640R2_LAUNCHXL_PIN_GLED
    
    #define Board_PWM0              CC2640R2_LAUNCHXL_PWM0
    #define Board_PWM1              CC2640R2_LAUNCHXL_PWM1
    #define Board_PWM2              CC2640R2_LAUNCHXL_PWM2
    #define Board_PWM3              CC2640R2_LAUNCHXL_PWM3
    #define Board_PWM4              CC2640R2_LAUNCHXL_PWM4
    #define Board_PWM5              CC2640R2_LAUNCHXL_PWM5
    #define Board_PWM6              CC2640R2_LAUNCHXL_PWM6
    #define Board_PWM7              CC2640R2_LAUNCHXL_PWM7
    
    #define Board_SD0               CC2640R2_LAUNCHXL_SDSPI0
    
    #define Board_SPI0              CC2640R2_LAUNCHXL_SPI0
    #define Board_SPI1              CC2640R2_LAUNCHXL_SPI1
    #define Board_SPI_FLASH_CS      CC2640R2_LAUNCHXL_SPI_FLASH_CS
    #define Board_FLASH_CS_ON       0
    #define Board_FLASH_CS_OFF      1
    
    #define Board_SPI_MASTER        CC2640R2_LAUNCHXL_SPI0
    #define Board_SPI_SLAVE         CC2640R2_LAUNCHXL_SPI0
    #define Board_SPI_MASTER_READY  CC2640R2_LAUNCHXL_SPI_MASTER_READY
    #define Board_SPI_SLAVE_READY   CC2640R2_LAUNCHXL_SPI_SLAVE_READY
    #define Board_UART0             CC2640R2_LAUNCHXL_UART0
    
    #define Board_WATCHDOG0         CC2640R2_LAUNCHXL_WATCHDOG0
    
    /*
     * These macros are provided for backwards compatibility.
     * Please use the <Driver>_init functions directly rather
     * than Board_init<Driver>.
     */
    #define Board_initADC()         ADC_init()
    #define Board_initADCBuf()      ADCBuf_init()
    #define Board_initGPIO()        GPIO_init()
    #define Board_initPWM()         PWM_init()
    #define Board_initSPI()         SPI_init()
    #define Board_initUART()        UART_init()
    #define Board_initWatchdog()    Watchdog_init()
    
    /*
     * These macros are provided for backwards compatibility.
     * Please use the 'Board_PIN_xxx' macros to differentiate
     * them from the 'Board_GPIO_xxx' macros.
     */
    #define Board_BUTTON0           Board_PIN_BUTTON0
    #define Board_BUTTON1           Board_PIN_BUTTON1
    #define Board_BTN1              Board_PIN_BTN1
    #define Board_BTN2              Board_PIN_BTN2
    #define Board_LED_ON            Board_GPIO_LED_ON
    #define Board_LED_OFF           Board_GPIO_LED_OFF
    #define Board_LED0              Board_PIN_LED0
    #define Board_LED1              Board_PIN_LED1
    #define Board_LED2              Board_PIN_LED2
    #define Board_RLED              Board_PIN_RLED
    #define Board_GLED              Board_PIN_GLED
    #define Board_ADCBUFCHANNEL0    Board_ADCBUF0CHANNEL0
    #define Board_ADCBUFCHANNEL1    Board_ADCBUF0CHANNEL1
    
    #ifdef __cplusplus
    }
    #endif
    
    #endif /* __BOARD_H */
    

    launch.c

    /*
     * Copyright (c) 2016-2017, 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.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    
    /*
     *  ====================== CC2640R2_LAUNCHXL.c =================================
     *  This board file is made for the 7x7 mm QFN package, to convert this board
     *  file to use for other smaller device packages please refer to the table
     *  below which lists the max IOID values supported by each package. All other
     *  unused pins should be set to IOID_UNUSED.
     *
     *  Furthermore the board file is also used
     *  to define a symbol that configures the RF front end and bias.
     *  See the comments below for more information.
     *  For an in depth tutorial on how to create a custom board file, please refer
     *  to the section "Running the SDK on Custom Boards" with in the Software
     *  Developer's Guide.
     *
     *  Refer to the datasheet for all the package options and IO descriptions:
     *  http://www.ti.com/lit/ds/symlink/cc2640r2f.pdf
     *
     *  +-----------------------+------------------+-----------------------+
     *  |     Package Option    |  Total GPIO Pins |   MAX IOID            |
     *  +=======================+==================+=======================+
     *  |     7x7 mm QFN        |     31           |   IOID_30             |
     *  +-----------------------+------------------+-----------------------+
     *  |     5x5 mm QFN        |     15           |   IOID_14             |
     *  +-----------------------+------------------+-----------------------+
     *  |     4x4 mm QFN        |     10           |   IOID_9              |
     *  +-----------------------+------------------+-----------------------+
     *  |     2.7 x 2.7 mm WCSP |     14           |   IOID_13             |
     *  +-----------------------+------------------+-----------------------+
     *  ============================================================================
     */
    
    #include <stdbool.h>
    #include <stddef.h>
    #include <stdint.h>
    
    #include <ti/devices/cc26x0r2/driverlib/ioc.h>
    #include <ti/devices/cc26x0r2/driverlib/udma.h>
    #include <ti/devices/cc26x0r2/inc/hw_ints.h>
    #include <ti/devices/cc26x0r2/inc/hw_memmap.h>
    
    #include "CC2640R2_LAUNCHXL.h"
    
    /*
     *  =============================== ADCBuf ===============================
     */
    #include <ti/drivers/ADCBuf.h>
    #include <ti/drivers/adcbuf/ADCBufCC26XX.h>
    
    ADCBufCC26XX_Object adcBufCC26xxObjects[CC2640R2_LAUNCHXL_ADCBUFCOUNT];
    
    /*
     *  This table converts a virtual adc channel into a dio and internal analogue
     *  input signal. This table is necessary for the functioning of the adcBuf
     *  driver. Comment out unused entries to save flash. Dio and internal signal
     *  pairs are hardwired. Do not remap them in the table. You may reorder entire
     *  entries. The mapping of dio and internal signals is package dependent.
     */
    const ADCBufCC26XX_AdcChannelLutEntry ADCBufCC26XX_adcChannelLut[CC2640R2_LAUNCHXL_ADCBUF0CHANNELCOUNT] = {
        {CC2640R2_LAUNCHXL_DIO23_ANALOG, ADC_COMPB_IN_AUXIO7},
        {CC2640R2_LAUNCHXL_DIO24_ANALOG, ADC_COMPB_IN_AUXIO6},
        {CC2640R2_LAUNCHXL_DIO25_ANALOG, ADC_COMPB_IN_AUXIO5},
        {CC2640R2_LAUNCHXL_DIO26_ANALOG, ADC_COMPB_IN_AUXIO4},
        {CC2640R2_LAUNCHXL_DIO27_ANALOG, ADC_COMPB_IN_AUXIO3},
        {CC2640R2_LAUNCHXL_DIO28_ANALOG, ADC_COMPB_IN_AUXIO2},
        {CC2640R2_LAUNCHXL_DIO29_ANALOG, ADC_COMPB_IN_AUXIO1},
        {CC2640R2_LAUNCHXL_DIO30_ANALOG, ADC_COMPB_IN_AUXIO0},
        {PIN_UNASSIGNED, ADC_COMPB_IN_VDDS},
        {PIN_UNASSIGNED, ADC_COMPB_IN_DCOUPL},
        {PIN_UNASSIGNED, ADC_COMPB_IN_VSS},
    };
    
    const ADCBufCC26XX_HWAttrs adcBufCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADCBUFCOUNT] = {
        {
            .intPriority       = ~0,
            .swiPriority       = 0,
            .adcChannelLut     = ADCBufCC26XX_adcChannelLut,
        }
    };
    
    const ADCBuf_Config ADCBuf_config[CC2640R2_LAUNCHXL_ADCBUFCOUNT] = {
        {
            &ADCBufCC26XX_fxnTable,
            &adcBufCC26xxObjects[CC2640R2_LAUNCHXL_ADCBUF0],
            &adcBufCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADCBUF0]
        },
    };
    
    const uint_least8_t ADCBuf_count = CC2640R2_LAUNCHXL_ADCBUFCOUNT;
    
    /*
     *  =============================== ADC ===============================
     */
    #include <ti/drivers/ADC.h>
    #include <ti/drivers/adc/ADCCC26XX.h>
    
    ADCCC26XX_Object adcCC26xxObjects[CC2640R2_LAUNCHXL_ADCCOUNT];
    
    const ADCCC26XX_HWAttrs adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADCCOUNT] = {
        {
            .adcDIO              = CC2640R2_LAUNCHXL_DIO23_ANALOG,
            .adcCompBInput       = ADC_COMPB_IN_AUXIO7,
            .refSource           = ADCCC26XX_FIXED_REFERENCE,
            .samplingDuration    = ADCCC26XX_SAMPLING_DURATION_2P7_US,
            .inputScalingEnabled = true,
            .triggerSource       = ADCCC26XX_TRIGGER_MANUAL,
            .returnAdjustedVal   = false
        },
        {
            .adcDIO              = CC2640R2_LAUNCHXL_DIO24_ANALOG,
            .adcCompBInput       = ADC_COMPB_IN_AUXIO6,
            .refSource           = ADCCC26XX_FIXED_REFERENCE,
            .samplingDuration    = ADCCC26XX_SAMPLING_DURATION_2P7_US,
            .inputScalingEnabled = true,
            .triggerSource       = ADCCC26XX_TRIGGER_MANUAL,
            .returnAdjustedVal   = false
        },
        {
            .adcDIO              = CC2640R2_LAUNCHXL_DIO25_ANALOG,
            .adcCompBInput       = ADC_COMPB_IN_AUXIO5,
            .refSource           = ADCCC26XX_FIXED_REFERENCE,
            .samplingDuration    = ADCCC26XX_SAMPLING_DURATION_2P7_US,
            .inputScalingEnabled = true,
            .triggerSource       = ADCCC26XX_TRIGGER_MANUAL,
            .returnAdjustedVal   = false
        },
        {
            .adcDIO              = CC2640R2_LAUNCHXL_DIO26_ANALOG,
            .adcCompBInput       = ADC_COMPB_IN_AUXIO4,
            .refSource           = ADCCC26XX_FIXED_REFERENCE,
            .samplingDuration    = ADCCC26XX_SAMPLING_DURATION_2P7_US,
            .inputScalingEnabled = true,
            .triggerSource       = ADCCC26XX_TRIGGER_MANUAL,
            .returnAdjustedVal   = false
        },
        {
            .adcDIO              = CC2640R2_LAUNCHXL_DIO27_ANALOG,
            .adcCompBInput       = ADC_COMPB_IN_AUXIO3,
            .refSource           = ADCCC26XX_FIXED_REFERENCE,
            .samplingDuration    = ADCCC26XX_SAMPLING_DURATION_2P7_US,
            .inputScalingEnabled = true,
            .triggerSource       = ADCCC26XX_TRIGGER_MANUAL,
            .returnAdjustedVal   = false
        },
        {
            .adcDIO              = CC2640R2_LAUNCHXL_DIO28_ANALOG,
            .adcCompBInput       = ADC_COMPB_IN_AUXIO2,
            .refSource           = ADCCC26XX_FIXED_REFERENCE,
            .samplingDuration    = ADCCC26XX_SAMPLING_DURATION_2P7_US,
            .inputScalingEnabled = true,
            .triggerSource       = ADCCC26XX_TRIGGER_MANUAL,
            .returnAdjustedVal   = false
        },
        {
            .adcDIO              = CC2640R2_LAUNCHXL_DIO29_ANALOG,
            .adcCompBInput       = ADC_COMPB_IN_AUXIO1,
            .refSource           = ADCCC26XX_FIXED_REFERENCE,
            .samplingDuration    = ADCCC26XX_SAMPLING_DURATION_2P7_US,
            .inputScalingEnabled = true,
            .triggerSource       = ADCCC26XX_TRIGGER_MANUAL,
            .returnAdjustedVal   = false
        },
        {
            .adcDIO              = CC2640R2_LAUNCHXL_DIO30_ANALOG,
            .adcCompBInput       = ADC_COMPB_IN_AUXIO0,
            .refSource           = ADCCC26XX_FIXED_REFERENCE,
            .samplingDuration    = ADCCC26XX_SAMPLING_DURATION_10P9_MS,
            .inputScalingEnabled = true,
            .triggerSource       = ADCCC26XX_TRIGGER_MANUAL,
            .returnAdjustedVal   = false
        },
        {
            .adcDIO              = PIN_UNASSIGNED,
            .adcCompBInput       = ADC_COMPB_IN_DCOUPL,
            .refSource           = ADCCC26XX_FIXED_REFERENCE,
            .samplingDuration    = ADCCC26XX_SAMPLING_DURATION_2P7_US,
            .inputScalingEnabled = true,
            .triggerSource       = ADCCC26XX_TRIGGER_MANUAL,
            .returnAdjustedVal   = false
        },
        {
            .adcDIO              = PIN_UNASSIGNED,
            .adcCompBInput       = ADC_COMPB_IN_VSS,
            .refSource           = ADCCC26XX_FIXED_REFERENCE,
            .samplingDuration    = ADCCC26XX_SAMPLING_DURATION_2P7_US,
            .inputScalingEnabled = true,
            .triggerSource       = ADCCC26XX_TRIGGER_MANUAL,
            .returnAdjustedVal   = false
        },
        {
            .adcDIO              = PIN_UNASSIGNED,
            .adcCompBInput       = ADC_COMPB_IN_VDDS,
            .refSource           = ADCCC26XX_FIXED_REFERENCE,
            .samplingDuration    = ADCCC26XX_SAMPLING_DURATION_2P7_US,
            .inputScalingEnabled = true,
            .triggerSource       = ADCCC26XX_TRIGGER_MANUAL,
            .returnAdjustedVal   = false
        }
    };
    
    const ADC_Config ADC_config[CC2640R2_LAUNCHXL_ADCCOUNT] = {
        {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC2640R2_LAUNCHXL_ADC0], &adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADC0]},
        {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC2640R2_LAUNCHXL_ADC1], &adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADC1]},
        {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC2640R2_LAUNCHXL_ADC2], &adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADC2]},
        {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC2640R2_LAUNCHXL_ADC3], &adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADC3]},
        {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC2640R2_LAUNCHXL_ADC4], &adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADC4]},
        {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC2640R2_LAUNCHXL_ADC5], &adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADC5]},
        {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC2640R2_LAUNCHXL_ADC6], &adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADC6]},
        {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC2640R2_LAUNCHXL_ADC7], &adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADC7]},
        {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC2640R2_LAUNCHXL_ADCDCOUPL], &adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADCDCOUPL]},
        {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC2640R2_LAUNCHXL_ADCVSS], &adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADCVSS]},
        {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC2640R2_LAUNCHXL_ADCVDDS], &adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADCVDDS]},
    };
    
    const uint_least8_t ADC_count = CC2640R2_LAUNCHXL_ADCCOUNT;
    
    /*
     *  =============================== Crypto ===============================
     */
    #include <ti/drivers/crypto/CryptoCC26XX.h>
    
    CryptoCC26XX_Object cryptoCC26XXObjects[CC2640R2_LAUNCHXL_CRYPTOCOUNT];
    
    const CryptoCC26XX_HWAttrs cryptoCC26XXHWAttrs[CC2640R2_LAUNCHXL_CRYPTOCOUNT] = {
        {
            .baseAddr       = CRYPTO_BASE,
            .powerMngrId    = PowerCC26XX_PERIPH_CRYPTO,
            .intNum         = INT_CRYPTO_RESULT_AVAIL_IRQ,
            .intPriority    = ~0,
        }
    };
    
    const CryptoCC26XX_Config CryptoCC26XX_config[CC2640R2_LAUNCHXL_CRYPTOCOUNT] = {
        {
             .object  = &cryptoCC26XXObjects[CC2640R2_LAUNCHXL_CRYPTO0],
             .hwAttrs = &cryptoCC26XXHWAttrs[CC2640R2_LAUNCHXL_CRYPTO0]
        },
    };
    
    /*
     *  =============================== AESCCM ===============================
     */
    #include <ti/drivers/AESCCM.h>
    #include <ti/drivers/aesccm/AESCCMCC26XX.h>
    
    AESCCMCC26XX_Object aesccmCC26XXObjects[CC2640R2_LAUNCHXL_AESCCMCOUNT];
    
    const AESCCMCC26XX_HWAttrs aesccmCC26XXHWAttrs[CC2640R2_LAUNCHXL_AESCCMCOUNT] = {
        {
            .intPriority       = ~0,
        }
    };
    
    const AESCCM_Config AESCCM_config[CC2640R2_LAUNCHXL_AESCCMCOUNT] = {
        {
             .object  = &aesccmCC26XXObjects[CC2640R2_LAUNCHXL_AESCCM0],
             .hwAttrs = &aesccmCC26XXHWAttrs[CC2640R2_LAUNCHXL_AESCCM0]
        },
    };
    
    const uint_least8_t AESCCM_count = CC2640R2_LAUNCHXL_AESCCMCOUNT;
    
    
    /*
     *  =============================== AESGCM ===============================
     */
    #include <ti/drivers/AESGCM.h>
    #include <ti/drivers/aesgcm/AESGCMCC26XX.h>
    
    AESGCMCC26XX_Object aesgcmCC26XXObjects[CC2640R2_LAUNCHXL_AESGCMCOUNT];
    
    const AESGCMCC26XX_HWAttrs aesgcmCC26XXHWAttrs[CC2640R2_LAUNCHXL_AESGCMCOUNT] = {
        {
            .intPriority       = ~0,
        }
    };
    
    const AESGCM_Config AESGCM_config[CC2640R2_LAUNCHXL_AESGCMCOUNT] = {
        {
             .object  = &aesgcmCC26XXObjects[CC2640R2_LAUNCHXL_AESGCM0],
             .hwAttrs = &aesgcmCC26XXHWAttrs[CC2640R2_LAUNCHXL_AESGCM0]
        },
    };
    
    const uint_least8_t AESGCM_count = CC2640R2_LAUNCHXL_AESGCMCOUNT;
    
    /*
     *  =============================== AESCBC ===============================
     */
    #include <ti/drivers/AESCBC.h>
    #include <ti/drivers/aescbc/AESCBCCC26XX.h>
    
    AESCBCCC26XX_Object aescbcCC26XXObjects[CC2640R2_LAUNCHXL_AESCBCCOUNT];
    
    const AESCBCCC26XX_HWAttrs aescbcCC26XXHWAttrs[CC2640R2_LAUNCHXL_AESCBCCOUNT] = {
        {
            .intPriority       = ~0,
        }
    };
    
    const AESCBC_Config AESCBC_config[CC2640R2_LAUNCHXL_AESCBCCOUNT] = {
        {
             .object  = &aescbcCC26XXObjects[CC2640R2_LAUNCHXL_AESCBC0],
             .hwAttrs = &aescbcCC26XXHWAttrs[CC2640R2_LAUNCHXL_AESCBC0]
        },
    };
    
    const uint_least8_t AESCBC_count = CC2640R2_LAUNCHXL_AESCBCCOUNT;
    
    /*
     *  =============================== AESCTR ===============================
     */
    #include <ti/drivers/AESCTR.h>
    #include <ti/drivers/aesctr/AESCTRCC26XX.h>
    
    AESCTRCC26XX_Object aesctrCC26XXObjects[CC2640R2_LAUNCHXL_AESCTRCOUNT];
    
    const AESCTRCC26XX_HWAttrs aesctrCC26XXHWAttrs[CC2640R2_LAUNCHXL_AESCTRCOUNT] = {
        {
            .intPriority       = ~0,
        }
    };
    
    const AESCTR_Config AESCTR_config[CC2640R2_LAUNCHXL_AESCTRCOUNT] = {
        {
             .object  = &aesctrCC26XXObjects[CC2640R2_LAUNCHXL_AESCTR0],
             .hwAttrs = &aesctrCC26XXHWAttrs[CC2640R2_LAUNCHXL_AESCTR0]
        },
    };
    
    const uint_least8_t AESCTR_count = CC2640R2_LAUNCHXL_AESCTRCOUNT;
    
    /*
     *  =============================== AESECB ===============================
     */
    #include <ti/drivers/AESECB.h>
    #include <ti/drivers/aesecb/AESECBCC26XX.h>
    
    AESECBCC26XX_Object aesecbCC26XXObjects[CC2640R2_LAUNCHXL_AESECBCOUNT];
    
    const AESECBCC26XX_HWAttrs aesecbCC26XXHWAttrs[CC2640R2_LAUNCHXL_AESECBCOUNT] = {
        {
            .intPriority       = ~0,
        }
    };
    
    const AESECB_Config AESECB_config[CC2640R2_LAUNCHXL_AESECBCOUNT] = {
        {
             .object  = &aesecbCC26XXObjects[CC2640R2_LAUNCHXL_AESECB0],
             .hwAttrs = &aesecbCC26XXHWAttrs[CC2640R2_LAUNCHXL_AESECB0]
        },
    };
    
    const uint_least8_t AESECB_count = CC2640R2_LAUNCHXL_AESECBCOUNT;
    
    /*
     *  =============================== AESCTRDRBG ===============================
     */
    #include <ti/drivers/AESCTRDRBG.h>
    #include <ti/drivers/aesctrdrbg/AESCTRDRBGXX.h>
    
    AESCTRDRBGXX_Object aesctrdrbgXXObjects[CC2640R2_LAUNCHXL_AESCTRDRBGCOUNT];
    
    const AESCTRDRBGXX_HWAttrs aesctrdrbgXXHWAttrs[CC2640R2_LAUNCHXL_AESCTRDRBGCOUNT] = {
        {
            .aesctrIndex       = CC2640R2_LAUNCHXL_AESCTR0,
        }
    };
    
    const AESCTRDRBG_Config AESCTRDRBG_config[CC2640R2_LAUNCHXL_AESCTRDRBGCOUNT] = {
        {
             .object  = &aesctrdrbgXXObjects[CC2640R2_LAUNCHXL_AESCTRDRBG0],
             .hwAttrs = &aesctrdrbgXXHWAttrs[CC2640R2_LAUNCHXL_AESCTRDRBG0]
        },
    };
    
    const uint_least8_t AESCTRDRBG_count = CC2640R2_LAUNCHXL_AESCTRDRBGCOUNT;
    
    /*
     *  =============================== Display ===============================
     */
    #include <ti/display/Display.h>
    #include <ti/display/DisplayUart.h>
    #include <ti/display/DisplaySharp.h>
    
    #ifndef BOARD_DISPLAY_UART_STRBUF_SIZE
    #define BOARD_DISPLAY_UART_STRBUF_SIZE    128
    #endif
    
    /* This value can be changed to 96 for use with the 430BOOST-SHARP96 BoosterPack. */
    #define BOARD_DISPLAY_SHARP_SIZE    128
    
    DisplayUart_Object     displayUartObject;
    DisplaySharp_Object    displaySharpObject;
    
    static char uartStringBuf[BOARD_DISPLAY_UART_STRBUF_SIZE];
    static uint_least8_t sharpDisplayBuf[BOARD_DISPLAY_SHARP_SIZE * BOARD_DISPLAY_SHARP_SIZE / 8];
    
    const DisplayUart_HWAttrs displayUartHWAttrs = {
        .uartIdx      = CC2640R2_LAUNCHXL_UART0,
        .baudRate     = 115200,
        .mutexTimeout = (unsigned int)(-1),
        .strBuf       = uartStringBuf,
        .strBufLen    = BOARD_DISPLAY_UART_STRBUF_SIZE,
    };
    
    const DisplaySharp_HWAttrsV1 displaySharpHWattrs = {
        .spiIndex    = CC2640R2_LAUNCHXL_SPI0,
        .csPin       = CC2640R2_LAUNCHXL_GPIO_LCD_CS,
        .powerPin    = CC2640R2_LAUNCHXL_GPIO_LCD_POWER,
        .enablePin   = CC2640R2_LAUNCHXL_GPIO_LCD_ENABLE,
        .pixelWidth  = BOARD_DISPLAY_SHARP_SIZE,
        .pixelHeight = BOARD_DISPLAY_SHARP_SIZE,
        .displayBuf  = sharpDisplayBuf,
    };
    
    #ifndef BOARD_DISPLAY_USE_UART
    #define BOARD_DISPLAY_USE_UART 1
    #endif
    #ifndef BOARD_DISPLAY_USE_UART_ANSI
    #define BOARD_DISPLAY_USE_UART_ANSI 0
    #endif
    #ifndef BOARD_DISPLAY_USE_LCD
    #define BOARD_DISPLAY_USE_LCD 0
    #endif
    
    /*
     * This #if/#else is needed to workaround a problem with the
     * IAR compiler. The IAR compiler doesn't like the empty array
     * initialization. (IAR Error[Pe1345])
     */
    #if (BOARD_DISPLAY_USE_UART || BOARD_DISPLAY_USE_LCD)
    
    const Display_Config Display_config[] = {
    #if (BOARD_DISPLAY_USE_UART)
        {
    #  if (BOARD_DISPLAY_USE_UART_ANSI)
            .fxnTablePtr = &DisplayUartAnsi_fxnTable,
    #  else /* Default to minimal UART with no cursor placement */
            .fxnTablePtr = &DisplayUartMin_fxnTable,
    #  endif
            .object      = &displayUartObject,
            .hwAttrs     = &displayUartHWAttrs,
        },
    #endif
    #if (BOARD_DISPLAY_USE_LCD)
        {
            .fxnTablePtr = &DisplaySharp_fxnTable,
            .object      = &displaySharpObject,
            .hwAttrs     = &displaySharpHWattrs
        },
    #endif
    };
    
    const uint_least8_t Display_count = sizeof(Display_config) / sizeof(Display_Config);
    
    #else
    
    const Display_Config *Display_config = NULL;
    const uint_least8_t Display_count = 0;
    
    #endif /* (BOARD_DISPLAY_USE_UART || BOARD_DISPLAY_USE_LCD) */
    
    /*
     *  =============================== GPIO ===============================
     */
    #include <ti/drivers/GPIO.h>
    #include <ti/drivers/gpio/GPIOCC26XX.h>
    
    /*
     * Array of Pin configurations
     * NOTE: The order of the pin configurations must coincide with what was
     *       defined in CC2640R2_LAUNCHXL.h
     * NOTE: Pins not used for interrupts should be placed at the end of the
     *       array. Callback entries can be omitted from callbacks array to
     *       reduce memory usage.
     */
    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 */
    
        /* 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 */
    };
    
    /*
     * Array of callback function pointers
     * NOTE: The order of the pin configurations must coincide with what was
     *       defined in CC2640R2_LAUNCH.h
     * NOTE: Pins not used for interrupts can be omitted from callbacks array to
     *       reduce memory usage (if placed at end of gpioPinConfigs array).
     */
    GPIO_CallbackFxn gpioCallbackFunctions[] = {
        NULL,  /* Button 0 */
        NULL,  /* Button 1 */
        NULL,  /* CC2640R2_LAUNCHXL_SPI_MASTER_READY */
        NULL,  /* CC2640R2_LAUNCHXL_SPI_SLAVE_READY */
    };
    
    const GPIOCC26XX_Config GPIOCC26XX_config = {
        .pinConfigs         = (GPIO_PinConfig *)gpioPinConfigs,
        .callbacks          = (GPIO_CallbackFxn *)gpioCallbackFunctions,
        .numberOfPinConfigs = CC2640R2_LAUNCHXL_GPIOCOUNT,
        .numberOfCallbacks  = sizeof(gpioCallbackFunctions)/sizeof(GPIO_CallbackFxn),
        .intPriority        = (~0)
    };
    
    /*
     *  =============================== GPTimer ===============================
     *  Remove unused entries to reduce flash usage both in Board.c and Board.h
     */
    #include <ti/drivers/timer/GPTimerCC26XX.h>
    
    GPTimerCC26XX_Object gptimerCC26XXObjects[CC2640R2_LAUNCHXL_GPTIMERCOUNT];
    
    const GPTimerCC26XX_HWAttrs gptimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_GPTIMERPARTSCOUNT] = {
        { .baseAddr = GPT0_BASE, .intNum = INT_GPT0A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT0, .pinMux = GPT_PIN_0A, },
        { .baseAddr = GPT0_BASE, .intNum = INT_GPT0B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT0, .pinMux = GPT_PIN_0B, },
        { .baseAddr = GPT1_BASE, .intNum = INT_GPT1A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT1, .pinMux = GPT_PIN_1A, },
        { .baseAddr = GPT1_BASE, .intNum = INT_GPT1B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT1, .pinMux = GPT_PIN_1B, },
        { .baseAddr = GPT2_BASE, .intNum = INT_GPT2A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT2, .pinMux = GPT_PIN_2A, },
        { .baseAddr = GPT2_BASE, .intNum = INT_GPT2B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT2, .pinMux = GPT_PIN_2B, },
        { .baseAddr = GPT3_BASE, .intNum = INT_GPT3A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT3, .pinMux = GPT_PIN_3A, },
        { .baseAddr = GPT3_BASE, .intNum = INT_GPT3B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT3, .pinMux = GPT_PIN_3B, },
    };
    
    const GPTimerCC26XX_Config GPTimerCC26XX_config[CC2640R2_LAUNCHXL_GPTIMERPARTSCOUNT] = {
        { &gptimerCC26XXObjects[CC2640R2_LAUNCHXL_GPTIMER0], &gptimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_GPTIMER0A], GPT_A },
        { &gptimerCC26XXObjects[CC2640R2_LAUNCHXL_GPTIMER0], &gptimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_GPTIMER0B], GPT_B },
        { &gptimerCC26XXObjects[CC2640R2_LAUNCHXL_GPTIMER1], &gptimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_GPTIMER1A], GPT_A },
        { &gptimerCC26XXObjects[CC2640R2_LAUNCHXL_GPTIMER1], &gptimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_GPTIMER1B], GPT_B },
        { &gptimerCC26XXObjects[CC2640R2_LAUNCHXL_GPTIMER2], &gptimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_GPTIMER2A], GPT_A },
        { &gptimerCC26XXObjects[CC2640R2_LAUNCHXL_GPTIMER2], &gptimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_GPTIMER2B], GPT_B },
        { &gptimerCC26XXObjects[CC2640R2_LAUNCHXL_GPTIMER3], &gptimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_GPTIMER3A], GPT_A },
        { &gptimerCC26XXObjects[CC2640R2_LAUNCHXL_GPTIMER3], &gptimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_GPTIMER3B], GPT_B },
    };
    
    /*
     *  =============================== I2C ===============================
    */
    #include <ti/drivers/I2C.h>
    #include <ti/drivers/i2c/I2CCC26XX.h>
    
    I2CCC26XX_Object i2cCC26xxObjects[CC2640R2_LAUNCHXL_I2CCOUNT];
    
    const I2CCC26XX_HWAttrsV1 i2cCC26xxHWAttrs[CC2640R2_LAUNCHXL_I2CCOUNT] = {
        {
            .baseAddr    = I2C0_BASE,
            .powerMngrId = PowerCC26XX_PERIPH_I2C0,
            .intNum      = INT_I2C_IRQ,
            .intPriority = ~0,
            .swiPriority = 0,
            .sdaPin      = CC2640R2_LAUNCHXL_I2C0_SDA0,
            .sclPin      = CC2640R2_LAUNCHXL_I2C0_SCL0,
        }
    };
    
    const I2C_Config I2C_config[CC2640R2_LAUNCHXL_I2CCOUNT] = {
        {
            .fxnTablePtr = &I2CCC26XX_fxnTable,
            .object      = &i2cCC26xxObjects[CC2640R2_LAUNCHXL_I2C0],
            .hwAttrs     = &i2cCC26xxHWAttrs[CC2640R2_LAUNCHXL_I2C0]
        },
    };
    
    const uint_least8_t I2C_count = CC2640R2_LAUNCHXL_I2CCOUNT;
    
    /*
     *  =============================== I2S ===============================
    */
    #include <ti/drivers/I2S.h>
    #include <ti/drivers/i2s/I2SCC26XX.h>
    
    I2SCC26XX_Object i2sCC26XXObjects[CC2640R2_LAUNCHXL_I2SCOUNT];
    
    const I2SCC26XX_HWAttrs i2sCC26XXHWAttrs[CC2640R2_LAUNCHXL_I2SCOUNT] = {
        {
            .pinSD1      =  CC2640R2_LAUNCHXL_I2S_ADI,
            .pinSD0      =  CC2640R2_LAUNCHXL_I2S_ADO,
            .pinSCK      =  CC2640R2_LAUNCHXL_I2S_BCLK,
            .pinMCLK     =  CC2640R2_LAUNCHXL_I2S_MCLK,
            .pinWS       =  CC2640R2_LAUNCHXL_I2S_WCLK,
            .intPriority = ~0,
        }
    };
    
    const I2S_Config I2S_config[CC2640R2_LAUNCHXL_I2SCOUNT] = {
        {
            .object      = &i2sCC26XXObjects[CC2640R2_LAUNCHXL_I2S0],
            .hwAttrs     = &i2sCC26XXHWAttrs[CC2640R2_LAUNCHXL_I2S0]
        },
    };
    
    const uint_least8_t I2S_count = CC2640R2_LAUNCHXL_I2SCOUNT;
    
    /*
     *  =============================== NVS ===============================
     */
    #include <ti/drivers/NVS.h>
    #include <ti/drivers/nvs/NVSSPI25X.h>
    #include <ti/drivers/nvs/NVSCC26XX.h>
    
    #define NVS_REGIONS_BASE 0x1A000
    #define SECTORSIZE       0x1000
    #define REGIONSIZE       (SECTORSIZE * 4)
    
    #ifndef Board_EXCLUDE_NVS_INTERNAL_FLASH
    
    /*
     * Reserve flash sectors for NVS driver use by placing an uninitialized byte
     * array at the desired flash address.
     */
    #if defined(__TI_COMPILER_VERSION__)
    
    /*
     * Place uninitialized array at NVS_REGIONS_BASE
     */
    #pragma LOCATION(flashBuf, NVS_REGIONS_BASE);
    #pragma NOINIT(flashBuf);
    static char flashBuf[REGIONSIZE];
    
    #elif defined(__IAR_SYSTEMS_ICC__)
    
    /*
     * Place uninitialized array at NVS_REGIONS_BASE
     */
    static __no_init char flashBuf[REGIONSIZE] @ NVS_REGIONS_BASE;
    
    #elif defined(__GNUC__)
    
    /*
     * Place the flash buffers in the .nvs section created in the gcc linker file.
     * The .nvs section enforces alignment on a sector boundary but may
     * be placed anywhere in flash memory.  If desired the .nvs section can be set
     * to a fixed address by changing the following in the gcc linker file:
     *
     * .nvs (FIXED_FLASH_ADDR) (NOLOAD) : AT (FIXED_FLASH_ADDR) {
     *      *(.nvs)
     * } > REGION_TEXT
     */
    __attribute__ ((section (".nvs")))
    static char flashBuf[REGIONSIZE];
    
    #endif
    
    /* Allocate objects for NVS Internal Regions */
    NVSCC26XX_Object nvsCC26xxObjects[1];
    
    /* Hardware attributes for NVS Internal Regions */
    const NVSCC26XX_HWAttrs nvsCC26xxHWAttrs[1] = {
        {
            .regionBase = (void *)flashBuf,
            .regionSize = REGIONSIZE,
        },
    };
    
    #endif /* Board_EXCLUDE_NVS_INTERNAL_FLASH */
    
    #ifndef Board_EXCLUDE_NVS_EXTERNAL_FLASH
    
    #define SPISECTORSIZE    0x1000
    #define SPIREGIONSIZE    (SPISECTORSIZE * 32)
    #define VERIFYBUFSIZE    64
    
    static uint8_t verifyBuf[VERIFYBUFSIZE];
    
    /* Allocate objects for NVS External Regions */
    NVSSPI25X_Object nvsSPI25XObjects[1];
    
    /* Hardware attributes for NVS External Regions */
    const NVSSPI25X_HWAttrs nvsSPI25XHWAttrs[1] = {
        {
            .regionBaseOffset = 0,
            .regionSize = SPIREGIONSIZE,
            .sectorSize = SPISECTORSIZE,
            .verifyBuf = verifyBuf,
            .verifyBufSize = VERIFYBUFSIZE,
            .spiHandle = NULL,
            .spiIndex = 0,
            .spiBitRate = 4000000,
            .spiCsnGpioIndex = CC2640R2_LAUNCHXL_GPIO_SPI_FLASH_CS,
            .statusPollDelayUs = 100,
        },
    };
    
    #endif /* Board_EXCLUDE_NVS_EXTERNAL_FLASH */
    
    /* NVS Region index 0 and 1 refer to NVS and NVS SPI respectively */
    const NVS_Config NVS_config[CC2640R2_LAUNCHXL_NVSCOUNT] = {
    #ifndef Board_EXCLUDE_NVS_INTERNAL_FLASH
        {
            .fxnTablePtr = &NVSCC26XX_fxnTable,
            .object = &nvsCC26xxObjects[0],
            .hwAttrs = &nvsCC26xxHWAttrs[0],
        },
    #endif
    #ifndef Board_EXCLUDE_NVS_EXTERNAL_FLASH
        {
            .fxnTablePtr = &NVSSPI25X_fxnTable,
            .object = &nvsSPI25XObjects[0],
            .hwAttrs = &nvsSPI25XHWAttrs[0],
        },
    #endif
    };
    
    const uint_least8_t NVS_count = CC2640R2_LAUNCHXL_NVSCOUNT;
    
    /*
     *  =============================== PIN ===============================
     */
    #include <ti/drivers/PIN.h>
    #include <ti/drivers/pin/PINCC26XX.h>
    
    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
    };
    
    const PINCC26XX_HWAttrs PINCC26XX_hwAttrs = {
        .intPriority = ~0,
        .swiPriority = 0
    };
    
    /*
     *  =============================== Power ===============================
     */
    #include <ti/drivers/Power.h>
    #include <ti/drivers/power/PowerCC26XX.h>
    
    const PowerCC26XX_Config PowerCC26XX_config = {
        .policyInitFxn      = NULL,
        .policyFxn          = &PowerCC26XX_standbyPolicy,
        .enablePolicy       = true,
    #ifdef USE_RCOSC
        .calibrateFxn       = &PowerCC26XX_calibrate,
        .calibrateRCOSC_LF  = true,
        .calibrateRCOSC_HF  = true,
    #else
    #ifdef NO_CALIBRATION_NO_RCOSC
        // use no_calibrate functions (when RCOSC is not used) 
        // in order to save uncalled functions flash size 
        .calibrateFxn       = &PowerCC26XX_noCalibrate,
        .calibrateRCOSC_LF  = false,
        .calibrateRCOSC_HF  = false,
    #else
        // old configuration  
        .calibrateFxn       = &PowerCC26XX_calibrate,
        .calibrateRCOSC_LF  = false,
        .calibrateRCOSC_HF  = true,
    #endif
    #endif
    };
    
    /*
     *  =============================== PWM ===============================
     *  Remove unused entries to reduce flash usage both in Board.c and Board.h
     */
    #include <ti/drivers/PWM.h>
    #include <ti/drivers/pwm/PWMTimerCC26XX.h>
    
    PWMTimerCC26XX_Object pwmtimerCC26xxObjects[CC2640R2_LAUNCHXL_PWMCOUNT];
    
    const PWMTimerCC26XX_HwAttrs pwmtimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_PWMCOUNT] = {
        { .pwmPin = CC2640R2_LAUNCHXL_PWMPIN0, .gpTimerUnit = CC2640R2_LAUNCHXL_GPTIMER0A },
        { .pwmPin = CC2640R2_LAUNCHXL_PWMPIN1, .gpTimerUnit = CC2640R2_LAUNCHXL_GPTIMER0B },
        { .pwmPin = CC2640R2_LAUNCHXL_PWMPIN2, .gpTimerUnit = CC2640R2_LAUNCHXL_GPTIMER1A },
        { .pwmPin = CC2640R2_LAUNCHXL_PWMPIN3, .gpTimerUnit = CC2640R2_LAUNCHXL_GPTIMER1B },
        { .pwmPin = CC2640R2_LAUNCHXL_PWMPIN4, .gpTimerUnit = CC2640R2_LAUNCHXL_GPTIMER2A },
        { .pwmPin = CC2640R2_LAUNCHXL_PWMPIN5, .gpTimerUnit = CC2640R2_LAUNCHXL_GPTIMER2B },
        { .pwmPin = CC2640R2_LAUNCHXL_PWMPIN6, .gpTimerUnit = CC2640R2_LAUNCHXL_GPTIMER3A },
        { .pwmPin = CC2640R2_LAUNCHXL_PWMPIN7, .gpTimerUnit = CC2640R2_LAUNCHXL_GPTIMER3B },
    };
    
    const PWM_Config PWM_config[CC2640R2_LAUNCHXL_PWMCOUNT] = {
        { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC2640R2_LAUNCHXL_PWM0], &pwmtimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_PWM0] },
        { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC2640R2_LAUNCHXL_PWM1], &pwmtimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_PWM1] },
        { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC2640R2_LAUNCHXL_PWM2], &pwmtimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_PWM2] },
        { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC2640R2_LAUNCHXL_PWM3], &pwmtimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_PWM3] },
        { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC2640R2_LAUNCHXL_PWM4], &pwmtimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_PWM4] },
        { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC2640R2_LAUNCHXL_PWM5], &pwmtimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_PWM5] },
        { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC2640R2_LAUNCHXL_PWM6], &pwmtimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_PWM6] },
        { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC2640R2_LAUNCHXL_PWM7], &pwmtimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_PWM7] },
    };
    
    const uint_least8_t PWM_count = CC2640R2_LAUNCHXL_PWMCOUNT;
    
    /*
     *  =============================== RF Driver ===============================
     */
    #include <ti/drivers/rf/RF.h>
    
    const RFCC26XX_HWAttrsV2 RFCC26XX_hwAttrs = {
        .hwiPriority        = ~0,       /* Lowest HWI priority */
        .swiPriority        = 0,        /* Lowest SWI priority */
        .xoscHfAlwaysNeeded = true,     /* Keep XOSC dependency while in standby */
        .globalCallback     = NULL,     /* No board specific callback */
        .globalEventMask    = 0         /* No events subscribed to */
    };
    
    /*
     *  =============================== SD ===============================
     */
    #include <ti/drivers/SD.h>
    #include <ti/drivers/sd/SDSPI.h>
    
    SDSPI_Object sdspiObjects[CC2640R2_LAUNCHXL_SDCOUNT];
    
    const SDSPI_HWAttrs sdspiHWAttrs[CC2640R2_LAUNCHXL_SDCOUNT] = {
        {
            .spiIndex = CC2640R2_LAUNCHXL_SPI0,
            .spiCsGpioIndex = CC2640R2_LAUNCHXL_SDSPI_CS
        }
    };
    
    const SD_Config SD_config[CC2640R2_LAUNCHXL_SDCOUNT] = {
        {
            .fxnTablePtr = &SDSPI_fxnTable,
            .object = &sdspiObjects[CC2640R2_LAUNCHXL_SDSPI0],
            .hwAttrs = &sdspiHWAttrs[CC2640R2_LAUNCHXL_SDSPI0]
        },
    };
    
    const uint_least8_t SD_count = CC2640R2_LAUNCHXL_SDCOUNT;
    
    /*
     *  =============================== SPI DMA ===============================
     */
    #include <ti/drivers/SPI.h>
    #include <ti/drivers/spi/SPICC26XXDMA.h>
    
    SPICC26XXDMA_Object spiCC26XXDMAObjects[CC2640R2_LAUNCHXL_SPICOUNT];
    
    /*
     * NOTE: The SPI instances below can be used by the SD driver to communicate
     * with a SD card via SPI.  The 'defaultTxBufValue' fields below are set to 0xFF
     * to satisfy the SDSPI driver requirement.
     */
    const SPICC26XXDMA_HWAttrsV1 spiCC26XXDMAHWAttrs[CC2640R2_LAUNCHXL_SPICOUNT] = {
        {
            .baseAddr           = SSI0_BASE,
            .intNum             = INT_SSI0_COMB,
            .intPriority        = ~0,
            .swiPriority        = 0,
            .powerMngrId        = PowerCC26XX_PERIPH_SSI0,
            .defaultTxBufValue  = 0xFF,
            .rxChannelBitMask   = 1<<UDMA_CHAN_SSI0_RX,
            .txChannelBitMask   = 1<<UDMA_CHAN_SSI0_TX,
            .mosiPin            = CC2640R2_LAUNCHXL_SPI0_MOSI,
            .misoPin            = CC2640R2_LAUNCHXL_SPI0_MISO,
            .clkPin             = CC2640R2_LAUNCHXL_SPI0_CLK,
            .csnPin             = CC2640R2_LAUNCHXL_SPI0_CSN,
            .minDmaTransferSize = 10
        },
        {
            .baseAddr           = SSI1_BASE,
            .intNum             = INT_SSI1_COMB,
            .intPriority        = ~0,
            .swiPriority        = 0,
            .powerMngrId        = PowerCC26XX_PERIPH_SSI1,
            .defaultTxBufValue  = 0xFF,
            .rxChannelBitMask   = 1<<UDMA_CHAN_SSI1_RX,
            .txChannelBitMask   = 1<<UDMA_CHAN_SSI1_TX,
            .mosiPin            = CC2640R2_LAUNCHXL_SPI1_MOSI,
            .misoPin            = CC2640R2_LAUNCHXL_SPI1_MISO,
            .clkPin             = CC2640R2_LAUNCHXL_SPI1_CLK,
            .csnPin             = CC2640R2_LAUNCHXL_SPI1_CSN,
            .minDmaTransferSize = 10
        }
    };
    
    const SPI_Config SPI_config[CC2640R2_LAUNCHXL_SPICOUNT] = {
        {
             .fxnTablePtr = &SPICC26XXDMA_fxnTable,
             .object      = &spiCC26XXDMAObjects[CC2640R2_LAUNCHXL_SPI0],
             .hwAttrs     = &spiCC26XXDMAHWAttrs[CC2640R2_LAUNCHXL_SPI0]
        },
        {
             .fxnTablePtr = &SPICC26XXDMA_fxnTable,
             .object      = &spiCC26XXDMAObjects[CC2640R2_LAUNCHXL_SPI1],
             .hwAttrs     = &spiCC26XXDMAHWAttrs[CC2640R2_LAUNCHXL_SPI1]
        },
    };
    
    const uint_least8_t SPI_count = CC2640R2_LAUNCHXL_SPICOUNT;
    
    /*
     *  =============================== UART ===============================
     */
    #include <ti/drivers/UART.h>
    #include <ti/drivers/uart/UARTCC26XX.h>
    
    UARTCC26XX_Object uartCC26XXObjects[CC2640R2_LAUNCHXL_UARTCOUNT];
    
    uint8_t uartCC26XXRingBuffer[CC2640R2_LAUNCHXL_UARTCOUNT][32];
    
    const UARTCC26XX_HWAttrsV2 uartCC26XXHWAttrs[CC2640R2_LAUNCHXL_UARTCOUNT] = {
        {
            .baseAddr       = UART0_BASE,
            .powerMngrId    = PowerCC26XX_PERIPH_UART0,
            .intNum         = INT_UART0_COMB,
            .intPriority    = ~0,
            .swiPriority    = 0,
            .txPin          = CC2640R2_LAUNCHXL_UART_TX,
            .rxPin          = CC2640R2_LAUNCHXL_UART_RX,
            .ctsPin         = PIN_UNASSIGNED,
            .rtsPin         = PIN_UNASSIGNED,
            .ringBufPtr     = uartCC26XXRingBuffer[CC2640R2_LAUNCHXL_UART0],
            .ringBufSize    = sizeof(uartCC26XXRingBuffer[CC2640R2_LAUNCHXL_UART0]),
            .txIntFifoThr   = UARTCC26XX_FIFO_THRESHOLD_1_8,
            .rxIntFifoThr   = UARTCC26XX_FIFO_THRESHOLD_4_8,
            .errorFxn       = NULL
        }
    };
    
    const UART_Config UART_config[CC2640R2_LAUNCHXL_UARTCOUNT] = {
        {
            .fxnTablePtr = &UARTCC26XX_fxnTable,
            .object      = &uartCC26XXObjects[CC2640R2_LAUNCHXL_UART0],
            .hwAttrs     = &uartCC26XXHWAttrs[CC2640R2_LAUNCHXL_UART0]
        },
    };
    
    const uint_least8_t UART_count = CC2640R2_LAUNCHXL_UARTCOUNT;
    
    /*
     *  =============================== UDMA ===============================
     */
    #include <ti/drivers/dma/UDMACC26XX.h>
    
    UDMACC26XX_Object udmaObjects[CC2640R2_LAUNCHXL_UDMACOUNT];
    
    const UDMACC26XX_HWAttrs udmaHWAttrs[CC2640R2_LAUNCHXL_UDMACOUNT] = {
        {
            .baseAddr    = UDMA0_BASE,
            .powerMngrId = PowerCC26XX_PERIPH_UDMA,
            .intNum      = INT_DMA_ERR,
            .intPriority = ~0
        }
    };
    
    const UDMACC26XX_Config UDMACC26XX_config[CC2640R2_LAUNCHXL_UDMACOUNT] = {
        {
             .object  = &udmaObjects[CC2640R2_LAUNCHXL_UDMA0],
             .hwAttrs = &udmaHWAttrs[CC2640R2_LAUNCHXL_UDMA0]
        },
    };
    
    
    
    /*
     *  =============================== Watchdog ===============================
     */
    #include <ti/drivers/Watchdog.h>
    #include <ti/drivers/watchdog/WatchdogCC26XX.h>
    
    WatchdogCC26XX_Object watchdogCC26XXObjects[CC2640R2_LAUNCHXL_WATCHDOGCOUNT];
    
    const WatchdogCC26XX_HWAttrs watchdogCC26XXHWAttrs[CC2640R2_LAUNCHXL_WATCHDOGCOUNT] = {
        {
            .baseAddr    = WDT_BASE,
            .reloadValue = 1000 /* Reload value in milliseconds */
        },
    };
    
    const Watchdog_Config Watchdog_config[CC2640R2_LAUNCHXL_WATCHDOGCOUNT] = {
        {
            .fxnTablePtr = &WatchdogCC26XX_fxnTable,
            .object      = &watchdogCC26XXObjects[CC2640R2_LAUNCHXL_WATCHDOG0],
            .hwAttrs     = &watchdogCC26XXHWAttrs[CC2640R2_LAUNCHXL_WATCHDOG0]
        },
    };
    
    const uint_least8_t Watchdog_count = CC2640R2_LAUNCHXL_WATCHDOGCOUNT;
    
    /*
     *  ========================= TRNG begin ====================================
     */
    #include <TRNGCC26XX.h>
    
    /* TRNG objects */
    TRNGCC26XX_Object trngCC26XXObjects[CC2640R2_LAUNCHXL_TRNGCOUNT];
    
    /* TRNG configuration structure, describing which pins are to be used */
    const TRNGCC26XX_HWAttrs TRNGCC26XXHWAttrs[CC2640R2_LAUNCHXL_TRNGCOUNT] = {
        {
            .powerMngrId    = PowerCC26XX_PERIPH_TRNG,
        }
    };
    
    /* TRNG configuration structure */
    const TRNGCC26XX_Config TRNGCC26XX_config[] = {
        {
             .object  = &trngCC26XXObjects[0],
             .hwAttrs = &TRNGCC26XXHWAttrs[0]
        },
        {NULL, NULL}
    };
    
    /*
     *  ========================= TRNG end ====================================
     */
    extern void Board_initHook(void);
    
    /*
     *  ======== CC2640R2_LAUNCHXL_initGeneral ========
     */
    void CC2640R2_LAUNCHXL_initGeneral(void)
    {
        Power_init();
    
        if (PIN_init(BoardGpioInitTable) != PIN_SUCCESS) {
            /* Error with PIN_init */
            while (1);
        }
    
        /* Perform board-specific initialization */
        Board_initHook();
    }
    
    /*
     *  ======== Board_init ========
     */
    void Board_init(void)
    {
        CC2640R2_LAUNCHXL_initGeneral();
    }
    

    launch.h

    /*
     * Copyright (c) 2016-2017, 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.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    /** ============================================================================
     *  @file       CC2640R2_LAUNCHXL.h
     *
     *  @brief      CC2640R2 LaunchPad Board Specific header file.
     *
     *  This file is responsible for setting up the board specific items for the
     *  CC2640R2_LAUNCHXL board.
     *
     *  This board file is made for the 7x7 mm QFN package, to convert this board
     *  file to use for other smaller device packages please refer to the table
     *  below which lists the max IOID values supported by each package. All other
     *  unused pins should be set to IOID_UNUSED.
     *
     *  Furthermore the board file is also used
     *  to define a symbol that configures the RF front end and bias.
     *  See the comments below for more information.
     *  For an in depth tutorial on how to create a custom board file, please refer
     *  to the section "Running the SDK on Custom Boards" with in the Software
     *  Developer's Guide.
     *
     *  Refer to the datasheet for all the package options and IO descriptions:
     *  http://www.ti.com/lit/ds/symlink/cc2640r2f.pdf
     *
     *  +-----------------------+------------------+-----------------------+
     *  |     Package Option    |  Total GPIO Pins |   MAX IOID            |
     *  +=======================+==================+=======================+
     *  |     7x7 mm QFN        |     31           |   IOID_30             |
     *  +-----------------------+------------------+-----------------------+
     *  |     5x5 mm QFN        |     15           |   IOID_14             |
     *  +-----------------------+------------------+-----------------------+
     *  |     4x4 mm QFN        |     10           |   IOID_9              |
     *  +-----------------------+------------------+-----------------------+
     *  |     2.7 x 2.7 mm WCSP |     14           |   IOID_13             |
     *  +-----------------------+------------------+-----------------------+
     *  ============================================================================
     */
    #ifndef __CC2640R2_LAUNCHXL_BOARD_H__
    #define __CC2640R2_LAUNCHXL_BOARD_H__
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    /* Includes */
    #include <ti/drivers/PIN.h>
    #include <ti/devices/cc26x0r2/driverlib/ioc.h>
    
    /* Externs */
    extern const PIN_Config BoardGpioInitTable[];
    
    /* Defines */
    #ifndef CC2640R2_LAUNCHXL
      #define CC2640R2_LAUNCHXL
    #endif /* CC2640R2_LAUNCHXL */
    
    /*
     *  ============================================================================
     *  RF Front End and Bias configuration symbols for TI reference designs and
     *  kits. This symbol sets the RF Front End configuration in ble_user_config.h
     *  and selects the appropriate PA table in ble_user_config.c.
     *  Other configurations can be used by editing these files.
     *
     *  Define only one symbol:
     *  CC2650EM_7ID    - Differential RF and internal biasing
                          (default for CC2640R2 LaunchPad)
     *  CC2650EM_5XD    – Differential RF and external biasing
     *  CC2650EM_4XS    – Single-ended RF on RF-P and external biasing
     *  CC2640R2DK_CXS  - WCSP: Single-ended RF on RF-N and external biasing
     *                    (Note that the WCSP is only tested and characterized for
     *                     single ended configuration, and it has a WCSP-specific
     *                     PA table)
     *
     *  Note: CC2650EM_xxx reference designs apply to all CC26xx devices.
     *  ==========================================================================
     */
    #define CC2650EM_7ID
    
    /* Mapping of pins to board signals using general board aliases
     *      <board signal alias>                  <pin mapping>
     */
    
    /* Analog Capable DIOs */
    #define CC2640R2_LAUNCHXL_DIO23_ANALOG          PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO24_ANALOG          PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO25_ANALOG          PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO26_ANALOG          PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO27_ANALOG          PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO28_ANALOG          PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO29_ANALOG          PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO30_ANALOG          PIN_UNASSIGNED
    
    /* Digital IOs */
    #define CC2640R2_LAUNCHXL_DIO0                  IOID_0
    #define CC2640R2_LAUNCHXL_DIO1_RFSW             IOID_1
    #define CC2640R2_LAUNCHXL_DIO12                 PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO15                 PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO16_TDO             PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO17_TDI             PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO21                 PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO22                 PIN_UNASSIGNED
    
    /* Discrete Inputs */
    #define CC2640R2_LAUNCHXL_PIN_BTN1              PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_PIN_BTN2              PIN_UNASSIGNED
    
    /* GPIO */
    #define CC2640R2_LAUNCHXL_GPIO_LED_ON           1
    #define CC2640R2_LAUNCHXL_GPIO_LED_OFF          0
    
    /* I2C */
    #define CC2640R2_LAUNCHXL_I2C0_SCL0             IOID_4
    #define CC2640R2_LAUNCHXL_I2C0_SDA0             IOID_5
    
    /* I2S */
    #define CC2640R2_LAUNCHXL_I2S_ADO               IOID_0
    #define CC2640R2_LAUNCHXL_I2S_ADI               IOID_1
    #define CC2640R2_LAUNCHXL_I2S_BCLK              PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_I2S_MCLK              PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_I2S_WCLK              PIN_UNASSIGNED
    
    /* LCD (430BOOST - Sharp96 Rev 1.1) */
    #define CC2640R2_LAUNCHXL_LCD_CS                PIN_UNASSIGNED /* SPI chip select */
    #define CC2640R2_LAUNCHXL_LCD_EXTCOMIN          PIN_UNASSIGNED /* External COM inversion */
    #define CC2640R2_LAUNCHXL_LCD_ENABLE            PIN_UNASSIGNED /* LCD enable */
    #define CC2640R2_LAUNCHXL_LCD_POWER             PIN_UNASSIGNED /* LCD power control */
    #define CC2640R2_LAUNCHXL_LCD_CS_ON             1
    #define CC2640R2_LAUNCHXL_LCD_CS_OFF            0
    
    /* LEDs */
    #define CC2640R2_LAUNCHXL_PIN_LED_ON            1
    #define CC2640R2_LAUNCHXL_PIN_LED_OFF           0
    #define CC2640R2_LAUNCHXL_PIN_RLED              IOID_6
    #define CC2640R2_LAUNCHXL_PIN_GLED              IOID_7
    
    /* PWM Outputs */
    #define CC2640R2_LAUNCHXL_PWMPIN0               CC2640R2_LAUNCHXL_PIN_RLED
    #define CC2640R2_LAUNCHXL_PWMPIN1               CC2640R2_LAUNCHXL_PIN_GLED
    #define CC2640R2_LAUNCHXL_PWMPIN2               PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_PWMPIN3               PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_PWMPIN4               PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_PWMPIN5               PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_PWMPIN6               PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_PWMPIN7               PIN_UNASSIGNED
    
    /* SPI */
    #define CC2640R2_LAUNCHXL_SPI_FLASH_CS          PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_FLASH_CS_ON           0
    #define CC2640R2_LAUNCHXL_FLASH_CS_OFF          1
    
    /* SPI Board */
    #define CC2640R2_LAUNCHXL_SPI0_MISO             IOID_8          /* RF1.20 */
    #define CC2640R2_LAUNCHXL_SPI0_MOSI             IOID_9          /* RF1.18 */
    #define CC2640R2_LAUNCHXL_SPI0_CLK              PIN_UNASSIGNED         /* RF1.16 */
    #define CC2640R2_LAUNCHXL_SPI0_CSN              PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_SPI1_MISO             PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_SPI1_MOSI             PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_SPI1_CLK              PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_SPI1_CSN              PIN_UNASSIGNED
    
    /* UART Board */
    #define CC2640R2_LAUNCHXL_UART_RX               IOID_2          /* RXD */
    #define CC2640R2_LAUNCHXL_UART_TX               IOID_3          /* TXD */
    #define CC2640R2_LAUNCHXL_UART_CTS              PIN_UNASSIGNED         /* CTS */
    #define CC2640R2_LAUNCHXL_UART_RTS              PIN_UNASSIGNED         /* RTS */
    
    /*!
     *  @brief  Initialize the general board specific settings
     *
     *  This function initializes the general board specific settings.
     */
    void CC2640R2_LAUNCHXL_initGeneral(void);
    
    /*!
     *  @brief  Turn off the external flash on LaunchPads
     *
     */
    void CC2640R2_LAUNCHXL_shutDownExtFlash(void);
    
    /*!
     *  @brief  Wake up the external flash present on the board files
     *
     *  This function toggles the chip select for the amount of time needed
     *  to wake the chip up.
     */
    void CC2640R2_LAUNCHXL_wakeUpExtFlash(void);
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_ADCBufName
     *  @brief  Enum of ADCs
     */
    typedef enum CC2640R2_LAUNCHXL_ADCBufName {
        CC2640R2_LAUNCHXL_ADCBUF0 = 0,
    
        CC2640R2_LAUNCHXL_ADCBUFCOUNT
    } CC2640R2_LAUNCHXL_ADCBufName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_ADCBuf0SourceName
     *  @brief  Enum of ADCBuf channels
     */
    typedef enum CC2640R2_LAUNCHXL_ADCBuf0ChannelName {
        CC2640R2_LAUNCHXL_ADCBUF0CHANNEL0 = 0,
        CC2640R2_LAUNCHXL_ADCBUF0CHANNEL1,
        CC2640R2_LAUNCHXL_ADCBUF0CHANNEL2,
        CC2640R2_LAUNCHXL_ADCBUF0CHANNEL3,
        CC2640R2_LAUNCHXL_ADCBUF0CHANNEL4,
        CC2640R2_LAUNCHXL_ADCBUF0CHANNEL5,
        CC2640R2_LAUNCHXL_ADCBUF0CHANNEL6,
        CC2640R2_LAUNCHXL_ADCBUF0CHANNEL7,
        CC2640R2_LAUNCHXL_ADCBUF0CHANNELVDDS,
        CC2640R2_LAUNCHXL_ADCBUF0CHANNELDCOUPL,
        CC2640R2_LAUNCHXL_ADCBUF0CHANNELVSS,
    
        CC2640R2_LAUNCHXL_ADCBUF0CHANNELCOUNT
    } CC2640R2_LAUNCHXL_ADCBuf0ChannelName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_ADCName
     *  @brief  Enum of ADCs
     */
    typedef enum CC2640R2_LAUNCHXL_ADCName {
        CC2640R2_LAUNCHXL_ADC0 = 0,
        CC2640R2_LAUNCHXL_ADC1,
        CC2640R2_LAUNCHXL_ADC2,
        CC2640R2_LAUNCHXL_ADC3,
        CC2640R2_LAUNCHXL_ADC4,
        CC2640R2_LAUNCHXL_ADC5,
        CC2640R2_LAUNCHXL_ADC6,
        CC2640R2_LAUNCHXL_ADC7,
        CC2640R2_LAUNCHXL_ADCDCOUPL,
        CC2640R2_LAUNCHXL_ADCVSS,
        CC2640R2_LAUNCHXL_ADCVDDS,
    
        CC2640R2_LAUNCHXL_ADCCOUNT
    } CC2640R2_LAUNCHXL_ADCName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_CryptoName
     *  @brief  Enum of Crypto names
     */
    typedef enum CC2640R2_LAUNCHXL_CryptoName {
        CC2640R2_LAUNCHXL_CRYPTO0 = 0,
    
        CC2640R2_LAUNCHXL_CRYPTOCOUNT
    } CC2640R2_LAUNCHXL_CryptoName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_AESCCMName
     *  @brief  Enum of AESCCM names
     */
    typedef enum CC2640R2_LAUNCHXL_AESCCMName {
        CC2640R2_LAUNCHXL_AESCCM0 = 0,
    
        CC2640R2_LAUNCHXL_AESCCMCOUNT
    } CC2640R2_LAUNCHXL_AESCCMName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_AESGCMName
     *  @brief  Enum of AESGCM names
     */
    typedef enum CC2640R2_LAUNCHXL_AESGCMName {
        CC2640R2_LAUNCHXL_AESGCM0 = 0,
    
        CC2640R2_LAUNCHXL_AESGCMCOUNT
    } CC2640R2_LAUNCHXL_AESGCMName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_AESCBCName
     *  @brief  Enum of AESCBC names
     */
    typedef enum CC2640R2_LAUNCHXL_AESCBCName {
        CC2640R2_LAUNCHXL_AESCBC0 = 0,
    
        CC2640R2_LAUNCHXL_AESCBCCOUNT
    } CC2640R2_LAUNCHXL_AESCBCName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_AESCTRName
     *  @brief  Enum of AESCTR names
     */
    typedef enum CC2640R2_LAUNCHXL_AESCTRName {
        CC2640R2_LAUNCHXL_AESCTR0 = 0,
    
        CC2640R2_LAUNCHXL_AESCTRCOUNT
    } CC2640R2_LAUNCHXL_AESCTRName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_AESECBName
     *  @brief  Enum of AESECB names
     */
    typedef enum CC2640R2_LAUNCHXL_AESECBName {
        CC2640R2_LAUNCHXL_AESECB0 = 0,
    
        CC2640R2_LAUNCHXL_AESECBCOUNT
    } CC2640R2_LAUNCHXL_AESECBName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_AESCTRDRBGName
     *  @brief  Enum of AESCTRDRBG names
     */
    typedef enum CC2640R2_LAUNCHXL_AESCTRDRBGName {
        CC2640R2_LAUNCHXL_AESCTRDRBG0 = 0,
    
        CC2640R2_LAUNCHXL_AESCTRDRBGCOUNT
    } CC2640R2_LAUNCHXL_AESCTRDRBGName;
    
    /*!
     *  @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_TMP116_EN,
        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;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_GPTimerName
     *  @brief  Enum of GPTimer parts
     */
    typedef enum CC2640R2_LAUNCHXL_GPTimerName {
        CC2640R2_LAUNCHXL_GPTIMER0A = 0,
        CC2640R2_LAUNCHXL_GPTIMER0B,
        CC2640R2_LAUNCHXL_GPTIMER1A,
        CC2640R2_LAUNCHXL_GPTIMER1B,
        CC2640R2_LAUNCHXL_GPTIMER2A,
        CC2640R2_LAUNCHXL_GPTIMER2B,
        CC2640R2_LAUNCHXL_GPTIMER3A,
        CC2640R2_LAUNCHXL_GPTIMER3B,
    
        CC2640R2_LAUNCHXL_GPTIMERPARTSCOUNT
    } CC2640R2_LAUNCHXL_GPTimerName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_GPTimers
     *  @brief  Enum of GPTimers
     */
    typedef enum CC2640R2_LAUNCHXL_GPTimers {
        CC2640R2_LAUNCHXL_GPTIMER0 = 0,
        CC2640R2_LAUNCHXL_GPTIMER1,
        CC2640R2_LAUNCHXL_GPTIMER2,
        CC2640R2_LAUNCHXL_GPTIMER3,
    
        CC2640R2_LAUNCHXL_GPTIMERCOUNT
    } CC2640R2_LAUNCHXL_GPTimers;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_I2CName
     *  @brief  Enum of I2C names
     */
    typedef enum CC2640R2_LAUNCHXL_I2CName {
        CC2640R2_LAUNCHXL_I2C0 = 0,
    
        CC2640R2_LAUNCHXL_I2CCOUNT
    } CC2640R2_LAUNCHXL_I2CName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_I2SName
     *  @brief  Enum of I2S names
     */
    typedef enum CC2640R2_LAUNCHXL_I2SName {
        CC2640R2_LAUNCHXL_I2S0 = 0,
    
        CC2640R2_LAUNCHXL_I2SCOUNT
    } CC2640R2_LAUNCHXL_I2SName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_NVSName
     *  @brief  Enum of NVS names
     */
    typedef enum CC2640R2_LAUNCHXL_NVSName {
    #ifndef Board_EXCLUDE_NVS_INTERNAL_FLASH
        CC2640R2_LAUNCHXL_NVSCC26XX0 = 0,
    #endif
    #ifndef Board_EXCLUDE_NVS_EXTERNAL_FLASH
        CC2640R2_LAUNCHXL_NVSSPI25X0,
    #endif
    
        CC2640R2_LAUNCHXL_NVSCOUNT
    } CC2640R2_LAUNCHXL_NVSName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_PWM
     *  @brief  Enum of PWM outputs
     */
    typedef enum CC2640R2_LAUNCHXL_PWMName {
        CC2640R2_LAUNCHXL_PWM0 = 0,
        CC2640R2_LAUNCHXL_PWM1,
        CC2640R2_LAUNCHXL_PWM2,
        CC2640R2_LAUNCHXL_PWM3,
        CC2640R2_LAUNCHXL_PWM4,
        CC2640R2_LAUNCHXL_PWM5,
        CC2640R2_LAUNCHXL_PWM6,
        CC2640R2_LAUNCHXL_PWM7,
    
        CC2640R2_LAUNCHXL_PWMCOUNT
    } CC2640R2_LAUNCHXL_PWMName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_SDName
     *  @brief  Enum of SD names
     */
    typedef enum CC2640R2_LAUNCHXL_SDName {
        CC2640R2_LAUNCHXL_SDSPI0 = 0,
    
        CC2640R2_LAUNCHXL_SDCOUNT
    } CC2640R2_LAUNCHXL_SDName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_SPIName
     *  @brief  Enum of SPI names
     */
    typedef enum CC2640R2_LAUNCHXL_SPIName {
        CC2640R2_LAUNCHXL_SPI0 = 0,
        CC2640R2_LAUNCHXL_SPI1,
    
        CC2640R2_LAUNCHXL_SPICOUNT
    } CC2640R2_LAUNCHXL_SPIName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_UARTName
     *  @brief  Enum of UARTs
     */
    typedef enum CC2640R2_LAUNCHXL_UARTName {
        CC2640R2_LAUNCHXL_UART0 = 0,
    
        CC2640R2_LAUNCHXL_UARTCOUNT
    } CC2640R2_LAUNCHXL_UARTName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_UDMAName
     *  @brief  Enum of DMA buffers
     */
    typedef enum CC2640R2_LAUNCHXL_UDMAName {
        CC2640R2_LAUNCHXL_UDMA0 = 0,
    
        CC2640R2_LAUNCHXL_UDMACOUNT
    } CC2640R2_LAUNCHXL_UDMAName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_WatchdogName
     *  @brief  Enum of Watchdogs
     */
    typedef enum CC2640R2_LAUNCHXL_WatchdogName {
        CC2640R2_LAUNCHXL_WATCHDOG0 = 0,
    
        CC2640R2_LAUNCHXL_WATCHDOGCOUNT
    } CC2640R2_LAUNCHXL_WatchdogName;
    
    /*!
     *  @def    CC2650_LAUNCHXL_TRNGName
     *  @brief  Enum of TRNG names on the board
     */
    typedef enum CC2640R2_LAUNCHXL_TRNGName {
        CC2640R2_LAUNCHXL_TRNG0 = 0,
        CC2640R2_LAUNCHXL_TRNGCOUNT
    } CC2640R2_LAUNCHXL_TRNGName;
    
    #ifdef __cplusplus
    }
    #endif
    
    #endif /* __CC2640R2_LAUNCHXL_BOARD_H__ */
    

    Regards,

    Ritoo

  • Hi Ritoo,

    Got it. Thank you for checking! I would like to narrow out a potential HW issue. Have you requested a design review at https://www.ti.com/tool/SIMPLELINK-2-4GHZ-DESIGN-REVIEWS?

    If not, then I would highly recommend you do so. Our HW engineers will take a look at your design and provide very helpful feedback. They also may be able to catch any issues with your RF circuitry.

    Best Regards,

    Jan

  • Hi,

    You need to debug the code and make sure it goes pass main() and SimplePeripheral_Init().

    Just some tips for custom CC2640R2F boards. At my past work we would use this reference design CC2650 uTag. Then we would replace the CC2650 with CC2640R2F. After that we modify it to our requirements. So, the initial batch of custom boards worked without problems. Then we further improve the custom board design as needed. At least the initial batch worked, if not I would be in trouble with top management.

    -kel

  • Hi Jan,

    This is the 2nd version of our board which we designed and got fabricated after giving the previous one for review to TI experts.

    I will submit this design for review as well.

    Regards,

    Ritoo

  • Hi Ritoo,

    Understood, thank you for clarifying! Please submit the design for review and let the team know that this is a follow up review. As Markel mentioned, it will make sense to see how far we get in the code. Are you able to check if you get past main(), past the board initialization functions, and into SimplePeripheral_init()?

    Best Regards,

    Jan

  • Hi Jan and Markel,

    In the SimplePeripheral project, I could go into main() and also SimplePeripheral_init(), however it doesn't make it past  GATTServApp_AddService(GATT_ALL_SERVICES);

    I'm attaching the ss below:

    Upon stepping into it, I'm lost here:

    I have made the following changes in the project:

    1. In ble_user_config.h, defined RF_FE_MODE_AND_BIAS  as:

    #elif defined( CC2650EM_4XS )

    #define RF_FE_MODE_AND_BIAS ( RF_FE_SINGLE_ENDED_RFP | \
    RF_FE_INT_BIAS )

    Since I have now removed the Balun IC and have directly connected the RF_P to the antenna feed line using a 0 Ohm resistor. (Basically no matching circuit at this point. I am just expecting some signal presence at RF_P which I will verify using a VNA today)

    2. In simple_peripheral.c #include "Board.h" instead of #include "board.h" and have deleted board.c along with copying the 4 config files from ../blestack/

    3. Made BoardGpioInitTable[] as PIN_TERMINATE;

    4. in ccfg.c made SET_CCFG_MODE_CONF_XOSC_FREQ  0x2 since I am using a 48 MHz crystal

    I'm also attaching the config files here:

    Board.h

    /*
     * Copyright (c) 2016-2017, 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.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    
    #ifndef __BOARD_H
    #define __BOARD_H
    
    #define Board_CC2640R2_LAUNCHXL
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    #include <ti/drivers/ADC.h>
    #include <ti/drivers/ADCBuf.h>
    #include <ti/drivers/PWM.h>
    #include <ti/drivers/SPI.h>
    #include <ti/drivers/UART.h>
    #include <ti/drivers/Watchdog.h>
    
    #include <ti/drivers/Board.h>
    
    #define Board_initGeneral()     Board_init()  /* deprecated */
    
    #include "CC2640R2_LAUNCHXL.h"
    
    #define Board_shutDownExtFlash() CC2640R2_LAUNCHXL_shutDownExtFlash()
    #define Board_wakeUpExtFlash() CC2640R2_LAUNCHXL_wakeUpExtFlash()
    
    /* These #defines allow us to reuse TI-RTOS across other device families */
    
    #define Board_ADC0              CC2640R2_LAUNCHXL_ADC0
    #define Board_ADC1              CC2640R2_LAUNCHXL_ADC1
    
    #define Board_ADCBUF0           CC2640R2_LAUNCHXL_ADCBUF0
    #define Board_ADCBUF0CHANNEL0   CC2640R2_LAUNCHXL_ADCBUF0CHANNEL0
    #define Board_ADCBUF0CHANNEL1   CC2640R2_LAUNCHXL_ADCBUF0CHANNEL1
    
    #define Board_CRYPTO0           CC2640R2_LAUNCHXL_CRYPTO0
    #define Board_AESCCM0           CC2640R2_LAUNCHXL_AESCCM0
    #define Board_AESGCM0           CC2640R2_LAUNCHXL_AESGCM0
    #define Board_AESCBC0           CC2640R2_LAUNCHXL_AESCBC0
    #define Board_AESCTR0           CC2640R2_LAUNCHXL_AESCTR0
    #define Board_AESECB0           CC2640R2_LAUNCHXL_AESECB0
    #define Board_AESCTRDRBG0       CC2640R2_LAUNCHXL_AESCTRDRBG0
    
    #define Board_DIO0              CC2640R2_LAUNCHXL_DIO0
    #define Board_DIO1_RFSW         CC2640R2_LAUNCHXL_DIO1_RFSW
    #define Board_DIO12             CC2640R2_LAUNCHXL_DIO12
    #define Board_DIO15             CC2640R2_LAUNCHXL_DIO15
    #define Board_DIO16_TDO         CC2640R2_LAUNCHXL_DIO16_TDO
    #define Board_DIO17_TDI         CC2640R2_LAUNCHXL_DIO17_TDI
    #define Board_DIO21             CC2640R2_LAUNCHXL_DIO21
    #define Board_DIO22             CC2640R2_LAUNCHXL_DIO22
    
    #define Board_DIO23_ANALOG      CC2640R2_LAUNCHXL_DIO23_ANALOG
    #define Board_DIO24_ANALOG      CC2640R2_LAUNCHXL_DIO24_ANALOG
    #define Board_DIO25_ANALOG      CC2640R2_LAUNCHXL_DIO25_ANALOG
    #define Board_DIO26_ANALOG      CC2640R2_LAUNCHXL_DIO26_ANALOG
    #define Board_DIO27_ANALOG      CC2640R2_LAUNCHXL_DIO27_ANALOG
    #define Board_DIO28_ANALOG      CC2640R2_LAUNCHXL_DIO28_ANALOG
    #define Board_DIO29_ANALOG      CC2640R2_LAUNCHXL_DIO29_ANALOG
    #define Board_DIO30_ANALOG      CC2640R2_LAUNCHXL_DIO30_ANALOG
    
    #define Board_GPIO_BUTTON0      CC2640R2_LAUNCHXL_GPIO_S1
    #define Board_GPIO_BUTTON1      CC2640R2_LAUNCHXL_GPIO_S2
    #define Board_GPIO_BTN1         CC2640R2_LAUNCHXL_GPIO_S1
    #define Board_GPIO_BTN2         CC2640R2_LAUNCHXL_GPIO_S2
    #define Board_GPIO_LED0         CC2640R2_LAUNCHXL_GPIO_LED_RED
    #define Board_GPIO_LED1         CC2640R2_LAUNCHXL_GPIO_LED_GREEN
    #define Board_GPIO_LED2         CC2640R2_LAUNCHXL_GPIO_LED_RED
    #define Board_GPIO_RLED         CC2640R2_LAUNCHXL_GPIO_LED_RED
    #define Board_GPIO_GLED         CC2640R2_LAUNCHXL_GPIO_LED_GREEN
    #define Board_GPIO_LED_ON       CC2640R2_LAUNCHXL_GPIO_LED_ON
    #define Board_GPIO_LED_OFF      CC2640R2_LAUNCHXL_GPIO_LED_OFF
    #define Board_GPIO_TMP116_EN    CC2640R2_LAUNCHXL_GPIO_TMP116_EN
    
    #define Board_GPTIMER0A         CC2640R2_LAUNCHXL_GPTIMER0A
    #define Board_GPTIMER0B         CC2640R2_LAUNCHXL_GPTIMER0B
    #define Board_GPTIMER1A         CC2640R2_LAUNCHXL_GPTIMER1A
    #define Board_GPTIMER1B         CC2640R2_LAUNCHXL_GPTIMER1B
    #define Board_GPTIMER2A         CC2640R2_LAUNCHXL_GPTIMER2A
    #define Board_GPTIMER2B         CC2640R2_LAUNCHXL_GPTIMER2B
    #define Board_GPTIMER3A         CC2640R2_LAUNCHXL_GPTIMER3A
    #define Board_GPTIMER3B         CC2640R2_LAUNCHXL_GPTIMER3B
    
    #define Board_I2C0              CC2640R2_LAUNCHXL_I2C0
    #define Board_I2C_TMP           Board_I2C0
    
    #define Board_I2S0              CC2640R2_LAUNCHXL_I2S0
    #define Board_I2S_ADO           CC2640R2_LAUNCHXL_I2S_ADO
    #define Board_I2S_ADI           CC2640R2_LAUNCHXL_I2S_ADI
    #define Board_I2S_BCLK          CC2640R2_LAUNCHXL_I2S_BCLK
    #define Board_I2S_MCLK          CC2640R2_LAUNCHXL_I2S_MCLK
    #define Board_I2S_WCLK          CC2640R2_LAUNCHXL_I2S_WCLK
    
    #define Board_NVSINTERNAL       CC2640R2_LAUNCHXL_NVSCC26XX0
    #define Board_NVSEXTERNAL       CC2640R2_LAUNCHXL_NVSSPI25X0
    
    #define Board_PIN_BUTTON0       CC2640R2_LAUNCHXL_PIN_BTN1
    #define Board_PIN_BUTTON1       CC2640R2_LAUNCHXL_PIN_BTN2
    #define Board_PIN_BTN1          CC2640R2_LAUNCHXL_PIN_BTN1
    #define Board_PIN_BTN2          CC2640R2_LAUNCHXL_PIN_BTN2
    #define Board_PIN_LED0          CC2640R2_LAUNCHXL_PIN_RLED
    #define Board_PIN_LED1          CC2640R2_LAUNCHXL_PIN_GLED
    #define Board_PIN_LED2          CC2640R2_LAUNCHXL_PIN_RLED
    #define Board_PIN_RLED          CC2640R2_LAUNCHXL_PIN_RLED
    #define Board_PIN_GLED          CC2640R2_LAUNCHXL_PIN_GLED
    
    #define Board_PWM0              CC2640R2_LAUNCHXL_PWM0
    #define Board_PWM1              CC2640R2_LAUNCHXL_PWM1
    #define Board_PWM2              CC2640R2_LAUNCHXL_PWM2
    #define Board_PWM3              CC2640R2_LAUNCHXL_PWM3
    #define Board_PWM4              CC2640R2_LAUNCHXL_PWM4
    #define Board_PWM5              CC2640R2_LAUNCHXL_PWM5
    #define Board_PWM6              CC2640R2_LAUNCHXL_PWM6
    #define Board_PWM7              CC2640R2_LAUNCHXL_PWM7
    
    #define Board_SD0               CC2640R2_LAUNCHXL_SDSPI0
    
    #define Board_SPI0              CC2640R2_LAUNCHXL_SPI0
    #define Board_SPI1              CC2640R2_LAUNCHXL_SPI1
    #define Board_SPI_FLASH_CS      CC2640R2_LAUNCHXL_SPI_FLASH_CS
    #define Board_FLASH_CS_ON       0
    #define Board_FLASH_CS_OFF      1
    
    #define Board_SPI_MASTER        CC2640R2_LAUNCHXL_SPI0
    #define Board_SPI_SLAVE         CC2640R2_LAUNCHXL_SPI0
    #define Board_SPI_MASTER_READY  CC2640R2_LAUNCHXL_SPI_MASTER_READY
    #define Board_SPI_SLAVE_READY   CC2640R2_LAUNCHXL_SPI_SLAVE_READY
    #define Board_UART0             CC2640R2_LAUNCHXL_UART0
    
    #define Board_WATCHDOG0         CC2640R2_LAUNCHXL_WATCHDOG0
    
    /*
     * These macros are provided for backwards compatibility.
     * Please use the <Driver>_init functions directly rather
     * than Board_init<Driver>.
     */
    #define Board_initADC()         ADC_init()
    #define Board_initADCBuf()      ADCBuf_init()
    #define Board_initGPIO()        GPIO_init()
    #define Board_initPWM()         PWM_init()
    #define Board_initSPI()         SPI_init()
    #define Board_initUART()        UART_init()
    #define Board_initWatchdog()    Watchdog_init()
    
    /*
     * These macros are provided for backwards compatibility.
     * Please use the 'Board_PIN_xxx' macros to differentiate
     * them from the 'Board_GPIO_xxx' macros.
     */
    #define Board_BUTTON0           Board_PIN_BUTTON0
    #define Board_BUTTON1           Board_PIN_BUTTON1
    #define Board_BTN1              Board_PIN_BTN1
    #define Board_BTN2              Board_PIN_BTN2
    #define Board_LED_ON            Board_GPIO_LED_ON
    #define Board_LED_OFF           Board_GPIO_LED_OFF
    #define Board_LED0              Board_PIN_LED0
    #define Board_LED1              Board_PIN_LED1
    #define Board_LED2              Board_PIN_LED2
    #define Board_RLED              Board_PIN_RLED
    #define Board_GLED              Board_PIN_GLED
    #define Board_ADCBUFCHANNEL0    Board_ADCBUF0CHANNEL0
    #define Board_ADCBUFCHANNEL1    Board_ADCBUF0CHANNEL1
    
    #ifdef __cplusplus
    }
    #endif
    
    #endif /* __BOARD_H */
    

    launch.c

    /*
     * Copyright (c) 2016-2017, 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.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    
    /*
     *  ====================== CC2640R2_LAUNCHXL.c =================================
     *  This board file is made for the 7x7 mm QFN package, to convert this board
     *  file to use for other smaller device packages please refer to the table
     *  below which lists the max IOID values supported by each package. All other
     *  unused pins should be set to IOID_UNUSED.
     *
     *  Furthermore the board file is also used
     *  to define a symbol that configures the RF front end and bias.
     *  See the comments below for more information.
     *  For an in depth tutorial on how to create a custom board file, please refer
     *  to the section "Running the SDK on Custom Boards" with in the Software
     *  Developer's Guide.
     *
     *  Refer to the datasheet for all the package options and IO descriptions:
     *  http://www.ti.com/lit/ds/symlink/cc2640r2f.pdf
     *
     *  +-----------------------+------------------+-----------------------+
     *  |     Package Option    |  Total GPIO Pins |   MAX IOID            |
     *  +=======================+==================+=======================+
     *  |     7x7 mm QFN        |     31           |   IOID_30             |
     *  +-----------------------+------------------+-----------------------+
     *  |     5x5 mm QFN        |     15           |   IOID_14             |
     *  +-----------------------+------------------+-----------------------+
     *  |     4x4 mm QFN        |     10           |   IOID_9              |
     *  +-----------------------+------------------+-----------------------+
     *  |     2.7 x 2.7 mm WCSP |     14           |   IOID_13             |
     *  +-----------------------+------------------+-----------------------+
     *  ============================================================================
     */
    
    #include <stdbool.h>
    #include <stddef.h>
    #include <stdint.h>
    
    #include <ti/devices/cc26x0r2/driverlib/ioc.h>
    #include <ti/devices/cc26x0r2/driverlib/udma.h>
    #include <ti/devices/cc26x0r2/inc/hw_ints.h>
    #include <ti/devices/cc26x0r2/inc/hw_memmap.h>
    
    #include "CC2640R2_LAUNCHXL.h"
    
    /*
     *  =============================== ADCBuf ===============================
     */
    #include <ti/drivers/ADCBuf.h>
    #include <ti/drivers/adcbuf/ADCBufCC26XX.h>
    
    ADCBufCC26XX_Object adcBufCC26xxObjects[CC2640R2_LAUNCHXL_ADCBUFCOUNT];
    
    /*
     *  This table converts a virtual adc channel into a dio and internal analogue
     *  input signal. This table is necessary for the functioning of the adcBuf
     *  driver. Comment out unused entries to save flash. Dio and internal signal
     *  pairs are hardwired. Do not remap them in the table. You may reorder entire
     *  entries. The mapping of dio and internal signals is package dependent.
     */
    const ADCBufCC26XX_AdcChannelLutEntry ADCBufCC26XX_adcChannelLut[CC2640R2_LAUNCHXL_ADCBUF0CHANNELCOUNT] = {
        {CC2640R2_LAUNCHXL_DIO23_ANALOG, ADC_COMPB_IN_AUXIO7},
        {CC2640R2_LAUNCHXL_DIO24_ANALOG, ADC_COMPB_IN_AUXIO6},
        {CC2640R2_LAUNCHXL_DIO25_ANALOG, ADC_COMPB_IN_AUXIO5},
        {CC2640R2_LAUNCHXL_DIO26_ANALOG, ADC_COMPB_IN_AUXIO4},
        {CC2640R2_LAUNCHXL_DIO27_ANALOG, ADC_COMPB_IN_AUXIO3},
        {CC2640R2_LAUNCHXL_DIO28_ANALOG, ADC_COMPB_IN_AUXIO2},
        {CC2640R2_LAUNCHXL_DIO29_ANALOG, ADC_COMPB_IN_AUXIO1},
        {CC2640R2_LAUNCHXL_DIO30_ANALOG, ADC_COMPB_IN_AUXIO0},
        {PIN_UNASSIGNED, ADC_COMPB_IN_VDDS},
        {PIN_UNASSIGNED, ADC_COMPB_IN_DCOUPL},
        {PIN_UNASSIGNED, ADC_COMPB_IN_VSS},
    };
    
    const ADCBufCC26XX_HWAttrs adcBufCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADCBUFCOUNT] = {
        {
            .intPriority       = ~0,
            .swiPriority       = 0,
            .adcChannelLut     = ADCBufCC26XX_adcChannelLut,
        }
    };
    
    const ADCBuf_Config ADCBuf_config[CC2640R2_LAUNCHXL_ADCBUFCOUNT] = {
        {
            &ADCBufCC26XX_fxnTable,
            &adcBufCC26xxObjects[CC2640R2_LAUNCHXL_ADCBUF0],
            &adcBufCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADCBUF0]
        },
    };
    
    const uint_least8_t ADCBuf_count = CC2640R2_LAUNCHXL_ADCBUFCOUNT;
    
    /*
     *  =============================== ADC ===============================
     */
    #include <ti/drivers/ADC.h>
    #include <ti/drivers/adc/ADCCC26XX.h>
    
    ADCCC26XX_Object adcCC26xxObjects[CC2640R2_LAUNCHXL_ADCCOUNT];
    
    const ADCCC26XX_HWAttrs adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADCCOUNT] = {
        {
            .adcDIO              = CC2640R2_LAUNCHXL_DIO23_ANALOG,
            .adcCompBInput       = ADC_COMPB_IN_AUXIO7,
            .refSource           = ADCCC26XX_FIXED_REFERENCE,
            .samplingDuration    = ADCCC26XX_SAMPLING_DURATION_2P7_US,
            .inputScalingEnabled = true,
            .triggerSource       = ADCCC26XX_TRIGGER_MANUAL,
            .returnAdjustedVal   = false
        },
        {
            .adcDIO              = CC2640R2_LAUNCHXL_DIO24_ANALOG,
            .adcCompBInput       = ADC_COMPB_IN_AUXIO6,
            .refSource           = ADCCC26XX_FIXED_REFERENCE,
            .samplingDuration    = ADCCC26XX_SAMPLING_DURATION_2P7_US,
            .inputScalingEnabled = true,
            .triggerSource       = ADCCC26XX_TRIGGER_MANUAL,
            .returnAdjustedVal   = false
        },
        {
            .adcDIO              = CC2640R2_LAUNCHXL_DIO25_ANALOG,
            .adcCompBInput       = ADC_COMPB_IN_AUXIO5,
            .refSource           = ADCCC26XX_FIXED_REFERENCE,
            .samplingDuration    = ADCCC26XX_SAMPLING_DURATION_2P7_US,
            .inputScalingEnabled = true,
            .triggerSource       = ADCCC26XX_TRIGGER_MANUAL,
            .returnAdjustedVal   = false
        },
        {
            .adcDIO              = CC2640R2_LAUNCHXL_DIO26_ANALOG,
            .adcCompBInput       = ADC_COMPB_IN_AUXIO4,
            .refSource           = ADCCC26XX_FIXED_REFERENCE,
            .samplingDuration    = ADCCC26XX_SAMPLING_DURATION_2P7_US,
            .inputScalingEnabled = true,
            .triggerSource       = ADCCC26XX_TRIGGER_MANUAL,
            .returnAdjustedVal   = false
        },
        {
            .adcDIO              = CC2640R2_LAUNCHXL_DIO27_ANALOG,
            .adcCompBInput       = ADC_COMPB_IN_AUXIO3,
            .refSource           = ADCCC26XX_FIXED_REFERENCE,
            .samplingDuration    = ADCCC26XX_SAMPLING_DURATION_2P7_US,
            .inputScalingEnabled = true,
            .triggerSource       = ADCCC26XX_TRIGGER_MANUAL,
            .returnAdjustedVal   = false
        },
        {
            .adcDIO              = CC2640R2_LAUNCHXL_DIO28_ANALOG,
            .adcCompBInput       = ADC_COMPB_IN_AUXIO2,
            .refSource           = ADCCC26XX_FIXED_REFERENCE,
            .samplingDuration    = ADCCC26XX_SAMPLING_DURATION_2P7_US,
            .inputScalingEnabled = true,
            .triggerSource       = ADCCC26XX_TRIGGER_MANUAL,
            .returnAdjustedVal   = false
        },
        {
            .adcDIO              = CC2640R2_LAUNCHXL_DIO29_ANALOG,
            .adcCompBInput       = ADC_COMPB_IN_AUXIO1,
            .refSource           = ADCCC26XX_FIXED_REFERENCE,
            .samplingDuration    = ADCCC26XX_SAMPLING_DURATION_2P7_US,
            .inputScalingEnabled = true,
            .triggerSource       = ADCCC26XX_TRIGGER_MANUAL,
            .returnAdjustedVal   = false
        },
        {
            .adcDIO              = CC2640R2_LAUNCHXL_DIO30_ANALOG,
            .adcCompBInput       = ADC_COMPB_IN_AUXIO0,
            .refSource           = ADCCC26XX_FIXED_REFERENCE,
            .samplingDuration    = ADCCC26XX_SAMPLING_DURATION_10P9_MS,
            .inputScalingEnabled = true,
            .triggerSource       = ADCCC26XX_TRIGGER_MANUAL,
            .returnAdjustedVal   = false
        },
        {
            .adcDIO              = PIN_UNASSIGNED,
            .adcCompBInput       = ADC_COMPB_IN_DCOUPL,
            .refSource           = ADCCC26XX_FIXED_REFERENCE,
            .samplingDuration    = ADCCC26XX_SAMPLING_DURATION_2P7_US,
            .inputScalingEnabled = true,
            .triggerSource       = ADCCC26XX_TRIGGER_MANUAL,
            .returnAdjustedVal   = false
        },
        {
            .adcDIO              = PIN_UNASSIGNED,
            .adcCompBInput       = ADC_COMPB_IN_VSS,
            .refSource           = ADCCC26XX_FIXED_REFERENCE,
            .samplingDuration    = ADCCC26XX_SAMPLING_DURATION_2P7_US,
            .inputScalingEnabled = true,
            .triggerSource       = ADCCC26XX_TRIGGER_MANUAL,
            .returnAdjustedVal   = false
        },
        {
            .adcDIO              = PIN_UNASSIGNED,
            .adcCompBInput       = ADC_COMPB_IN_VDDS,
            .refSource           = ADCCC26XX_FIXED_REFERENCE,
            .samplingDuration    = ADCCC26XX_SAMPLING_DURATION_2P7_US,
            .inputScalingEnabled = true,
            .triggerSource       = ADCCC26XX_TRIGGER_MANUAL,
            .returnAdjustedVal   = false
        }
    };
    
    const ADC_Config ADC_config[CC2640R2_LAUNCHXL_ADCCOUNT] = {
        {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC2640R2_LAUNCHXL_ADC0], &adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADC0]},
        {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC2640R2_LAUNCHXL_ADC1], &adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADC1]},
        {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC2640R2_LAUNCHXL_ADC2], &adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADC2]},
        {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC2640R2_LAUNCHXL_ADC3], &adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADC3]},
        {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC2640R2_LAUNCHXL_ADC4], &adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADC4]},
        {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC2640R2_LAUNCHXL_ADC5], &adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADC5]},
        {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC2640R2_LAUNCHXL_ADC6], &adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADC6]},
        {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC2640R2_LAUNCHXL_ADC7], &adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADC7]},
        {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC2640R2_LAUNCHXL_ADCDCOUPL], &adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADCDCOUPL]},
        {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC2640R2_LAUNCHXL_ADCVSS], &adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADCVSS]},
        {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC2640R2_LAUNCHXL_ADCVDDS], &adcCC26xxHWAttrs[CC2640R2_LAUNCHXL_ADCVDDS]},
    };
    
    const uint_least8_t ADC_count = CC2640R2_LAUNCHXL_ADCCOUNT;
    
    /*
     *  =============================== Crypto ===============================
     */
    #include <ti/drivers/crypto/CryptoCC26XX.h>
    
    CryptoCC26XX_Object cryptoCC26XXObjects[CC2640R2_LAUNCHXL_CRYPTOCOUNT];
    
    const CryptoCC26XX_HWAttrs cryptoCC26XXHWAttrs[CC2640R2_LAUNCHXL_CRYPTOCOUNT] = {
        {
            .baseAddr       = CRYPTO_BASE,
            .powerMngrId    = PowerCC26XX_PERIPH_CRYPTO,
            .intNum         = INT_CRYPTO_RESULT_AVAIL_IRQ,
            .intPriority    = ~0,
        }
    };
    
    const CryptoCC26XX_Config CryptoCC26XX_config[CC2640R2_LAUNCHXL_CRYPTOCOUNT] = {
        {
             .object  = &cryptoCC26XXObjects[CC2640R2_LAUNCHXL_CRYPTO0],
             .hwAttrs = &cryptoCC26XXHWAttrs[CC2640R2_LAUNCHXL_CRYPTO0]
        },
    };
    
    /*
     *  =============================== AESCCM ===============================
     */
    #include <ti/drivers/AESCCM.h>
    #include <ti/drivers/aesccm/AESCCMCC26XX.h>
    
    AESCCMCC26XX_Object aesccmCC26XXObjects[CC2640R2_LAUNCHXL_AESCCMCOUNT];
    
    const AESCCMCC26XX_HWAttrs aesccmCC26XXHWAttrs[CC2640R2_LAUNCHXL_AESCCMCOUNT] = {
        {
            .intPriority       = ~0,
        }
    };
    
    const AESCCM_Config AESCCM_config[CC2640R2_LAUNCHXL_AESCCMCOUNT] = {
        {
             .object  = &aesccmCC26XXObjects[CC2640R2_LAUNCHXL_AESCCM0],
             .hwAttrs = &aesccmCC26XXHWAttrs[CC2640R2_LAUNCHXL_AESCCM0]
        },
    };
    
    const uint_least8_t AESCCM_count = CC2640R2_LAUNCHXL_AESCCMCOUNT;
    
    
    /*
     *  =============================== AESGCM ===============================
     */
    #include <ti/drivers/AESGCM.h>
    #include <ti/drivers/aesgcm/AESGCMCC26XX.h>
    
    AESGCMCC26XX_Object aesgcmCC26XXObjects[CC2640R2_LAUNCHXL_AESGCMCOUNT];
    
    const AESGCMCC26XX_HWAttrs aesgcmCC26XXHWAttrs[CC2640R2_LAUNCHXL_AESGCMCOUNT] = {
        {
            .intPriority       = ~0,
        }
    };
    
    const AESGCM_Config AESGCM_config[CC2640R2_LAUNCHXL_AESGCMCOUNT] = {
        {
             .object  = &aesgcmCC26XXObjects[CC2640R2_LAUNCHXL_AESGCM0],
             .hwAttrs = &aesgcmCC26XXHWAttrs[CC2640R2_LAUNCHXL_AESGCM0]
        },
    };
    
    const uint_least8_t AESGCM_count = CC2640R2_LAUNCHXL_AESGCMCOUNT;
    
    /*
     *  =============================== AESCBC ===============================
     */
    #include <ti/drivers/AESCBC.h>
    #include <ti/drivers/aescbc/AESCBCCC26XX.h>
    
    AESCBCCC26XX_Object aescbcCC26XXObjects[CC2640R2_LAUNCHXL_AESCBCCOUNT];
    
    const AESCBCCC26XX_HWAttrs aescbcCC26XXHWAttrs[CC2640R2_LAUNCHXL_AESCBCCOUNT] = {
        {
            .intPriority       = ~0,
        }
    };
    
    const AESCBC_Config AESCBC_config[CC2640R2_LAUNCHXL_AESCBCCOUNT] = {
        {
             .object  = &aescbcCC26XXObjects[CC2640R2_LAUNCHXL_AESCBC0],
             .hwAttrs = &aescbcCC26XXHWAttrs[CC2640R2_LAUNCHXL_AESCBC0]
        },
    };
    
    const uint_least8_t AESCBC_count = CC2640R2_LAUNCHXL_AESCBCCOUNT;
    
    /*
     *  =============================== AESCTR ===============================
     */
    #include <ti/drivers/AESCTR.h>
    #include <ti/drivers/aesctr/AESCTRCC26XX.h>
    
    AESCTRCC26XX_Object aesctrCC26XXObjects[CC2640R2_LAUNCHXL_AESCTRCOUNT];
    
    const AESCTRCC26XX_HWAttrs aesctrCC26XXHWAttrs[CC2640R2_LAUNCHXL_AESCTRCOUNT] = {
        {
            .intPriority       = ~0,
        }
    };
    
    const AESCTR_Config AESCTR_config[CC2640R2_LAUNCHXL_AESCTRCOUNT] = {
        {
             .object  = &aesctrCC26XXObjects[CC2640R2_LAUNCHXL_AESCTR0],
             .hwAttrs = &aesctrCC26XXHWAttrs[CC2640R2_LAUNCHXL_AESCTR0]
        },
    };
    
    const uint_least8_t AESCTR_count = CC2640R2_LAUNCHXL_AESCTRCOUNT;
    
    /*
     *  =============================== AESECB ===============================
     */
    #include <ti/drivers/AESECB.h>
    #include <ti/drivers/aesecb/AESECBCC26XX.h>
    
    AESECBCC26XX_Object aesecbCC26XXObjects[CC2640R2_LAUNCHXL_AESECBCOUNT];
    
    const AESECBCC26XX_HWAttrs aesecbCC26XXHWAttrs[CC2640R2_LAUNCHXL_AESECBCOUNT] = {
        {
            .intPriority       = ~0,
        }
    };
    
    const AESECB_Config AESECB_config[CC2640R2_LAUNCHXL_AESECBCOUNT] = {
        {
             .object  = &aesecbCC26XXObjects[CC2640R2_LAUNCHXL_AESECB0],
             .hwAttrs = &aesecbCC26XXHWAttrs[CC2640R2_LAUNCHXL_AESECB0]
        },
    };
    
    const uint_least8_t AESECB_count = CC2640R2_LAUNCHXL_AESECBCOUNT;
    
    /*
     *  =============================== AESCTRDRBG ===============================
     */
    #include <ti/drivers/AESCTRDRBG.h>
    #include <ti/drivers/aesctrdrbg/AESCTRDRBGXX.h>
    
    AESCTRDRBGXX_Object aesctrdrbgXXObjects[CC2640R2_LAUNCHXL_AESCTRDRBGCOUNT];
    
    const AESCTRDRBGXX_HWAttrs aesctrdrbgXXHWAttrs[CC2640R2_LAUNCHXL_AESCTRDRBGCOUNT] = {
        {
            .aesctrIndex       = CC2640R2_LAUNCHXL_AESCTR0,
        }
    };
    
    const AESCTRDRBG_Config AESCTRDRBG_config[CC2640R2_LAUNCHXL_AESCTRDRBGCOUNT] = {
        {
             .object  = &aesctrdrbgXXObjects[CC2640R2_LAUNCHXL_AESCTRDRBG0],
             .hwAttrs = &aesctrdrbgXXHWAttrs[CC2640R2_LAUNCHXL_AESCTRDRBG0]
        },
    };
    
    const uint_least8_t AESCTRDRBG_count = CC2640R2_LAUNCHXL_AESCTRDRBGCOUNT;
    
    /*
     *  =============================== Display ===============================
     */
    #include <ti/display/Display.h>
    #include <ti/display/DisplayUart.h>
    #include <ti/display/DisplaySharp.h>
    
    #ifndef BOARD_DISPLAY_UART_STRBUF_SIZE
    #define BOARD_DISPLAY_UART_STRBUF_SIZE    128
    #endif
    
    /* This value can be changed to 96 for use with the 430BOOST-SHARP96 BoosterPack. */
    #define BOARD_DISPLAY_SHARP_SIZE    128
    
    DisplayUart_Object     displayUartObject;
    DisplaySharp_Object    displaySharpObject;
    
    static char uartStringBuf[BOARD_DISPLAY_UART_STRBUF_SIZE];
    static uint_least8_t sharpDisplayBuf[BOARD_DISPLAY_SHARP_SIZE * BOARD_DISPLAY_SHARP_SIZE / 8];
    
    const DisplayUart_HWAttrs displayUartHWAttrs = {
        .uartIdx      = CC2640R2_LAUNCHXL_UART0,
        .baudRate     = 115200,
        .mutexTimeout = (unsigned int)(-1),
        .strBuf       = uartStringBuf,
        .strBufLen    = BOARD_DISPLAY_UART_STRBUF_SIZE,
    };
    
    const DisplaySharp_HWAttrsV1 displaySharpHWattrs = {
        .spiIndex    = CC2640R2_LAUNCHXL_SPI0,
        .csPin       = CC2640R2_LAUNCHXL_GPIO_LCD_CS,
        .powerPin    = CC2640R2_LAUNCHXL_GPIO_LCD_POWER,
        .enablePin   = CC2640R2_LAUNCHXL_GPIO_LCD_ENABLE,
        .pixelWidth  = BOARD_DISPLAY_SHARP_SIZE,
        .pixelHeight = BOARD_DISPLAY_SHARP_SIZE,
        .displayBuf  = sharpDisplayBuf,
    };
    
    #ifndef BOARD_DISPLAY_USE_UART
    #define BOARD_DISPLAY_USE_UART 1
    #endif
    #ifndef BOARD_DISPLAY_USE_UART_ANSI
    #define BOARD_DISPLAY_USE_UART_ANSI 0
    #endif
    #ifndef BOARD_DISPLAY_USE_LCD
    #define BOARD_DISPLAY_USE_LCD 0
    #endif
    
    /*
     * This #if/#else is needed to workaround a problem with the
     * IAR compiler. The IAR compiler doesn't like the empty array
     * initialization. (IAR Error[Pe1345])
     */
    #if (BOARD_DISPLAY_USE_UART || BOARD_DISPLAY_USE_LCD)
    
    const Display_Config Display_config[] = {
    #if (BOARD_DISPLAY_USE_UART)
        {
    #  if (BOARD_DISPLAY_USE_UART_ANSI)
            .fxnTablePtr = &DisplayUartAnsi_fxnTable,
    #  else /* Default to minimal UART with no cursor placement */
            .fxnTablePtr = &DisplayUartMin_fxnTable,
    #  endif
            .object      = &displayUartObject,
            .hwAttrs     = &displayUartHWAttrs,
        },
    #endif
    #if (BOARD_DISPLAY_USE_LCD)
        {
            .fxnTablePtr = &DisplaySharp_fxnTable,
            .object      = &displaySharpObject,
            .hwAttrs     = &displaySharpHWattrs
        },
    #endif
    };
    
    const uint_least8_t Display_count = sizeof(Display_config) / sizeof(Display_Config);
    
    #else
    
    const Display_Config *Display_config = NULL;
    const uint_least8_t Display_count = 0;
    
    #endif /* (BOARD_DISPLAY_USE_UART || BOARD_DISPLAY_USE_LCD) */
    
    /*
     *  =============================== GPIO ===============================
     */
    #include <ti/drivers/GPIO.h>
    #include <ti/drivers/gpio/GPIOCC26XX.h>
    
    /*
     * Array of Pin configurations
     * NOTE: The order of the pin configurations must coincide with what was
     *       defined in CC2640R2_LAUNCHXL.h
     * NOTE: Pins not used for interrupts should be placed at the end of the
     *       array. Callback entries can be omitted from callbacks array to
     *       reduce memory usage.
     */
    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 */
    
        /* 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 */
    };
    
    /*
     * Array of callback function pointers
     * NOTE: The order of the pin configurations must coincide with what was
     *       defined in CC2640R2_LAUNCH.h
     * NOTE: Pins not used for interrupts can be omitted from callbacks array to
     *       reduce memory usage (if placed at end of gpioPinConfigs array).
     */
    GPIO_CallbackFxn gpioCallbackFunctions[] = {
        NULL,  /* Button 0 */
        NULL,  /* Button 1 */
        NULL,  /* CC2640R2_LAUNCHXL_SPI_MASTER_READY */
        NULL,  /* CC2640R2_LAUNCHXL_SPI_SLAVE_READY */
    };
    
    const GPIOCC26XX_Config GPIOCC26XX_config = {
        .pinConfigs         = (GPIO_PinConfig *)gpioPinConfigs,
        .callbacks          = (GPIO_CallbackFxn *)gpioCallbackFunctions,
        .numberOfPinConfigs = CC2640R2_LAUNCHXL_GPIOCOUNT,
        .numberOfCallbacks  = sizeof(gpioCallbackFunctions)/sizeof(GPIO_CallbackFxn),
        .intPriority        = (~0)
    };
    
    /*
     *  =============================== GPTimer ===============================
     *  Remove unused entries to reduce flash usage both in Board.c and Board.h
     */
    #include <ti/drivers/timer/GPTimerCC26XX.h>
    
    GPTimerCC26XX_Object gptimerCC26XXObjects[CC2640R2_LAUNCHXL_GPTIMERCOUNT];
    
    const GPTimerCC26XX_HWAttrs gptimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_GPTIMERPARTSCOUNT] = {
        { .baseAddr = GPT0_BASE, .intNum = INT_GPT0A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT0, .pinMux = GPT_PIN_0A, },
        { .baseAddr = GPT0_BASE, .intNum = INT_GPT0B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT0, .pinMux = GPT_PIN_0B, },
        { .baseAddr = GPT1_BASE, .intNum = INT_GPT1A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT1, .pinMux = GPT_PIN_1A, },
        { .baseAddr = GPT1_BASE, .intNum = INT_GPT1B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT1, .pinMux = GPT_PIN_1B, },
        { .baseAddr = GPT2_BASE, .intNum = INT_GPT2A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT2, .pinMux = GPT_PIN_2A, },
        { .baseAddr = GPT2_BASE, .intNum = INT_GPT2B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT2, .pinMux = GPT_PIN_2B, },
        { .baseAddr = GPT3_BASE, .intNum = INT_GPT3A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT3, .pinMux = GPT_PIN_3A, },
        { .baseAddr = GPT3_BASE, .intNum = INT_GPT3B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT3, .pinMux = GPT_PIN_3B, },
    };
    
    const GPTimerCC26XX_Config GPTimerCC26XX_config[CC2640R2_LAUNCHXL_GPTIMERPARTSCOUNT] = {
        { &gptimerCC26XXObjects[CC2640R2_LAUNCHXL_GPTIMER0], &gptimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_GPTIMER0A], GPT_A },
        { &gptimerCC26XXObjects[CC2640R2_LAUNCHXL_GPTIMER0], &gptimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_GPTIMER0B], GPT_B },
        { &gptimerCC26XXObjects[CC2640R2_LAUNCHXL_GPTIMER1], &gptimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_GPTIMER1A], GPT_A },
        { &gptimerCC26XXObjects[CC2640R2_LAUNCHXL_GPTIMER1], &gptimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_GPTIMER1B], GPT_B },
        { &gptimerCC26XXObjects[CC2640R2_LAUNCHXL_GPTIMER2], &gptimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_GPTIMER2A], GPT_A },
        { &gptimerCC26XXObjects[CC2640R2_LAUNCHXL_GPTIMER2], &gptimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_GPTIMER2B], GPT_B },
        { &gptimerCC26XXObjects[CC2640R2_LAUNCHXL_GPTIMER3], &gptimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_GPTIMER3A], GPT_A },
        { &gptimerCC26XXObjects[CC2640R2_LAUNCHXL_GPTIMER3], &gptimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_GPTIMER3B], GPT_B },
    };
    
    /*
     *  =============================== I2C ===============================
    */
    #include <ti/drivers/I2C.h>
    #include <ti/drivers/i2c/I2CCC26XX.h>
    
    I2CCC26XX_Object i2cCC26xxObjects[CC2640R2_LAUNCHXL_I2CCOUNT];
    
    const I2CCC26XX_HWAttrsV1 i2cCC26xxHWAttrs[CC2640R2_LAUNCHXL_I2CCOUNT] = {
        {
            .baseAddr    = I2C0_BASE,
            .powerMngrId = PowerCC26XX_PERIPH_I2C0,
            .intNum      = INT_I2C_IRQ,
            .intPriority = ~0,
            .swiPriority = 0,
            .sdaPin      = CC2640R2_LAUNCHXL_I2C0_SDA0,
            .sclPin      = CC2640R2_LAUNCHXL_I2C0_SCL0,
        }
    };
    
    const I2C_Config I2C_config[CC2640R2_LAUNCHXL_I2CCOUNT] = {
        {
            .fxnTablePtr = &I2CCC26XX_fxnTable,
            .object      = &i2cCC26xxObjects[CC2640R2_LAUNCHXL_I2C0],
            .hwAttrs     = &i2cCC26xxHWAttrs[CC2640R2_LAUNCHXL_I2C0]
        },
    };
    
    const uint_least8_t I2C_count = CC2640R2_LAUNCHXL_I2CCOUNT;
    
    /*
     *  =============================== I2S ===============================
    */
    #include <ti/drivers/I2S.h>
    #include <ti/drivers/i2s/I2SCC26XX.h>
    
    I2SCC26XX_Object i2sCC26XXObjects[CC2640R2_LAUNCHXL_I2SCOUNT];
    
    const I2SCC26XX_HWAttrs i2sCC26XXHWAttrs[CC2640R2_LAUNCHXL_I2SCOUNT] = {
        {
            .pinSD1      =  CC2640R2_LAUNCHXL_I2S_ADI,
            .pinSD0      =  CC2640R2_LAUNCHXL_I2S_ADO,
            .pinSCK      =  CC2640R2_LAUNCHXL_I2S_BCLK,
            .pinMCLK     =  CC2640R2_LAUNCHXL_I2S_MCLK,
            .pinWS       =  CC2640R2_LAUNCHXL_I2S_WCLK,
            .intPriority = ~0,
        }
    };
    
    const I2S_Config I2S_config[CC2640R2_LAUNCHXL_I2SCOUNT] = {
        {
            .object      = &i2sCC26XXObjects[CC2640R2_LAUNCHXL_I2S0],
            .hwAttrs     = &i2sCC26XXHWAttrs[CC2640R2_LAUNCHXL_I2S0]
        },
    };
    
    const uint_least8_t I2S_count = CC2640R2_LAUNCHXL_I2SCOUNT;
    
    /*
     *  =============================== NVS ===============================
     */
    #include <ti/drivers/NVS.h>
    #include <ti/drivers/nvs/NVSSPI25X.h>
    #include <ti/drivers/nvs/NVSCC26XX.h>
    
    #define NVS_REGIONS_BASE 0x1A000
    #define SECTORSIZE       0x1000
    #define REGIONSIZE       (SECTORSIZE * 4)
    
    #ifndef Board_EXCLUDE_NVS_INTERNAL_FLASH
    
    /*
     * Reserve flash sectors for NVS driver use by placing an uninitialized byte
     * array at the desired flash address.
     */
    #if defined(__TI_COMPILER_VERSION__)
    
    /*
     * Place uninitialized array at NVS_REGIONS_BASE
     */
    #pragma LOCATION(flashBuf, NVS_REGIONS_BASE);
    #pragma NOINIT(flashBuf);
    static char flashBuf[REGIONSIZE];
    
    #elif defined(__IAR_SYSTEMS_ICC__)
    
    /*
     * Place uninitialized array at NVS_REGIONS_BASE
     */
    static __no_init char flashBuf[REGIONSIZE] @ NVS_REGIONS_BASE;
    
    #elif defined(__GNUC__)
    
    /*
     * Place the flash buffers in the .nvs section created in the gcc linker file.
     * The .nvs section enforces alignment on a sector boundary but may
     * be placed anywhere in flash memory.  If desired the .nvs section can be set
     * to a fixed address by changing the following in the gcc linker file:
     *
     * .nvs (FIXED_FLASH_ADDR) (NOLOAD) : AT (FIXED_FLASH_ADDR) {
     *      *(.nvs)
     * } > REGION_TEXT
     */
    __attribute__ ((section (".nvs")))
    static char flashBuf[REGIONSIZE];
    
    #endif
    
    /* Allocate objects for NVS Internal Regions */
    NVSCC26XX_Object nvsCC26xxObjects[1];
    
    /* Hardware attributes for NVS Internal Regions */
    const NVSCC26XX_HWAttrs nvsCC26xxHWAttrs[1] = {
        {
            .regionBase = (void *)flashBuf,
            .regionSize = REGIONSIZE,
        },
    };
    
    #endif /* Board_EXCLUDE_NVS_INTERNAL_FLASH */
    
    #ifndef Board_EXCLUDE_NVS_EXTERNAL_FLASH
    
    #define SPISECTORSIZE    0x1000
    #define SPIREGIONSIZE    (SPISECTORSIZE * 32)
    #define VERIFYBUFSIZE    64
    
    static uint8_t verifyBuf[VERIFYBUFSIZE];
    
    /* Allocate objects for NVS External Regions */
    NVSSPI25X_Object nvsSPI25XObjects[1];
    
    /* Hardware attributes for NVS External Regions */
    const NVSSPI25X_HWAttrs nvsSPI25XHWAttrs[1] = {
        {
            .regionBaseOffset = 0,
            .regionSize = SPIREGIONSIZE,
            .sectorSize = SPISECTORSIZE,
            .verifyBuf = verifyBuf,
            .verifyBufSize = VERIFYBUFSIZE,
            .spiHandle = NULL,
            .spiIndex = 0,
            .spiBitRate = 4000000,
            .spiCsnGpioIndex = CC2640R2_LAUNCHXL_GPIO_SPI_FLASH_CS,
            .statusPollDelayUs = 100,
        },
    };
    
    #endif /* Board_EXCLUDE_NVS_EXTERNAL_FLASH */
    
    /* NVS Region index 0 and 1 refer to NVS and NVS SPI respectively */
    const NVS_Config NVS_config[CC2640R2_LAUNCHXL_NVSCOUNT] = {
    #ifndef Board_EXCLUDE_NVS_INTERNAL_FLASH
        {
            .fxnTablePtr = &NVSCC26XX_fxnTable,
            .object = &nvsCC26xxObjects[0],
            .hwAttrs = &nvsCC26xxHWAttrs[0],
        },
    #endif
    #ifndef Board_EXCLUDE_NVS_EXTERNAL_FLASH
        {
            .fxnTablePtr = &NVSSPI25X_fxnTable,
            .object = &nvsSPI25XObjects[0],
            .hwAttrs = &nvsSPI25XHWAttrs[0],
        },
    #endif
    };
    
    const uint_least8_t NVS_count = CC2640R2_LAUNCHXL_NVSCOUNT;
    
    /*
     *  =============================== PIN ===============================
     */
    #include <ti/drivers/PIN.h>
    #include <ti/drivers/pin/PINCC26XX.h>
    
    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
    };
    
    const PINCC26XX_HWAttrs PINCC26XX_hwAttrs = {
        .intPriority = ~0,
        .swiPriority = 0
    };
    
    /*
     *  =============================== Power ===============================
     */
    #include <ti/drivers/Power.h>
    #include <ti/drivers/power/PowerCC26XX.h>
    
    const PowerCC26XX_Config PowerCC26XX_config = {
        .policyInitFxn      = NULL,
        .policyFxn          = &PowerCC26XX_standbyPolicy,
        .enablePolicy       = true,
    #ifdef USE_RCOSC
        .calibrateFxn       = &PowerCC26XX_calibrate,
        .calibrateRCOSC_LF  = true,
        .calibrateRCOSC_HF  = true,
    #else
    #ifdef NO_CALIBRATION_NO_RCOSC
        // use no_calibrate functions (when RCOSC is not used) 
        // in order to save uncalled functions flash size 
        .calibrateFxn       = &PowerCC26XX_noCalibrate,
        .calibrateRCOSC_LF  = false,
        .calibrateRCOSC_HF  = false,
    #else
        // old configuration  
        .calibrateFxn       = &PowerCC26XX_calibrate,
        .calibrateRCOSC_LF  = false,
        .calibrateRCOSC_HF  = true,
    #endif
    #endif
    };
    
    /*
     *  =============================== PWM ===============================
     *  Remove unused entries to reduce flash usage both in Board.c and Board.h
     */
    #include <ti/drivers/PWM.h>
    #include <ti/drivers/pwm/PWMTimerCC26XX.h>
    
    PWMTimerCC26XX_Object pwmtimerCC26xxObjects[CC2640R2_LAUNCHXL_PWMCOUNT];
    
    const PWMTimerCC26XX_HwAttrs pwmtimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_PWMCOUNT] = {
        { .pwmPin = CC2640R2_LAUNCHXL_PWMPIN0, .gpTimerUnit = CC2640R2_LAUNCHXL_GPTIMER0A },
        { .pwmPin = CC2640R2_LAUNCHXL_PWMPIN1, .gpTimerUnit = CC2640R2_LAUNCHXL_GPTIMER0B },
        { .pwmPin = CC2640R2_LAUNCHXL_PWMPIN2, .gpTimerUnit = CC2640R2_LAUNCHXL_GPTIMER1A },
        { .pwmPin = CC2640R2_LAUNCHXL_PWMPIN3, .gpTimerUnit = CC2640R2_LAUNCHXL_GPTIMER1B },
        { .pwmPin = CC2640R2_LAUNCHXL_PWMPIN4, .gpTimerUnit = CC2640R2_LAUNCHXL_GPTIMER2A },
        { .pwmPin = CC2640R2_LAUNCHXL_PWMPIN5, .gpTimerUnit = CC2640R2_LAUNCHXL_GPTIMER2B },
        { .pwmPin = CC2640R2_LAUNCHXL_PWMPIN6, .gpTimerUnit = CC2640R2_LAUNCHXL_GPTIMER3A },
        { .pwmPin = CC2640R2_LAUNCHXL_PWMPIN7, .gpTimerUnit = CC2640R2_LAUNCHXL_GPTIMER3B },
    };
    
    const PWM_Config PWM_config[CC2640R2_LAUNCHXL_PWMCOUNT] = {
        { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC2640R2_LAUNCHXL_PWM0], &pwmtimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_PWM0] },
        { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC2640R2_LAUNCHXL_PWM1], &pwmtimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_PWM1] },
        { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC2640R2_LAUNCHXL_PWM2], &pwmtimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_PWM2] },
        { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC2640R2_LAUNCHXL_PWM3], &pwmtimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_PWM3] },
        { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC2640R2_LAUNCHXL_PWM4], &pwmtimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_PWM4] },
        { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC2640R2_LAUNCHXL_PWM5], &pwmtimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_PWM5] },
        { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC2640R2_LAUNCHXL_PWM6], &pwmtimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_PWM6] },
        { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC2640R2_LAUNCHXL_PWM7], &pwmtimerCC26xxHWAttrs[CC2640R2_LAUNCHXL_PWM7] },
    };
    
    const uint_least8_t PWM_count = CC2640R2_LAUNCHXL_PWMCOUNT;
    
    /*
     *  =============================== RF Driver ===============================
     */
    #include <ti/drivers/rf/RF.h>
    
    const RFCC26XX_HWAttrsV2 RFCC26XX_hwAttrs = {
        .hwiPriority        = ~0,       /* Lowest HWI priority */
        .swiPriority        = 0,        /* Lowest SWI priority */
        .xoscHfAlwaysNeeded = true,     /* Keep XOSC dependency while in standby */
        .globalCallback     = NULL,     /* No board specific callback */
        .globalEventMask    = 0         /* No events subscribed to */
    };
    
    /*
     *  =============================== SD ===============================
     */
    #include <ti/drivers/SD.h>
    #include <ti/drivers/sd/SDSPI.h>
    
    SDSPI_Object sdspiObjects[CC2640R2_LAUNCHXL_SDCOUNT];
    
    const SDSPI_HWAttrs sdspiHWAttrs[CC2640R2_LAUNCHXL_SDCOUNT] = {
        {
            .spiIndex = CC2640R2_LAUNCHXL_SPI0,
            .spiCsGpioIndex = CC2640R2_LAUNCHXL_SDSPI_CS
        }
    };
    
    const SD_Config SD_config[CC2640R2_LAUNCHXL_SDCOUNT] = {
        {
            .fxnTablePtr = &SDSPI_fxnTable,
            .object = &sdspiObjects[CC2640R2_LAUNCHXL_SDSPI0],
            .hwAttrs = &sdspiHWAttrs[CC2640R2_LAUNCHXL_SDSPI0]
        },
    };
    
    const uint_least8_t SD_count = CC2640R2_LAUNCHXL_SDCOUNT;
    
    /*
     *  =============================== SPI DMA ===============================
     */
    #include <ti/drivers/SPI.h>
    #include <ti/drivers/spi/SPICC26XXDMA.h>
    
    SPICC26XXDMA_Object spiCC26XXDMAObjects[CC2640R2_LAUNCHXL_SPICOUNT];
    
    /*
     * NOTE: The SPI instances below can be used by the SD driver to communicate
     * with a SD card via SPI.  The 'defaultTxBufValue' fields below are set to 0xFF
     * to satisfy the SDSPI driver requirement.
     */
    const SPICC26XXDMA_HWAttrsV1 spiCC26XXDMAHWAttrs[CC2640R2_LAUNCHXL_SPICOUNT] = {
        {
            .baseAddr           = SSI0_BASE,
            .intNum             = INT_SSI0_COMB,
            .intPriority        = ~0,
            .swiPriority        = 0,
            .powerMngrId        = PowerCC26XX_PERIPH_SSI0,
            .defaultTxBufValue  = 0xFF,
            .rxChannelBitMask   = 1<<UDMA_CHAN_SSI0_RX,
            .txChannelBitMask   = 1<<UDMA_CHAN_SSI0_TX,
            .mosiPin            = CC2640R2_LAUNCHXL_SPI0_MOSI,
            .misoPin            = CC2640R2_LAUNCHXL_SPI0_MISO,
            .clkPin             = CC2640R2_LAUNCHXL_SPI0_CLK,
            .csnPin             = CC2640R2_LAUNCHXL_SPI0_CSN,
            .minDmaTransferSize = 10
        },
        {
            .baseAddr           = SSI1_BASE,
            .intNum             = INT_SSI1_COMB,
            .intPriority        = ~0,
            .swiPriority        = 0,
            .powerMngrId        = PowerCC26XX_PERIPH_SSI1,
            .defaultTxBufValue  = 0xFF,
            .rxChannelBitMask   = 1<<UDMA_CHAN_SSI1_RX,
            .txChannelBitMask   = 1<<UDMA_CHAN_SSI1_TX,
            .mosiPin            = CC2640R2_LAUNCHXL_SPI1_MOSI,
            .misoPin            = CC2640R2_LAUNCHXL_SPI1_MISO,
            .clkPin             = CC2640R2_LAUNCHXL_SPI1_CLK,
            .csnPin             = CC2640R2_LAUNCHXL_SPI1_CSN,
            .minDmaTransferSize = 10
        }
    };
    
    const SPI_Config SPI_config[CC2640R2_LAUNCHXL_SPICOUNT] = {
        {
             .fxnTablePtr = &SPICC26XXDMA_fxnTable,
             .object      = &spiCC26XXDMAObjects[CC2640R2_LAUNCHXL_SPI0],
             .hwAttrs     = &spiCC26XXDMAHWAttrs[CC2640R2_LAUNCHXL_SPI0]
        },
        {
             .fxnTablePtr = &SPICC26XXDMA_fxnTable,
             .object      = &spiCC26XXDMAObjects[CC2640R2_LAUNCHXL_SPI1],
             .hwAttrs     = &spiCC26XXDMAHWAttrs[CC2640R2_LAUNCHXL_SPI1]
        },
    };
    
    const uint_least8_t SPI_count = CC2640R2_LAUNCHXL_SPICOUNT;
    
    /*
     *  =============================== UART ===============================
     */
    #include <ti/drivers/UART.h>
    #include <ti/drivers/uart/UARTCC26XX.h>
    
    UARTCC26XX_Object uartCC26XXObjects[CC2640R2_LAUNCHXL_UARTCOUNT];
    
    uint8_t uartCC26XXRingBuffer[CC2640R2_LAUNCHXL_UARTCOUNT][32];
    
    const UARTCC26XX_HWAttrsV2 uartCC26XXHWAttrs[CC2640R2_LAUNCHXL_UARTCOUNT] = {
        {
            .baseAddr       = UART0_BASE,
            .powerMngrId    = PowerCC26XX_PERIPH_UART0,
            .intNum         = INT_UART0_COMB,
            .intPriority    = ~0,
            .swiPriority    = 0,
            .txPin          = CC2640R2_LAUNCHXL_UART_TX,
            .rxPin          = CC2640R2_LAUNCHXL_UART_RX,
            .ctsPin         = PIN_UNASSIGNED,
            .rtsPin         = PIN_UNASSIGNED,
            .ringBufPtr     = uartCC26XXRingBuffer[CC2640R2_LAUNCHXL_UART0],
            .ringBufSize    = sizeof(uartCC26XXRingBuffer[CC2640R2_LAUNCHXL_UART0]),
            .txIntFifoThr   = UARTCC26XX_FIFO_THRESHOLD_1_8,
            .rxIntFifoThr   = UARTCC26XX_FIFO_THRESHOLD_4_8,
            .errorFxn       = NULL
        }
    };
    
    const UART_Config UART_config[CC2640R2_LAUNCHXL_UARTCOUNT] = {
        {
            .fxnTablePtr = &UARTCC26XX_fxnTable,
            .object      = &uartCC26XXObjects[CC2640R2_LAUNCHXL_UART0],
            .hwAttrs     = &uartCC26XXHWAttrs[CC2640R2_LAUNCHXL_UART0]
        },
    };
    
    const uint_least8_t UART_count = CC2640R2_LAUNCHXL_UARTCOUNT;
    
    /*
     *  =============================== UDMA ===============================
     */
    #include <ti/drivers/dma/UDMACC26XX.h>
    
    UDMACC26XX_Object udmaObjects[CC2640R2_LAUNCHXL_UDMACOUNT];
    
    const UDMACC26XX_HWAttrs udmaHWAttrs[CC2640R2_LAUNCHXL_UDMACOUNT] = {
        {
            .baseAddr    = UDMA0_BASE,
            .powerMngrId = PowerCC26XX_PERIPH_UDMA,
            .intNum      = INT_DMA_ERR,
            .intPriority = ~0
        }
    };
    
    const UDMACC26XX_Config UDMACC26XX_config[CC2640R2_LAUNCHXL_UDMACOUNT] = {
        {
             .object  = &udmaObjects[CC2640R2_LAUNCHXL_UDMA0],
             .hwAttrs = &udmaHWAttrs[CC2640R2_LAUNCHXL_UDMA0]
        },
    };
    
    
    
    /*
     *  =============================== Watchdog ===============================
     */
    #include <ti/drivers/Watchdog.h>
    #include <ti/drivers/watchdog/WatchdogCC26XX.h>
    
    WatchdogCC26XX_Object watchdogCC26XXObjects[CC2640R2_LAUNCHXL_WATCHDOGCOUNT];
    
    const WatchdogCC26XX_HWAttrs watchdogCC26XXHWAttrs[CC2640R2_LAUNCHXL_WATCHDOGCOUNT] = {
        {
            .baseAddr    = WDT_BASE,
            .reloadValue = 1000 /* Reload value in milliseconds */
        },
    };
    
    const Watchdog_Config Watchdog_config[CC2640R2_LAUNCHXL_WATCHDOGCOUNT] = {
        {
            .fxnTablePtr = &WatchdogCC26XX_fxnTable,
            .object      = &watchdogCC26XXObjects[CC2640R2_LAUNCHXL_WATCHDOG0],
            .hwAttrs     = &watchdogCC26XXHWAttrs[CC2640R2_LAUNCHXL_WATCHDOG0]
        },
    };
    
    const uint_least8_t Watchdog_count = CC2640R2_LAUNCHXL_WATCHDOGCOUNT;
    
    /*
     *  ========================= TRNG begin ====================================
     */
    #include <TRNGCC26XX.h>
    
    /* TRNG objects */
    TRNGCC26XX_Object trngCC26XXObjects[CC2640R2_LAUNCHXL_TRNGCOUNT];
    
    /* TRNG configuration structure, describing which pins are to be used */
    const TRNGCC26XX_HWAttrs TRNGCC26XXHWAttrs[CC2640R2_LAUNCHXL_TRNGCOUNT] = {
        {
            .powerMngrId    = PowerCC26XX_PERIPH_TRNG,
        }
    };
    
    /* TRNG configuration structure */
    const TRNGCC26XX_Config TRNGCC26XX_config[] = {
        {
             .object  = &trngCC26XXObjects[0],
             .hwAttrs = &TRNGCC26XXHWAttrs[0]
        },
        {NULL, NULL}
    };
    
    /*
     *  ========================= TRNG end ====================================
     */
    extern void Board_initHook(void);
    
    /*
     *  ======== CC2640R2_LAUNCHXL_initGeneral ========
     */
    void CC2640R2_LAUNCHXL_initGeneral(void)
    {
        Power_init();
    
        if (PIN_init(BoardGpioInitTable) != PIN_SUCCESS) {
            /* Error with PIN_init */
            while (1);
        }
    
        /* Perform board-specific initialization */
        Board_initHook();
    }
    
    /*
     *  ======== Board_init ========
     */
    void Board_init(void)
    {
        CC2640R2_LAUNCHXL_initGeneral();
    }
    

    launch.h

    /*
     * Copyright (c) 2016-2017, 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.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    /** ============================================================================
     *  @file       CC2640R2_LAUNCHXL.h
     *
     *  @brief      CC2640R2 LaunchPad Board Specific header file.
     *
     *  This file is responsible for setting up the board specific items for the
     *  CC2640R2_LAUNCHXL board.
     *
     *  This board file is made for the 7x7 mm QFN package, to convert this board
     *  file to use for other smaller device packages please refer to the table
     *  below which lists the max IOID values supported by each package. All other
     *  unused pins should be set to IOID_UNUSED.
     *
     *  Furthermore the board file is also used
     *  to define a symbol that configures the RF front end and bias.
     *  See the comments below for more information.
     *  For an in depth tutorial on how to create a custom board file, please refer
     *  to the section "Running the SDK on Custom Boards" with in the Software
     *  Developer's Guide.
     *
     *  Refer to the datasheet for all the package options and IO descriptions:
     *  http://www.ti.com/lit/ds/symlink/cc2640r2f.pdf
     *
     *  +-----------------------+------------------+-----------------------+
     *  |     Package Option    |  Total GPIO Pins |   MAX IOID            |
     *  +=======================+==================+=======================+
     *  |     7x7 mm QFN        |     31           |   IOID_30             |
     *  +-----------------------+------------------+-----------------------+
     *  |     5x5 mm QFN        |     15           |   IOID_14             |
     *  +-----------------------+------------------+-----------------------+
     *  |     4x4 mm QFN        |     10           |   IOID_9              |
     *  +-----------------------+------------------+-----------------------+
     *  |     2.7 x 2.7 mm WCSP |     14           |   IOID_13             |
     *  +-----------------------+------------------+-----------------------+
     *  ============================================================================
     */
    #ifndef __CC2640R2_LAUNCHXL_BOARD_H__
    #define __CC2640R2_LAUNCHXL_BOARD_H__
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    /* Includes */
    #include <ti/drivers/PIN.h>
    #include <ti/devices/cc26x0r2/driverlib/ioc.h>
    
    /* Externs */
    extern const PIN_Config BoardGpioInitTable[];
    
    /* Defines */
    #ifndef CC2640R2_LAUNCHXL
      #define CC2640R2_LAUNCHXL
    #endif /* CC2640R2_LAUNCHXL */
    
    #define CC2650EM_4XS
    /*
     *  ============================================================================
     *  RF Front End and Bias configuration symbols for TI reference designs and
     *  kits. This symbol sets the RF Front End configuration in ble_user_config.h
     *  and selects the appropriate PA table in ble_user_config.c.
     *  Other configurations can be used by editing these files.
     *
     *  Define only one symbol:
     *  CC2650EM_7ID    - Differential RF and internal biasing
                          (default for CC2640R2 LaunchPad)
     *  CC2650EM_5XD    – Differential RF and external biasing
     *  CC2650EM_4XS    – Single-ended RF on RF-P and external biasing
     *  CC2640R2DK_CXS  - WCSP: Single-ended RF on RF-N and external biasing
     *                    (Note that the WCSP is only tested and characterized for
     *                     single ended configuration, and it has a WCSP-specific
     *                     PA table)
     *
     *  Note: CC2650EM_xxx reference designs apply to all CC26xx devices.
     *  ==========================================================================
     */
    //#define CC2650EM_7ID
    
    /* Mapping of pins to board signals using general board aliases
     *      <board signal alias>                  <pin mapping>
     */
    
    /* Analog Capable DIOs */
    #define CC2640R2_LAUNCHXL_DIO23_ANALOG          PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO24_ANALOG          PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO25_ANALOG          PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO26_ANALOG          PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO27_ANALOG          PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO28_ANALOG          PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO29_ANALOG          PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO30_ANALOG          PIN_UNASSIGNED
    
    /* Digital IOs */
    #define CC2640R2_LAUNCHXL_DIO0                  IOID_0
    #define CC2640R2_LAUNCHXL_DIO1_RFSW             IOID_1
    #define CC2640R2_LAUNCHXL_DIO12                 PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO15                 PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO16_TDO             PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO17_TDI             PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO21                 PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_DIO22                 PIN_UNASSIGNED
    
    /* Discrete Inputs */
    #define CC2640R2_LAUNCHXL_PIN_BTN1              PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_PIN_BTN2              PIN_UNASSIGNED
    
    /* GPIO */
    #define CC2640R2_LAUNCHXL_GPIO_LED_ON           1
    #define CC2640R2_LAUNCHXL_GPIO_LED_OFF          0
    
    /* I2C */
    #define CC2640R2_LAUNCHXL_I2C0_SCL0             IOID_4
    #define CC2640R2_LAUNCHXL_I2C0_SDA0             IOID_5
    
    /* I2S */
    #define CC2640R2_LAUNCHXL_I2S_ADO               PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_I2S_ADI               PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_I2S_BCLK              PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_I2S_MCLK              PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_I2S_WCLK              PIN_UNASSIGNED
    
    /* LCD (430BOOST - Sharp96 Rev 1.1) */
    #define CC2640R2_LAUNCHXL_LCD_CS                PIN_UNASSIGNED /* SPI chip select */
    #define CC2640R2_LAUNCHXL_LCD_EXTCOMIN          PIN_UNASSIGNED /* External COM inversion */
    #define CC2640R2_LAUNCHXL_LCD_ENABLE            PIN_UNASSIGNED /* LCD enable */
    #define CC2640R2_LAUNCHXL_LCD_POWER             PIN_UNASSIGNED /* LCD power control */
    #define CC2640R2_LAUNCHXL_LCD_CS_ON             1
    #define CC2640R2_LAUNCHXL_LCD_CS_OFF            0
    
    /* LEDs */
    #define CC2640R2_LAUNCHXL_PIN_LED_ON            1
    #define CC2640R2_LAUNCHXL_PIN_LED_OFF           0
    #define CC2640R2_LAUNCHXL_PIN_RLED              IOID_6
    #define CC2640R2_LAUNCHXL_PIN_GLED              IOID_7
    
    /* PWM Outputs */
    #define CC2640R2_LAUNCHXL_PWMPIN0               PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_PWMPIN1               PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_PWMPIN2               PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_PWMPIN3               PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_PWMPIN4               PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_PWMPIN5               PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_PWMPIN6               PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_PWMPIN7               PIN_UNASSIGNED
    
    /* SPI */
    #define CC2640R2_LAUNCHXL_SPI_FLASH_CS          PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_FLASH_CS_ON           0
    #define CC2640R2_LAUNCHXL_FLASH_CS_OFF          1
    
    /* SPI Board */
    #define CC2640R2_LAUNCHXL_SPI0_MISO             IOID_8          /* RF1.20 */
    #define CC2640R2_LAUNCHXL_SPI0_MOSI             IOID_9          /* RF1.18 */
    #define CC2640R2_LAUNCHXL_SPI0_CLK              PIN_UNASSIGNED         /* RF1.16 */
    #define CC2640R2_LAUNCHXL_SPI0_CSN              PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_SPI1_MISO             PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_SPI1_MOSI             PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_SPI1_CLK              PIN_UNASSIGNED
    #define CC2640R2_LAUNCHXL_SPI1_CSN              PIN_UNASSIGNED
    
    /* UART Board */
    #define CC2640R2_LAUNCHXL_UART_RX               PIN_UNASSIGNED          /* RXD */
    #define CC2640R2_LAUNCHXL_UART_TX               PIN_UNASSIGNED          /* TXD */
    #define CC2640R2_LAUNCHXL_UART_CTS              PIN_UNASSIGNED         /* CTS */
    #define CC2640R2_LAUNCHXL_UART_RTS              PIN_UNASSIGNED         /* RTS */
    
    /*!
     *  @brief  Initialize the general board specific settings
     *
     *  This function initializes the general board specific settings.
     */
    void CC2640R2_LAUNCHXL_initGeneral(void);
    
    /*!
     *  @brief  Turn off the external flash on LaunchPads
     *
     */
    void CC2640R2_LAUNCHXL_shutDownExtFlash(void);
    
    /*!
     *  @brief  Wake up the external flash present on the board files
     *
     *  This function toggles the chip select for the amount of time needed
     *  to wake the chip up.
     */
    void CC2640R2_LAUNCHXL_wakeUpExtFlash(void);
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_ADCBufName
     *  @brief  Enum of ADCs
     */
    typedef enum CC2640R2_LAUNCHXL_ADCBufName {
        CC2640R2_LAUNCHXL_ADCBUF0 = 0,
    
        CC2640R2_LAUNCHXL_ADCBUFCOUNT
    } CC2640R2_LAUNCHXL_ADCBufName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_ADCBuf0SourceName
     *  @brief  Enum of ADCBuf channels
     */
    typedef enum CC2640R2_LAUNCHXL_ADCBuf0ChannelName {
        CC2640R2_LAUNCHXL_ADCBUF0CHANNEL0 = 0,
        CC2640R2_LAUNCHXL_ADCBUF0CHANNEL1,
        CC2640R2_LAUNCHXL_ADCBUF0CHANNEL2,
        CC2640R2_LAUNCHXL_ADCBUF0CHANNEL3,
        CC2640R2_LAUNCHXL_ADCBUF0CHANNEL4,
        CC2640R2_LAUNCHXL_ADCBUF0CHANNEL5,
        CC2640R2_LAUNCHXL_ADCBUF0CHANNEL6,
        CC2640R2_LAUNCHXL_ADCBUF0CHANNEL7,
        CC2640R2_LAUNCHXL_ADCBUF0CHANNELVDDS,
        CC2640R2_LAUNCHXL_ADCBUF0CHANNELDCOUPL,
        CC2640R2_LAUNCHXL_ADCBUF0CHANNELVSS,
    
        CC2640R2_LAUNCHXL_ADCBUF0CHANNELCOUNT
    } CC2640R2_LAUNCHXL_ADCBuf0ChannelName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_ADCName
     *  @brief  Enum of ADCs
     */
    typedef enum CC2640R2_LAUNCHXL_ADCName {
        CC2640R2_LAUNCHXL_ADC0 = 0,
        CC2640R2_LAUNCHXL_ADC1,
        CC2640R2_LAUNCHXL_ADC2,
        CC2640R2_LAUNCHXL_ADC3,
        CC2640R2_LAUNCHXL_ADC4,
        CC2640R2_LAUNCHXL_ADC5,
        CC2640R2_LAUNCHXL_ADC6,
        CC2640R2_LAUNCHXL_ADC7,
        CC2640R2_LAUNCHXL_ADCDCOUPL,
        CC2640R2_LAUNCHXL_ADCVSS,
        CC2640R2_LAUNCHXL_ADCVDDS,
    
        CC2640R2_LAUNCHXL_ADCCOUNT
    } CC2640R2_LAUNCHXL_ADCName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_CryptoName
     *  @brief  Enum of Crypto names
     */
    typedef enum CC2640R2_LAUNCHXL_CryptoName {
        CC2640R2_LAUNCHXL_CRYPTO0 = 0,
    
        CC2640R2_LAUNCHXL_CRYPTOCOUNT
    } CC2640R2_LAUNCHXL_CryptoName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_AESCCMName
     *  @brief  Enum of AESCCM names
     */
    typedef enum CC2640R2_LAUNCHXL_AESCCMName {
        CC2640R2_LAUNCHXL_AESCCM0 = 0,
    
        CC2640R2_LAUNCHXL_AESCCMCOUNT
    } CC2640R2_LAUNCHXL_AESCCMName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_AESGCMName
     *  @brief  Enum of AESGCM names
     */
    typedef enum CC2640R2_LAUNCHXL_AESGCMName {
        CC2640R2_LAUNCHXL_AESGCM0 = 0,
    
        CC2640R2_LAUNCHXL_AESGCMCOUNT
    } CC2640R2_LAUNCHXL_AESGCMName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_AESCBCName
     *  @brief  Enum of AESCBC names
     */
    typedef enum CC2640R2_LAUNCHXL_AESCBCName {
        CC2640R2_LAUNCHXL_AESCBC0 = 0,
    
        CC2640R2_LAUNCHXL_AESCBCCOUNT
    } CC2640R2_LAUNCHXL_AESCBCName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_AESCTRName
     *  @brief  Enum of AESCTR names
     */
    typedef enum CC2640R2_LAUNCHXL_AESCTRName {
        CC2640R2_LAUNCHXL_AESCTR0 = 0,
    
        CC2640R2_LAUNCHXL_AESCTRCOUNT
    } CC2640R2_LAUNCHXL_AESCTRName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_AESECBName
     *  @brief  Enum of AESECB names
     */
    typedef enum CC2640R2_LAUNCHXL_AESECBName {
        CC2640R2_LAUNCHXL_AESECB0 = 0,
    
        CC2640R2_LAUNCHXL_AESECBCOUNT
    } CC2640R2_LAUNCHXL_AESECBName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_AESCTRDRBGName
     *  @brief  Enum of AESCTRDRBG names
     */
    typedef enum CC2640R2_LAUNCHXL_AESCTRDRBGName {
        CC2640R2_LAUNCHXL_AESCTRDRBG0 = 0,
    
        CC2640R2_LAUNCHXL_AESCTRDRBGCOUNT
    } CC2640R2_LAUNCHXL_AESCTRDRBGName;
    
    /*!
     *  @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_TMP116_EN,
        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;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_GPTimerName
     *  @brief  Enum of GPTimer parts
     */
    typedef enum CC2640R2_LAUNCHXL_GPTimerName {
        CC2640R2_LAUNCHXL_GPTIMER0A = 0,
        CC2640R2_LAUNCHXL_GPTIMER0B,
        CC2640R2_LAUNCHXL_GPTIMER1A,
        CC2640R2_LAUNCHXL_GPTIMER1B,
        CC2640R2_LAUNCHXL_GPTIMER2A,
        CC2640R2_LAUNCHXL_GPTIMER2B,
        CC2640R2_LAUNCHXL_GPTIMER3A,
        CC2640R2_LAUNCHXL_GPTIMER3B,
    
        CC2640R2_LAUNCHXL_GPTIMERPARTSCOUNT
    } CC2640R2_LAUNCHXL_GPTimerName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_GPTimers
     *  @brief  Enum of GPTimers
     */
    typedef enum CC2640R2_LAUNCHXL_GPTimers {
        CC2640R2_LAUNCHXL_GPTIMER0 = 0,
        CC2640R2_LAUNCHXL_GPTIMER1,
        CC2640R2_LAUNCHXL_GPTIMER2,
        CC2640R2_LAUNCHXL_GPTIMER3,
    
        CC2640R2_LAUNCHXL_GPTIMERCOUNT
    } CC2640R2_LAUNCHXL_GPTimers;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_I2CName
     *  @brief  Enum of I2C names
     */
    typedef enum CC2640R2_LAUNCHXL_I2CName {
        CC2640R2_LAUNCHXL_I2C0 = 0,
    
        CC2640R2_LAUNCHXL_I2CCOUNT
    } CC2640R2_LAUNCHXL_I2CName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_I2SName
     *  @brief  Enum of I2S names
     */
    typedef enum CC2640R2_LAUNCHXL_I2SName {
        CC2640R2_LAUNCHXL_I2S0 = 0,
    
        CC2640R2_LAUNCHXL_I2SCOUNT
    } CC2640R2_LAUNCHXL_I2SName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_NVSName
     *  @brief  Enum of NVS names
     */
    typedef enum CC2640R2_LAUNCHXL_NVSName {
    #ifndef Board_EXCLUDE_NVS_INTERNAL_FLASH
        CC2640R2_LAUNCHXL_NVSCC26XX0 = 0,
    #endif
    #ifndef Board_EXCLUDE_NVS_EXTERNAL_FLASH
        CC2640R2_LAUNCHXL_NVSSPI25X0,
    #endif
    
        CC2640R2_LAUNCHXL_NVSCOUNT
    } CC2640R2_LAUNCHXL_NVSName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_PWM
     *  @brief  Enum of PWM outputs
     */
    typedef enum CC2640R2_LAUNCHXL_PWMName {
        CC2640R2_LAUNCHXL_PWM0 = 0,
        CC2640R2_LAUNCHXL_PWM1,
        CC2640R2_LAUNCHXL_PWM2,
        CC2640R2_LAUNCHXL_PWM3,
        CC2640R2_LAUNCHXL_PWM4,
        CC2640R2_LAUNCHXL_PWM5,
        CC2640R2_LAUNCHXL_PWM6,
        CC2640R2_LAUNCHXL_PWM7,
    
        CC2640R2_LAUNCHXL_PWMCOUNT
    } CC2640R2_LAUNCHXL_PWMName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_SDName
     *  @brief  Enum of SD names
     */
    typedef enum CC2640R2_LAUNCHXL_SDName {
        CC2640R2_LAUNCHXL_SDSPI0 = 0,
    
        CC2640R2_LAUNCHXL_SDCOUNT
    } CC2640R2_LAUNCHXL_SDName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_SPIName
     *  @brief  Enum of SPI names
     */
    typedef enum CC2640R2_LAUNCHXL_SPIName {
        CC2640R2_LAUNCHXL_SPI0 = 0,
        CC2640R2_LAUNCHXL_SPI1,
    
        CC2640R2_LAUNCHXL_SPICOUNT
    } CC2640R2_LAUNCHXL_SPIName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_UARTName
     *  @brief  Enum of UARTs
     */
    typedef enum CC2640R2_LAUNCHXL_UARTName {
        CC2640R2_LAUNCHXL_UART0 = 0,
    
        CC2640R2_LAUNCHXL_UARTCOUNT
    } CC2640R2_LAUNCHXL_UARTName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_UDMAName
     *  @brief  Enum of DMA buffers
     */
    typedef enum CC2640R2_LAUNCHXL_UDMAName {
        CC2640R2_LAUNCHXL_UDMA0 = 0,
    
        CC2640R2_LAUNCHXL_UDMACOUNT
    } CC2640R2_LAUNCHXL_UDMAName;
    
    /*!
     *  @def    CC2640R2_LAUNCHXL_WatchdogName
     *  @brief  Enum of Watchdogs
     */
    typedef enum CC2640R2_LAUNCHXL_WatchdogName {
        CC2640R2_LAUNCHXL_WATCHDOG0 = 0,
    
        CC2640R2_LAUNCHXL_WATCHDOGCOUNT
    } CC2640R2_LAUNCHXL_WatchdogName;
    
    /*!
     *  @def    CC2650_LAUNCHXL_TRNGName
     *  @brief  Enum of TRNG names on the board
     */
    typedef enum CC2640R2_LAUNCHXL_TRNGName {
        CC2640R2_LAUNCHXL_TRNG0 = 0,
        CC2640R2_LAUNCHXL_TRNGCOUNT
    } CC2640R2_LAUNCHXL_TRNGName;
    
    #ifdef __cplusplus
    }
    #endif
    
    #endif /* __CC2640R2_LAUNCHXL_BOARD_H__ */
    

    I'd be glad if you are able to help me out, thanks!

    Regards,

    Ritoo

  • Hi Ritoo,

    Can you specify which function you are stuck in the icall.c file? The function name is being cut-off. My first guess is that we may have missed something in the custom board file bring up. Have you verified the bring up section of the CC13xx/CC26xx Hardware Configuration and PCB Design
    Considerations

    The Initial Board Bring Up, Creating a Custom Board File, and Configuring the RF Front-End for Custom Hardware sections also should be double checked to ensure no step was missed.

    Best Regards,

    Jan

  • Hi,

    I went through the whole process again and am providing you with the screenshots of the process mentioned here 

    1. I am getting VDDR = 1.67 V and DCOUPL = 1.27 V

    2. In the RF Test: SmartRF Studio section of the document, here are the results:

         a.  Result of Tx-Rx between 2 launchpads

         b. Result of Rx-Tx between Launchpad (left) and DUT (right)

    As you can observe, there was no packet transmission. The settings that I have used for the target config is the following

    Pls Note this setting is specifically for our board version which has a Balun IC for differential to single ended followed by LC filter to the chip antenna.

    Also, in the command view the result is still >CMD_BLE_ADV_NC executed

    > Status: 0x0 IDLE

    Can you pls tell whether this being IDLE is due to hardware or software issue?

    Regards,

    Ritoo

  • Hi,

    Can you specify which function you are stuck in the icall.c file?

    Here:

    Also, do you know if we can change XOSC settings in SmartRF to account for the 48MHz crystal? Right now I am not sure if my crystals are working correctly or not.

    I removed POWER_SAVINGS from my predefined symbols as mentioned here by JXS

    Please suggest, thanks.

  • Hi,

    Given that the issue is visible on SmartRF Studio, this may point to a HW issue. It could also be a configuration issue on SmartRF as you had mentioned. Can you try taking a conducted measurement using a carrier wave? I would like to see if theres any output visible on the RF path.

    Best Regards,

    Jan