com.cesys.cebo.cebomsr
Class DigitalPort

java.lang.Object
  extended by com.cesys.cebo.cebomsr.DigitalPort
All Implemented Interfaces:
Input, Output

public final class DigitalPort
extends java.lang.Object
implements Input, Output

Offers functionality to work with digital ports. Direct construction is not possible. Instances can be retrieved calling getDigitalPorts() of the respective Device instance.

Author:
Thomas Hoppe

Method Summary
 int getIoCount()
          Return count of I/O's for the specified port.
 java.lang.String getIoName(int io)
          Return name of the I/O as specified by io.
 java.lang.String getName()
          Returns name of the component.
 int read()
          Read value currently active on the port.
 void setOutputEnableMask(int mask)
          Set output mask.
 java.lang.String toString()
           
 void write(int value)
          Set output I/O's.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

setOutputEnableMask

public void setOutputEnableMask(int mask)
                         throws java.io.IOException
Set output mask. The default mask is 0.

Parameters:
mask - Mask to use, bits that have state '1' specify output direction.
Throws:
java.io.IOException

getIoCount

public int getIoCount()
Return count of I/O's for the specified port.


read

public int read()
         throws java.io.IOException
Read value currently active on the port.

Throws:
java.io.IOException

write

public void write(int value)
           throws java.io.IOException
Set output I/O's. Only the bits that have been defined as output using setOutputEnableMask() are modified.

Parameters:
value - Value to set on this port.
Throws:
java.io.IOException

getName

public java.lang.String getName()
Returns name of the component.


getIoName

public java.lang.String getIoName(int io)
Return name of the I/O as specified by io.

Parameters:
io - I/O index in range (0 <= io < getIoCount()).

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object