public final class SerialComSLabsCP210xRuntime extends SerialComVendorLib
Silicon labs provides libraries to communicate with their USB-UART devices. More information can be found here : https://www.silabs.com/products/mcu/Pages/USBtoUARTBridgeVCPDrivers.aspx
[0] The data types used in java layer may be bigger in size than the native layer. For example; if native function returns 16 bit signed integer, than java method will return 32 bit integer. This is done to make sure that no data loss occur. This library take care of sign and their applicability internally.
[1] Developers are requested to check with vendor library documentation if a particular function is supported for desired platform or not and also how does a particular API will behave. Also consider paying attention to valid values and range when passing arguments to a method.
[2] The application note for CP210XRuntime library is here : https://www.silabs.com/Support%20Documents/TechnicalDocs/an223.pdf
SCM version 1.0.4 is linked to v3.4.0.0 version of CP210xRuntime library (CP210xRuntime.dll).
| Modifier and Type | Field and Description |
|---|---|
static int |
CP210x_GPIO_0
Bit mask to represent mask and latch definition for GPIO0 in CP210X terminology.
|
static int |
CP210x_GPIO_1
Bit mask to represent mask and latch definition for GPIO1 in CP210X terminology.
|
static int |
CP210x_GPIO_10
Bit mask to represent mask and latch definition for GPIO10 in CP210X terminology.
|
static int |
CP210x_GPIO_11
Bit mask to represent mask and latch definition for GPIO11 in CP210X terminology.
|
static int |
CP210x_GPIO_12
Bit mask to represent mask and latch definition for GPIO12 in CP210X terminology.
|
static int |
CP210x_GPIO_13
Bit mask to represent mask and latch definition for GPIO13 in CP210X terminology.
|
static int |
CP210x_GPIO_14
Bit mask to represent mask and latch definition for GPIO14 in CP210X terminology.
|
static int |
CP210x_GPIO_15
Bit mask to represent mask and latch definition for GPIO15 in CP210X terminology.
|
static int |
CP210x_GPIO_2
Bit mask to represent mask and latch definition for GPIO2 in CP210X terminology.
|
static int |
CP210x_GPIO_3
Bit mask to represent mask and latch definition for GPIO3 in CP210X terminology.
|
static int |
CP210x_GPIO_4
Bit mask to represent mask and latch definition for GPIO4 in CP210X terminology.
|
static int |
CP210x_GPIO_5
Bit mask to represent mask and latch definition for GPIO5 in CP210X terminology.
|
static int |
CP210x_GPIO_6
Bit mask to represent mask and latch definition for GPIO6 in CP210X terminology.
|
static int |
CP210x_GPIO_7
Bit mask to represent mask and latch definition for GPIO7 in CP210X terminology.
|
static int |
CP210x_GPIO_8
Bit mask to represent mask and latch definition for GPIO8 in CP210X terminology.
|
static int |
CP210x_GPIO_9
Bit mask to represent mask and latch definition for GPIO9 in CP210X terminology.
|
VLIB_FTDI_D2XX, VLIB_MCHP_SIMPLEIO, VLIB_SLABS_CP210XMANUFACTURING, VLIB_SLABS_CP210XRUNTIME, VLIB_SLABS_USBXPRESS| Constructor and Description |
|---|
SerialComSLabsCP210xRuntime(File libDirectory,
String vlibName,
int cpuArch,
int osType,
SerialComSystemProperty serialComSystemProperty)
Allocates a new SerialComSLabsCP210xRuntime object and extract and load shared libraries as
required.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getDeviceInterfaceString(long handle)
Executes CP210xRT_GetDeviceInterfaceString function of CP210XRuntime library.
|
String |
getDeviceProductString(long handle)
Executes CP210xRT_GetDeviceProductString function of CP210XRuntime library.
|
String |
getDeviceSerialNumber(long handle)
Executes CP210xRT_GetDeviceSerialNumber function of CP210XRuntime library.
|
String |
getPartNumber(long handle)
Executes CP210xRT_GetPartNumber function of CP210XRuntime library.
|
long |
readLatch(long handle)
Executes CP210xRT_ReadLatch function of CP210XRuntime library.
|
boolean |
writeLatch(long handle,
long mask,
long latchValue)
Executes CP210xRT_WriteLatch function of CP210XRuntime library.
|
getVendorLibInstancepublic static final int CP210x_GPIO_0
Bit mask to represent mask and latch definition for GPIO0 in CP210X terminology.
public static final int CP210x_GPIO_1
Bit mask to represent mask and latch definition for GPIO1 in CP210X terminology.
public static final int CP210x_GPIO_2
Bit mask to represent mask and latch definition for GPIO2 in CP210X terminology.
public static final int CP210x_GPIO_3
Bit mask to represent mask and latch definition for GPIO3 in CP210X terminology.
public static final int CP210x_GPIO_4
Bit mask to represent mask and latch definition for GPIO4 in CP210X terminology.
public static final int CP210x_GPIO_5
Bit mask to represent mask and latch definition for GPIO5 in CP210X terminology.
public static final int CP210x_GPIO_6
Bit mask to represent mask and latch definition for GPIO6 in CP210X terminology.
public static final int CP210x_GPIO_7
Bit mask to represent mask and latch definition for GPIO7 in CP210X terminology.
public static final int CP210x_GPIO_8
Bit mask to represent mask and latch definition for GPIO8 in CP210X terminology.
public static final int CP210x_GPIO_9
Bit mask to represent mask and latch definition for GPIO9 in CP210X terminology.
public static final int CP210x_GPIO_10
Bit mask to represent mask and latch definition for GPIO10 in CP210X terminology.
public static final int CP210x_GPIO_11
Bit mask to represent mask and latch definition for GPIO11 in CP210X terminology.
public static final int CP210x_GPIO_12
Bit mask to represent mask and latch definition for GPIO12 in CP210X terminology.
public static final int CP210x_GPIO_13
Bit mask to represent mask and latch definition for GPIO13 in CP210X terminology.
public static final int CP210x_GPIO_14
Bit mask to represent mask and latch definition for GPIO14 in CP210X terminology.
public static final int CP210x_GPIO_15
Bit mask to represent mask and latch definition for GPIO15 in CP210X terminology.
public SerialComSLabsCP210xRuntime(File libDirectory, String vlibName, int cpuArch, int osType, SerialComSystemProperty serialComSystemProperty) throws UnsatisfiedLinkError, SerialComLoadException, SerialComUnexpectedException, SecurityException, FileNotFoundException
Allocates a new SerialComSLabsCP210xRuntime object and extract and load shared libraries as required.
libDirectory - directory in which native library will be extracted and vendor library will
be found.vlibName - name of vendor library to load and link.cpuArch - architecture of CPU this library is running on.osType - operating system this library is running on.serialComSystemProperty - instance of SerialComSystemProperty to get required java properties.SerialComUnexpectedException - if a critical java system property is null in system.SecurityException - if any java system property can not be accessed.FileNotFoundException - if the vendor library file is not found.SerialComLoadException - if any file system related issue occurs.UnsatisfiedLinkError - if loading/linking shared library fails.SerialComException - if initializing native library fails.public long readLatch(long handle)
throws SerialComException
Executes CP210xRT_ReadLatch function of CP210XRuntime library.
Gets the current port latch value from the device.
handle - handle of the opened COM port.SerialComException - if an I/O error occurs.public boolean writeLatch(long handle,
long mask,
long latchValue)
throws SerialComException
Executes CP210xRT_WriteLatch function of CP210XRuntime library.
Sets the current port latch value for the device.
handle - handle of the opened COM port.mask - determines which pins to change [Change = 1, Leave = 0].latchValue - bit mask value to write to GPIO latch [Logic High = 1, Logic Low = 0].SerialComException - if an I/O error occurs.public String getPartNumber(long handle) throws SerialComException
Executes CP210xRT_GetPartNumber function of CP210XRuntime library.
Gets the part number of the current device.
handle - handle of the opened COM port.SerialComException - if an I/O error occurs.public String getDeviceProductString(long handle) throws SerialComException
Executes CP210xRT_GetDeviceProductString function of CP210XRuntime library.
Gets the product string in the current device.
handle - handle of the opened COM port.SerialComException - if an I/O error occurs.public String getDeviceSerialNumber(long handle) throws SerialComException
Executes CP210xRT_GetDeviceSerialNumber function of CP210XRuntime library.
Gets the serial number in the current device.
handle - handle of the opened COM port.SerialComException - if an I/O error occurs.public String getDeviceInterfaceString(long handle) throws SerialComException
Executes CP210xRT_GetDeviceInterfaceString function of CP210XRuntime library.
Gets the interface string of the current device.
handle - handle of the opened COM port.SerialComException - if an I/O error occurs.Copyright © 2016. All rights reserved.