public class BrickletIO4 extends Device
Modifier and Type | Class and Description |
---|---|
class |
BrickletIO4.Configuration |
class |
BrickletIO4.EdgeCountConfig |
static interface |
BrickletIO4.InterruptListener
This listener is triggered whenever a change of the voltage level is detected
on pins where the interrupt was activated with
setInterrupt(short) . |
class |
BrickletIO4.Monoflop |
static interface |
BrickletIO4.MonoflopDoneListener
This listener is triggered whenever a monoflop timer reaches 0.
|
Device.Identity
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEVICE_DISPLAY_NAME |
static int |
DEVICE_IDENTIFIER |
static char |
DIRECTION_IN |
static char |
DIRECTION_OUT |
static short |
EDGE_TYPE_BOTH |
static short |
EDGE_TYPE_FALLING |
static short |
EDGE_TYPE_RISING |
static byte |
FUNCTION_GET_CONFIGURATION |
static byte |
FUNCTION_GET_DEBOUNCE_PERIOD |
static byte |
FUNCTION_GET_EDGE_COUNT |
static byte |
FUNCTION_GET_EDGE_COUNT_CONFIG |
static byte |
FUNCTION_GET_IDENTITY |
static byte |
FUNCTION_GET_INTERRUPT |
static byte |
FUNCTION_GET_MONOFLOP |
static byte |
FUNCTION_GET_VALUE |
static byte |
FUNCTION_SET_CONFIGURATION |
static byte |
FUNCTION_SET_DEBOUNCE_PERIOD |
static byte |
FUNCTION_SET_EDGE_COUNT_CONFIG |
static byte |
FUNCTION_SET_INTERRUPT |
static byte |
FUNCTION_SET_MONOFLOP |
static byte |
FUNCTION_SET_SELECTED_VALUES |
static byte |
FUNCTION_SET_VALUE |
Constructor and Description |
---|
BrickletIO4(java.lang.String uid,
IPConnection ipcon)
Creates an object with the unique device ID \c uid.
|
Modifier and Type | Method and Description |
---|---|
void |
addInterruptListener(BrickletIO4.InterruptListener listener)
Adds a Interrupt listener.
|
void |
addMonoflopDoneListener(BrickletIO4.MonoflopDoneListener listener)
Adds a MonoflopDone listener.
|
BrickletIO4.Configuration |
getConfiguration()
Returns a value bitmask and a direction bitmask.
|
long |
getDebouncePeriod()
Returns the debounce period as set by
setDebouncePeriod(long) . |
long |
getEdgeCount(short pin,
boolean resetCounter)
Returns the current value of the edge counter for the selected pin.
|
BrickletIO4.EdgeCountConfig |
getEdgeCountConfig(short pin)
Returns the edge type and debounce time for the selected pin as set by
setEdgeCountConfig(short, short, short) . |
Device.Identity |
getIdentity()
Returns the UID, the UID where the Bricklet is connected to,
the position, the hardware and firmware version as well as the
device identifier.
|
short |
getInterrupt()
Returns the interrupt bitmask as set by
setInterrupt(short) . |
BrickletIO4.Monoflop |
getMonoflop(short pin)
Returns (for the given pin) the current value and the time as set by
setMonoflop(short, short, long) as well as the remaining time until the value flips. |
short |
getValue()
Returns a bitmask of the values that are currently measured.
|
void |
removeInterruptListener(BrickletIO4.InterruptListener listener)
Removes a Interrupt listener.
|
void |
removeMonoflopDoneListener(BrickletIO4.MonoflopDoneListener listener)
Removes a MonoflopDone listener.
|
void |
setConfiguration(short selectionMask,
char direction,
boolean value)
Configures the value and direction of the specified pins.
|
void |
setDebouncePeriod(long debounce)
Sets the debounce period of the
BrickletIO4.InterruptListener listener. |
void |
setEdgeCountConfig(short selectionMask,
short edgeType,
short debounce)
Configures the edge counter for the selected pins.
|
void |
setInterrupt(short interruptMask)
Sets the pins on which an interrupt is activated with a bitmask.
|
void |
setMonoflop(short selectionMask,
short valueMask,
long time)
Configures a monoflop of the pins specified by the first parameter as 4 bit
long bitmask.
|
void |
setSelectedValues(short selectionMask,
short valueMask)
Sets the output value (high or low) with a bitmask, according to
the selection mask.
|
void |
setValue(short valueMask)
Sets the output value (high or low) with a bitmask (4bit).
|
getAPIVersion, getResponseExpected, setResponseExpected, setResponseExpectedAll
public static final int DEVICE_IDENTIFIER
public static final java.lang.String DEVICE_DISPLAY_NAME
public static final byte FUNCTION_SET_VALUE
public static final byte FUNCTION_GET_VALUE
public static final byte FUNCTION_SET_CONFIGURATION
public static final byte FUNCTION_GET_CONFIGURATION
public static final byte FUNCTION_SET_DEBOUNCE_PERIOD
public static final byte FUNCTION_GET_DEBOUNCE_PERIOD
public static final byte FUNCTION_SET_INTERRUPT
public static final byte FUNCTION_GET_INTERRUPT
public static final byte FUNCTION_SET_MONOFLOP
public static final byte FUNCTION_GET_MONOFLOP
public static final byte FUNCTION_SET_SELECTED_VALUES
public static final byte FUNCTION_GET_EDGE_COUNT
public static final byte FUNCTION_SET_EDGE_COUNT_CONFIG
public static final byte FUNCTION_GET_EDGE_COUNT_CONFIG
public static final byte FUNCTION_GET_IDENTITY
public static final char DIRECTION_IN
public static final char DIRECTION_OUT
public static final short EDGE_TYPE_RISING
public static final short EDGE_TYPE_FALLING
public static final short EDGE_TYPE_BOTH
public BrickletIO4(java.lang.String uid, IPConnection ipcon)
public void setValue(short valueMask) throws TinkerforgeException
setConfiguration(short, char, boolean)
.TinkerforgeException
public short getValue() throws TinkerforgeException
TinkerforgeException
public void setConfiguration(short selectionMask, char direction, boolean value) throws TinkerforgeException
TinkerforgeException
public BrickletIO4.Configuration getConfiguration() throws TinkerforgeException
TinkerforgeException
public void setDebouncePeriod(long debounce) throws TinkerforgeException
BrickletIO4.InterruptListener
listener.
For example: If you set this value to 100, you will get the interrupt
maximal every 100ms. This is necessary if something that bounces is
connected to the IO-4 Bricklet, such as a button.TinkerforgeException
public long getDebouncePeriod() throws TinkerforgeException
setDebouncePeriod(long)
.TinkerforgeException
public void setInterrupt(short interruptMask) throws TinkerforgeException
BrickletIO4.InterruptListener
listener.TinkerforgeException
public short getInterrupt() throws TinkerforgeException
setInterrupt(short)
.TinkerforgeException
public void setMonoflop(short selectionMask, short valueMask, long time) throws TinkerforgeException
TinkerforgeException
public BrickletIO4.Monoflop getMonoflop(short pin) throws TinkerforgeException
setMonoflop(short, short, long)
as well as the remaining time until the value flips.
If the timer is not running currently, the remaining time will be returned
as 0.TinkerforgeException
public void setSelectedValues(short selectionMask, short valueMask) throws TinkerforgeException
setConfiguration(short, char, boolean)
.TinkerforgeException
public long getEdgeCount(short pin, boolean resetCounter) throws TinkerforgeException
setEdgeCountConfig(short, short, short)
.
If you set the reset counter to *true*, the count is set back to 0
directly after it is read.
.. versionadded:: 2.0.1$nbsp;(Plugin)TinkerforgeException
public void setEdgeCountConfig(short selectionMask, short edgeType, short debounce) throws TinkerforgeException
TinkerforgeException
public BrickletIO4.EdgeCountConfig getEdgeCountConfig(short pin) throws TinkerforgeException
setEdgeCountConfig(short, short, short)
.
.. versionadded:: 2.0.1$nbsp;(Plugin)TinkerforgeException
public Device.Identity getIdentity() throws TinkerforgeException
getIdentity
in class Device
TinkerforgeException
public void addInterruptListener(BrickletIO4.InterruptListener listener)
public void removeInterruptListener(BrickletIO4.InterruptListener listener)
public void addMonoflopDoneListener(BrickletIO4.MonoflopDoneListener listener)
public void removeMonoflopDoneListener(BrickletIO4.MonoflopDoneListener listener)
Copyright © 2020 Tinkerforge GmbH. All rights reserved.