解析Linux下的并口编程(英文版)(2)

2008-02-23 05:41:39来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折



  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来得到程式运行信息

下一篇: 在CMP实体BEAN中使用BLOB数据类型