cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
301 Views
Registered: ‎07-27-2017

Multiple Interrupt Handling - Microblaze

I am working on handling multiple interrupts with Microblaze for my project. I have a custom PWM with interrupt IP (Axi-Lite Slave), AXI UART lite and AXI Timer, where all IPs have an interrupt respectively (Custom IP also have auto infer single bit Interrupt).

My interrupt handler of Custom IP is supposed to do the following.

void PWMIsr()
{
// Inform the user that an invalid value was detected by the PWM controller.
     print("PWM Value exceeded, brightness reset to zero. Please enter new value: \r\n");

// Set the brightness value to a safe value and write it to the PWM controller in order to clear the pending interrupt.
    brightness = 0;
    Xil_Out32(PWM_BASE_ADDRESS, brightness);
}

I have some questions:

1. What should I add in the arguments of XIntc_Connect()?

int XIntc_Connect(XIntc * InstancePtr, u8 Id, XInterruptHandler Handler, void *CallBackRef);

eg. For AXI-Uart Lite, XIntc_Connect(&InterruptController, UARTLITE_INT_IRQ_ID, (XInterruptHandler)XUartLite_InterruptHandler, (void *)UartLitePtr);

But for a simple-application in my case, Status = XIntc_Connect(&InterruptController, INTC_PWM_INTERRUPT_ID, (XInterruptHandler)PwmIsr, ????);

 

2. No compiling error when I configure like this.

XIntc_Connect(&InterruptController, INTC_PWM_INTERRUPT_ID, (XInterruptHandler)PwmIsr, (void *)&InterruptController)

What is happening here?

 

3. How can I use the following functionalities for my application?

XGpio_InterruptClear();
XIntc_Acknowledge();

Thanks in advance!

0 Kudos
1 Reply
Highlighted
Moderator
Moderator
207 Views
Registered: ‎09-12-2007

0 Kudos