Communication Device Class - Renesas H8SX1664 User Manual

Starter kit usb sample code
Table of Contents

Advertisement

4.4.Communication Device Class

The CDC ACM allows a host to see a device as a standard serial (COM) port. This is particularly useful when working with legacy applications
that use serial communications. Bulk IN and Bulk OUT transfers are used for all non-setup data.
The CDC module utilises the USBCore layer for the processing of all standard requests. In addition it processes the following class requests.
GET_LINE_CODING
SET_LINE_CODING (As required by MS HyperTerminal)
SET_CONTROL_LINE_STATE
The CDC class is supported by MS Windows so there is no need to develop a custom Windows kernel driver. However a custom 'inf' file is
required, the sample CDC application includes such a file. When a CDC ACM device is plugged into a Windows PC an additional (virtual)
COM port will become available that applications can use just like a standard COM port.
Here are the functions that make up the USBCDC API.
Name
USBCDC_Init
USBCDC_IsConnected
USBCDC_WriteString
USBCDC_PutChar
USBCDC_GetChar
USBCDC_Write
USBCDC_Write_Async
USBCDC_Read
USBCDC_Read_Async
USBCDC_Cancel
The CDC module consists of the following files:-
usb_cdc.c
usb_cdc.h.
usb_descriptors.c
usb_descriptors.h
usb_common.h
Description
Initialise the CDC module. This also initialises the Core and HAL layers.
Returns the connected status of the device.
A blocking function that sends a string to the host.
A blocking function that sends a character to the host.
A blocking function that gets a character from the host.
A blocking function that sends a supplied data buffer to the host.
Starts an asynchronous write of a data buffer to the host. A call back is used to signal when the operation
has completed.
A blocking function that reads from the host into a supplied data buffer.
Starts an asynchronous read from the host into a data buffer. A call back is used to signal when the
operation has completed.
Cancel any asynchronous operations that are pending.
9

Advertisement

Table of Contents
loading

Table of Contents