usb_function_cdc.h

Microchip USB Device Library

USB Device Library Help
usb_function_cdc.h

USB CDC Function Driver File 

This file contains all of functions, macros, definitions, variables, datatypes, etc. that are required for usage with the CDC function driver. This file should be included in projects that use the CDC function driver. This file should also be included into the usb_descriptors.c file and any other user file that requires access to the CDC interface. 

This file is located in the "<Install Directory>\Microchip\Include\USB" directory. 

When including this file in a new project, this file can either be referenced from the directory in which it was installed or copied directly into the user application folder. If the first method is chosen to keep the file located in the folder in which it is installed then include paths need to be added so that the library and the application both know where to reference each others files. If the application folder is located in the same folder as the Microchip folder (like the current demo folders), then the following include paths need to be added to the application's project: 

..\Include 

..\..\Include 

..\..\MicrochipInclude 

..\..\<Application Folder> 

..\..\..\<Application Folder> 

If a different directory structure is used, modify the paths as required. An example using absolute paths instead of relative paths would be the following: 

C:\Microchip Solutions\Microchip\Include 

C:\Microchip Solutions\My Demo Application

Functions
 
Name 
Description 
 
This function initializes the CDC function driver. This function should be called after the SET_CONFIGURATION command. 
 
CDCTxService handles device-to-host transaction(s). This function should be called once per Main Program loop after the device reaches the configured state. 
 
getsUSBUSART copies a string of BYTEs received through USB CDC Bulk OUT endpoint to a user's specified location. It is a non-blocking function. It does not wait for data if there is no data available. Instead it returns '0' to notify the caller that there is no data available. 
 
putrsUSBUSART writes a string of data to the USB including the null character. Use this version, 'putrs', to transfer data literals and data located in program memory. 
 
putsUSBUSART writes a string of data to the USB including the null character. Use this version, 'puts', to transfer data from a RAM buffer. 
 
putUSBUSART writes an array of data to the USB. Use this version, is capable of transfering 0x00 (what is typically a NULL character in any of the string transfer functions). 
Macros
 
Name 
Description 
 
This macro is used set the baud rate reported back to the host during a get line coding request. (optional) 
 
This macro is used manually set the character format reported back to the host during a get line coding request. (optional) 
 
This function is used manually set the number of data bits reported back to the host during a get line coding request. (optional) 
 
This function is used to manually set the data reported back to the host during a get line coding request. (optional) 
 
This function is used manually set the parity format reported back to the host during a get line coding request. (optional) 
 
Depricated in MCHPFSUSB v2.3. This macro has been replaced by USBUSARTIsTxTrfReady(). 
 
1 stop bit - used by CDCSetLineCoding() and CDCSetCharacterFormat() 
 
1.5 stop bit - used by CDCSetLineCoding() and CDCSetCharacterFormat() 
 
2 stop bit - used by CDCSetLineCoding() and CDCSetCharacterFormat() 
 
even parity - used by CDCSetLineCoding() and CDCSetParity() 
 
mark parity - used by CDCSetLineCoding() and CDCSetParity() 
 
no parity - used by CDCSetLineCoding() and CDCSetParity() 
 
odd parity - used by CDCSetLineCoding() and CDCSetParity() 
 
space parity - used by CDCSetLineCoding() and CDCSetParity() 
 
This macro is used to check if the CDC class is ready to send more data. 
Microchip MCHPFSUSB v2.3 - Sept 20, 2008
Copyright © 2008 Microchip Technology, Inc.  All rights reserved.