|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.bluemelon.bluesense.Device
org.bluemelon.bluesense.SwitchInputDevice
public class SwitchInputDevice
Interface to the switchInputDevice BM7001.
The BM7001 allows you to measure the state of 12 different switches.
Besides 12 normal switch the device has been programmed with special software to support automatic measurement of up to six rotary encoders.
This means that you don't have to write complicated code anymore.
The device simply outputs a number which determines the state of the rotary encoder.
Each input can have a configured counter which counts the number of switch state changes.
Because these features have been implemented in the device itself you can be sure that your software won't miss any information.
| Field Summary | |
|---|---|
static int |
INPUT_COUNT
|
static int |
PROXY_ID
|
static java.lang.String |
PROXY_TITLE
|
static int[] |
SUPPORTS
|
static int |
SWITCHINPUT_PA_1
Port pin value for pin A1 |
static int |
SWITCHINPUT_PA_2
Port pin value for pin A2 |
static int |
SWITCHINPUT_PA_3
Port pin value for pin A3 |
static int |
SWITCHINPUT_PA_4
Port pin value for pin A4 |
static int |
SWITCHINPUT_PA_5
Port pin value for pin A5 |
static int |
SWITCHINPUT_PA_6
Port pin value for pin A6 |
static int |
SWITCHINPUT_PB_1
Port pin value for pin B1 |
static int |
SWITCHINPUT_PB_2
Port pin value for pin B2 |
static int |
SWITCHINPUT_PB_3
Port pin value for pin B3 |
static int |
SWITCHINPUT_PB_4
Port pin value for pin B4 |
static int |
SWITCHINPUT_PB_5
Port pin value for pin B5 |
static int |
SWITCHINPUT_PB_6
Port pin value for pin B6 |
static int |
SWITCHINPUT_RA_1_2
Port pin value combination for a rotary encoder connection on ports A1 en A2 |
static int |
SWITCHINPUT_RA_3_4
Port pin value combination for a rotary encoder connection on ports A3 en A4 |
static int |
SWITCHINPUT_RA_5_6
Port pin value combination for a rotary encoder connection on ports A5 en A6 |
static int |
SWITCHINPUT_RB_1_2
Port pin value combination for a rotary encoder connection on ports B1 en B2 |
static int |
SWITCHINPUT_RB_3_4
Port pin value combination for a rotary encoder connection on ports B3 en B4 |
static int |
SWITCHINPUT_RB_5_6
Port pin value combination for a rotary encoder connection on ports B5 en B6 |
| Constructor Summary | |
|---|---|
SwitchInputDevice(Master master,
int deviceId)
Creates a 'software' switchInput device with a given id. |
|
| Method Summary | |
|---|---|
boolean |
configPending()
Checks if a configuration is being currently being set or being retrieved |
int |
getChangedCountersMask()
|
int |
getChangedInputsMask()
|
int |
getChangedRotariesMask()
|
long |
getLastSampledCounter(int port)
returns the last received counter value |
boolean |
getLastSampledInput(int port)
returns the last taken bit sample on a specific port |
int |
getLastSampledInputs()
returns the last taken multiplexed bit sample. |
int |
getLastSampledRotary(int rport)
returns the last received rotary value |
boolean |
getRequestGetConfigDone()
Checks if the configuration request is finished |
boolean |
getRequestGetInputsDone()
Checks if an 'input values' request is finished |
boolean |
getRequestSetConfigDone()
Checks if the configuration set request is finished |
long |
getSampleCount()
returns the total number of samples taken since the start of the application |
long |
getTimeOutUs()
Returns the current set time out delay. |
void |
requestGetConfiguration()
Request to obtain the configuration settings from a adcInput Device. |
void |
requestGetInputs()
Send a request to obtain the values of the switch inputs |
void |
requestNeedsBooleans(int side,
boolean needs)
Sends a request: request that the device should not/should send boolean states |
void |
requestNeedsCounter(int port,
boolean needs)
Sends a request: request that the device should not/should send counter states |
void |
requestNeedsRotary(int rport,
boolean needs)
Sends a request: request that the device should not/should send rotary encoder states |
void |
requestSetConfiguration(int booleansMask,
int rotaryMask,
int counterMask)
Request the switchInput device to set the input types |
void |
setTimeOutUs(long timeOutUs)
Sets the time out value which is used to check if a request was acknowledged in the set time. |
boolean |
usesBooleans(int side)
Find out if we receive the boolean states of hardware side A or B. |
boolean |
usesCounter(int port)
Find out if we receive counter states. |
boolean |
usesRotary(int rport)
Find out if we receive rotary states. |
| Methods inherited from class org.bluemelon.bluesense.Device |
|---|
addDeviceEventListener, detect, getFirmwareVersion, getId, getType, getTypeName, isAccessible, removeDeviceEventListener |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROXY_TITLE
public static final int PROXY_ID
public static final int[] SUPPORTS
public static final int INPUT_COUNT
public static final int SWITCHINPUT_RA_1_2
public static final int SWITCHINPUT_RA_3_4
public static final int SWITCHINPUT_RA_5_6
public static final int SWITCHINPUT_RB_1_2
public static final int SWITCHINPUT_RB_3_4
public static final int SWITCHINPUT_RB_5_6
public static final int SWITCHINPUT_PA_1
public static final int SWITCHINPUT_PA_2
public static final int SWITCHINPUT_PA_3
public static final int SWITCHINPUT_PA_4
public static final int SWITCHINPUT_PA_5
public static final int SWITCHINPUT_PA_6
public static final int SWITCHINPUT_PB_1
public static final int SWITCHINPUT_PB_2
public static final int SWITCHINPUT_PB_3
public static final int SWITCHINPUT_PB_4
public static final int SWITCHINPUT_PB_5
public static final int SWITCHINPUT_PB_6
| Constructor Detail |
|---|
public SwitchInputDevice(Master master,
int deviceId)
master - deviceId - | Method Detail |
|---|
public boolean getLastSampledInput(int port)
port - port pin value. @see bsSwitchInput_pA_1
public int getLastSampledInputs()
public long getLastSampledCounter(int port)
port - port pin value. @see bsSwitchInput_pA_1
public int getLastSampledRotary(int rport)
rport - the port pin value. @see bsSwitchInput_rA_1_2
public long getSampleCount()
public boolean getRequestGetInputsDone()
public void requestGetInputs()
public void requestNeedsBooleans(int side,
boolean needs)
side - if 0, side A selected, if 1 side B selected.needs - if true, device should send boolean states, false device should not send boolean states
public void requestNeedsCounter(int port,
boolean needs)
port - port pin value. @see bsSwitchInput_pA_1needs - if true, device should send counter value, false device should not send counter value
public void requestNeedsRotary(int rport,
boolean needs)
rport - the port pin value. @see bsSwitchInput_rA_1_2needs - if true, device should send rotary states, false device should not send rotary statespublic boolean usesBooleans(int side)
side - if 0, check if side A booleans are received, if 1 check if side B booleans are received.
public boolean usesCounter(int port)
port - port pin value. @see bsSwitchInput_pA_1
public boolean usesRotary(int rport)
rport - the port pin value. @see bsSwitchInput_rA_1_2
public boolean configPending()
public boolean getRequestGetConfigDone()
public boolean getRequestSetConfigDone()
public void requestGetConfiguration()
public void requestSetConfiguration(int booleansMask,
int rotaryMask,
int counterMask)
booleansMask - receive switch data from side A (bit 0) and/or side B(bit 1)rotaryMask - receive rotary data from pin 1,2 (bit 0), pin 3,4 (bit 1), pin 5,6 (bit 2)...counterMask - receiver counter values from pin 1 (bit 0), pin 2 (bit 1), pin 3 (bit 2)....public long getTimeOutUs()
public void setTimeOutUs(long timeOutUs)
timeOutUs - the value in microseconds which is the maximum duraion between a request and its answer.public int getChangedInputsMask()
public int getChangedRotariesMask()
public int getChangedCountersMask()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||