UART的默认波特率
https://blog.csdn.net/jin615567975/article/details/71515875
linux kernel下输入输出console如何实现
Linux串口驱动程序(5)-数据接收
https://blog.csdn.net/qq_22847457/article/details/91785162
tty初探—uart驱动框架分析
https://blog.csdn.net/lizuobin2/article/details/51773305
//一般来说,实现下面的成员函数是UART驱动的主体工作
static struct uart_ops s3c24xx_serial_ops ={
.pm =s3c24xx_serial_pm, //电源管理函数
.tx_empty = s3c24xx_serial_tx_empty, //检车发送FIFO缓冲区是否空
.get_mctrl = s3c24xx_serial_get_mctrl, //是否串口流控
.set_mctrl = s3c24xx_serial_set_mctrl, //是否设置串口流控cts
.stop_tx =s3c24xx_serial_stop_tx, //停止发送
.start_tx =s3c24xx_serial_start_tx, //启动发送
.stop_rx =s3c24xx_serial_stop_rx, //停止接收
.enable_ms = s3c24xx_serial_enable_ms, //空函数
.break_ctl = s3c24xx_serial_break_ctl, //发送break信号
.startup =s3c24xx_serial_startup, //串口发送/接收,以及中断申请初始配置函数
.shutdown = s3c24xx_serial_shutdown, //关闭串口
.set_termios = s3c24xx_serial_set_termios,//串口clk,波特率,数据位等参数设置
.type = s3c24xx_serial_type, // CPU类型关于串口
.release_port =s3c24xx_serial_release_port, //释放串口
.request_port =s3c24xx_serial_request_port, //申请串口
.config_port = s3c24xx_serial_config_port, //串口的一些配置信息info
.verify_port = s3c24xx_serial_verify_port, //串口检测
.wake_peer = s3c24xx_serial_wake_peer,
};
终端特殊设备文件一般有以下几种:
1、串行端口终端(/dev/ttySn)
2、伪终端(/dev/pty/)
3、控制终端(/dev/tty)
4、控制台终端(/dev/ttyn, /dev/console)
https://www.cnblogs.com/noble/p/4144053.html
* TTY_DRIVER_DYNAMIC_DEV --- if set, the individual tty devices need
* to be registered with a call to tty_register_device() when the
* device is found in the system and unregistered with a call to
* tty_unregister_device() so the devices will be show up
* properly in sysfs. If not set, driver->num entries will be
* created by the tty core in sysfs when tty_register_driver() is
* called. This is to be used by drivers that have tty devices
* that can appear and disappear while the main tty driver is
* registered with the tty core.TTY_DRIVER_DYNAMIC_DEV ---如果已设置,则当在系统中找到某个tty设备时,需要使用对tty_register_device()的调用注册该设备,并使用对tty_unregister_device()的调用注销该设备,以便这些设备将在sysfs中正确显示。如果未设置,则在调用tty_register_driver()时,将由sysfs中的tty core创建driver->num条目。这将被具有tty设备的驱动程序使用,这些tty设备可以在主tty驱动程序注册到tty核心时出现或消失。
tty_register_driver
if (!(driver->flags & TTY_DRIVER_DYNAMIC_DEV)) { //如果是USB serial驱动,该 if 不成立