我的问题是,这个函数 XGpio_SetDataDirection 的作用是什么,en C。例如 XGpio_SetDataDirection (&gp_out, 1, 0x00) ?
最佳答案
您可以直接从您的设计中查找/生成 Microblaze 驱动程序的 API 文档。例如。在 Xilinx Platform Studio 中,右键单击 Microblaze 核心应该会显示菜单项 Driver/View API Documentation。从那里您可以导航到 xgpio
驱动程序,对于 XGpio_SetDataDirection
您应该看到如下内容:
void XGpio_SetDataDirection (XGpio * InstancePtr, unsigned Channel, u32 DirectionMask )
Set the input/output direction of all discrete signals for the specified GPIO channel.
Parameters:
InstancePtr
is a pointer to an XGpio instance to be worked on.Channel
contains the channel of the GPIO (1 or 2) to operate on.DirectionMask
is a bitmask specifying which discretes are input and which are output. Bits set to 0 are output and bits set to 1 are input.Returns: None.
Note: The hardware must be built for dual channels if this function is used with any channel other than 1. If it is not, this function will assert.
因此,在您的情况下,XGpio_SetDataDirection (&gp_out, 1, 0x00)
会将 GPIO 端口(带有 LED)设置为 Microblaze CPU 内核的输出。
关于c - XGpio_SetDataDirection,Xilinx,C 开发人员,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16946270/