STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
usbd_cdc.c File Reference

This file provides the high layer firmware functions to manage the following functionalities of the USB CDC Class: More...

#include "usbd_cdc.h"
#include "usbd_ctlreq.h"
Include dependency graph for usbd_cdc.c:

Go to the source code of this file.

Functions

static uint8_t USBD_CDC_Init (USBD_HandleTypeDef *pdev, uint8_t cfgidx)
 USBD_CDC_Init Initialize the CDC interface.
static uint8_t USBD_CDC_DeInit (USBD_HandleTypeDef *pdev, uint8_t cfgidx)
 USBD_CDC_Init DeInitialize the CDC layer.
static uint8_t USBD_CDC_Setup (USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
 USBD_CDC_Setup Handle the CDC specific requests.
static uint8_t USBD_CDC_DataIn (USBD_HandleTypeDef *pdev, uint8_t epnum)
 USBD_CDC_DataIn Data sent on non-control IN endpoint.
static uint8_t USBD_CDC_DataOut (USBD_HandleTypeDef *pdev, uint8_t epnum)
 USBD_CDC_DataOut Data received on non-control Out endpoint.
static uint8_t USBD_CDC_EP0_RxReady (USBD_HandleTypeDef *pdev)
 USBD_CDC_EP0_RxReady Handle EP0 Rx Ready event.
static uint8_t * USBD_CDC_GetFSCfgDesc (uint16_t *length)
 USBD_CDC_GetFSCfgDesc Return configuration descriptor.
static uint8_t * USBD_CDC_GetHSCfgDesc (uint16_t *length)
 USBD_CDC_GetHSCfgDesc Return configuration descriptor.
static uint8_t * USBD_CDC_GetOtherSpeedCfgDesc (uint16_t *length)
 USBD_CDC_GetOtherSpeedCfgDesc Return configuration descriptor.
uint8_t * USBD_CDC_GetDeviceQualifierDescriptor (uint16_t *length)
 USBD_CDC_GetDeviceQualifierDescriptor return Device Qualifier descriptor.
uint8_t USBD_CDC_RegisterInterface (USBD_HandleTypeDef *pdev, USBD_CDC_ItfTypeDef *fops)
 USBD_CDC_RegisterInterface.
uint8_t USBD_CDC_SetTxBuffer (USBD_HandleTypeDef *pdev, uint8_t *pbuff, uint32_t length)
 USBD_CDC_SetTxBuffer.
uint8_t USBD_CDC_SetRxBuffer (USBD_HandleTypeDef *pdev, uint8_t *pbuff)
 USBD_CDC_SetRxBuffer.
uint8_t USBD_CDC_TransmitPacket (USBD_HandleTypeDef *pdev)
 USBD_CDC_TransmitPacket Transmit packet on IN endpoint.
uint8_t USBD_CDC_ReceivePacket (USBD_HandleTypeDef *pdev)
 USBD_CDC_ReceivePacket prepare OUT Endpoint for reception.

Variables

static __ALIGN_BEGIN uint8_t USBD_CDC_DeviceQualifierDesc[USB_LEN_DEV_QUALIFIER_DESC] __ALIGN_END
USBD_ClassTypeDef USBD_CDC
static uint8_t CDCInEpAdd = CDC_IN_EP
static uint8_t CDCOutEpAdd = CDC_OUT_EP
static uint8_t CDCCmdEpAdd = CDC_CMD_EP

Detailed Description

This file provides the high layer firmware functions to manage the following functionalities of the USB CDC Class:

Author
MCD Application Team
  • Initialization and Configuration of high and low layer
  • Enumeration as CDC Device (and enumeration for each implemented memory interface)
  • OUT/IN data transfer
  • Command IN transfer (class requests management)
  • Error management
Attention

Copyright (c) 2015 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

*
*          ===================================================================
*                                CDC Class Driver Description
*          ===================================================================
*           This driver manages the "Universal Serial Bus Class Definitions for Communications Devices
*           Revision 1.2 November 16, 2007" and the sub-protocol specification of "Universal Serial Bus
*           Communications Class Subclass Specification for PSTN Devices Revision 1.2 February 9, 2007"
*           This driver implements the following aspects of the specification:
*             - Device descriptor management
*             - Configuration descriptor management
*             - Enumeration as CDC device with 2 data endpoints (IN and OUT) and 1 command endpoint (IN)
*             - Requests management (as described in section 6.2 in specification)
*             - Abstract Control Model compliant
*             - Union Functional collection (using 1 IN endpoint for control)
*             - Data interface class
*
*           These aspects may be enriched or modified for a specific user application.
*
*            This driver doesn't implement the following aspects of the specification
*            (but it is possible to manage these features with some modifications on this driver):
*             - Any class-specific aspect relative to communication classes should be managed by user application.
*             - All communication classes other than PSTN are not managed
*
*  

Definition in file usbd_cdc.c.