gpiops
Vitis Drivers API Documentation
xgpiops.h File Reference

Data Structures

struct  XGpioPs_Config
 This typedef contains configuration information for a device. More...
 
struct  XGpioPs
 The XGpioPs driver instance data. More...
 

Macros

#define XGPIOPS_H
 by using protection macros More...
 
#define XGPIOPS_BANK_MAX_PINS   (u32)32
 Max pins in a GPIO bank. More...
 
#define XGPIOPS_BANK0   0x00U
 GPIO Bank 0. More...
 
#define XGPIOPS_BANK1   0x01U
 GPIO Bank 1. More...
 
#define XGPIOPS_BANK2   0x02U
 GPIO Bank 2. More...
 
#define XGPIOPS_BANK3   0x03U
 GPIO Bank 3. More...
 
#define XGPIOPS_BANK4   0x04U
 GPIO Bank 4. More...
 
#define XGPIOPS_BANK5   0x05U
 GPIO Bank 5. More...
 
#define XGPIOPS_MAX_BANKS_ZYNQMP   0x06U
 Max banks in a Zynq Ultrascale+ MP GPIO device. More...
 
#define XGPIOPS_MAX_BANKS   0x04U
 Max banks in a Zynq GPIO device. More...
 
#define XGPIOPS_DEVICE_MAX_PIN_NUM_ZYNQMP   (u32)174
 Max pins in the Zynq Ultrascale+ MP GPIO device 0 - 25, Bank 0 26 - 51, Bank 1 52 - 77, Bank 2 78 - 109, Bank 3 110 - 141, Bank 4 142 - 173, Bank 5. More...
 
#define XGPIOPS_DEVICE_MAX_PIN_NUM   (u32)118
 Max pins in the Zynq GPIO device 0 - 31, Bank 0 32 - 53, Bank 1 54 - 85, Bank 2 86 - 117, Bank 3. More...
 
Interrupt types

The following constants define the interrupt types that can be set for each GPIO pin.

#define XGPIOPS_IRQ_TYPE_EDGE_RISING   0x00U
 Interrupt on Rising edge. More...
 
#define XGPIOPS_IRQ_TYPE_EDGE_FALLING   0x01U
 Interrupt Falling edge. More...
 
#define XGPIOPS_IRQ_TYPE_EDGE_BOTH   0x02U
 Interrupt on both edges. More...
 
#define XGPIOPS_IRQ_TYPE_LEVEL_HIGH   0x03U
 Interrupt on high level. More...
 
#define XGPIOPS_IRQ_TYPE_LEVEL_LOW   0x04U
 Interrupt on low level. More...
 

Typedefs

typedef void(* XGpioPs_Handler )(void *CallBackRef, u32 Bank, u32 Status)
 This handler data type allows the user to define a callback function to handle the interrupts for the GPIO device. More...
 

Functions

s32 XGpioPs_CfgInitialize (XGpioPs *InstancePtr, const XGpioPs_Config *ConfigPtr, u32 EffectiveAddr)
 This function initializes a XGpioPs instance/driver. More...
 
u32 XGpioPs_Read (const XGpioPs *InstancePtr, u8 Bank)
 Read the Data register of the specified GPIO bank. More...
 
void XGpioPs_Write (const XGpioPs *InstancePtr, u8 Bank, u32 Data)
 Write to the Data register of the specified GPIO bank. More...
 
void XGpioPs_SetDirection (const XGpioPs *InstancePtr, u8 Bank, u32 Direction)
 Set the Direction of the pins of the specified GPIO Bank. More...
 
u32 XGpioPs_GetDirection (const XGpioPs *InstancePtr, u8 Bank)
 Get the Direction of the pins of the specified GPIO Bank. More...
 
void XGpioPs_SetOutputEnable (const XGpioPs *InstancePtr, u8 Bank, u32 OpEnable)
 Set the Output Enable of the pins of the specified GPIO Bank. More...
 
u32 XGpioPs_GetOutputEnable (const XGpioPs *InstancePtr, u8 Bank)
 Get the Output Enable status of the pins of the specified GPIO Bank. More...
 
void XGpioPs_GetBankPin (u8 PinNumber, u8 *BankNumber, u8 *PinNumberInBank)
 Get the Bank number and the Pin number in the Bank, for the given PinNumber in the GPIO device. More...
 
u32 XGpioPs_ReadPin (const XGpioPs *InstancePtr, u32 Pin)
 Read Data from the specified pin. More...
 
