gpiops: xgpiops_intr_example.c File Reference

| gpiops Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Functions
xgpiops_intr_example.c File Reference

## Overview

This file contains a design example using the GPIO driver (XGpioPs) in an interrupt driven mode of operation.

The example uses the interrupt capability of the GPIO to detect push button events and set the output LEDs based on the input.

Note
  This example assumes that there is a Uart device in the HW design. This example is to provide support only for zcu102 on ZynqMp Platform and only for zc702 on Zynq Platform. For ZynqMP Platform, Input pin is 22(sw19 on zcu102 board) and Output Pin is 23(DS50 on zcu102 board). For Zynq Platform, Input Pins are 12(sw14 on zc702 board), 14(sw13 on zc702 board) and Output Pin is 10(DS23 on zc702 board). SW15 on zc702 board is a combination of sw13 and sw14. To operate either of the input pins, keep SW15 low(both should be 00).

In versal Platform we have two devices(PMC GPIO and PS GPIO),PMC contain 4 banks and 116 pins,PS GPIO contain 2 banks and 58 pins. This example can work for both PS and PMC GPIO based on the value of GPIO_DEVICE_ID The default value of 0 makes this example work for PMC GPIO controller.

     MODIFICATION HISTORY:

     Ver   Who  Date     Changes

     1.00a sv   01/18/10 First Release
     3.3   ms   04/17/17 Added notes about gpio input and output pin description
                         for zcu102 and zc702 boards, configured Interrupt pin
                         to input pin for proper working of interrupt example.
     3.6   sne  08/19/19 Added interrupt support on versal.Using pmc_MIO38 and
                          pmc_MIO39 for PMC device and LPD_MIO14,LPD_MIO15 for PS
                          for testing purpose.

## Functions
int | main (void)
| Main function that invokes the GPIO Interrupt example. More...

## Function Documentation

int main | ( | void |  | ) |

Main function that invokes the GPIO Interrupt example.

Parameters

  None. |

Returns
  - XST_SUCCESS if the example has completed successfully.
  - XST_FAILURE if the example has failed.

Note
  None.