Port I/O Properties And Methods
Previous  Top  Next

I/O ports control function set includes two major groups of functions: - single input/output by byte (word, double word) and data array input/output.

There are two modes of controlling I/O ports - "Soft Mode" and "Hard Mode". "Soft Mode" provides better speed, but requires a root permissions. "Hard Mode" is slower but provides a very reliable ports access even if you are logged not as root user.

The HardAccess property for switching between the above two modes as well as to verify the current port I/O mode.

The following set of propertiesf is used to read/write single values through port. Their assignment is evident from names and requires no comments.

Port[]  - read/write a byte from/to a port  
PortW[] - read/write a 16-bit word from/to a port  
PortL[] - read/write a 32-bit double word from/to a port  
 
 
Here is an example of how to work with these propertties:

   HW32.Port[$378] := 0x17; // write one byte to the port $378

   a := HW32.Port[$379];    // read one byte from the port $379


TVicHW32 aslo contains a set of methods for read/write data arrays from/to a single port. These functions are based on INSB/INSW/INSD assembly input commands and OUTSB/OUTSW/OUTSD output commands.
Remember, these methods don't provide another exchange algorithm ("handshaking"). They are used only for devices with hardware support of group input/output operations.
You can use these methods, for example, to perform the LPT operations in EPP mode.

List of methods:

ReadPortFIFO   - read an array of bytes  
ReadPortWFIFO  - read an array of words  
ReadPortLFIFO  - read an array of double words  
WritePortFIFO  - write an array of bytes  
WritePortWFIFO - write an array of words  
WritePortLFIFO - write an array of doble words