Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| IM Profile
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.siemens.icm.io
Class OutPort

    java.lang.Object
      com.siemens.icm.io.OutPort

public class OutPort
extends Object

This class supports the access and configuration of a port of output pins of the general purpose IO driver (GPIO).
The usage of all GPIO ports is restricted to the same interface where the GPIO driver was opened. The paralel access of the GPIO driver by Java and another interface (i.e. AT commnad interface) is not supported.
When the module starts up, all GPIO pins are set to high-impedance state after initializing. Therefore, it is recommended to connect pull-up or pull-down resistors to all GPIO pins you want to use as output. This is necessary to keep these pins from floating or driving any external devices before all settings are done by the output port constructor and after release the output port again.
For example, to create a GPIO port of four output pins:

>           Vector pins = new Vector(4);
>           Vector values = new Vector(4);

>           pins.addElement("GPIO10"); values.addElement(Integer.valueOf("1"));
>           pins.addElement("GPIO3"); values.addElement(Integer.valueOf("0"));
>           pins.addElement("GPIO5"); values.addElement(Integer.valueOf("0"));
>           pins.addElement("GPIO1"); values.addElement(Integer.valueOf("1"));

>           OutPort outport = new OutPort(pins,values);

A group of maximum 10 pins can be configured to act as a parallel port. A pin can only be added once to a port, and only to a port. A maximun of 5 GPIO ports can be configured.

Constructor Summary
`OutPort(Vector pins, Vector values)` Creates a new instance of a GPIO port of output pins.

Method Summary
`Vector` | `getPins()` Gets the given pin configuration of an instance of a GPIO port of output pins.
`int` | `getValue()` Gets the current value of an instance of a GPIO port of output pins.
`void` | `release()` Releases an instance of a GPIO port of output pins.
`void` | `setValue(int portValue)` Sets the current value of an instance of a GPIO port of output pins.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### OutPort

    public OutPort(Vector pins,
                   Vector values)
            throws IOException

  Creates a new instance of a GPIO port of output pins.

Parameters:
  `pins` - pin configuration of port. First pin in vector is the LSB
  `values` - values of pins. First value is value of the LSB
Throws:
  `IOException` - if creating the GPIO port instance fails

Method Detail

### release

    public void release()
                 throws IOException

  Releases an instance of a GPIO port of output pins. The pins of the port are closed as well and can be added to a new port.

  Throws:
    `IOException` - if releasing the GPIO port instance fails

### setValue

    public void setValue(int portValue)
                  throws IOException

  Sets the current value of an instance of a GPIO port of output pins.

  Throws:
    `IOException` - if creating the GPIO port instance failed

### getValue

    public int getValue()
                 throws IOException

  Gets the current value of an instance of a GPIO port of output pins. Getting the state of a port whose width is less than 10 bits, the bits of the returned value that are more significant than the MSB of the port are set to zero.

  Throws:
    `IOException` - if creating the GPIO port instance failed

### getPins

    public Vector getPins()

  Gets the given pin configuration of an instance of a GPIO port of output pins.

  Throws:
    `IOException` - if creating the GPIO port instance failed

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| IM Profile
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Submit a comment or suggestion Version 2.0 of IM Profile Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries. Copyright (c) 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road,Palo Alto, California, 94303, U.S.A. All Rights Reserved.