TIOCM_OUT1 和 TIOCM_OUT2 有什么用处?
termios.h
定义:
#define TIOCM_OUT1 0x2000
#define TIOCM_OUT2 0x4000
但是这些标志有什么用呢?
termios.h
defines:
#define TIOCM_OUT1 0x2000
#define TIOCM_OUT2 0x4000
But what are the flags good for?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它们用作类似于 DTR 等的信号线。 它们是“未分配的”,因此可供使用。 因此,从理论上讲,您可以使用它们来发出带外某些特殊条件的信号,这可能会非常方便。
但是,除非您正在构建自己的硬件解决方案,否则我不会将它们用于任何事情:商品串行硬件通常仅支持最常见用途的最低要求。 即,它通常不完全符合RS-232(或RS-XXX)标准。
They are used as signal lines similar to DTR, et al. They are "unassigned" and therefore open for use. So theoretically you could use them to signal some special condition out of band, which could come in very handy.
However, I would not use them for anything unless you are building your own hardware solution: commodity serial hardware often supports only the minimum requirements for the most common uses. I.e., it's often not full RS-232 (or RS-XXX) compliant.
看起来它们可用于设置 MCR 中的
OUT1
和OUT2
位。但未分配的可编程输出有什么用呢?
我最好的理解是它们在环回模式下用于中断,并且最好不要用于任何事情(因为它们旨在内部使用)。
It looks like they can be used to set the
OUT1
andOUT2
bits in the MCR.But what are the Unassigned Programmable Outputs good for?
My best understanding is they are used during loopback mode for interrupts and are best NOT used for anything (since they are intended to be used internally).