I configured an interrupt with DPI based on a PWM created first of 100kHz.
It is working but the thing I am notifying is that it is taking a lot of time before clearing the interrupt (~1µs in the InterruptHandler).
Moreover, I have an offset of 500ns between the falling edge of the PWM and the interrupt!
Here is what I did :
adi_int_InstallHandler(/*DPII*/ ADI_CID_P14I , (ADI_INT_HANDLER_PTR)InterruptHandler, 0, true);
SRU (DPI_PB07_O, DPI_PB08_I); // route DPI P7 (PWM) to DPI P8 (Interrupt)
SRU (HIGH, DPI_PBEN08_I); // Input
SRU (DPI_PB08_O, MISCB1_I);
// interrupts latch on the falling edge
*pDPI_IRPTL_FE |= EXT_MISC_1_INT;
*pDPI_IRPTL |= EXT_MISC_1_INT;
sysreg_bit_set(sysreg_IMASK, DPII); //Enable DPI Interrupt
sysreg_bit_set(sysreg_MODE1, IRPTEN); //Enable Interrupt
adi_int_EnableInt(/*DPII*/ ADI_CID_P14I , true);
SRU2(LOW,DAI_PB16_I); // Test Point DAI16
SRU(HIGH,DAI_PB16_I); // Set the DAI P16
temp = *pDPI_IRPTL;
SRU(LOW,DAI_PB16_I); // Set the DAI P16
Please let me know if I missed something or how could I optimize this?