Good afternoon,
I'm working with the SDK RTOS v.08.06.00.12 and I implemented a code that configured an interrupt on the GPIO0_77 on the both edge.
The code runs on the mcu2_0 and starts using SBL.
My code works fine but I have a doubt about what I did to make it work.
In my main code mainly I did so (before I defined a GPIO_PinConfig and a GPIO_CallbackFxn and the GPIO0_77 is defined as and input with interrupt both edge at the index 0):
Board_initCfg boardCfg = BOARD_INIT_PINMUX_CONFIG;
Board_init(boardCfg);
GPIO_v0_HwAttrs gpio_cfg;
GPIO_socGetInitCfg(0, &gpio_cfg);
GPIO_configIntRouter(0, 77, 0, &gpio_cfg); (in this function I used this code: intCfg[pinNum].intNum = CSLR_GPIOMUX_INTRTR0_IN_GPIO0_GPIO_BANK_4 + bankNum;)
GPIO_socSetInitCfg(0, &gpio_cfg);
GPIO_init();
GPIO_setCallback(0U, getBothEdge);
GPIO_enableInt(0U);
My questions are these:
- why do I call the GPIO_configIntRouter if the intNum variable is set in the GPIO_socConfigIntrPath called by the GPIO_setConfig_v0 called by the GPIO_init_v0?
- why do I have to change the set of the dst_host_irq variable in the GPIO_socConfigIntrPath function?
GPIO_socConfigIntrPath function original code:
dst_host_irq = irq_range_start + bankNum;
GPIO_socConfigIntrPath function in my code:
dst_host_irq = irq_range_start;
In addition I want to ask you:
- is it possible to check which edge of the signal triggers the interrupt when the interrupt is configured as both edges?
Thank you.
Regards,
Matteo Radaelli