www.riscos.com Technical Support: |
|
This module provides parallel device support. It is not available in RISC OS 2. The module is a client of DeviceFS and can be accessed via that system.
It will setup PrinterType$1 to point at its DeviceFS object, ie:
The module supports SWIs to allow the 82C710 or 82C711 chip driving the parallel port to be directly accessed (if present - some machines use other chips).
The 'parallel:' device can be opened for output (eg to a printer) or input but not for both. The input stream is only available on machines which use an 710/711 controller.
The output stream uses standard parallel printer handshaking, and can send data to many types of printer. In the absence of any standard parallel input protocol the input stream has been provided mainly as a means of passing data between one machine and another (eg downloading data from a portable to a master machine). The input device driver behaves like a printer, and can therefore accept data from another machine which is 'printing' from its parallel port. To enable such data transfer a twisted cable must be made with the following connections:
Pin | Signal | Direction | Pin | Signal | Direction |
---|---|---|---|---|---|
1 | /STROBE | O | 10 | /ACK | I |
2 | DATA 0 | I/O | 2 | DATA 0 | I/O |
3 | DATA 1 | I/O | 3 | DATA 1 | I/O |
4 | DATA 2 | I/O | 4 | DATA 2 | I/O |
5 | DATA 3 | I/O | 5 | DATA 3 | I/O |
6 | DATA 4 | I/O | 6 | DATA 4 | I/O |
7 | DATA 5 | I/O | 7 | DATA 5 | I/O |
8 | DATA 6 | I/O | 8 | DATA 6 | I/O |
9 | DATA 7 | I/O | 9 | DATA 7 | I/O |
10 | /ACK | I | 1 | /STROBE | O |
11 | BUSY | I | 17 | /SLCTIN | O |
17 | /SLCTIN | O | 11 | BUSY | I |
Either end of such a cable can be connected to a sending or receiving machine. Note that sending (ie 'printing') machines do not need to be Acorn products, so you can use the parallel input device to transfer data from, for example, a PC.
To send data, the 'parallel:' device should be opened for output as if it were a file. Data can then be written to the open device which should be closed when no more data is to be sent (*Copy file printer#parallel: does this). At the receiving end the 'parallel:' device should be opened for input, the bytes should be read, and then the device should be closed.
This call is for internal use only. Do not use it; use the SWI Parallel_Op instead.
R0 = reason code
other registers are reason code dependent
R0 preserved
other registers are reason code dependent
Interrupt status is undefined
Fast interrupts are enabled
Processor is in SVC mode
Not defined
This call provides low level parallel operations, which are only available with newer hardware that uses the 710/711 family of controllers (such as the A5000). The SWI returns an error for (older) machines on which a 710/711 is not present.
The action of the call depends on the reason code passed in R0:
R0 | Action | Page |
---|---|---|
0 | read data and status registers | Parallel_Op 0 |
1 | write data register | Parallel_Op 1 |
2 | read/write control register | Parallel_Op 2 |
This call is not available in RISC OS 2, or in RISC OS 3.00.
The call is provided to allow you to drive the 82C710/82C711 for yourself. If you intend to drive the hardware directly then you should open the parallel: device. For example:
lock = OPENOUT("parallel:") ... play around with hardware ... CLOSE#lock
This stops any other application altering the values that you have setup, preventing any possible confusion.
None
R0 = 0
R0 preserved
R1 = contents of the parallel data register
R2 = contents of the parallel status register
This call is used to obtain the current state of the parallel data lines and status register. The bits in the read only parallel status register correspond to the following inputs:
Bits 8 to 31 of R2 are undefined. See the 82C710/82C711 data sheet for a description of these bits. If the DIR bit in the parallel control register (see The bits in this value correspond to the following outputs:) is 0 (ie output) then the contents of the data register will be the same as the last data value written. The data register is read after the status register.
Writes the parallel data register
R0 = 1
R1 = data
R0, R1 preserved
This call is used to write a byte to the parallel data lines. This will only have an effect if the DIR bit in the parallel control register (see The bits in this value correspond to the following outputs:) is 0 (ie output).
R0 = 2
R1 = EOR mask
R2 = AND mask
R0 preserved
R1 = old contents of the parallel control register
R2 = new contents of the parallel control register
This call is used to read or write the current state of the parallel control register. The new state is determined by:
new state = (old state AND R2) EOR R1
The bits in this value correspond to the following outputs:
Bits 8 to 31 are undefined and must not be modified. See the 82C710/82C711 data sheet for a description of these bits. These lines are output only, but their current state can be read without changing them by setting R1 = 0 and R2 = &FFFFFFFF. The interrupt enable bit, IRQEN, should normally be 1 and interrupt disabling should be done in IOC.