在Linux中可以使用9位串行通信吗? [英] Is it possible to use 9-bit serial communication in Linux?
问题描述
RS-232通信有时使用9位字节.它可用于与总线上的多个微控制器通信,总线上的8位是数据,多余的位表示地址字节(而不是数据).不活动的控制器只会为地址字节生成中断.
RS-232 communication sometimes uses 9-bit bytes. This can be used to communicate with multiple microcontrollers on a bus where 8 bits are data and the extra bit indicates an address byte (rather than data). Inactive controllers only generate an interrupt for address bytes.
Linux程序可以通过串行设备发送和接收9位字节吗?怎么样?
Can a Linux program send and receive 9-bit bytes over a serial device? How?
推荐答案
termios系统不直接支持9位操作,但是可以通过使用CMSPAR标志来技巧在某些系统上进行仿真.它没有记录,但并非在所有实现中都显示.
The termios system does not directly support 9 bit operation but it can be emulated on some systems by playing tricks with the CMSPAR flag. It is undocumented and my not appear in all implementations.
以下是有关如何完成9位仿真的详细文章的链接:
Here is a link to a detailed write-up on how 9-bit emulation is done:
http://www.lothosoft.ch/thomas/libmip/markspaceparity.php
这篇关于在Linux中可以使用9位串行通信吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!