Firefly开源社区

标题: Firefly-RK3288 修改uart波特率及属性 [打印本页]

作者: jpchen    时间: 2018-11-9 15:49
标题: Firefly-RK3288 修改uart波特率及属性
UART串口通信我们经常会使用到,比较常用的是查看对应UART节点的波特率,修改波特率和设置相关属性,如下做一下描述
1.查看波特率相关信息
shell@firefly:/ # busybox stty -F /dev/ttyS1                                   
speed 9600 baud; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-brkint -imaxbel


2.设置串口波特率
shell@firefly:/ # busybox stty -F /dev/ttyS1 115200
#查看一下/dev/ttyS1属性                          
shell@firefly:/ # busybox stty -F /dev/ttyS1                                   
speed 115200 baud; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-brkint -imaxbel


3.关闭回显
shell@firefly:/ # busybox stty -echo -F /dev/ttyS1
#查看一下/dev/ttyS1属性   
shell@firefly:/ # busybox stty -F /dev/ttyS1                                   
speed 115200 baud; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-brkint -imaxbel
-echo

#可以注意到最好有添加了-echo属性





欢迎光临 Firefly开源社区 (https://dev.t-firefly.com/) Powered by Discuz! X3.1