### Xilinx Processor IP Library

Software Drivers

Main Page | Data Structures | File List | Globals

# xgpio_intr.c File Reference

## Detailed Description

Implements GPIO interrupt processing functions for the XGpio component. See xgpio.h for more information about the component.

The functions in this file require the hardware device to be built with interrupt capabilities. The functions will assert if called using hardware that does not have interrupt capabilities.

     MODIFICATION HISTORY:

     Ver   Who  Date     Changes
     ----- ---- -------- -----------------------------------------------
     2.00a jhl  11/26/03 Initial release
     2.11a mta  03/21/07 Updated to new coding style
     2.12a sv   06/05/08 Updated driver to fix the XGpio_InterruptDisable function
    		      to properly update the Interrupt Enable register

## Functions
void | XGpio_InterruptGlobalEnable (XGpio *InstancePtr)
void | XGpio_InterruptGlobalDisable (XGpio *InstancePtr)
void | XGpio_InterruptEnable (XGpio *InstancePtr, u32 Mask)
void | XGpio_InterruptDisable (XGpio *InstancePtr, u32 Mask)
void | XGpio_InterruptClear (XGpio *InstancePtr, u32 Mask)
u32 | XGpio_InterruptGetEnabled (XGpio *InstancePtr)
u32 | XGpio_InterruptGetStatus (XGpio *InstancePtr)

## Function Documentation

void XGpio_InterruptClear | ( | XGpio * | InstancePtr,
|  | u32 | Mask
| ) |

  | Clear pending interrupts with the provided mask. This function should be called after the software has serviced the interrupts that are pending. This function will assert if the hardware device has not been built with interrupt capabilities. Parameters:
  | InstancePtr | is the GPIO component to operate on.
  | Mask | is the mask to clear pending interrupts for. Bit positions of 1 are cleared. This mask is formed by OR'ing bits from XGPIO_IR* bits which are contained in xgpio_l.h.
Returns: None. Note: None.

void XGpio_InterruptDisable | ( | XGpio * | InstancePtr,
|  | u32 | Mask
| ) |

  | Disable interrupts. This function allows specific interrupts for each channel to be disabled. This function will assert if the hardware device has not been built with interrupt capabilities. Parameters:
  | InstancePtr | is the GPIO component to operate on.
  | Mask | is the mask to disable. Bits set to 1 are disabled. This mask is formed by OR'ing bits from XGPIO_IR* bits which are contained in xgpio_l.h.
Returns: None. Note: None.

void XGpio_InterruptEnable | ( | XGpio * | InstancePtr,
|  | u32 | Mask
| ) |

  | Enable interrupts. The global interrupt must also be enabled by calling XGpio_InterruptGlobalEnable() for interrupts to occur. This function will assert if the hardware device has not been built with interrupt capabilities. Parameters:
  | InstancePtr | is the GPIO component to operate on.
  | Mask | is the mask to enable. Bit positions of 1 are enabled. This mask is formed by OR'ing bits from XGPIO_IR* bits which are contained in xgpio_l.h.
Returns: None. Note: None.

u32 XGpio_InterruptGetEnabled | ( | XGpio * | InstancePtr | ) |

  | Returns the interrupt enable mask. This function will assert if the hardware device has not been built with interrupt capabilities. Parameters:
  | InstancePtr | is the GPIO component to operate on.
Returns: A mask of bits made from XGPIO_IR* bits which are contained in xgpio_l.h. None. Note: None.

u32 XGpio_InterruptGetStatus | ( | XGpio * | InstancePtr | ) |

  | Returns the status of interrupt signals. Any bit in the mask set to 1 indicates that the channel associated with the bit has asserted an interrupt condition. This function will assert if the hardware device has not been built with interrupt capabilities. Parameters:
  | InstancePtr | is the GPIO component to operate on.
Returns: A pointer to a mask of bits made from XGPIO_IR* bits which are contained in xgpio_l.h. Note: The interrupt status indicates the status of the device irregardless if the interrupts from the devices have been enabled or not through XGpio_InterruptEnable().

void XGpio_InterruptGlobalDisable | ( | XGpio * | InstancePtr | ) |

  | Disable the interrupt output signal. Interrupts enabled through XGpio_InterruptEnable() will no longer be passed through until the global enable bit is set by XGpio_InterruptGlobalEnable(). This function is designed to allow all interrupts (both channels) to be disabled easily for entering a critical section. This function will assert if the hardware device has not been built with interrupt capabilities. Parameters:
  | InstancePtr | is the GPIO component to operate on.
Returns: None. Note: None.

void XGpio_InterruptGlobalEnable | ( | XGpio * | InstancePtr | ) |

  | Enable the interrupt output signal. Interrupts enabled through XGpio_InterruptEnable() will not be passed through until the global enable bit is set by this function. This function is designed to allow all interrupts (both channels) to be enabled easily for exiting a critical section. This function will assert if the hardware device has not been built with interrupt capabilities. Parameters:
  | InstancePtr | is the GPIO component to operate on.
Returns: None. Note: None.

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