|
||||||||
| 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.OCOutputDevice
public class OCOutputDevice
| Field Summary | |
|---|---|
static int |
OCOUTPUT_PA_1
Port pin value for pin A1 |
static int |
OCOUTPUT_PA_2
Port pin value for pin A2 |
static int |
OCOUTPUT_PA_3
Port pin value for pin A3 |
static int |
OCOUTPUT_PA_4
Port pin value for pin A4 |
static int |
OCOUTPUT_PA_5
Port pin value for pin A5 |
static int |
OCOUTPUT_PA_6
Port pin value for pin A6 |
static int |
OCOUTPUT_PA_7
Port pin value for pin A7 |
static int |
OCOUTPUT_PA_8
Port pin value for pin A8 |
static int |
OCOUTPUT_PB_1
Port pin value for pin B1 |
static int |
OCOUTPUT_PB_2
Port pin value for pin B2 |
static int |
OCOUTPUT_PB_3
Port pin value for pin B3 |
static int |
OCOUTPUT_PB_4
Port pin value for pin B4 |
static int |
OCOUTPUT_PB_5
Port pin value for pin B5 |
static int |
OCOUTPUT_PB_6
Port pin value for pin B6 |
static int |
OCOUTPUT_PB_7
Port pin value for pin B7 |
static int |
OCOUTPUT_PB_8
Port pin value for pin B8 |
static int |
OUTPUTCOUNT
|
static int |
PROXY_ID
|
static java.lang.String |
PROXY_TITLE
|
static int[] |
SUPPORTS
|
| Constructor Summary | |
|---|---|
OCOutputDevice(Master master,
int deviceId)
Creates a bluesense device with id 'deviceid' |
|
| Method Summary | |
|---|---|
boolean |
getCurrentOutput(int port)
returns output state of a pin |
int |
getCurrentOutputs()
Returns the current output states (in a multiplexed value) |
int |
getCurrentPWMDutyCycle(int port)
Firmware: 2+ Returns the current set duty cycle of a specific port. |
void |
getCurrentPWMDutyCycles(int[] dutyCycles)
Firmware: 2+ Fills an array with the current set PWM duty cycles. |
boolean |
getPendingOutput(int port)
Returns the 'tobe set' state of an output |
int |
getPendingOutputs()
Returns a bitmask containing which outputs are be set after the request finishes |
int |
getPendingPWMDutyCycle(int port)
Firmware: 2+ Returns the angle of a specific servo, which is currently underway to the device |
void |
getPendingPWMDutyCycles(int[] dutyCycles)
Firmware: 2+ Fills an array with duty cycle values which are currently underway to the device |
boolean |
getRequestSetOutputsDone()
Checks if the output set request is finished |
long |
getTimeOutUs()
Returns the current set time out delay. |
void |
requestGetOutputs()
Sends a request to retrieve the current set output states |
void |
requestSetOutput(int port,
boolean state)
Sends a request to set a single output to a new state |
void |
requestSetOutputs(int mask,
int states)
Sends a request to update the output states of the device. |
void |
requestSetPWMDutyCycle(int port,
int dutyCycle)
Firmware: version 2+ Sets the dutycycle for PWM (pulse width modulation) for the specified pin |
void |
requestSetPWMDutyCycles(int relevantDutyCycles,
int[] duryCycle)
Firmware: version 2+ Sets the duty cycles of pwm (pulse width modulation) pins |
void |
setTimeOutUs(int timeOutUs)
Sets the time out value which is used to check if a request was acknowledged in the set time. |
| 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 OUTPUTCOUNT
public static final int OCOUTPUT_PA_1
public static final int OCOUTPUT_PA_2
public static final int OCOUTPUT_PA_3
public static final int OCOUTPUT_PA_4
public static final int OCOUTPUT_PA_5
public static final int OCOUTPUT_PA_6
public static final int OCOUTPUT_PA_7
public static final int OCOUTPUT_PA_8
public static final int OCOUTPUT_PB_1
public static final int OCOUTPUT_PB_2
public static final int OCOUTPUT_PB_3
public static final int OCOUTPUT_PB_4
public static final int OCOUTPUT_PB_5
public static final int OCOUTPUT_PB_6
public static final int OCOUTPUT_PB_7
public static final int OCOUTPUT_PB_8
| Constructor Detail |
|---|
public OCOutputDevice(Master master,
int deviceId)
deviceId - the new device has getFound() set to false until
the device has been physically detected!| Method Detail |
|---|
public void requestGetOutputs()
public boolean getCurrentOutput(int port)
port - port pin value. @see bsOCOutput_pA_1public int getCurrentOutputs()
public int getCurrentPWMDutyCycle(int port)
port - one of the port pin values. @see bsServo_p1
public void getCurrentPWMDutyCycles(int[] dutyCycles)
dutyCycles - a pointer to an array of uint8_t values with enough space for all pins. @see OUTPUTCOUNT
public void requestSetOutput(int port,
boolean state)
port - port pin value. @see bsOCOutput_pA_1state - the new state of the output. 1 activates, 0 disables.
public void requestSetPWMDutyCycles(int relevantDutyCycles,
int[] duryCycle)
relevantDutyCycles - a bit mask indicating which pwm duty Cycle to updateduryCycle - an array of size OUTPUTCOUNT containing byte values (0-255) of the new duty cycles.
A duty cycle of 0 will disable pwm for the coreesponding pin. @see OCOutputDevice.OUTPUTCOUNT
public void requestSetPWMDutyCycle(int port,
int dutyCycle)
port - port pin value. @see bsOCOutput_pA_1dutyCycle - the new dutyCycle value (0-255). A dutyCycle of 0 disables PWM for the corresponding pinpublic boolean getRequestSetOutputsDone()
public long getTimeOutUs()
public void setTimeOutUs(int timeOutUs)
timeOutUs - the value in microseconds which is the maximum duraion between a request and its answer.
public void requestSetOutputs(int mask,
int states)
mask - a bit mask indicating which outputs to updatestates - an uint16_t bit mask containing the new output states.
Only those outputs will be updated for which a bit is set in the relevantBits parameterpublic int getPendingOutputs()
public void getPendingPWMDutyCycles(int[] dutyCycles)
dutyCycles - a pointer to an array of uint8_t values with enough space for all pins. @see OUTPUTCOUNTpublic int getPendingPWMDutyCycle(int port)
port - one of the port pin values. @see bsServo_p1
public boolean getPendingOutput(int port)
port - port pin value. @see bsOCOutput_pA_1
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||