c - XGpio_SetDataDirection,Xilinx,C 开发人员

标签 c xilinx microblaze

我的问题是,这个函数 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/

相关文章:

c - 试图使连续的 FIFO 数据流

vhdl - 在 VHDL 中按名称连接端口,UCF 样式

c - 如何控制变量中的单个位?

c - 记录添加/显示/删除文件功能不起作用

c - 如何管理 Linux 加密 api 使用的分散列表?

c - 幂为-3/2或-5/2的c语言pow函数的实现

c - 这会导致段错误吗

usb - 与 Xilinx Atlys 板的外部 USB 设备接口(interface)

c - Microblaze 多中断代码不起作用

c - AXI-Uartlite 和 Teraterm 之间的波特率不匹配