免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
123
最近访问板块 发新帖
楼主: ljwilliam
打印 上一主题 下一主题

[驱动] 串口接收GPS模块发送的信息,接收上丢失数据 [复制链接]

论坛徽章:
0
21 [报告]
发表于 2010-11-22 09:59 |显示全部楼层
硬件流控需要有相应的管脚支持,既接收端的cts和对端(gps)的rts,这是必要的硬件引脚。
软件流控是通过应用层设置就可以了,内核中是支持的,不知道你的gps行不行。

论坛徽章:
0
22 [报告]
发表于 2010-11-22 19:48 |显示全部楼层
The sending device (e.g. another UART) may send an additional byte after the trigger level is reached because it may not recognize the de-assertion of RTS until it has begun sending the additional byte.

论坛徽章:
0
23 [报告]
发表于 2010-11-22 20:03 |显示全部楼层
Hardware flow control

论坛徽章:
0
24 [报告]
发表于 2010-11-23 18:15 |显示全部楼层
唉,为什么每次我的回复你都不仔细的看,明显100楼说的是硬件流控。
软件流控需要两方的支持,不需要硬件的支持。

论坛徽章:
0
25 [报告]
发表于 2010-11-26 20:05 |显示全部楼层
对于软流控是不是硬件发出来和处理的.我也很困惑.因为目前还没看到哪个UART讲这个
如果没有,我觉得只能在驱 ...
smalloc 发表于 2010-11-26 17:05



    When software flow control operation is enabled, the UART compares incoming data with XOFF1/2
programmed characters (in certain cases XOFF1 and XOFF2 must be received sequentially). When the
correct XOFF characters are received, transmission is halted after completing transmission of the current
character.

论坛徽章:
0
26 [报告]
发表于 2010-11-27 10:30 |显示全部楼层
本帖最后由 EZWORD 于 2010-11-27 10:32 编辑

硬件流控,需要硬件支持,根据引脚电平决定是否发送。软件流控内核代码中有。
  1.         if (tty->receive_room < TTY_THRESHOLD_THROTTLE)
  2.                 tty_throttle(tty);
复制代码
在n_tty.c文件中,有个函数叫做n_tty_receive_buf,这个函数调用了tty_throttle,接着调用uart_throttle,发送XOFF。以上为2.6.36内核中。

论坛徽章:
0
27 [报告]
发表于 2010-11-29 13:47 |显示全部楼层
简单的研究过一段时间,详细的内容还是直接看源码比较好。
内核中关于串口的驱动分层确实有些复杂。
我自己总结的层次关系如下:
1,struct uart_ops功能靠直接操作硬件层来实现;                  物理层(此处驱动硬件工作)
2,struct tty_operations的实现依赖于struct uart_ops;        串口核心层
3,struct tty_ldisc_ops的实现依赖于struct tty_operations        线程规程层
4,struct file_operations的实现依赖于struct tty_ldisc_ops        tty核心层?

当然实际可能比上面要复杂一些,也可能存在理解上的错误,自己去分析下吧。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP