前言
ZYNQ在PS端有基本完备的函数库,但是相关学习文档或资料中并未像ARM一样对这些函数的功能进行详细的解释,这篇文章就是想在学习过程中将GPIO相关的函数随手总结下来。
GPIO相关函数汇总
1.XGpioPs_CfgInitializes32 XGpioPs_CfgInitialize(XGpioPs *InstancePtr, XGpioPs_Config *ConfigPtr,u32 EffectiveAddr)
{
s32 Status = XST_SUCCESS;
u8 i;
Xil_AssertNonvoid(InstancePtr != NULL);
Xil_AssertNonvoid(ConfigPtr != NULL);
Xil_AssertNonvoid(EffectiveAddr != (u32)0);
InstancePtr->IsReady = 0U;
InstancePtr->GpioConfig.BaseAddr = EffectiveAddr;
InstancePtr->GpioConfig.DeviceId = ConfigPtr->DeviceId;
InstancePtr->Handler = (XGpioPs_Handler)StubHandler;
InstancePtr->Platform = XGetPlatform_Info();
if (InstancePtr->Platform == XPLAT_ZYNQ_ULTRA_MP) {
InstancePtr->MaxPinNum = (u32)174;
InstancePtr->MaxBanks = (u8)6;
} else {