Prusa MINI Firmware overview
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_desc.h"
#include "usbd_ctlreq.h"

Functions

static uint8_t USBD_CDC_Init (USBD_HandleTypeDef *pdev, uint8_t cfgidx)
 USBD_CDC_Init Initialize the CDC interface. More...
 
static uint8_t USBD_CDC_DeInit (USBD_HandleTypeDef *pdev, uint8_t cfgidx)
 USBD_CDC_Init DeInitialize the CDC layer. More...
 
static uint8_t USBD_CDC_Setup (USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
 USBD_CDC_Setup Handle the CDC specific requests. More...
 
static uint8_t USBD_CDC_DataIn (USBD_HandleTypeDef *pdev, uint8_t epnum)
 USBD_CDC_DataIn Data sent on non-control IN endpoint. More...
 
static uint8_t USBD_CDC_DataOut (USBD_HandleTypeDef *pdev, uint8_t epnum)
 USBD_CDC_DataOut Data received on non-control Out endpoint. More...
 
static uint8_t USBD_CDC_EP0_RxReady (USBD_HandleTypeDef *pdev)
 USBD_CDC_DataOut Data received on non-control Out endpoint. More...
 
static uint8_tUSBD_CDC_GetFSCfgDesc (uint16_t *length)
 USBD_CDC_GetFSCfgDesc Return configuration descriptor. More...
 
static uint8_tUSBD_CDC_GetHSCfgDesc (uint16_t *length)
 USBD_CDC_GetHSCfgDesc Return configuration descriptor. More...
 
static uint8_tUSBD_CDC_GetOtherSpeedCfgDesc (uint16_t *length)
 USBD_CDC_GetCfgDesc Return configuration descriptor. More...
 
uint8_tUSBD_CDC_GetDeviceQualifierDescriptor (uint16_t *length)
 DeviceQualifierDescriptor return Device Qualifier descriptor. More...
 
uint8_t USBD_CDC_RegisterInterface (USBD_HandleTypeDef *pdev, USBD_CDC_ItfTypeDef *fops)
 USBD_CDC_RegisterInterface. More...
 
uint8_t USBD_CDC_SetTxBuffer (USBD_HandleTypeDef *pdev, uint8_t *pbuff, uint16_t length)
 USBD_CDC_SetTxBuffer. More...
 
uint8_t USBD_CDC_SetRxBuffer (USBD_HandleTypeDef *pdev, uint8_t *pbuff)
 USBD_CDC_SetRxBuffer. More...
 
uint8_t USBD_CDC_TransmitPacket (USBD_HandleTypeDef *pdev)
 USBD_CDC_DataOut Data received on non-control Out endpoint. More...
 
uint8_t USBD_CDC_ReceivePacket (USBD_HandleTypeDef *pdev)
 USBD_CDC_ReceivePacket prepare OUT Endpoint for reception. More...
 

Variables

static __ALIGN_BEGIN uint8_t USBD_CDC_DeviceQualifierDesc[USB_LEN_DEV_QUALIFIER_DESC__ALIGN_END
 
USBD_ClassTypeDef USBD_CDC
 

Detailed Description

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

Author
MCD Application Team
Version
V2.4.2
Date
11-December-2015
  • 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
*
*          ===================================================================
*                                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
*
*  
Attention

© COPYRIGHT 2015 STMicroelectronics

Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at:

   http://www.st.com/software_license_agreement_liberty_v2

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.