### Xilinx Processor IP Library

Software Drivers

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

# xintc_l.c File Reference

## Detailed Description

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

     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.00c rpm  04/09/04 Added conditional compilation around the old handler
                         XIntc_LowLevelInterruptHandler(). This handler will only
                         be include/compiled if XPAR_INTC_SINGLE_DEVICE_ID is
                         defined.
     1.10c mta  03/21/07 Updated to new coding style
     1.10c ecm  07/09/07 Read the ISR after the Acknowledge in the interrupt
    					  handler to support architectures with posted write bus
    					  access issues.

## Functions
void | XIntc_DeviceInterruptHandler (void *DeviceId)
void | XIntc_SetIntrSvcOption (u32 BaseAddress, int Option)
void | XIntc_RegisterHandler (u32 BaseAddress, int InterruptId, XInterruptHandler Handler, void *CallBackRef)

## 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.