码迷,mamicode.com
首页 > 系统相关 > 详细

Linux command stty

时间:2019-03-12 18:35:39      阅读:222      评论:0      收藏:0      [点我收藏+]

标签:停止   otp   amp   mina   echo   rpo   arm   linu   cms   

Linux command stty

reference: https://blog.csdn.net/lqxandroid2012/article/details/78929506

Purpose

       Learning linux command stty for get/set serial uart speed 

 

Eevironment

       Ubuntu 16.04 terminal

 

Procdeure

       example get uart speed:

root@IoTP:~# stty -F /dev/ttyUSB2 -a 
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^A; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig -icanon iexten -echo -echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke -flusho -extproc

  example set uart speed:

 

stty -F /dev/ttyS0 speed 115200 cs8 -parenb -cstopb  -echo
解释:通过stty设置/dev/ttyS0串口, 波特率为115200 ,数据位cs8,奇偶校验位-parenb,停止位-cstopb,同时-echo禁止终端回显。

 

Linux command stty

标签:停止   otp   amp   mina   echo   rpo   arm   linu   cms   

原文地址:https://www.cnblogs.com/lianghong881018/p/10518283.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!