108#ifndef USE_USBD_COMPOSITE
115#ifndef USE_USBD_COMPOSITE
153#ifdef USE_USBD_COMPOSITE
164#if (USBD_SUPPORT_USER_STRING_DESC == 1U)
169#ifndef USE_USBD_COMPOSITE
182#if (USBD_SELF_POWERED == 1U)
308#ifdef USE_USBD_COMPOSITE
396#ifdef USE_USBD_COMPOSITE
441 uint16_t status_info = 0U;
452 if (req->wLength != 0U)
454 if ((req->bmRequest & 0x80U) != 0U)
457 (uint8_t *)hcdc->
data,
479 switch (req->bRequest)
542 PCD_HandleTypeDef *hpcd = (PCD_HandleTypeDef *)pdev->
pData;
552 ((pdev->
ep_in[epnum & 0xFU].
total_length % hpcd->IN_ep[epnum & 0xFU].maxpacket) == 0U))
618 (uint8_t *)hcdc->
data,
625#ifndef USE_USBD_COMPOSITE
638 if (pEpCmdDesc !=
NULL)
643 if (pEpOutDesc !=
NULL)
648 if (pEpInDesc !=
NULL)
653 *length = (uint16_t)
sizeof(USBD_CDC_CfgDesc);
654 return USBD_CDC_CfgDesc;
669 if (pEpCmdDesc !=
NULL)
674 if (pEpOutDesc !=
NULL)
679 if (pEpInDesc !=
NULL)
684 *length = (uint16_t)
sizeof(USBD_CDC_CfgDesc);
685 return USBD_CDC_CfgDesc;
700 if (pEpCmdDesc !=
NULL)
705 if (pEpOutDesc !=
NULL)
710 if (pEpInDesc !=
NULL)
715 *length = (uint16_t)
sizeof(USBD_CDC_CfgDesc);
716 return USBD_CDC_CfgDesc;
727 *length = (uint16_t)
sizeof(USBD_CDC_DeviceQualifierDesc);
729 return USBD_CDC_DeviceQualifierDesc;
760#ifdef USE_USBD_COMPOSITE
762 uint8_t *pbuff, uint32_t length, uint8_t ClassId)
767 uint8_t *pbuff, uint32_t length)
811#ifdef USE_USBD_COMPOSITE
823#ifdef USE_USBD_COMPOSITE
860#ifdef USE_USBD_COMPOSITE
static uint8_t * USBD_CDC_GetFSCfgDesc(uint16_t *length)
USBD_CDC_GetFSCfgDesc Return configuration descriptor.
static uint8_t USBD_CDC_DeInit(USBD_HandleTypeDef *pdev, uint8_t cfgidx)
USBD_CDC_Init DeInitialize the CDC layer.
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_Setup(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
USBD_CDC_Setup Handle the CDC specific requests.
uint8_t * USBD_CDC_GetDeviceQualifierDescriptor(uint16_t *length)
USBD_CDC_GetDeviceQualifierDescriptor return Device Qualifier descriptor.
static uint8_t * USBD_CDC_GetOtherSpeedCfgDesc(uint16_t *length)
USBD_CDC_GetOtherSpeedCfgDesc Return configuration descriptor.
static uint8_t USBD_CDC_Init(USBD_HandleTypeDef *pdev, uint8_t cfgidx)
USBD_CDC_Init Initialize the CDC interface.
static uint8_t * USBD_CDC_GetHSCfgDesc(uint16_t *length)
USBD_CDC_GetHSCfgDesc Return configuration descriptor.
uint8_t USBD_CDC_RegisterInterface(USBD_HandleTypeDef *pdev, USBD_CDC_ItfTypeDef *fops)
USBD_CDC_RegisterInterface.
uint8_t USBD_CDC_ReceivePacket(USBD_HandleTypeDef *pdev)
USBD_CDC_ReceivePacket prepare OUT Endpoint for reception.
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_SetTxBuffer(USBD_HandleTypeDef *pdev, uint8_t *pbuff, uint32_t length)
USBD_CDC_SetTxBuffer.
static uint8_t CDCCmdEpAdd
static uint8_t CDCOutEpAdd
static uint8_t CDCInEpAdd
#define USBD_malloc
Alias for memory allocation.
#define USBD_free
Alias for memory release.
#define USBD_memset
Alias for memory set.
USBD_StatusTypeDef USBD_LL_Transmit(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t *pbuf, uint32_t size)
Transmits data over an endpoint.
USBD_StatusTypeDef USBD_LL_PrepareReceive(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t *pbuf, uint32_t size)
Prepares an endpoint for reception.
USBD_StatusTypeDef USBD_LL_OpenEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t ep_type, uint16_t ep_mps)
Opens an endpoint of the low level driver.
USBD_StatusTypeDef USBD_LL_CloseEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr)
Closes an endpoint of the low level driver.
uint32_t USBD_LL_GetRxDataSize(USBD_HandleTypeDef *pdev, uint8_t ep_addr)
Returns the last transferred packet size.
void * USBD_GetEpDesc(uint8_t *pConfDesc, uint8_t EpAddr)
USBD_GetEpDesc This function return the Endpoint descriptor.
USBD_ClassTypeDef USBD_CDC
struct _USBD_HandleTypeDef USBD_HandleTypeDef
struct usb_setup_req USBD_SetupReqTypedef
struct _Device_cb USBD_ClassTypeDef
USBD_StatusTypeDef USBD_CtlSendData(USBD_HandleTypeDef *pdev, uint8_t *pbuf, uint32_t len)
USBD_CtlSendData send data on the ctl pipe.
USBD_StatusTypeDef USBD_CtlPrepareRx(USBD_HandleTypeDef *pdev, uint8_t *pbuf, uint32_t len)
USBD_CtlPrepareRx receive data on the ctl pipe.
void USBD_CtlError(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
USBD_CtlError Handle USB low level Error.
#define USB_REQ_GET_INTERFACE
#define USB_REQ_SET_INTERFACE
#define USB_DESC_TYPE_CONFIGURATION
#define USB_REQ_TYPE_STANDARD
#define USB_REQ_CLEAR_FEATURE
#define USBD_STATE_CONFIGURED
#define USBD_EP_TYPE_BULK
#define USB_REQ_TYPE_MASK
#define USB_REQ_GET_STATUS
#define USB_LEN_DEV_QUALIFIER_DESC
#define USB_DESC_TYPE_ENDPOINT
#define USB_DESC_TYPE_INTERFACE
#define USB_DESC_TYPE_DEVICE_QUALIFIER
#define USBD_EP_TYPE_INTR
#define USB_REQ_TYPE_CLASS
#define CDC_DATA_HS_IN_PACKET_SIZE
#define CDC_DATA_FS_MAX_PACKET_SIZE
#define CDC_DATA_FS_OUT_PACKET_SIZE
#define CDC_DATA_HS_OUT_PACKET_SIZE
#define CDC_REQ_MAX_DATA_SIZE
#define CDC_DATA_HS_MAX_PACKET_SIZE
#define USB_CDC_CONFIG_DESC_SIZ
#define CDC_CMD_PACKET_SIZE
#define CDC_DATA_FS_IN_PACKET_SIZE
struct _USBD_CDC_Itf USBD_CDC_ItfTypeDef
uint32_t data[CDC_DATA_HS_MAX_PACKET_SIZE/4U]
USBD_EndpointTypeDef ep_in[16]
USBD_EndpointTypeDef ep_out[16]
void * pClassDataCmsit[USBD_MAX_SUPPORTED_CLASS]
USBD_SpeedTypeDef dev_speed
void * pUserData[USBD_MAX_SUPPORTED_CLASS]
header file for the usbd_cdc.c file.