linux 串口笔记

UART的默认波特率

https://blog.csdn.net/jin615567975/article/details/71515875

 

linux kernel下输入输出console如何实现

https://blog.csdn.net/skyflying2012/article/details/41078349?depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-13&utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-13

 

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)

Linux中tty、pty、pts的概念区别

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 不成立

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值