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.

MSPM0C1104: How to setup GPIO and generate interrupt?

Part Number: MSPM0C1104

Tool/software:

As title, now I'm trying to capture a interrupt from PA22

But I can't find any interrupt if I output a raising edge to PA22.

Below is my code, have any expert can gine me some advise. Many thanks.

/* Defines for DC: GPIOA.22 with pinCMx 23 on package pin 22 */
#define BAMBOO_GPIO_DC_PIN                                     (DL_GPIO_PIN_22)
#define BAMBOO_GPIO_DC_IOMUX                                    (IOMUX_PINCM23)

/* Defines for LED_RED: GPIOA.2 with pinCMx 3 on package pin 8 */
#define BAMBOO_GPIO_LED_RED_PIN                                  (DL_GPIO_PIN_2)
#define BAMBOO_GPIO_LED_RED_IOMUX                                 (IOMUX_PINCM3)

int main(void)
{
    SYSCFG_DL_init();

// Sleep test...PK 20241017+
    // set DC to input...PK 20241017+
    DL_GPIO_enableGlobalFastWake(GPIOA);

    DL_GPIO_initDigitalInputFeatures(BAMBOO_GPIO_DC_IOMUX,
         DL_GPIO_INVERSION_DISABLE, DL_GPIO_RESISTOR_PULL_UP,
         DL_GPIO_HYSTERESIS_DISABLE, DL_GPIO_WAKEUP_ENABLE);

    DL_GPIO_setUpperPinsPolarity(GPIOA, DL_GPIO_PIN_22_EDGE_RISE_FALL);
    DL_GPIO_clearInterruptStatus(GPIOA, BAMBOO_GPIO_DC_PIN);
    DL_GPIO_enableInterrupt(GPIOA, BAMBOO_GPIO_DC_PIN);

    NVIC_EnableIRQ(GPIOA_INT_IRQn);

    DL_SYSCTL_setPowerPolicySTANDBY0();

    while(1){
        __WFI();
    }

}

void GPIOA_IRQHandler(void)
{
    /* If SW is high, turn the LED off */
    if (DL_GPIO_readPins(
            BAMBOO_GPIO_PORT, BAMBOO_GPIO_DC_PIN)) {
        DL_GPIO_setPins(BAMBOO_GPIO_PORT, BAMBOO_GPIO_LED_RED_PIN);
    }
    /* Otherwise, turn the LED on */
    else {
        DL_GPIO_clearPins(BAMBOO_GPIO_PORT, BAMBOO_GPIO_LED_RED_PIN);
    }
}

======================

Code Composer Studio Version: 12.8.0.00012

ICE : LP-MSPM0C1104 Rev.B

======================