### Xilinx Processor IP Library

Software Drivers

Main Page | Data Structures | File List | Globals

# gpio v2_13_a

This file contains the software API definition of the Xilinx General Purpose I/O (XGpio) device driver component.

The Xilinx GPIO controller is a soft IP core designed for Xilinx FPGAs on the PLB bus and contains the following general features:

- Support for up to 32 I/O discretes for each channel (64 bits total).
- Each of the discretes can be configured for input or output.
- Configurable support for dual channels and interrupt generation.

The driver provides interrupt management functions. Implementation of interrupt handlers is left to the user. Refer to the provided interrupt example in the examples directory for details.

This driver is intended to be RTOS and processor independent. Any needs for dynamic memory management, threads or thread mutual exclusion, virtual memory, or cache control must be satisfied by the layer above this driver.

Initialization & Configuration

The XGpio_Config structure is used by the driver to configure itself. This configuration structure is typically created by the tool-chain based on HW build properties.

To support multiple runtime loading and initialization strategies employed by various operating systems, the driver instance can be initialized in one of the following ways:

- XGpio_Initialize(InstancePtr, DeviceId) - The driver looks up its own configuration structure created by the tool-chain based on an ID provided by the tool-chain.

- XGpio_CfgInitialize(InstancePtr, CfgPtr, EffectiveAddr) - Uses a configuration structure provided by the caller. If running in a system with address translation, the provided virtual memory base address replaces the physical address present in the configuration structure.

Note:

This API utilizes 32 bit I/O to the GPIO registers. With less than 32 bits, the unused bits from registers are read as zero and written as don't cares.

     MODIFICATION HISTORY:

     Ver   Who  Date     Changes
     ----- ---- -------- -----------------------------------------------
     1.00a rmm  03/13/02 First release
     2.00a jhl  11/26/03 Added support for dual channels and interrupts
     2.01a jvb  12/14/05 I separated dependency on the static config table and
                         xparameters.h from the driver initialization by moving
                         _Initialize and _LookupConfig to _sinit.c. I also added
                         the new _CfgInitialize routine.
     2.11a mta  03/21/07 Updated to new coding style, added GetDataDirection
     2.12a sv   11/21/07 Updated driver to support access through DCR bus
     2.12a sv   06/05/08 Updated driver to fix the XGpio_InterruptDisable function
    		      to properly update the Interrupt Enable register
     2.13a sdm  08/22/08 Removed support for static interrupt handlers from the MDD
    		      file

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