解析Linux下的并口编程(英文版)(2)
2008-02-23 05:41:39来源:互联网 阅读 ()
The ioctl parameter should be a pointer to an int; values for this are in incluce/linux/parport.h and include:
IEEE1284_MODE_COMPAT
IEEE1284_MODE_NIBBLE
IEEE1284_MODE_BYTE
IEEE1284_MODE_EPP
IEEE1284_MODE_ECP
The PPNEGOT ioctl actually does two things: it performs the on-the-wire negotiation, and it sets the behaviour of subsequent read/write calls so that they use that mode (but see PPSETMODE).
PPSETMODE
Sets which IEEE 1284 protocol to use for the read and write calls.
The ioctl parameter should be a pointer to an int.
PPGETMODE
Retrieves the current IEEE 1284 mode to use for read and write.
PPGETTIME
Retrieves the time-out value. The read and write calls will time out if the peripheral doesn't respond quickly enough. The PPGETTIME ioctl retrieves the length of time that the peripheral is allowed to have before giving up.
The ioctl parameter should be a pointer to a struct timeval.
PPSETTIME
Sets the time-out. The ioctl parameter should be a pointer to a struct timeval.
PPGETMODES
Retrieves the capabilities of the hardware (i.e. the modes field of the parport structure).
PPSETFLAGS
Sets flags on the ppdev device which can affect future I/O operations. Available flags are:
PP_FASTWRITE
PP_FASTREAD
PP_W91284PIC
PPWCONTROL
Sets the control lines. The ioctl parameter is a pointer to an unsigned char, the bitwise OR of the control line values in include/linux/parport.h.
PPRCONTROL
Returns the last value written to the control register, in the form of an unsigned char: each bit corresponds to a control line (although some are unused). The ioctl parameter should be a pointer to an unsigned char.
This doesn't actually touch the hardware; the last value written is remembered in software. This is because some parallel port hardware does not offer read access to the control register.
The control lines bits are defined in include/linux/parport.h:
PARPORT_CONTROL_STROBE
PARPORT_CONTROL_AUTOFD
PARPORT_CONTROL_SELECT
PARPORT_CONTROL_INIT
PPFCONTROL
Frobs the control lines. Since a common operation is to change one of the control signals while leaving the others alone, it would be quite inefficient for the user-land driver to have to use PPRCONTROL, make the change, and then use PPWCONTROL. Of course, ea
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
上一篇: 使用profile来得到程式运行信息
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash
