### Xilinx Processor IP Library

Software Drivers

Main Page | Data Structures | File List | Data Fields | Globals

# xintc_l.h File Reference

## Detailed Description

This header file contains identifiers and low-level driver functions (or macros) that can be used to access the device. The user should refer to the hardware device specification for more details of the device operation.

Note that users of the driver interface given in this file can register an interrupt handler dynamically (at run-time) using the XIntc_RegisterHandler() function. User of the driver interface given in xintc.h should still use XIntc_Connect(), as always. Also see the discussion of the interrupt vector tables in xintc.h.

There are currently two interrupt handlers specified in this interface.

- XIntc_LowLevelInterruptHandler() is a handler without any arguments that is used in cases where there is a single interrupt controller device in the system and the handler cannot be passed an argument. This function is provided mostly for backward compatibility.

- XIntc_DeviceInterruptHandler() is a handler that takes a device ID as an argument, indicating which interrupt controller device in the system is causing the interrupt - thereby supporting multiple interrupt controllers.

     MODIFICATION HISTORY:

     Ver   Who  Date     Changes
     ----- ---- -------- -----------------------------------------------------
     1.00b jhl  04/24/02 First release
     1.00c rpm  10/17/03 New release. Support the static vector table created
                         in the xintc_g.c configuration table.
     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

## Data Structures
struct | XIntc_VectorTableEntry
## Defines
#define | XIntc_mMasterEnable(BaseAddress)
#define | XIntc_mMasterDisable(BaseAddress)
#define | XIntc_mEnableIntr(BaseAddress, EnableMask)
#define | XIntc_mDisableIntr(BaseAddress, DisableMask)
#define | XIntc_mAckIntr(BaseAddress, AckMask)
#define | XIntc_mGetIntrStatus(BaseAddress)
## Functions
void | XIntc_DeviceInterruptHandler (void *DeviceId)
void | XIntc_SetIntrSvcOption (u32 BaseAddress, int Option)
void | XIntc_RegisterHandler (u32 BaseAddress, int InterruptId, XInterruptHandler Handler, void *CallBackRef)

## Define Documentation

#define XIntc_mAckIntr | ( | BaseAddress,
|  | AckMask |  | ) |

  | Acknowledge specific interrupt(s) in the interrupt controller. Parameters:
  | BaseAddress | is the base address of the device
  | AckMask | is the 32-bit value to write to the acknowledge register. Each bit of the mask corresponds to an interrupt input signal that is connected to the interrupt controller (INT0 = LSB). Only the bits which are set in the mask will acknowledge interrupts.
Returns: None. Note: C-style signature: void XIntc_mAckIntr(u32 BaseAddress, u32 AckMask);

#define XIntc_mDisableIntr | ( | BaseAddress,
|  | DisableMask |  | ) |

  | Disable specific interrupt(s) in the interrupt controller. Parameters:
  | BaseAddress | is the base address of the device
  | DisableMask | is the 32-bit value to write to the enable register. Each bit of the mask corresponds to an interrupt input signal that is connected to the interrupt controller (INT0 = LSB). Only the bits which are set in the mask will disable interrupts.
Returns: None. Note: C-style signature: void XIntc_mDisableIntr(u32 BaseAddress, u32 DisableMask);

#define XIntc_mEnableIntr | ( | BaseAddress,
|  | EnableMask |  | ) |

  | Enable specific interrupt(s) in the interrupt controller. Parameters:
  | BaseAddress | is the base address of the device
  | EnableMask | is the 32-bit value to write to the enable register. Each bit of the mask corresponds to an interrupt input signal that is connected to the interrupt controller (INT0 = LSB). Only the bits which are set in the mask will enable interrupts.
Returns: None. Note: C-style signature: void XIntc_mEnableIntr(u32 BaseAddress, u32 EnableMask);

#define XIntc_mGetIntrStatus | ( | BaseAddress |  | ) |

  | Get the interrupt status from the interrupt controller which indicates which interrupts are active and enabled. Parameters:
  | BaseAddress | is the base address of the device
