|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.alarexgroup.m2mplf.adapters.io.PinConfiguration
public class PinConfiguration
Pin configuration profile. With this profile you can set up parameters of respective pins.
Example of creating the pin configuration
PinConfiguration pinConf = new PinConfiguration();
|
| Field Summary | |
|---|---|
static int |
PIN_DIRECTION_INPUT
Input orientation |
static int |
PIN_DIRECTION_OUTPUT
Output orientation |
static int |
PIN_MODE_CLOSE
Inactive pin |
static int |
PIN_MODE_OPEN
Active pin |
static int |
TOTAL_NUMBER_OF_PINS
Total number of all pins |
| Constructor Summary | |
|---|---|
PinConfiguration()
Creates configuration profile. |
|
| Method Summary | |
|---|---|
void |
configurePin(int pinIndex,
int pinMode,
int pinDirection)
Set up configuration of the specified pin. |
void |
configurePins(int[] pinIndexes,
int pinMode,
int pinDirectionInput)
Global pin configuration. |
int |
getPinDirection(int pinIndex)
Returns pin mode |
int |
getPinMode(int pinIndex)
Returns working state of pin, whether it is opened or closed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int TOTAL_NUMBER_OF_PINS
public static final int PIN_MODE_CLOSE
public static final int PIN_MODE_OPEN
public static final int PIN_DIRECTION_INPUT
public static final int PIN_DIRECTION_OUTPUT
| Constructor Detail |
|---|
public PinConfiguration()
| Method Detail |
|---|
public void configurePin(int pinIndex,
int pinMode,
int pinDirection)
pinIndex - pinu id. Pins are numbered from 0-9: GPIO1 = 0; GPIO10 = 9pinMode - pin statusPIN_MODE_OPEN - pin is opened and is activePIN_MODE_CLOSE - pin is closed, not usablepinDirection - pin modePIN_DIRECTION_OUTPUT - pin is outputPIN_DIRECTION_OUTPUT - pin is input
public void configurePins(int[] pinIndexes,
int pinMode,
int pinDirectionInput)
pinIndexes - array of pinspinMode - pin statusPIN_MODE_OPEN - pin is opened and activePIN_MODE_CLOSE - pin is closed, not usablepinDirectionInput - Pin modePIN_DIRECTION_OUTPUT - pin is outputPIN_DIRECTION_OUTPUT - pin is inputpublic int getPinDirection(int pinIndex)
pinIndex - pin id
PIN_DIRECTION_OUTPUT - pin is outputPIN_DIRECTION_OUTPUT - pin is inputpublic int getPinMode(int pinIndex)
pinIndex - pin id
PIN_MODE_OPEN - pin is opened and activePIN_MODE_CLOSE - pin is closed, not usable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||