|
【Android】
Firefly-RK3288 修改uart波特率及属性
发表于 2018-11-9 15:49:05
浏览:7247
|
回复:0
打印
只看该作者
[复制链接]
楼主
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属性
|
|