English
Language : 

AN223 Datasheet, PDF (1/7 Pages) Silicon Laboratories – RUNTIME GPIO CONTROL
AN223
RUNTIME GPIO CONTROL FOR CP210X
1. Introduction
Some CP210x devices include GPIO pins that can be controlled by the PC using a Dynamic Link Library (DLL).
The default configuration of these pins is controlled by the software included in AN721, “CP210x/CP211x Device
Customization Guide,” available on the interface application note web page (http://www.silabs.com/products/
Interface/Pages/interface-application-notes.aspx). This document discusses reading and writing the state of these
pins with software.
The CP210x Port Read/Write Example illustrates how the GPIO latch can be read from and written to using the
CP210xRuntime.DLL. The functions in this API (CP210xRT_ReadLatch() and CP210xRT_WriteLatch()) give host-
based software access to the CP210x device’s GPIO latch using the USB connection as shown in Figure 1.
Figure 1. Main Window
The main window of the CP210x Port Read/Write Example contains one section to write the GPIO latch and
another to read the GPIO latch. Below that is a list to select a COM port and display boxes for the device part
number, product string, and serial number.
To write new values to the latch, select which GPIO pins to update, and set the pin state for each. Any GPIO pins
not selected to change will remain static when the “Write Latch” button is pressed. The “Write Latch” button calls
the CP210xRT_WriteLatch() function followed by the CP210xRT_ReadLatch() function, which updates the values
displayed in the Read Latch portion of the dialog. At any time, the “Read Latch” button can be pressed to read in
the current GPIO pin state of the device.
Rev. 0.5 3/13
Copyright © 2013 by Silicon Laboratories
AN223