MODIFICATION HISTORY:
Ver Who Date Changes ----- ---- -------- -------------------------------------------------------- 1.00a ecm 08/16/01 First release 1.00b jhl 02/21/02 Repartitioned the driver for smaller files 1.00b jhl 04/24/02 Made LookupConfig global and compressed ack before table in the configuration into a bit mask 1.00c rpm 10/17/03 New release. Support the static vector table created in the xintc_g.c configuration table. 1.00c rpm 04/23/04 Removed check in XIntc_Connect for a previously connected handler. Always overwrite the vector table handler with the handler provided as an argument. 1.10c mta 03/21/07 Updated to new coding style 1.11a sv 11/21/07 Updated driver to support access through a DCR bridge 2.00a ktn 10/20/09 Updated to use HAL Processor APIs. 2.04a bss 01/13/12 Added XIntc_ConnectFastHandler API for Fast Interrupt and XIntc_SetNormalIntrMode for setting to normal interrupt mode. 2.05a bss 08/16/12 Updated to support relocatable vectors in Microblaze, updated XIntc_SetNormalIntrMode to use IntVectorAddr which is the interrupt vector address 2.06a bss 01/28/13 To support Cascade mode: Modified XIntc_Initialize,XIntc_Start,XIntc_Connect XIntc_Disconnect,XIntc_Enable,XIntc_Disable, XIntc_Acknowledge,XIntc_ConnectFastHandler and XIntc_SetNormalIntrMode APIs. Added XIntc_InitializeSlaves API. 3.0 bss 01/28/13 Modified to initialize IVAR register with XPAR_MICROBLAZE_BASE_VECTORS + 0x10 to fix CR#765931
#include "xil_types.h"
#include "xil_assert.h"
#include "xintc.h"
#include "xintc_l.h"
#include "xintc_i.h"
Functions | |
int | XIntc_Initialize (XIntc *InstancePtr, u16 DeviceId) |
int | XIntc_Start (XIntc *InstancePtr, u8 Mode) |
void | XIntc_Stop (XIntc *InstancePtr) |
int | XIntc_Connect (XIntc *InstancePtr, u8 Id, XInterruptHandler Handler, void *CallBackRef) |
void | XIntc_Disconnect (XIntc *InstancePtr, u8 Id) |
void | XIntc_Enable (XIntc *InstancePtr, u8 Id) |
void | XIntc_Disable (XIntc *InstancePtr, u8 Id) |
void | XIntc_Acknowledge (XIntc *InstancePtr, u8 Id) |
XIntc_Config * | XIntc_LookupConfig (u16 DeviceId) |
int | XIntc_ConnectFastHandler (XIntc *InstancePtr, u8 Id, XFastInterruptHandler Handler) |
void | XIntc_SetNormalIntrMode (XIntc *InstancePtr, u8 Id) |
Variables | |
u32 | XIntc_BitPosMask [XIN_CONTROLLER_MAX_INTRS] |
void XIntc_Acknowledge | ( | XIntc * | InstancePtr, | |
u8 | Id | |||
) |
Acknowledges the interrupt source provided as the argument Id. When the interrupt is acknowledged, it causes the interrupt controller to clear its interrupt condition.In Cascade mode, acknowledges corresponding interrupt source of Slave controllers depending on the Id.
InstancePtr | is a pointer to the XIntc instance to be worked on. | |
Id | contains the ID of the interrupt source and should be in the range of 0 to XPAR_INTC_MAX_NUM_INTR_INPUTS - 1 with 0 being the highest priority interrupt. |
int XIntc_Connect | ( | XIntc * | InstancePtr, | |
u8 | Id, | |||
XInterruptHandler | Handler, | |||
void * | CallBackRef | |||
) |
Makes the connection between the Id of the interrupt source and the associated handler that is to run when the interrupt is recognized. The argument provided in this call as the Callbackref is used as the argument for the handler when it is called. In Cascade mode, connects handler to Slave controller handler table depending on the interrupt Id.
InstancePtr | is a pointer to the XIntc instance to be worked on. | |
Id | contains the ID of the interrupt source and should be in the range of 0 to XPAR_INTC_MAX_NUM_INTR_INPUTS - 1 with 0 being the highest priority interrupt. | |
Handler | to the handler for that interrupt. | |
CallBackRef | is the callback reference, usually the instance pointer of the connecting driver. |
int XIntc_ConnectFastHandler | ( | XIntc * | InstancePtr, | |
u8 | Id, | |||
XFastInterruptHandler | Handler | |||
) |
Makes the connection between the Id of the interrupt source and the associated handler that is to run when the interrupt is recognized.In Cascade mode, connects handler to corresponding Slave controller IVAR register depending on the Id and sets all interrupt sources of the Slave controller as fast interrupts.
InstancePtr | is a pointer to the XIntc instance to be worked on. | |
Id | contains the ID of the interrupt source and should be in the range of 0 to XPAR_INTC_MAX_NUM_INTR_INPUTS - 1 with 0 being the highest priority interrupt. | |
Handler | to the handler for that interrupt. |
void XIntc_Disable | ( | XIntc * | InstancePtr, | |
u8 | Id | |||
) |
Disables the interrupt source provided as the argument Id such that the interrupt controller will not cause interrupts for the specified Id. The interrupt controller will continue to hold an interrupt condition for the Id, but will not cause an interrupt.In Cascade mode, disables corresponding interrupt of Slave controllers depending on the Id.
InstancePtr | is a pointer to the XIntc instance to be worked on. | |
Id | contains the ID of the interrupt source and should be in the range of 0 to XPAR_INTC_MAX_NUM_INTR_INPUTS - 1 with 0 being the highest priority interrupt. |
void XIntc_Disconnect | ( | XIntc * | InstancePtr, | |
u8 | Id | |||
) |
Updates the interrupt table with the Null Handler and NULL arguments at the location pointed at by the Id. This effectively disconnects that interrupt source from any handler. The interrupt is disabled also. In Cascade mode, disconnects handler from Slave controller handler table depending on the interrupt Id.
InstancePtr | is a pointer to the XIntc instance to be worked on. | |
Id | contains the ID of the interrupt source and should be in the range of 0 to XPAR_INTC_MAX_NUM_INTR_INPUTS - 1 with 0 being the highest priority interrupt. |
void XIntc_Enable | ( | XIntc * | InstancePtr, | |
u8 | Id | |||
) |
Enables the interrupt source provided as the argument Id. Any pending interrupt condition for the specified Id will occur after this function is called. In Cascade mode, enables corresponding interrupt of Slave controllers depending on the Id.
InstancePtr | is a pointer to the XIntc instance to be worked on. | |
Id | contains the ID of the interrupt source and should be in the range of 0 to XPAR_INTC_MAX_NUM_INTR_INPUTS - 1 with 0 being the highest priority interrupt. |
int XIntc_Initialize | ( | XIntc * | InstancePtr, | |
u16 | DeviceId | |||
) |
Initialize a specific interrupt controller instance/driver. The initialization entails:
InstancePtr | is a pointer to the XIntc instance to be worked on. | |
DeviceId | is the unique id of the device controlled by this XIntc instance. Passing in a device id associates the generic XIntc instance to a specific device, as chosen by the caller or application developer. |
XIntc_Config* XIntc_LookupConfig | ( | u16 | DeviceId | ) |
Looks up the device configuration based on the unique device ID. A table contains the configuration info for each device in the system.
DeviceId | is the unique identifier for a device. |
void XIntc_SetNormalIntrMode | ( | XIntc * | InstancePtr, | |
u8 | Id | |||
) |
Sets the normal interrupt mode for the specified interrupt in the Interrupt Mode Register. In Cascade mode disconnects handler from corresponding Slave controller IVAR register depending on the Id and sets all interrupt sources of the Slave controller as normal interrupts.
InstancePtr | is a pointer to the XIntc instance to be worked on. | |
Id | contains the ID of the interrupt source and should be in the range of 0 to XPAR_INTC_MAX_NUM_INTR_INPUTS - 1 with 0 being the highest priority interrupt. |
int XIntc_Start | ( | XIntc * | InstancePtr, | |
u8 | Mode | |||
) |
Starts the interrupt controller by enabling the output from the controller to the processor. Interrupts may be generated by the interrupt controller after this function is called.
It is necessary for the caller to connect the interrupt handler of this component to the proper interrupt source. This function also starts Slave controllers in Cascade mode.
InstancePtr | is a pointer to the XIntc instance to be worked on. | |
Mode | determines if software is allowed to simulate interrupts or real interrupts are allowed to occur. Note that these modes are mutually exclusive. The interrupt controller hardware resets in a mode that allows software to simulate interrupts until this mode is exited. It cannot be reentered once it has been exited. |
void XIntc_Stop | ( | XIntc * | InstancePtr | ) |
Stops the interrupt controller by disabling the output from the controller so that no interrupts will be caused by the interrupt controller.
InstancePtr | is a pointer to the XIntc instance to be worked on. |
u32 XIntc_BitPosMask[XIN_CONTROLLER_MAX_INTRS] |
Copyright @ 1995-2014 Xilinx, Inc. All rights reserved.