I'm slowly being driven insane by what should be a very simple problem and all I can say without being rude is that the documentation is less than helpful.
My problem: I want to trigger an interrupt when DPI P6 goes from low to high. DPI P6 is input from an external source (it's an I2C chip that will drive one of its pins high to signal the CPU that it needs its attention, nothing fancy). The platform I'm working on is based on ADSP-21489. I can confirm that DPI P6 is indeed being driven from low to high. I can also confirm that DPI interrupts *are* being unmasked and properly served because I'm already routing the pins used for I2C through it. My ISR gets correctly called there.
What I'm doing is roughly as follows (the succession is correct, but the calls are spread through various function calls so that my code doesn't look like spaghetti):
/* DPI P6 is input */
/* Route DPI P6 to MISCB1 interrupt */
I suspect the mistake is here:
*pDPI_IRPTL |= SRU_EXTMISCB1_INT
*pDPI_IRPTL_RE |= SRU_EXTMISCB1_INT
At this point, DPI interrupts are already enabled and an interrupt handler is already being set. I don't know if this is relevant or not, but I couldn't find any mention of it in the manual.
What happens: nothing. A rising edge on the pin does not generate an interrupt. DPI interrupts are working, because I2C communication, which uses them, is still working!
I know I'm doing something wrong in the SRU routing or when setting up interrupts, but for the life of me I cannot figure out what that is. The Hardware Reference is devoid of any relevant code here and I am particularly unable to understand what peripherals and signals get routed where. In particular:
- Can I actually trigger MISCA and MISCB interrupts from a DPI pin? The hardware reference would suggest that I can, but a summary reading of def21489.h suggests that I can't!
- What is the relation between EXT_MISC_?_INT and the MISC ports? What mask do I apply to pDPI_IRPTL_RE if I want to enable an interrupt for a rising edge on MISCB1? After I route a PB output to MISCBx_I, what mask do I apply in DPI_IRPTL_RE? It's obviously not one of the SRU_EXTMISC* values, because those are masks for DAI_IRPTL*, but I don't understand how I ought to choose one of the EXT_MISC_?_INT masks, either.