1IEEE1284_TRANSFER(3) Functions IEEE1284_TRANSFER(3)
2
3
4
6 ieee1284_nibble_read, ieee1284_compat_write, ieee1284_byte_read,
7 ieee1284_epp_read_data, ieee1284_epp_write_data,
8 ieee1284_epp_read_addr, ieee1284_epp_write_addr,
9 ieee1284_ecp_read_data, ieee1284_ecp_write_data,
10 ieee1284_ecp_read_addr, ieee1284_ecp_write_addr - data transfer
11 functions
12
14 #include <ieee1284.h>
15
16 ssize_t ieee1284_nibble_read(struct parport *port, int flags,
17 char *buffer, size_t len);
18
19 ssize_t ieee1284_compat_write(struct parport *port, int flags,
20 const char *buffer, size_t len);
21
22 ssize_t ieee1284_byte_read(struct parport *port, int flags,
23 char *buffer, size_t len);
24
25 ssize_t ieee1284_epp_read_data(struct parport *port, int flags,
26 char *buffer, size_t len);
27
28 ssize_t ieee1284_epp_write_data(struct parport *port, int flags,
29 const char *buffer, size_t len);
30
31 ssize_t ieee1284_epp_read_addr(struct parport *port, int flags,
32 char *buffer, size_t len);
33
34 ssize_t ieee1284_epp_write_addr(struct parport *port, int flags,
35 const char *buffer, size_t len);
36
37 ssize_t ieee1284_ecp_read_data(struct parport *port, int flags,
38 char *buffer, size_t len);
39
40 ssize_t ieee1284_ecp_write_data(struct parport *port, int flags,
41 const char *buffer, size_t len);
42
43 ssize_t ieee1284_ecp_read_addr(struct parport *port, int flags,
44 char *buffer, size_t len);
45
46 ssize_t ieee1284_ecp_write_addr(struct parport *port, int flags,
47 const char *buffer, size_t len);
48
50 This set of functions is for tranferring bytes in the relevant transfer
51 mode. For ECP and EPP modes two types of transfer are possible: data
52 and address (usually referred to as channel in ECP).
53
54 The supplied port must be a claimed port.
55
56 The supplied buffer must be at least len bytes long. When reading, the
57 transferred data is stored in the buffer; when writing the data to be
58 transferred is taken from the buffer.
59
60 For reads (peripheral to host): if no data is available and
61 F1284_NONBLOCK is not in effect, the inactivity timer is started. If
62 data becomes available before the inactivity time-out elapses it is
63 read; otherwise the return value will be E1284_TIMEDOUT.
64
65 For writes (host to peripheral): if the peripheral is not willing to
66 accept data and F1284_NONBLOCK is not in effect, the inactivity timer
67 is started. If the peripheral indicates that it is willing to accept
68 data before the inactivity time-out elapses it is sent; otherwise the
69 return value will be E1284_TIMEDOUT
70
71 The flags may alter the behaviour slightly:
72
73 F1284_NONBLOCK
74 For reads (peripheral to host): if no data is available, return
75 immediately (with E1284_TIMEDOUT).
76
77 For writes (host to peripheral): if the peripheral is not willing
78 to accept data, return immediately (with E1284_TIMEDOUT).
79
80 F1284_SWE
81 Don´t use hardware assistance for the transfer, but instead set the
82 parallel port pins according to the wire protocol.
83
84 F1284_RLE (for ECP only)
85 Use run length encoding. If the peripheral is in ECP mode with RLE,
86 calls to ieee1284_ecp_read_data must set this flag in order for the
87 RLE from the peripheral to be interpreted correctly, and calls to
88 ieee1284_ecp_write_data may set this flag in order to take
89 advantage of RLE.
90
91 F1284_FASTEPP (for EPP only)
92 Use multi-byte transfers. Several bytes at a time are transferred
93 using hardware assistance, if supporting hardware is present. The
94 price of this increased speed is that the return value will be less
95 reliable when this flag is used.
96
97 For ECP mode, a given direction is in force at any particular time, and
98 it is up to the application to ensure that it is only writing when in
99 forward mode, and reading when in reverse mode.
100
102 The return value is the number of bytes successfully transferred or, if
103 negative, one of:
104
105 E1284_NOTIMPL
106 This transfer mode and flags combination is not yet implemented in
107 libieee1284.
108
109 E1284_TIMEDOUT
110 Timed out waiting for peripheral to handshake.
111
112 E1284_NOMEM
113 Not enough memory is available.
114
115 E1284_SYS
116 There was a problem at the operating system level. The global
117 variable errno has been set appropriately.
118
119 E1284_INVALIDPORT
120 The port parameter is invalid (for instance, perhaps the port is
121 not claimed).
122
123 If any bytes are successfully transferred, that number is returned. An
124 error is returned only if no bytes are transferred.
125
126 For host-to-peripheral transfers, all data is at the peripheral by the
127 time the call returns.
128
130 ieee1284_ecp_fwd_to_rev(3)
131
133 Tim Waugh <twaugh@redhat.com>
134 Author.
135
137 Copyright © 2001-2003 Tim Waugh
138
139
140
141[FIXME: source] 07/22/2010 IEEE1284_TRANSFER(3)