jcontrol.io
Class GPIO

java.lang.Object
  extended by jcontrol.io.GPIO

public class GPIO
extends Object

Controls JControls available portpins.

The number of ports varies at JControl Modules, for details refer to the tables below.

JControl/BFT

GPIO #connector pin #pin descriptionspecial use
CHANNEL_RS422_BOOTCTL0x100BootCTLconnected to BootCTL-GPIO, used by SerialCommunicator
CHANNEL_RS422_RESETCTL0x101ResetCTLconnected to ResetCTL-GPIO, used by SerialCommunicator


example:
    "GPIO.setState(GPIO.CHANNEL_RS422_BOOTCTL, GPIO.HIGH)" switch the BootCTL-GPIO on     "GPIO.getState(GPIO.CHANNEL_RS422_BOOTCTL)" gets the state of the BootCTL-GPIO


Field Summary
static int CHANNEL_RS422_BOOTCTL
          GPIO Port BOOTCTL
static int CHANNEL_RS422_RESETCTL
          GPIO Port RESETCTL
static int FLOATING
          NOTE: not supported

Represents a floating GPIO input mode.
static boolean HIGH
          Represents the GPIO state "HIGH".
static boolean LOW
          Represents the GPIO state "LOW" Used for input and output channels.
static int OPENDRAIN
          NOTE: not supported

Represents an GPIO output mode with with integrated pullup resistor.
static int OPENDRAIN_HIGH
          NOTE: not supported

Represents a GPIO output mode with with integrated pullup resistor.
static int OPENDRAIN_LOW
          NOTE: not supported

Represents a GPIO output mode with with integrated pullup resistor.
static int PULLUP
          NOTE: not supported

Represents a GPIO input mode with integrated weak pullup resistor.
static int PUSHPULL
          NOTE: not supported

Represents a GPIO Push/Pull output mode.
static int PUSHPULL_HIGH
          NOTE: not supported

Represents a GPIO Push/Pull output mode.
static int PUSHPULL_LOW
          NOTE: not supported

Represents a GPIO Push/Pull output mode.
 
Method Summary
static int getMode(int channel)
          NOTE: not supported

Gets the mode of the given pin.
static boolean getState(int channel)
          Gets the state of a single IO-Pin.
static void setMode(int channel, int mode)
          NOTE: not supported

Sets the mode of the given pin.
static void setState(int channel, boolean state)
          Sets a single IO-Pin.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, notifyAll, toString, wait
 

Field Detail

CHANNEL_RS422_BOOTCTL

public static final int CHANNEL_RS422_BOOTCTL
GPIO Port BOOTCTL

See Also:
Constant Field Values

CHANNEL_RS422_RESETCTL

public static final int CHANNEL_RS422_RESETCTL
GPIO Port RESETCTL

See Also:
Constant Field Values

HIGH

public static final boolean HIGH
Represents the GPIO state "HIGH". Used for input and output channels.

See Also:
setState(int, boolean), getState(int), Constant Field Values

LOW

public static final boolean LOW
Represents the GPIO state "LOW" Used for input and output channels.

See Also:
setState(int, boolean), getState(int), Constant Field Values

FLOATING

public static final int FLOATING
NOTE: not supported

Represents a floating GPIO input mode.

See Also:
setMode(int, int), getMode(int), Constant Field Values

PULLUP

public static final int PULLUP
NOTE: not supported

Represents a GPIO input mode with integrated weak pullup resistor.

See Also:
setMode(int, int), getMode(int), Constant Field Values

OPENDRAIN

public static final int OPENDRAIN
NOTE: not supported

Represents an GPIO output mode with with integrated pullup resistor. The GPIO's output state is undefined.

See Also:
setMode(int, int), getMode(int), Constant Field Values

OPENDRAIN_LOW

public static final int OPENDRAIN_LOW
NOTE: not supported

Represents a GPIO output mode with with integrated pullup resistor. The GPIO's output state is "LOW".

See Also:
setMode(int, int), getMode(int), Constant Field Values

OPENDRAIN_HIGH

public static final int OPENDRAIN_HIGH
NOTE: not supported

Represents a GPIO output mode with with integrated pullup resistor. The GPIO's output state is "HIGH".

See Also:
setMode(int, int), getMode(int), Constant Field Values

PUSHPULL

public static final int PUSHPULL
NOTE: not supported

Represents a GPIO Push/Pull output mode. The GPIO's output state is undefined.

See Also:
setMode(int, int), getMode(int), Constant Field Values

PUSHPULL_LOW

public static final int PUSHPULL_LOW
NOTE: not supported

Represents a GPIO Push/Pull output mode. The GPIO's output state is "LOW".

See Also:
setMode(int, int), getMode(int), Constant Field Values

PUSHPULL_HIGH

public static final int PUSHPULL_HIGH
NOTE: not supported

Represents a GPIO Push/Pull output mode. The GPIO's output state is "LOW".

See Also:
setMode(int, int), getMode(int), Constant Field Values
Method Detail

setState

public static void setState(int channel,
                            boolean state)
Sets a single IO-Pin. The GPIO channel has to be chosen from the tables above alternatively by the constant values of this class.

Parameters:
channel - logical identification number of the pin
state - decides, if the Pin is to be turned HIGH or LOW
See Also:
HIGH, LOW, setMode(int, int)

getState

public static boolean getState(int channel)
Gets the state of a single IO-Pin. The GPIO channel has to be chosen from the tables above alternatively by the constant values of this class..

Parameters:
channel - logical identification number of the pin
Returns:
the level of the selected pin, equals HIGH or LOW.
See Also:
HIGH, LOW

setMode

public static void setMode(int channel,
                           int mode)
NOTE: not supported

Sets the mode of the given pin. The GPIO channel has to be chosen from the tables above. mode is either an input mode identifier or a combination of output mode identifier and a pin level representation.

Parameters:
channel - logical identification number of the pin
mode - a constant or combination of constants, defined in this class
See Also:
getMode(int), FLOATING, PULLUP, OPENDRAIN, OPENDRAIN_LOW, OPENDRAIN_HIGH, PUSHPULL, PUSHPULL_LOW, PUSHPULL_HIGH

getMode

public static int getMode(int channel)
NOTE: not supported

Gets the mode of the given pin. The GPIO channel has to be chosen from the tables above. Returned mode is a combination of input or output mode identifier and a pin level representation.

Parameters:
channel - logical identification number of the pin
Returns:
the current mode
See Also:
setMode(int channel, int mode), FLOATING, PULLUP, OPENDRAIN, OPENDRAIN_LOW, OPENDRAIN_HIGH, PUSHPULL, PUSHPULL_LOW, PUSHPULL_HIGH