|
From: John T. <gi...@gi...> - 2011-12-15 13:38:42
|
Docs: markup fixes Signed-off-by: John Thornton <jth...@gn...> http://git.linuxcnc.org/?p=emc2.git;a=commitdiff;h=b2f68fc --- docs/src/hal/parallel_port.txt | 189 ++++++++++++++++++++---------------- docs/src/hal/parallel_port_de.txt | 189 ++++++++++++++++++++---------------- docs/src/hal/parallel_port_es.txt | 189 ++++++++++++++++++++---------------- docs/src/hal/parallel_port_pl.txt | 189 ++++++++++++++++++++---------------- 4 files changed, 420 insertions(+), 336 deletions(-) diff --git a/docs/src/hal/parallel_port.txt b/docs/src/hal/parallel_port.txt index 86767ab..9b1a455 100644 --- a/docs/src/hal/parallel_port.txt +++ b/docs/src/hal/parallel_port.txt @@ -1,3 +1,6 @@ +:lang: en +:toc: + = Parallel Port [[sec:Parport]] @@ -19,46 +22,48 @@ provides 4 outputs and 13 inputs. In some parallel ports, the control group pins are open collectors, which may also be driven low by an external gate. On a board with open -collector control pins, the "x" mode allows a more flexible mode with 8 +collector control pins, the 'x' mode allows a more flexible mode with 8 outputs, and 9 inputs. In other parallel ports, the control group has push-pull drivers and cannot be used as an input. .HAL and Open Collectors [NOTE] =========================================================== -HAL cannot automatically determine if the "x" mode bidirectional pins +HAL cannot automatically determine if the 'x' mode bidirectional pins are actually open collectors (OC). If they are not, they cannot be used as inputs, and attempting to drive them LOW from an external source can damage the hardware. -To determine whether your port has "open collector" pins, load -hal_parport in "x" mode. With no device attached, HAL should read the +To determine whether your port has 'open collector' pins, load +hal_parport in 'x' mode. With no device attached, HAL should read the pin as TRUE. Next, insert a 470 ohm resistor from one of the control pins to GND. If the resulting voltage on the control pin is close to 0V, and HAL now reads the pin as FALSE, then you have an OC port. If the resulting voltage is far from 0V, or HAL does not read the -pin as FALSE, then your port cannot be used in "x" mode. +pin as FALSE, then your port cannot be used in 'x' mode. The external hardware that drives the control pins should also use open collector gates (e.g., 74LS05). -On some machines, BIOS settings may affect whether "x" mode can be -used. "SPP" mode is most likely to work. +On some machines, BIOS settings may affect whether 'x' mode can be +used. 'SPP' mode is most likely to work. =========================================================== No other combinations are supported, and a port cannot be changed from input to output once the driver is installed. Figure <<fig:Parport-block-diag>> shows two block diagrams, one showing the driver when the data group is configured for output, and one showing it -configured for input. For "x" mode, refer to the pin listing of -"halcmd show pin" for pin direction assignment. +configured for input. For 'x' mode, refer to the pin listing of +'halcmd show pin' for pin direction assignment. The parport driver can control up to 8 ports (defined by MAX_PORTS in hal_parport.c). The ports are numbered starting at zero. === Installing -+*loadrt hal_parport cfg="<config-string>"*+ +---- +loadrt hal_parport cfg="<config-string>" +---- ==== Using the Port Index @@ -66,125 +71,136 @@ I/O addresses below 16 are treated as port indexes. This is the simplest way to install the parport driver and cooperates with the Linux parport_pc driver if it is loaded. -+*loadrt hal_parport cfg="0"*+ +---- +loadrt hal_parport cfg="0" +---- -Will use the address Linux has detected for parport0. +Will use the address Linux has detected for parport 0. ==== Using the Port Address The configure string consists of a hex port address, followed by an -optional direction, repeated for each port. The direction is "in", -"out", or "x" and determines the direction of the physical pins 2 +optional direction, repeated for each port. The direction is 'in', +'out', or 'x' and determines the direction of the physical pins 2 through 9, and whether to create input HAL pins for the physical control pins. If the direction is not specified, the data group defaults to output. For example: -+*loadrt hal_parport cfg="0x278 0x378 in 0x20A0 out"*+ +---- +loadrt hal_parport cfg="0x278 0x378 in 0x20A0 out" +---- This example installs drivers for one port at 0x0278, with pins 2-9 as -outputs (by default, since neither "in" nor "out" was specified), one +outputs (by default, since neither 'in' nor 'out' was specified), one at 0x0378, with pins 2-9 as inputs, and one at 0x20A0, with pins 2-9 explicitly specified as outputs. Note that you must know the base address of the parallel port to properly configure the driver. For ISA bus ports, this is usually not a problem, since the port is almost -always at a "well known" address, like 0278 or 0378 which is typically +always at a 'well known' address, like 0278 or 0378 which is typically configured in the system BIOS. The address for a PCI card is usually -shown in "lspci -v" in an "I/O ports" line, or in the kernel message -log after executing `"sudo modprobe -a parport_pc`". There is no -default address; if `<config-string>` does not contain at least one +shown in 'lspci -v' in an 'I/O ports' line, or in the kernel message +log after executing 'sudo modprobe -a parport_pc'. There is no +default address; if '<config-string>' does not contain at least one address, it is an error. .Parport Block Diagram[[fig:Parport-block-diag]] -image::images/parport-block-diag.eps[] +image::images/parport-block-diag.png[] === Pins - - `(bit) parport.<portnum>.pin-<pinnum>-out` -- Drives a physical - output pin. - - `(bit) parport.<portnum>.pin-<pinnum>-in` -- Tracks a physical input - pin. - - `(bit) parport.<portnum>.pin-<pinnum>-in-not` -- Tracks a physical - input pin, but inverted. +*parport.<p>.pin-<n>-out* (bit) Drives a physical output pin. + +*parport.<p>.pin-<n>-in* (bit) Tracks a physical input pin. -For each pin, `<portnum>` is the port number, and `<pinnum>` is the +*parport.<p>.pin-<n>-in-not* (bit) Tracks a physical input pin, but inverted. + +For each pin, '<p>' is the port number, and '<n>' is the physical pin number in the 25 pin D-shell connector. For each physical output pin, the driver creates a single HAL pin, for example: -`parport.0.pin-14-out` . + +'parport.0.pin-14-out' . + Pins 2 through 9 are part of the data group and are output pins if the port is defined as an output port. (Output is the default.) Pins 1, 14, 16, and 17 are outputs in all modes. These HAL pins control the state of the corresponding physical pins. -For each physical input pin, the driver creates two HAL pins, for example: + -`parport.0.pin-12-in` and `parport.0.pin-12-in-not` . + +For each physical input pin, the driver creates two HAL pins, for example: +'parport.0.pin-12-in' and 'parport.0.pin-12-in-not' . + Pins 10, 11, 12, 13, and 15 are always input pins. Pins 2 through 9 -are input pins only if the port is defined as an input port. The `-in` +are input pins only if the port is defined as an input port. The '-in' HAL pin is TRUE if the physical pin is high, and FALSE if the -physical pin is low. The `-in-not` HAL pin is inverted -- it is FALSE +physical pin is low. The '-in-not' HAL pin is inverted -- it is FALSE if the physical pin is high. By connecting a signal to one or the other, the user can determine the -state of the input. In "x" mode, pins 1, 14, 16, and 17 are also input +state of the input. In 'x' mode, pins 1, 14, 16, and 17 are also input pins. === Parameters - - `(bit) parport.<portnum>.pin-<pinnum>-out-invert` -- Inverts an - output pin. - - `(bit) parport.<portnum>.pin-<pinnum>-out-reset` (only for "out" - pins) -- TRUE if this pin should be reset when the `-reset` function is - executed. - - `(U32) parport.<portnum>.reset-time` -- The time (in nanoseconds) - between a pin is set by `write` and reset by the `reset` function if it - is enabled. +*parport.<p>.pin-<n>-out-invert* (bit) Inverts an output pin. + +*parport.<p>.pin-<n>-out-reset* (bit) (only for 'out' pins) TRUE if this +pin should be reset when the '-reset' function is executed. -The `-invert` parameter determines whether an output pin is active +*parport.<p>.reset-time* (U32) The time (in nanoseconds) +between a pin is set by 'write' and reset by the 'reset' function if it +is enabled. + +The '-invert' parameter determines whether an output pin is active high or active - low. If `-invert` is FALSE, setting the HAL `-out` pin TRUE drives the -physical pin high, and FALSE drives it low. If `-invert` is TRUE, then -setting the HAL `-out` pin TRUE will drive the physical pin low. + low. If '-invert' is FALSE, setting the HAL '-out' pin TRUE drives the +physical pin high, and FALSE drives it low. If '-invert' is TRUE, then +setting the HAL '-out' pin TRUE will drive the physical pin low. === Functions - - `(funct) parport.<portnum>.read`-- Reads physical input pins of port - `<portnum>` and updates HAL `-in` and `-in-not` pins. - - `(funct) parport.read-all` -- Reads physical input pins of all ports - and updates HAL `-in` and `-in-not` pins. - - `(funct) parport.<portnum>.write` -- Reads HAL `-out` pins of port - `<portnum>` and updates that port's physical output pins. - - `(funct) parport.write-all` -- Reads HAL `-out` pins of all ports +*parport.<p>.read* (funct) Reads physical input pins of port + '<portnum>' and updates HAL '-in' and '-in-not' pins. + +*parport.read-all* (funct) Reads physical input pins of all ports + and updates HAL '-in' and '-in-not' pins. + +*parport.<p>.write* (funct) Reads HAL '-out' pins of port + '<p>' and updates that port's physical output pins. + +*parport.write-all* (funct) Reads HAL '-out' pins of all ports and updates all physical output pins. - - `(funct) parport.<portnum>.reset` -- Waits until `reset-time` has - elapsed since the associated `write`, then resets pins to values - indicated by `-out-invert` and `-out-invert` settings. `reset` must be - later in the same thread as `write. `If `-reset` is TRUE, then the - `reset` function will set the pin to the value of `-out-invert`. This - can be used in conjunction with stepgen's `doublefreq` to produce one + +*parport.<p>.reset* (funct) Waits until 'reset-time' has + elapsed since the associated 'write', then resets pins to values + indicated by '-out-invert' and '-out-invert' settings. 'reset' must be + later in the same thread as 'write. 'If '-reset' is TRUE, then the + 'reset' function will set the pin to the value of '-out-invert'. This + can be used in conjunction with stepgen's 'doublefreq' to produce one step per period. The stepgen stepspace for that pin must be set to 0 to enable doublefreq. The individual functions are provided for situations where one port needs to be updated in a very fast thread, but other ports can be updated in a slower thread to save CPU time. It is probably not a good -idea to use both an `-all` function and an individual function at the +idea to use both an '-all' function and an individual function at the same time. === Common problems If loading the module reports - insmod: error inserting '/home/jepler/emc2/rtlib/hal_parport.ko': - -1 Device or resource busy +---- +insmod: error inserting '/home/jepler/emc2/rtlib/hal_parport.ko': +-1 Device or resource busy +---- -then ensure that the standard kernel module `parport_pc` is not +then ensure that the standard kernel module 'parport_pc' is not loadedfootnote:[In the EMC packages for Ubuntu, the file /etc/modprobe.d/emc2 -generally prevents `parport_pc` from being automatically loaded.] +generally prevents 'parport_pc' from being automatically loaded.] and that no other device in the system has claimed the I/O ports. If the module loads but does not appear to function, then the port -address is incorrect or the `probe_parport` module is required. +address is incorrect or the 'probe_parport' module is required. === Using DoubleStep @@ -196,39 +212,44 @@ specificed by parport.n.reset-time. For example: - loadrt hal_parport cfg="0x378 out" - setp parport.0.reset-time 5000 - loadrt stepgen step_type=0,0,0 - addf parport.0.read base-thread - addf stepgen.make-pulses base-thread - addf parport.0.write base-thread - addf parport.0.reset base-thread - addf stepgen.capture-position servo-thread - ... - setp stepgen.0.steplen 1 - setp stepgen.0.stepspace 0 +---- +loadrt hal_parport cfg="0x378 out" +setp parport.0.reset-time 5000 +loadrt stepgen step_type=0,0,0 +addf parport.0.read base-thread +addf stepgen.make-pulses base-thread +addf parport.0.write base-thread +addf parport.0.reset base-thread +addf stepgen.capture-position servo-thread +... +setp stepgen.0.steplen 1 +setp stepgen.0.stepspace 0 +---- [[sec:probe_parport]] == probe_parport In modern PCs, the parallel port may require plug and play (PNP) -configuration before it can be used. The `probe_parport` module +configuration before it can be used. The 'probe_parport' module performs configuration of any PNP ports present, and should be -loaded before `hal_parport`. On machines without PNP ports, it may be +loaded before 'hal_parport'. On machines without PNP ports, it may be loaded but has no effect. === Installing -+loadrt probe_parport+ - -+loadrt hal_parport ...+ +---- +loadrt probe_parport +loadrt hal_parport ... +---- If the Linux kernel prints a message similar to -+parport: PnPBIOS parport detected.+ +---- +parport: PnPBIOS parport detected. +---- -when the parport_pc module is loaded (`sudo modprobe -a parport_pc; -sudo rmmod parport_pc)` then use of this module is probably required. +when the parport_pc module is loaded ('sudo modprobe -a parport_pc; +sudo rmmod parport_pc)' then use of this module is probably required. diff --git a/docs/src/hal/parallel_port_de.txt b/docs/src/hal/parallel_port_de.txt index 8bda67a..6ab2d87 100644 --- a/docs/src/hal/parallel_port_de.txt +++ b/docs/src/hal/parallel_port_de.txt @@ -1,3 +1,6 @@ +:lang: de +:toc: + = Parallel Port [[sec:Parport]] @@ -19,46 +22,48 @@ provides 4 outputs and 13 inputs. In some parallel ports, the control group pins are open collectors, which may also be driven low by an external gate. On a board with open -collector control pins, the "x" mode allows a more flexible mode with 8 +collector control pins, the 'x' mode allows a more flexible mode with 8 outputs, and 9 inputs. In other parallel ports, the control group has push-pull drivers and cannot be used as an input. .HAL and Open Collectors [NOTE] =========================================================== -HAL cannot automatically determine if the "x" mode bidirectional pins +HAL cannot automatically determine if the 'x' mode bidirectional pins are actually open collectors (OC). If they are not, they cannot be used as inputs, and attempting to drive them LOW from an external source can damage the hardware. -To determine whether your port has "open collector" pins, load -hal_parport in "x" mode. With no device attached, HAL should read the +To determine whether your port has 'open collector' pins, load +hal_parport in 'x' mode. With no device attached, HAL should read the pin as TRUE. Next, insert a 470 ohm resistor from one of the control pins to GND. If the resulting voltage on the control pin is close to 0V, and HAL now reads the pin as FALSE, then you have an OC port. If the resulting voltage is far from 0V, or HAL does not read the -pin as FALSE, then your port cannot be used in "x" mode. +pin as FALSE, then your port cannot be used in 'x' mode. The external hardware that drives the control pins should also use open collector gates (e.g., 74LS05). -On some machines, BIOS settings may affect whether "x" mode can be -used. "SPP" mode is most likely to work. +On some machines, BIOS settings may affect whether 'x' mode can be +used. 'SPP' mode is most likely to work. =========================================================== No other combinations are supported, and a port cannot be changed from input to output once the driver is installed. Figure <<fig:Parport-block-diag>> shows two block diagrams, one showing the driver when the data group is configured for output, and one showing it -configured for input. For "x" mode, refer to the pin listing of -"halcmd show pin" for pin direction assignment. +configured for input. For 'x' mode, refer to the pin listing of +'halcmd show pin' for pin direction assignment. The parport driver can control up to 8 ports (defined by MAX_PORTS in hal_parport.c). The ports are numbered starting at zero. === Installing -+*loadrt hal_parport cfg="<config-string>"*+ +---- +loadrt hal_parport cfg="<config-string>" +---- ==== Using the Port Index @@ -66,125 +71,136 @@ I/O addresses below 16 are treated as port indexes. This is the simplest way to install the parport driver and cooperates with the Linux parport_pc driver if it is loaded. -+*loadrt hal_parport cfg="0"*+ +---- +loadrt hal_parport cfg="0" +---- -Will use the address Linux has detected for parport0. +Will use the address Linux has detected for parport 0. ==== Using the Port Address The configure string consists of a hex port address, followed by an -optional direction, repeated for each port. The direction is "in", -"out", or "x" and determines the direction of the physical pins 2 +optional direction, repeated for each port. The direction is 'in', +'out', or 'x' and determines the direction of the physical pins 2 through 9, and whether to create input HAL pins for the physical control pins. If the direction is not specified, the data group defaults to output. For example: -+*loadrt hal_parport cfg="0x278 0x378 in 0x20A0 out"*+ +---- +loadrt hal_parport cfg="0x278 0x378 in 0x20A0 out" +---- This example installs drivers for one port at 0x0278, with pins 2-9 as -outputs (by default, since neither "in" nor "out" was specified), one +outputs (by default, since neither 'in' nor 'out' was specified), one at 0x0378, with pins 2-9 as inputs, and one at 0x20A0, with pins 2-9 explicitly specified as outputs. Note that you must know the base address of the parallel port to properly configure the driver. For ISA bus ports, this is usually not a problem, since the port is almost -always at a "well known" address, like 0278 or 0378 which is typically +always at a 'well known' address, like 0278 or 0378 which is typically configured in the system BIOS. The address for a PCI card is usually -shown in "lspci -v" in an "I/O ports" line, or in the kernel message -log after executing `"sudo modprobe -a parport_pc`". There is no -default address; if `<config-string>` does not contain at least one +shown in 'lspci -v' in an 'I/O ports' line, or in the kernel message +log after executing 'sudo modprobe -a parport_pc'. There is no +default address; if '<config-string>' does not contain at least one address, it is an error. .Parport Block Diagram[[fig:Parport-block-diag]] -image::images/parport-block-diag.eps[] +image::images/parport-block-diag.png[] === Pins - - `(bit) parport.<portnum>.pin-<pinnum>-out` -- Drives a physical - output pin. - - `(bit) parport.<portnum>.pin-<pinnum>-in` -- Tracks a physical input - pin. - - `(bit) parport.<portnum>.pin-<pinnum>-in-not` -- Tracks a physical - input pin, but inverted. +*parport.<p>.pin-<n>-out* (bit) Drives a physical output pin. + +*parport.<p>.pin-<n>-in* (bit) Tracks a physical input pin. -For each pin, `<portnum>` is the port number, and `<pinnum>` is the +*parport.<p>.pin-<n>-in-not* (bit) Tracks a physical input pin, but inverted. + +For each pin, '<p>' is the port number, and '<n>' is the physical pin number in the 25 pin D-shell connector. For each physical output pin, the driver creates a single HAL pin, for example: -`parport.0.pin-14-out` . + +'parport.0.pin-14-out' . + Pins 2 through 9 are part of the data group and are output pins if the port is defined as an output port. (Output is the default.) Pins 1, 14, 16, and 17 are outputs in all modes. These HAL pins control the state of the corresponding physical pins. -For each physical input pin, the driver creates two HAL pins, for example: -`parport.0.pin-12-in` and `parport.0.pin-12-in-not` . + +For each physical input pin, the driver creates two HAL pins, for example: +'parport.0.pin-12-in' and 'parport.0.pin-12-in-not' . + Pins 10, 11, 12, 13, and 15 are always input pins. Pins 2 through 9 -are input pins only if the port is defined as an input port. The `-in` +are input pins only if the port is defined as an input port. The '-in' HAL pin is TRUE if the physical pin is high, and FALSE if the -physical pin is low. The `-in-not` HAL pin is inverted -- it is FALSE +physical pin is low. The '-in-not' HAL pin is inverted -- it is FALSE if the physical pin is high. By connecting a signal to one or the other, the user can determine the -state of the input. In "x" mode, pins 1, 14, 16, and 17 are also input +state of the input. In 'x' mode, pins 1, 14, 16, and 17 are also input pins. === Parameters - - `(bit) parport.<portnum>.pin-<pinnum>-out-invert` -- Inverts an - output pin. - - `(bit) parport.<portnum>.pin-<pinnum>-out-reset` (only for "out" - pins) -- TRUE if this pin should be reset when the `-reset` function is - executed. - - `(U32) parport.<portnum>.reset-time` -- The time (in nanoseconds) - between a pin is set by `write` and reset by the `reset` function if it - is enabled. +*parport.<p>.pin-<n>-out-invert* (bit) Inverts an output pin. + +*parport.<p>.pin-<n>-out-reset* (bit) (only for 'out' pins) TRUE if this +pin should be reset when the '-reset' function is executed. -The `-invert` parameter determines whether an output pin is active +*parport.<p>.reset-time* (U32) The time (in nanoseconds) +between a pin is set by 'write' and reset by the 'reset' function if it +is enabled. + +The '-invert' parameter determines whether an output pin is active high or active - low. If `-invert` is FALSE, setting the HAL `-out` pin TRUE drives the -physical pin high, and FALSE drives it low. If `-invert` is TRUE, then -setting the HAL `-out` pin TRUE will drive the physical pin low. + low. If '-invert' is FALSE, setting the HAL '-out' pin TRUE drives the +physical pin high, and FALSE drives it low. If '-invert' is TRUE, then +setting the HAL '-out' pin TRUE will drive the physical pin low. === Functions - - `(funct) parport.<portnum>.read`-- Reads physical input pins of port - `<portnum>` and updates HAL `-in` and `-in-not` pins. - - `(funct) parport.read-all` -- Reads physical input pins of all ports - and updates HAL `-in` and `-in-not` pins. - - `(funct) parport.<portnum>.write` -- Reads HAL `-out` pins of port - `<portnum>` and updates that port's physical output pins. - - `(funct) parport.write-all` -- Reads HAL `-out` pins of all ports +*parport.<p>.read* (funct) Reads physical input pins of port + '<portnum>' and updates HAL '-in' and '-in-not' pins. + +*parport.read-all* (funct) Reads physical input pins of all ports + and updates HAL '-in' and '-in-not' pins. + +*parport.<p>.write* (funct) Reads HAL '-out' pins of port + '<p>' and updates that port's physical output pins. + +*parport.write-all* (funct) Reads HAL '-out' pins of all ports and updates all physical output pins. - - `(funct) parport.<portnum>.reset` -- Waits until `reset-time` has - elapsed since the associated `write`, then resets pins to values - indicated by `-out-invert` and `-out-invert` settings. `reset` must be - later in the same thread as `write. `If `-reset` is TRUE, then the - `reset` function will set the pin to the value of `-out-invert`. This - can be used in conjunction with stepgen's `doublefreq` to produce one + +*parport.<p>.reset* (funct) Waits until 'reset-time' has + elapsed since the associated 'write', then resets pins to values + indicated by '-out-invert' and '-out-invert' settings. 'reset' must be + later in the same thread as 'write. 'If '-reset' is TRUE, then the + 'reset' function will set the pin to the value of '-out-invert'. This + can be used in conjunction with stepgen's 'doublefreq' to produce one step per period. The stepgen stepspace for that pin must be set to 0 to enable doublefreq. The individual functions are provided for situations where one port needs to be updated in a very fast thread, but other ports can be updated in a slower thread to save CPU time. It is probably not a good -idea to use both an `-all` function and an individual function at the +idea to use both an '-all' function and an individual function at the same time. === Common problems If loading the module reports - insmod: error inserting '/home/jepler/emc2/rtlib/hal_parport.ko': - -1 Device or resource busy +---- +insmod: error inserting '/home/jepler/emc2/rtlib/hal_parport.ko': +-1 Device or resource busy +---- -then ensure that the standard kernel module `parport_pc` is not +then ensure that the standard kernel module 'parport_pc' is not loadedfootnote:[In the EMC packages for Ubuntu, the file /etc/modprobe.d/emc2 -generally prevents `parport_pc` from being automatically loaded.] +generally prevents 'parport_pc' from being automatically loaded.] and that no other device in the system has claimed the I/O ports. If the module loads but does not appear to function, then the port -address is incorrect or the `probe_parport` module is required. +address is incorrect or the 'probe_parport' module is required. === Using DoubleStep @@ -196,39 +212,44 @@ specificed by parport.n.reset-time. For example: - loadrt hal_parport cfg="0x378 out" - setp parport.0.reset-time 5000 - loadrt stepgen step_type=0,0,0 - addf parport.0.read base-thread - addf stepgen.make-pulses base-thread - addf parport.0.write base-thread - addf parport.0.reset base-thread - addf stepgen.capture-position servo-thread - ... - setp stepgen.0.steplen 1 - setp stepgen.0.stepspace 0 +---- +loadrt hal_parport cfg="0x378 out" +setp parport.0.reset-time 5000 +loadrt stepgen step_type=0,0,0 +addf parport.0.read base-thread +addf stepgen.make-pulses base-thread +addf parport.0.write base-thread +addf parport.0.reset base-thread +addf stepgen.capture-position servo-thread +... +setp stepgen.0.steplen 1 +setp stepgen.0.stepspace 0 +---- [[sec:probe_parport]] == probe_parport In modern PCs, the parallel port may require plug and play (PNP) -configuration before it can be used. The `probe_parport` module +configuration before it can be used. The 'probe_parport' module performs configuration of any PNP ports present, and should be -loaded before `hal_parport`. On machines without PNP ports, it may be +loaded before 'hal_parport'. On machines without PNP ports, it may be loaded but has no effect. === Installing -+loadrt probe_parport+ - -+loadrt hal_parport ...+ +---- +loadrt probe_parport +loadrt hal_parport ... +---- If the Linux kernel prints a message similar to -+parport: PnPBIOS parport detected.+ +---- +parport: PnPBIOS parport detected. +---- -when the parport_pc module is loaded (`sudo modprobe -a parport_pc; -sudo rmmod parport_pc)` then use of this module is probably required. +when the parport_pc module is loaded ('sudo modprobe -a parport_pc; +sudo rmmod parport_pc)' then use of this module is probably required. diff --git a/docs/src/hal/parallel_port_es.txt b/docs/src/hal/parallel_port_es.txt index 8bda67a..7bd7944 100644 --- a/docs/src/hal/parallel_port_es.txt +++ b/docs/src/hal/parallel_port_es.txt @@ -1,3 +1,6 @@ +:lang: es +:toc: + = Parallel Port [[sec:Parport]] @@ -19,46 +22,48 @@ provides 4 outputs and 13 inputs. In some parallel ports, the control group pins are open collectors, which may also be driven low by an external gate. On a board with open -collector control pins, the "x" mode allows a more flexible mode with 8 +collector control pins, the 'x' mode allows a more flexible mode with 8 outputs, and 9 inputs. In other parallel ports, the control group has push-pull drivers and cannot be used as an input. .HAL and Open Collectors [NOTE] =========================================================== -HAL cannot automatically determine if the "x" mode bidirectional pins +HAL cannot automatically determine if the 'x' mode bidirectional pins are actually open collectors (OC). If they are not, they cannot be used as inputs, and attempting to drive them LOW from an external source can damage the hardware. -To determine whether your port has "open collector" pins, load -hal_parport in "x" mode. With no device attached, HAL should read the +To determine whether your port has 'open collector' pins, load +hal_parport in 'x' mode. With no device attached, HAL should read the pin as TRUE. Next, insert a 470 ohm resistor from one of the control pins to GND. If the resulting voltage on the control pin is close to 0V, and HAL now reads the pin as FALSE, then you have an OC port. If the resulting voltage is far from 0V, or HAL does not read the -pin as FALSE, then your port cannot be used in "x" mode. +pin as FALSE, then your port cannot be used in 'x' mode. The external hardware that drives the control pins should also use open collector gates (e.g., 74LS05). -On some machines, BIOS settings may affect whether "x" mode can be -used. "SPP" mode is most likely to work. +On some machines, BIOS settings may affect whether 'x' mode can be +used. 'SPP' mode is most likely to work. =========================================================== No other combinations are supported, and a port cannot be changed from input to output once the driver is installed. Figure <<fig:Parport-block-diag>> shows two block diagrams, one showing the driver when the data group is configured for output, and one showing it -configured for input. For "x" mode, refer to the pin listing of -"halcmd show pin" for pin direction assignment. +configured for input. For 'x' mode, refer to the pin listing of +'halcmd show pin' for pin direction assignment. The parport driver can control up to 8 ports (defined by MAX_PORTS in hal_parport.c). The ports are numbered starting at zero. === Installing -+*loadrt hal_parport cfg="<config-string>"*+ +---- +loadrt hal_parport cfg="<config-string>" +---- ==== Using the Port Index @@ -66,125 +71,136 @@ I/O addresses below 16 are treated as port indexes. This is the simplest way to install the parport driver and cooperates with the Linux parport_pc driver if it is loaded. -+*loadrt hal_parport cfg="0"*+ +---- +loadrt hal_parport cfg="0" +---- -Will use the address Linux has detected for parport0. +Will use the address Linux has detected for parport 0. ==== Using the Port Address The configure string consists of a hex port address, followed by an -optional direction, repeated for each port. The direction is "in", -"out", or "x" and determines the direction of the physical pins 2 +optional direction, repeated for each port. The direction is 'in', +'out', or 'x' and determines the direction of the physical pins 2 through 9, and whether to create input HAL pins for the physical control pins. If the direction is not specified, the data group defaults to output. For example: -+*loadrt hal_parport cfg="0x278 0x378 in 0x20A0 out"*+ +---- +loadrt hal_parport cfg="0x278 0x378 in 0x20A0 out" +---- This example installs drivers for one port at 0x0278, with pins 2-9 as -outputs (by default, since neither "in" nor "out" was specified), one +outputs (by default, since neither 'in' nor 'out' was specified), one at 0x0378, with pins 2-9 as inputs, and one at 0x20A0, with pins 2-9 explicitly specified as outputs. Note that you must know the base address of the parallel port to properly configure the driver. For ISA bus ports, this is usually not a problem, since the port is almost -always at a "well known" address, like 0278 or 0378 which is typically +always at a 'well known' address, like 0278 or 0378 which is typically configured in the system BIOS. The address for a PCI card is usually -shown in "lspci -v" in an "I/O ports" line, or in the kernel message -log after executing `"sudo modprobe -a parport_pc`". There is no -default address; if `<config-string>` does not contain at least one +shown in 'lspci -v' in an 'I/O ports' line, or in the kernel message +log after executing 'sudo modprobe -a parport_pc'. There is no +default address; if '<config-string>' does not contain at least one address, it is an error. .Parport Block Diagram[[fig:Parport-block-diag]] -image::images/parport-block-diag.eps[] +image::images/parport-block-diag.png[] === Pins - - `(bit) parport.<portnum>.pin-<pinnum>-out` -- Drives a physical - output pin. - - `(bit) parport.<portnum>.pin-<pinnum>-in` -- Tracks a physical input - pin. - - `(bit) parport.<portnum>.pin-<pinnum>-in-not` -- Tracks a physical - input pin, but inverted. +*parport.<p>.pin-<n>-out* (bit) Drives a physical output pin. + +*parport.<p>.pin-<n>-in* (bit) Tracks a physical input pin. -For each pin, `<portnum>` is the port number, and `<pinnum>` is the +*parport.<p>.pin-<n>-in-not* (bit) Tracks a physical input pin, but inverted. + +For each pin, '<p>' is the port number, and '<n>' is the physical pin number in the 25 pin D-shell connector. For each physical output pin, the driver creates a single HAL pin, for example: -`parport.0.pin-14-out` . + +'parport.0.pin-14-out' . + Pins 2 through 9 are part of the data group and are output pins if the port is defined as an output port. (Output is the default.) Pins 1, 14, 16, and 17 are outputs in all modes. These HAL pins control the state of the corresponding physical pins. -For each physical input pin, the driver creates two HAL pins, for example: -`parport.0.pin-12-in` and `parport.0.pin-12-in-not` . + +For each physical input pin, the driver creates two HAL pins, for example: +'parport.0.pin-12-in' and 'parport.0.pin-12-in-not' . + Pins 10, 11, 12, 13, and 15 are always input pins. Pins 2 through 9 -are input pins only if the port is defined as an input port. The `-in` +are input pins only if the port is defined as an input port. The '-in' HAL pin is TRUE if the physical pin is high, and FALSE if the -physical pin is low. The `-in-not` HAL pin is inverted -- it is FALSE +physical pin is low. The '-in-not' HAL pin is inverted -- it is FALSE if the physical pin is high. By connecting a signal to one or the other, the user can determine the -state of the input. In "x" mode, pins 1, 14, 16, and 17 are also input +state of the input. In 'x' mode, pins 1, 14, 16, and 17 are also input pins. === Parameters - - `(bit) parport.<portnum>.pin-<pinnum>-out-invert` -- Inverts an - output pin. - - `(bit) parport.<portnum>.pin-<pinnum>-out-reset` (only for "out" - pins) -- TRUE if this pin should be reset when the `-reset` function is - executed. - - `(U32) parport.<portnum>.reset-time` -- The time (in nanoseconds) - between a pin is set by `write` and reset by the `reset` function if it - is enabled. +*parport.<p>.pin-<n>-out-invert* (bit) Inverts an output pin. + +*parport.<p>.pin-<n>-out-reset* (bit) (only for 'out' pins) TRUE if this +pin should be reset when the '-reset' function is executed. -The `-invert` parameter determines whether an output pin is active +*parport.<p>.reset-time* (U32) The time (in nanoseconds) +between a pin is set by 'write' and reset by the 'reset' function if it +is enabled. + +The '-invert' parameter determines whether an output pin is active high or active - low. If `-invert` is FALSE, setting the HAL `-out` pin TRUE drives the -physical pin high, and FALSE drives it low. If `-invert` is TRUE, then -setting the HAL `-out` pin TRUE will drive the physical pin low. + low. If '-invert' is FALSE, setting the HAL '-out' pin TRUE drives the +physical pin high, and FALSE drives it low. If '-invert' is TRUE, then +setting the HAL '-out' pin TRUE will drive the physical pin low. === Functions - - `(funct) parport.<portnum>.read`-- Reads physical input pins of port - `<portnum>` and updates HAL `-in` and `-in-not` pins. - - `(funct) parport.read-all` -- Reads physical input pins of all ports - and updates HAL `-in` and `-in-not` pins. - - `(funct) parport.<portnum>.write` -- Reads HAL `-out` pins of port - `<portnum>` and updates that port's physical output pins. - - `(funct) parport.write-all` -- Reads HAL `-out` pins of all ports +*parport.<p>.read* (funct) Reads physical input pins of port + '<portnum>' and updates HAL '-in' and '-in-not' pins. + +*parport.read-all* (funct) Reads physical input pins of all ports + and updates HAL '-in' and '-in-not' pins. + +*parport.<p>.write* (funct) Reads HAL '-out' pins of port + '<p>' and updates that port's physical output pins. + +*parport.write-all* (funct) Reads HAL '-out' pins of all ports and updates all physical output pins. - - `(funct) parport.<portnum>.reset` -- Waits until `reset-time` has - elapsed since the associated `write`, then resets pins to values - indicated by `-out-invert` and `-out-invert` settings. `reset` must be - later in the same thread as `write. `If `-reset` is TRUE, then the - `reset` function will set the pin to the value of `-out-invert`. This - can be used in conjunction with stepgen's `doublefreq` to produce one + +*parport.<p>.reset* (funct) Waits until 'reset-time' has + elapsed since the associated 'write', then resets pins to values + indicated by '-out-invert' and '-out-invert' settings. 'reset' must be + later in the same thread as 'write. 'If '-reset' is TRUE, then the + 'reset' function will set the pin to the value of '-out-invert'. This + can be used in conjunction with stepgen's 'doublefreq' to produce one step per period. The stepgen stepspace for that pin must be set to 0 to enable doublefreq. The individual functions are provided for situations where one port needs to be updated in a very fast thread, but other ports can be updated in a slower thread to save CPU time. It is probably not a good -idea to use both an `-all` function and an individual function at the +idea to use both an '-all' function and an individual function at the same time. === Common problems If loading the module reports - insmod: error inserting '/home/jepler/emc2/rtlib/hal_parport.ko': - -1 Device or resource busy +---- +insmod: error inserting '/home/jepler/emc2/rtlib/hal_parport.ko': +-1 Device or resource busy +---- -then ensure that the standard kernel module `parport_pc` is not +then ensure that the standard kernel module 'parport_pc' is not loadedfootnote:[In the EMC packages for Ubuntu, the file /etc/modprobe.d/emc2 -generally prevents `parport_pc` from being automatically loaded.] +generally prevents 'parport_pc' from being automatically loaded.] and that no other device in the system has claimed the I/O ports. If the module loads but does not appear to function, then the port -address is incorrect or the `probe_parport` module is required. +address is incorrect or the 'probe_parport' module is required. === Using DoubleStep @@ -196,39 +212,44 @@ specificed by parport.n.reset-time. For example: - loadrt hal_parport cfg="0x378 out" - setp parport.0.reset-time 5000 - loadrt stepgen step_type=0,0,0 - addf parport.0.read base-thread - addf stepgen.make-pulses base-thread - addf parport.0.write base-thread - addf parport.0.reset base-thread - addf stepgen.capture-position servo-thread - ... - setp stepgen.0.steplen 1 - setp stepgen.0.stepspace 0 +---- +loadrt hal_parport cfg="0x378 out" +setp parport.0.reset-time 5000 +loadrt stepgen step_type=0,0,0 +addf parport.0.read base-thread +addf stepgen.make-pulses base-thread +addf parport.0.write base-thread +addf parport.0.reset base-thread +addf stepgen.capture-position servo-thread +... +setp stepgen.0.steplen 1 +setp stepgen.0.stepspace 0 +---- [[sec:probe_parport]] == probe_parport In modern PCs, the parallel port may require plug and play (PNP) -configuration before it can be used. The `probe_parport` module +configuration before it can be used. The 'probe_parport' module performs configuration of any PNP ports present, and should be -loaded before `hal_parport`. On machines without PNP ports, it may be +loaded before 'hal_parport'. On machines without PNP ports, it may be loaded but has no effect. === Installing -+loadrt probe_parport+ - -+loadrt hal_parport ...+ +---- +loadrt probe_parport +loadrt hal_parport ... +---- If the Linux kernel prints a message similar to -+parport: PnPBIOS parport detected.+ +---- +parport: PnPBIOS parport detected. +---- -when the parport_pc module is loaded (`sudo modprobe -a parport_pc; -sudo rmmod parport_pc)` then use of this module is probably required. +when the parport_pc module is loaded ('sudo modprobe -a parport_pc; +sudo rmmod parport_pc)' then use of this module is probably required. diff --git a/docs/src/hal/parallel_port_pl.txt b/docs/src/hal/parallel_port_pl.txt index 86767ab..8ca0e33 100644 --- a/docs/src/hal/parallel_port_pl.txt |