- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Functions
csl_cdc.c File Reference

USB CDC functional layer API source file. More...

`#include <stdio.h>`
`#include <string.h>`
`#include <csl_usbAux.h>`
`#include <csl_cdc.h>`

## Functions
CSL_Status | CDC_Open (pCdcAppClassHandle pAppClassHandle)
CSL_Status | CDC_OpenFullspeed (pCdcAppClassHandle pAppClassHandle)
static CSL_Status | CDC_Setup (pCdcAppClassHandle pAppClassHandle, Bool usbSpeedCfg)
CSL_Status | CDC_Close (pCdcAppClassHandle pAppClassHandle)
Uint16 | CDC_GetactivityFlagStatus (void *pCDC)
Uint16 | CDC_GetsuspendFlagStatus (void *pCDC)
CSL_CdcRequestRet | CDC_eventHandler (pUsbContext pContext, CSL_CdcClassStruct *hCdcClass)
CSL_Status | CDC_bulkOutHandler (pUsbContext pContext, CSL_CdcInitStructApp *cdcAppHandle)
CSL_Status | CDC_bulkInHandler (pUsbContext pContext, CSL_CdcInitStructApp *cdcAppHandle)
Uint16 | CDC_getData (pUsbContext pContext, CSL_CdcInitStructApp *cdcAppHandle, Uint16 *data)
Uint16 | CDC_putData (pUsbContext pContext, CSL_CdcInitStructApp *cdcAppHandle, Uint16 *data, Uint16 size)

## Detailed Description

USB CDC functional layer API source file.

Path: \(CSLPATH)\ src

## Function Documentation

static CSL_Status CDC_Setup | ( | pCdcAppClassHandle | pAppClassHandle,
|  | Bool | usbSpeedCfg
| ) |  | `[static]`

============================================================================
CDC_Setup

Description
This function used to setup the Cdc and Ctrl handles. This is an internal function and is called from CDC_Open or CDC_OpenFullspeed functions.

Arguments

    		    pAppClassHandle      Application handle to the CDC Class Obj
    		    usbSpeedCfg          USB speed selection parameter
    		                         0 - USB CDC operates in fullspeed mode
    		                         1 - USB CDC operates in highspeed mode

Return Value CSL_Status

- CSL_SOK - Returned for success
- CSL_ESYS_BADHANDLE - Invalid Cdc handle

Pre Condition
None

Post Condition
Initializes Cdc and Ctrl handles

Modifies
Cdc and Ctrl handle data

Example

    			CSL_CdcInitStructApp    cdcAppHandle;
    			pCdcAppClassHandle      pAppClassHandle;
    			Uint16                  cdcAppBuffer[420];
    			CSL_Status              status;

    			pAppClassHandle = &cdcAppHandle;

    			// Assign values to all the members in cdcAppHandle struct
    			cdcAppHandle.pCdcObj = &cdcAppBuffer[0];
    			.....
    			.....
    			// Setup USB for highspeed
    			status = CDC_Setup(pAppClassHandle, TRUE);

============================================================================

References CSL_CdcInitStructApp::bulkHandler, CSL_CdcObject::bulkInEpObj, CSL_CdcObject::bulkOutEpObj, CSL_CdcClassStruct::cdcHandle, CSL_CDC_INTR_IN_EP, CSL_USB_BULK, CSL_USB_CTRL, CSL_USB_EP0_PACKET_SIZE, CSL_USB_EP1_PACKET_SIZE_FS, CSL_USB_EP1_PACKET_SIZE_HS, CSL_USB_EVENT_EOT, CSL_USB_EVENT_RESET, CSL_USB_EVENT_RESUME, CSL_USB_EVENT_SETUP, CSL_USB_EVENT_SUSPEND, CSL_USB_IN_EP0, CSL_USB_INTR, CSL_USB_OUT_EP0, CSL_CdcClassStruct::ctrlHandle, CSL_CdcInitStructApp::ctrlHandler, CSL_CdcCtrlObject::ctrlInEpObj, CSL_CdcCtrlObject::ctrlOutEpObj, CSL_CdcCtrlObject::curConfigStat, CSL_CdcCtrlObject::devNum, CSL_CdcCtrlObject::hEpObjArray, CSL_CdcInitStructApp::intrHandler, CSL_CdcObject::intrInEpObj, CSL_CdcObject::intrOutEpObj, CSL_CdcInitStructApp::pCdcObj, CSL_CdcCtrlObject::suspendFlag, USB_connectDev(), USB_initEndptObj(), USB_setParams(), and CSL_CdcCtrlObject::usbSpeedCfg.

Referenced by CDC_Open(), and CDC_OpenFullspeed().