English
Language : 

UM0290 Datasheet, PDF (55/76 Pages) STMicroelectronics – This document presents a description
UM0290
Virtual COM port demo
Note:
UART 0 to the PC through USB and the endpoint 3 (OUT) used to receive the data from
the PC and send it to through UART.
For more information on the CDC class please refer to the Class Definitions for
Communication Devices specification provided by www.usb.org web site.
Class Specific requests
To implement a virtual COM port, the device supports the following class specific requests:
● SET_CONTROL_LINE_STATE: RS-232 signal used to tell the device that the Date
Terminal Equipment device is now present. This request always returns with a
USB_SUCCESS status in the function Virtual_Com_Port_NoData_Setup() (file
usb_porp.c).
● SET_COMM_FEATURE: Controls the settings for a particular communication feature.
This request always returns with a USB_SUCCESS status in the function
Virtual_Com_Port_NoData_Setup() (file usb_porp.c).
● SET_LINE_CODING: send the configuration of the device. It includes the baud rate,
stop-bits, parity, and number-of-character bits. The received data is stored in a specific
data structure called “linecoding” and used to update the UART 0 parameters.
● GET_LINE_CODING: This command requests the device current baud rate, stop-bits,
parity, and number-of-character bits. The device responds to this request with the data
stored in the structure “linecoding”.
Hardware configuration interface
The hardware configuration interface (hw_config.c and .h) in the Virtual COM port manages
the following routines:
● Configure the system and IPs (UAB & UART0) clock and interrupt
● Initialize the UART 0 at Default parameters
● Configure the UART with the parameters received by the SET_LINE_CODING request
● Send the data received by the UART to the PC through PC
● Send the data received by the USB through UART
The core of these routines depends on the used microcontroller.
55/76