public class TiOWMaster extends Object
Modifier and Type | Field and Description |
---|---|
static int |
IO_OVERDRIVE
Over driver I/O mode
|
static int |
IO_STANDARD
Standard I/O mode
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the port of current object
|
int |
getPort()
Gets the port id of current object
|
static TiOWMaster |
open(int portID,
int... ioIDs)
Open the TiOWMaster port by port id and the io list, and return the object
|
static int |
portNumber()
Maximum number of port supported
|
int |
readBits(int ioID,
int bits)
Read bits from slave on io
|
void |
reset(int ioID)
Reset the slave on io
|
void |
setWorkMode(int ioID,
int mode)
Set the io work mode
|
void |
writeBits(int ioID,
int value,
int bits)
Write bits to slave on io
|
public static final int IO_OVERDRIVE
public static final int IO_STANDARD
public void close() throws IOException
IOException
- If a TiOWMaster error occurspublic int getPort()
public static TiOWMaster open(int portID, int... ioIDs) throws IOException
portID
- port idioIDs
- the io id use, range:0-15IOException
- If a TiOWMaster error occurspublic static int portNumber()
public int readBits(int ioID, int bits) throws IOException
ioID
- io id, range:0-15bits
- bits number, range:1-16IOException
- If a TiOWMaster error occurspublic void reset(int ioID) throws IOException
ioID
- io id, range:0-15IOException
- If a TiOWMaster error occurspublic void setWorkMode(int ioID, int mode) throws IOException
ioID
- io id, range:0-15mode
- work mode,IOException
- If a TiOWMaster error occurspublic void writeBits(int ioID, int value, int bits) throws IOException
ioID
- io id, range:0-15value
- bits value, range:0-65535bits
- bits number,range:1-16IOException
- If a TiOWMaster error occurs