Returns: The 32-bit contents of the interrupt status register. Each bit corresponds to an interrupt input signal that is connected to the interrupt controller (INT0 = LSB). Bits which are set indicate an active interrupt which is also enabled. Note: C-style signature: u32 XIntc_mGetIntrStatus(u32 BaseAddress);

#define XIntc_mMasterDisable | ( | BaseAddress |  | ) |

  | Disable all interrupts in the Master Enable register of the interrupt controller. Parameters:
  | BaseAddress | is the base address of the device.
Returns: None. Note: C-style signature: void XIntc_mMasterDisable(u32 BaseAddress);

#define XIntc_mMasterEnable | ( | BaseAddress |  | ) |

  | Enable all interrupts in the Master Enable register of the interrupt controller. The interrupt controller defaults to all interrupts disabled from reset such that this macro must be used to enable interrupts. Parameters:
  | BaseAddress | is the base address of the device.
Returns: None. Note: C-style signature: void XIntc_mMasterEnable(u32 BaseAddress);

## Function Documentation

void XIntc_DeviceInterruptHandler | ( | void * | DeviceId | ) |

  | This function is the primary interrupt handler for the driver. It must be connected to the interrupt source such that is called when an interrupt of the interrupt controller is active. It will resolve which interrupts are active and enabled and call the appropriate interrupt handler. It uses the AckBeforeService flag in the configuration data to determine when to acknowledge the interrupt. Highest priority interrupts are serviced first. The driver can be configured to service only the highest priority interrupt or all pending interrupts using the {XIntc_SetOptions()} function or the {XIntc_SetIntrSrvOption()} function. This function assumes that an interrupt vector table has been previously initialized. It does not verify that entries in the table are valid before calling an interrupt handler. Parameters:
  | DeviceId | is the zero-based device ID defined in xparameters.h of the interrupting interrupt controller. It is used as a direct index into the configuration data, which contains the vector table for the interrupt controller. Note that even though the argument is a void pointer, the value is not a pointer but the actual device ID. The void pointer type is necessary to meet the XInterruptHandler typedef for interrupt handlers.
Returns: None. Note: The constant XPAR_INTC_MAX_NUM_INTR_INPUTS must be setup for this to compile. Interrupt IDs range from 0 - 31 and correspond to the interrupt input signals for the interrupt controller. XPAR_INTC_MAX_NUM_INTR_INPUTS specifies the highest numbered interrupt input signal that is used.

void XIntc_RegisterHandler | ( | u32 | BaseAddress,
|  | int | InterruptId,
|  | XInterruptHandler | Handler,
|  | void * | CallBackRef
| ) |

  | Register a handler function for a specific interrupt ID. The vector table of the interrupt controller is updated, overwriting any previous handler. The handler function will be called when an interrupt occurs for the given interrupt ID. This function can also be used to remove a handler from the vector table by passing in the XIntc_DefaultHandler() as the handler and NULL as the callback reference. Parameters:
  | BaseAddress | is the base address of the interrupt controller whose vector table will be modified.
  | InterruptId | is the interrupt ID to be associated with the input handler. Handler is the function pointer that will be added to the vector table for the given interrupt ID. It adheres to the XInterruptHandler signature found in xbasic_types.h.
  | CallBackRef | is the argument that will be passed to the new handler function when it is called. This is user-specific.
Returns: None. Note: Note that this function has no effect if the input base address is invalid.

void XIntc_SetIntrSvcOption | ( | u32 | BaseAddress,
|  | int | Option
| ) |

  | Set the interrupt service option, which can configure the driver so that it services only a single interrupt at a time when an interrupt occurs, or services all pending interrupts when an interrupt occurs. The default behavior when using the driver interface given in xintc.h file is to service only a single interrupt, whereas the default behavior when using the driver interface given in this file is to service all outstanding interrupts when an interrupt occurs. Parameters:
  | BaseAddress | is the unique identifier for a device.
  | Option | is XIN_SVC_SGL_ISR_OPTION if you want only a single interrupt serviced when an interrupt occurs, or XIN_SVC_ALL_ISRS_OPTION if you want all pending interrupts serviced when an interrupt occurs.
Returns: None. Note: Note that this function has no effect if the input base address is invalid.

Copyright © 1995-2009 Xilinx, Inc. All rights reserved.