使用Xilinix内置的UART函数来刻度某些值

发布于 2025-02-09 02:12:11 字数 894 浏览 1 评论 0 原文

我正在使用Xilinx UARTPS数据表来编写功能以禁用和启用UART的流量控制。我发现了数据表中定义的适当的位掩码,但是我不确定我应该使用此掩码来调用哪个内置功能,以便将此掩码传递给。

我认为最初可能是这个功能,

然而,经过仔细检查,它将U16作为一个参数,而我要使用的位掩码是U20。任何熟悉此库的人,我都会称呼哪个函数,以启用流量控制,

也就是指向数据表的链接。

I am using the Xilinx uartps data sheet in order to write functions to disable and enable Flow Control For UART. I found the appropriate bitmask defined in the data sheet, however I am not sure which built in function I should call with this mask in order to pass this bit mask to.

Flow Control Bit Mask

I thought initially it may be this function,
Set Options Function

However upon closer inspection, it takes a u16 as an argument and the bitmask I want to use is a u20. Anyone familiar with this library, what function do I call with the bit mask in order enable flow control

Here is a link to the datasheet as well.

https://xilinx.github.io/embeddedsw.github.io/uartps/doc/html/api/group__uartps__v3__11.html#gad74cdb596f414bee06ebd9159f496cef

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吃颗糖壮壮胆 2025-02-16 02:12:11

您的使用方式正确。面具比它们应该代表的16倍多的十六进制“ 0”,但是如果您查看选项,则永远不会使用此位。

配置选项
#define xuartps_option_set_break 0x0080u
这些常数指定可以使用驱动程序设置或检索的选项,每个选项都是唯一的位掩码,因此可以指定多个选项。

#define     XUARTPS_OPTION_STOP_BREAK   0x0040U
    Stops break transmission.
 
#define     XUARTPS_OPTION_RESET_TMOUT   0x0020U
    Reset the receive timeout.
 
#define     XUARTPS_OPTION_RESET_TX   0x0010U
    Reset the transmitter.
 
#define     XUARTPS_OPTION_RESET_RX   0x0008U
    Reset the receiver.
 
#define     XUARTPS_OPTION_ASSERT_RTS   0x0004U
    Assert the RTS bit.
 
#define     XUARTPS_OPTION_ASSERT_DTR   0x0002U
    Assert the DTR bit.
 
#define     XUARTPS_OPTION_SET_FCM   0x0001U
    Turn on flow control mode. 

这意味着您在使用此类标志时可能会受到警告,但是无论如何您都会得到所需的结果。

You are correct in what you are using. The masks have a hex "0" more than the 16bits they should represent, but if you look at the options, this bit is never used.

Configuration options
#define XUARTPS_OPTION_SET_BREAK 0x0080U
These constants specify the options that may be set or retrieved with the driver, each is a unique bit mask such that multiple options may be specified.

#define     XUARTPS_OPTION_STOP_BREAK   0x0040U
    Stops break transmission.
 
#define     XUARTPS_OPTION_RESET_TMOUT   0x0020U
    Reset the receive timeout.
 
#define     XUARTPS_OPTION_RESET_TX   0x0010U
    Reset the transmitter.
 
#define     XUARTPS_OPTION_RESET_RX   0x0008U
    Reset the receiver.
 
#define     XUARTPS_OPTION_ASSERT_RTS   0x0004U
    Assert the RTS bit.
 
#define     XUARTPS_OPTION_ASSERT_DTR   0x0002U
    Assert the DTR bit.
 
#define     XUARTPS_OPTION_SET_FCM   0x0001U
    Turn on flow control mode. 

This means that you might get a warning when using such flags, but you'll get the result you want anyway.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文