AN978: CP210x USB-to-UART API
Specification
This document describes the API for the CP210x Manufacturing
Library, used to configure CP210x devices, and the CP210x
Runtime Library, used to operate the devices' GPIOs during run-
time.
The Silicon Labs CP210x USB-to-UART bridges are devices that communicate over
the Universal Serial Bus (USB) to perform Universal Asynchronous Receiver/Transmit-
ter (UART) data transfers. These devices have many programmable options that can
be configured via USB. These devices also often include flexible GPIO functions that
can be configured and accessed via USB during runtime. Silicon Labs provides libra-
ries that can be used to configure these devices and access their GPIOs.
KEY POINTS
• Silicon Labs provides public libraries to
access all available features on CP210x
devices.
• Use the CP210x Manufacturing library to
configure a device's programmable
settings.
• Use the CP210x Runtime library to control
a device's GPIOs at runtime.
PC
User Application
CP210x Device
Programmable
Memory
GPIO Controller
External Devices
GPIOs
Manufacturing Library Runtime Library
USB
silabs.com | Building a more connected world. Copyright © 2022 by Silicon Laboratories Rev. 1.5
1. CP210x Host API Functions
Two DLL files can be used to interface with CP210x devices, CP210xManufacturing.DLL, which is responsible for reading and writing
the device settings, and CP210xRuntime.DLL, which is responsible for interfacing with the device's GPIOs. The APIs for these DLLs are
described in the following sections.
1.1 CP210xManufacturing.DLL
The CP210x Host API is provided as a means to facilitate production of customized CP210x devices. The API allows access to the
CP210x device for retrieving and setting the VID, PID, product string, serial number, self- power attribute, maximum power consump-
tion, and device version.
The CP210x Host API is provided in the form of a Windows Dynamic Link Library (DLL), CP210xManufacturing.DLL. The host inter-
face DLL communicates with the bridge controller device via the provided device driver and the operating system's USB stack. The
following is a list of the available host API functions:
CP210x_GetNumDevices() Returns the number of CP210x devices connected.
CP210x_GetProductString() Returns a descriptor from the registry for a CP210x USB device.
CP210x_GetPartNumber() Returns the 1-byte Part Number of a CP210x device.
CP210x_Open() Opens a CP210x device as a USB device and returns a handle.
CP210x_Close() Closes a CP210x device handle.
CP210x_SetVid() Sets the 2-byte vendor ID of a CP210x device.
CP210x_SetPid() Sets the 2-byte product ID of a CP210x device.
CP210x_SetManufacturerString() Sets the manufacturer description string of a CP210x device.
CP210x_SetProductString() Sets the product description string of a CP210x device.
CP210x_SetInterfaceString() Sets the interface string of a CP2105 device.
CP210x_SetSerialNumber() Sets the serial number string of a CP210x device.
CP210x_SetSelfPower() Sets the self-power attribute of a CP210x device.
CP210x_SetMaxPower() Sets the maximum power consumption of a CP210x device.
CP210x_SetFlushBufferConfig() Sets the flush buffer configuration of CP2104/5 devices.
CP210x_SetDeviceMode() Sets the operating modes of both interfaces of a CP2105 device.
CP210x_SetDeviceVersion() Sets version number of the CP210x device.
CP210x_SetBaudRateConfig() Sets the baud rate configuration data of a CP210x device.
CP210x_SetLockValue() Sets the 1-byte Lock Value of a CP210x device.
CP210x_SetPortConfig() Sets the port configuration of a CP2101/2/3/4 device.
CP210x_SetDualPortConfig() Sets the port configuration of a CP2105 device.
CP210x_SetQuadPortConfig() Sets the port configuration of a CP2108 device.
CP210x_SetConfig() Programs the entire configuration of a CP2102N device.
AN978: CP210x USB-to-UART API Specification
CP210x Host API Functions
silabs.com | Building a more connected world. Rev. 1.5 | 2