当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 3 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : 编程遇到的一个问题,
帖子发表于 : 2007-09-14 16:50 

注册: 2007-03-31 15:53
帖子: 86
送出感谢: 0 次
接收感谢: 0 次
static inline int rt_com_setup(unsigned int tty,
int baud, int mode,
unsigned int parity,
unsigned int stopbits,
unsigned int numbits,
int fifotrig)

这个rtai中的函数,其中mode 与fifotrig 这二个参数是用来做什么的,


页首
 用户资料  
 
2 楼 
 文章标题 :
帖子发表于 : 2007-09-14 17:23 
头像

注册: 2005-12-28 1:16
帖子: 3916
地址: 火星
系统: Ubuntu 12.10 X64
送出感谢: 1
接收感谢: 0 次
好像咱们看到的声明不一样

代码:
rt_com
Name
rt_com -- serial port driver for RTLinux
Synopsis

       #include <rt_com.h>
       #include <rt_comP.h>

       void rt_com_write(unsigned int com, char *pointer, int cnt);
       int rt_com_read(unsigned int com, char *pointer, int cnt);
       int rt_com_setup(unsigned int com, unsigned int baud,
                        unsigned int parity, unsigned int stopbits,
                        unsigned int wordlength);

DESCRIPTION

rt_com_write - writes cnt characters from buffer ptr to serial port com.

rt_com_read - attempts to read cnt characters to buffer ptr from serial port com.

rt_com_setup - for setting of serial port parameters.

rt_com is a linux module. The user must specify, via entries in the rt_com_table (in rt_com.h):
Serial ports, relevant parameters for each, and an interrupt service routine (ISR) to be executed
 when the port irq fires. When rt_com is installed with insmod or modprobe, its init_module function
 (in rt_com.c) requests the port device memory, registers the ISR, and sets various default values,
for each port entry in rt_com_table.

The user-specified ISR is merely a wrapper to call rt_com_isr() (in rt_com.c); the latter is the real
ISR that does the work of reading from a port to a buffer, or writing from a buffer to a port (it takes
as input the number of the port). The user must edit rt_com.c to insert a wrapper for each desired
port (beyond the first), called rt_com_isrN(), where N is the port's rt_com_table entry number,
 following the example of the wrapper given for a first port: rt_com_isr0().

rt_com creates buffers for its own use in reading and writing to the serial ports. The user can specify
the size of these buffers by giving a value to RT_COM_BUF_SIZ in rt_com.h.

After this, RTLinux realtime user modules can use the three rt_com functions listed above to setup,
read from and write to, the serial ports. (rt_com_read and rt_com_write actually read from and write
to the buffers.)

rt_com uses RTLinux facilities for irq's and mutual exclusion. This is what makes the rt_com functions
"realtime": They proceed with all the privileges of the real kernel: RTLinux.

When the module is removed by rmmod, the cleanup_module function in rt_com.c frees all resources.


_________________
目前负债150多万


页首
 用户资料  
 
3 楼 
 文章标题 :
帖子发表于 : 2007-09-14 17:38 

注册: 2007-03-31 15:53
帖子: 86
送出感谢: 0 次
接收感谢: 0 次
你是在rtlinux下的吧,我现在是在rtai中的,是不一样,


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 3 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:Google [Bot] 和 4 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译