There are two APIs can be used for CP2114 Pins configuration:
Please see SLABCP2114.h for more details on CP2114 APIs declaration.
Here is an example on how to use the two APIs to get or set CP2114 Pins configuration based on HidUartExample that is included in the USBXpressHostSDK for Linux. The source code is attached.
How to use the HidUartExample
Step 1. Connect CP2114 device to a Linux machine.
Step 2. Specify the PID of CP2114 device when executing the hidUartExample generated after
building. The VID and PID of CP2114 is 0x14C4 and 0xEAB0 respectively by default.
Step 3. Select 'Get Pin Config' by entering '7' following the 'Enter' key to query the current pin configuration of CP2114 device.
Step 4. Select 'Set Pin Config' by entering '8' following the 'Enter' key to configure CP2114 Pins with new setting. User can update the pin setting in source code depending on their application. Note that CP2114 pins configuration can be programmed only once.
Step 5. Finally type '9' to exit this example.
The CP2110/CP2114 hidUartExample is written in C++, and it is a good start to use the CP2110/CP2114 API functions. This example is enclosed in USBXpressHostSDK in the latest AN721SW v6.7.5.
After extracting the USBXpressHostSDK on Linux, look at the source code of slabhiddevice and slabhidtouart libraries under USBXpressHostSDK/CP2110_4/srcpkg/, and then build both libraries by executing the associated makefiles, these libraries will be used by the hidUartExample.
If the libusb package has not been installed on your Linux machine before, then you may see an error about the libusb.h as below:
To resolve this, try to install the libusb-1.0 package using the following command:
sudo app-get install libusb-1.0-0-dev
Build both slabhiddevice and libraries again by typing a "make" command, and then copy the library generated to /usr/local/lib/ using the "make install" command below, referring to the makefile if needed.
After building all libraries, change directory to the HidUartExample in /srcpkg/slabhidtouart/ and build this example by executing the makefile at the same folder.
The makefile of HidUartExample is originally written for 32-bit machine. If you are using an 64-bit Linux system, you may see an error as below when trying to run the makefile.
Here recommend modifying the makefile of HidUartExample before building by replacing:
Then build the HidUartExample again, below is the final building result.
To run an executable that was built against the shared object library (.so), set the library path to /usr/local/lib before running the executable
$ export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
Here is the help information when executing the hidUartExample.
If a CP2110 or CP2114 device is connected, then it will display the main menu after executing this example.
By default, the example uses the VID and PID of CP2110, and therefore user need to specify the VID/PID when testing with CP2114 device .
The CP2114 is a bridge product which can transfer audio data from USB to I2S without any code development. CP2114 is a USB audio device which support USB Audio Class v1.0, and this class should be natively supported by all major operating systems (e.g. Windows, Linux, Mac, iOS, Android).
The native operating system of the PlayStation 4 is Orbis OS, which is a fork of FreeBSD version 9.0 that also provides support for USB audio class natively. So the CP2114 can be used as an USB Digital Audio Out/ In device on PS4.