uart串口

简单原理图

uart串口

RS-232可以支持更长距离传输
uart串口

如何使用:设置波特率和格式(数据位,停止位,校验位,流控)
uart串口

传输能力: 一秒能传多少数据(根据波特率和格式决定)
uart串口

uart串口

uart串口
uart串口

uart串口

其他:
fatal error: sys/cdefs.h No such file or directory 解决方案

在64位的ubuntu系统,使用gcc想编译出32位的应用程序,需要使用gcc -m32选项,但是使用gcc -m32选项后,出现:
fatal error: sys/cdefs.h: No such file or directory|

可以使用如下方法解决:
sudo apt-get update
sudo apt-get purge libc6-dev
sudo apt-get install libc6-dev
sudo apt-get install libc6-dev-i386