gpiops
Vitis Drivers API Documentation
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). This example supports the VCK190 and VMK180 for Versal, but requires a PL shim. See Answer Record AR# 75677 and Figure 61 in AM011 Versal TRM for more details. Driver supports both PS GPIO and PMC GPIO. For accessing PMC GPIOs application you need to set "GPIO.PmcGpio = 1" otherwise it accesses PS GPIO.
 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.7 sne 12/04/19 Reverted versal example support. 3.8 sne 09/17/20 Added description for Versal PS and PMC GPIO pins. 3.9 sne 11/19/20 Added versal PmcGpio example support. 3.12 gm 07/11/23 Added SDT support.

 

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.

Returns
  • XST_SUCCESS if the example has completed successfully.
  • XST_FAILURE if the example has failed.
Note
None.