Post Go back to editing

EZ-KIT

Category: Software
Product Number: ADSP-CM409F
Software Version: EZ-KIT

#define HI3220_INT_PORT ADI_GPIO_PORT_A
#define HI3220_INT_PIN ADI_GPIO_PIN_1

Using the following calls, I am unable to trigger an interrupt on PA_01

gpioResult = adi_gpio_Init(gpioMemory, HI3220_GPIO_MEMORY,
&gpioMaxCallbacks);
checkResult(gpioResult, ADI_GPIO_SUCCESS, __func__, __LINE__);

gpioResult = adi_gpio_SetDirection(HI3220_INT_PORT, HI3220_INT_PIN,
ADI_GPIO_DIRECTION_INPUT);
checkResult(gpioResult, ADI_GPIO_SUCCESS, __func__, __LINE__);

/* set edge sense mode (PORT A is connected to Pin Interrupt 0)*/
gpioResult = adi_gpio_SetPinIntEdgeSense(ADI_GPIO_PIN_INTERRUPT_0,
HI3220_INT_PIN,
ADI_GPIO_SENSE_FALLING_EDGE);
checkResult(gpioResult, ADI_GPIO_SUCCESS, __func__, __LINE__);

/* register Pin Interrupt 0 callback */
gpioResult = adi_gpio_RegisterCallback(ADI_GPIO_PIN_INTERRUPT_0,
HI3220_INT_PIN,
HI3220InterruptCallback, (void*)0);
checkResult(gpioResult, ADI_GPIO_SUCCESS, __func__, __LINE__);

/* set Pin Interrupt 0 mask */
gpioResult = adi_gpio_EnablePinInterruptMask(ADI_GPIO_PIN_INTERRUPT_0,
HI3220_INT_PIN, true);
checkResult(gpioResult, ADI_GPIO_SUCCESS, __func__, __LINE__);

What am I missing?

  • Hi,

    Thank you for your inquiry.

    In your code, we noticed that the PINT pin (pin within the pint to which push button is connected) has not been defined. For PA_01, you need to define the PINT pin as 17. As you are expecting interrupt in PA_01, we are using the below API to set the pint interrupt pin.

    please create another macro like #define HI3220_INT_PINT_PIN ADI_GPIO_PIN_17 and pass it in the API.

    gpioResult = adi_gpio_SetPinIntEdgeSense(ADI_GPIO_PIN_INTERRUPT_0, HI3220_INT_PINT_PIN, ADI_GPIO_SENSE_FALLING_EDGE);

    Please refer the below image for understanding how to select the appropriate PINT pin.


    And then Set a breakpoint at the callback function to confirm whether the callback gets hit. Additionally, check whether the Latch register values are being updated when the push button is pressed.

    Also, please refer to the HRM link below for more information on PORT Interrupt Signals (page 13-7).

    www.analog.com/.../ADSP-CM40x-hrm.pdf

    You can find the GPIO driver example Project from the below path:

    C:\Analog Devices\ADSP-CM40x\CM403F_CM408F_EZ-KIT\examples\Button_LED_GPIO

    Hope this helps.

    Best Regards,
    Santhakumari.V