![]() |
gpiops
Xilinx SDK Drivers API Documentation
|
This file contains an example for using GPIO hardware and driver.
This example provides the usage of APIs for reading/writing to the individual pins. Please see xgpiops.h file for description of the pin numbering.
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 1.01a sv 04/15/12 Removed the calling of some unnecessary APIs. Updated the examples for a ZC702 board . Updated the example to use only pin APIs. 3.3 ms 04/17/17 Added notes about input and output pin description for zcu102 and zc702 boards. 3.5 sne 04/26/19 Added versal support. 3.6 sne 08/19/19 Updated gpio pin numbers for versal platform. Using pmc_MIO38,pmc_MIO39 for PMC device and LPD_MIO14,LPD_MIO15 for PS device.
Functions | |
int | GpioPolledExample (u16 DeviceId, u32 *DataRead) |
The purpose of this function is to illustrate how to use the GPIO driver to turn on/off an LED and read the inputs using the pin APIs. More... | |
int | main (void) |
Main function to call the example. More... | |
int GpioPolledExample | ( | u16 | DeviceId, |
u32 * | DataRead | ||
) |
The purpose of this function is to illustrate how to use the GPIO driver to turn on/off an LED and read the inputs using the pin APIs.
DeviceId | is the XPAR_<GPIO_instance>_DEVICE_ID value from xparameters.h |
DataRead | is the pointer where the data read from GPIO Input is returned. |
References XGpioPs_Config::BaseAddr, XGpioPs_Config::DeviceId, XGpioPs::PmcGpio, and XGpioPs_LookupConfig().
Referenced by main().
int main | ( | void | ) |
Main function to call the example.
None |
References GpioPolledExample().