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.

CC2642R: CCS/LAUNCHXL-CC1352R1: PIN_open function always return NULL

Part Number: CC2642R
Other Parts Discussed in Thread: SYSCONFIG

Hi ,

I am trying to allocate some pins using PIN_open but it always returns NULL.Can someone guide what could be the issue.

const PIN_Config BoardGpioInitTable[CONFIG_PIN_COUNT + 1] = {
/* LaunchPad Button BTN-1 (Left), Parent Signal: CONFIG_GPIO_BTN1 GPIO Pin, (DIO13) */
CONFIG_PIN_BTN1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_POSEDGE,
/* LaunchPad Button BTN-2 (Right), Parent Signal: CONFIG_GPIO_BTN2 GPIO Pin, (DIO14) */
CONFIG_PIN_BTN2 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_POSEDGE,
/* LaunchPad LED Red, Parent Signal: CONFIG_GPIO_RLED GPIO Pin, (DIO6) */
CONFIG_PIN_RLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
/* LaunchPad LED Green, Parent Signal: CONFIG_GPIO_GLED GPIO Pin, (DIO7) */
CONFIG_PIN_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
/* Parent Signal: CONFIG_I2C_0 SDA, (DIO1) */
CONFIG_PIN_0 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_DIS,
/* Parent Signal: CONFIG_I2C_0 SCL, (DIO0) */
CONFIG_PIN_1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_DIS,
/* XDS110 UART, Parent Signal: CONFIG_DISPLAY_UART TX, (DIO3) */
CONFIG_PIN_UART_TX | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MED,
/* XDS110 UART, Parent Signal: CONFIG_DISPLAY_UART RX, (DIO2) */
CONFIG_PIN_UART_RX | PIN_INPUT_EN | PIN_PULLDOWN | PIN_IRQ_DIS,

PIN_TERMINATE
};

PIN_Config AccInterruptPinTable[] = {
CONFIG_PIN_BTN1 | PIN_INPUT_EN | PIN_PUSHPULL | PIN_IRQ_POSEDGE, // MOTION
CONFIG_PIN_BTN2 | PIN_INPUT_EN | PIN_PUSHPULL | PIN_IRQ_POSEDGE, // IMPACT
// Board_PIN_BUTTON2 | PIN_INPUT_EN | PIN_PULLDOWN| PIN_IRQ_POSEDGE, // DOUBLE TAP
PIN_TERMINATE };

static PIN_Handle InterruptPinHandle;

InterruptPinHandle = PIN_open(&buttonPinState, AccInterruptPinTable);
if (!InterruptPinHandle)
{
Display_printf(dispHandle, SP_ROW_SEPARATOR_1, 0, "PIN OPEN FAIL\r\n");
volatile int i;
/* Error initializing button pins */
while (1){

}

}

/* Setup callback for button pins */
if (PIN_registerIntCb(InterruptPinHandle, &AccelrometerCallbackFxn) != 0)
{
Display_printf(dispHandle, SP_ROW_SEPARATOR_1, 0, "CALL back failed\r\n");
volatile int i;
/* Error registering button callback function */
while (1){

}

}