void XGpioPs_WritePin (const XGpioPs *InstancePtr, u32 Pin, u32 Data)
 Write data to the specified pin. More...
 
void XGpioPs_SetDirectionPin (const XGpioPs *InstancePtr, u32 Pin, u32 Direction)
 Set the Direction of the specified pin. More...
 
u32 XGpioPs_GetDirectionPin (const XGpioPs *InstancePtr, u32 Pin)
 Get the Direction of the specified pin. More...
 
void XGpioPs_SetOutputEnablePin (const XGpioPs *InstancePtr, u32 Pin, u32 OpEnable)
 Set the Output Enable of the specified pin. More...
 
u32 XGpioPs_GetOutputEnablePin (const XGpioPs *InstancePtr, u32 Pin)
 Get the Output Enable status of the specified pin. More...
 
s32 XGpioPs_SelfTest (const XGpioPs *InstancePtr)
 This function runs a self-test on the GPIO driver/device. More...
 
void XGpioPs_IntrEnable (const XGpioPs *InstancePtr, u8 Bank, u32 Mask)
 This function enables the interrupts for the specified pins in the specified bank. More...
 
void XGpioPs_IntrDisable (const XGpioPs *InstancePtr, u8 Bank, u32 Mask)
 This function disables the interrupts for the specified pins in the specified bank. More...
 
u32 XGpioPs_IntrGetEnabled (const XGpioPs *InstancePtr, u8 Bank)
 This function returns the interrupt enable status for a bank. More...
 
u32 XGpioPs_IntrGetStatus (const XGpioPs *InstancePtr, u8 Bank)
 This function returns interrupt status read from Interrupt Status Register. More...
 
void XGpioPs_IntrClear (const XGpioPs *InstancePtr, u8 Bank, u32 Mask)
 This function clears pending interrupt(s) with the provided mask. More...
 
void XGpioPs_SetIntrType (const XGpioPs *InstancePtr, u8 Bank, u32 IntrType, u32 IntrPolarity, u32 IntrOnAny)
 This function is used for setting the Interrupt Type, Interrupt Polarity and Interrupt On Any for the specified GPIO Bank pins. More...
 
void XGpioPs_GetIntrType (const XGpioPs *InstancePtr, u8 Bank, u32 *IntrType, u32 *IntrPolarity, u32 *IntrOnAny)
 This function is used for getting the Interrupt Type, Interrupt Polarity and Interrupt On Any for the specified GPIO Bank pins. More...
 
void XGpioPs_SetCallbackHandler (XGpioPs *InstancePtr, void *CallBackRef, XGpioPs_Handler FuncPointer)
 This function sets the status callback function. More...
 
void XGpioPs_IntrHandler (const XGpioPs *InstancePtr)
 This function is the interrupt handler for GPIO interrupts.It checks the interrupt status registers of all the banks to determine the actual bank in which an interrupt has been triggered. More...
 
void XGpioPs_SetIntrTypePin (const XGpioPs *InstancePtr, u32 Pin, u8 IrqType)
 This function is used for setting the IRQ Type of a single GPIO pin. More...
 
u8 XGpioPs_GetIntrTypePin (const XGpioPs *InstancePtr, u32 Pin)
 This function returns the IRQ Type of a given GPIO pin. More...
 
void XGpioPs_IntrEnablePin (const XGpioPs *InstancePtr, u32 Pin)
 This function enables the interrupt for the specified pin. More...
 
void XGpioPs_IntrDisablePin (const XGpioPs *InstancePtr, u32 Pin)
 This function disables the interrupts for the specified pin. More...
 
u32 XGpioPs_IntrGetEnabledPin (const XGpioPs *InstancePtr, u32 Pin)
 This function returns whether interrupts are enabled for the specified pin. More...
 
u32 XGpioPs_IntrGetStatusPin (const XGpioPs *InstancePtr, u32 Pin)
 This function returns interrupt enable status of the specified pin. More...
 
void XGpioPs_IntrClearPin (const XGpioPs *InstancePtr, u32 Pin)
 This function clears the specified pending interrupt. More...
 
XGpioPs_ConfigXGpioPs_LookupConfig (u16 DeviceId)
 This function looks for the device configuration based on the unique device ID. More...
 

Variables

XGpioPs_Config XGpioPs_ConfigTable []
 This table contains configuration information for each GPIO device in the system. More...