UM1021 - STMicroelectronics


Add to my manuals
107 Pages

advertisement

UM1021 - STMicroelectronics | Manualzz

UM1021

6.5

USB device library

Table 8.

usbd_req (.c, .h)

(continued)

Functions

void USBD_ParseSetupRequest

( USB_OTG_CORE_HANDLE *pdev,

USB_SETUP_REQ *req) void USBD_CtlError

( USB_OTG_CORE_HANDLE *pdev,

USB_SETUP_REQ *req)

Description

Copies request buffer into setup structure.

Handles USB Errors on the control pipe.

USB device class interface

The USB class is chosen during the USB Device library initialization by selecting the corresponding class callback structure. The class structure is defined as follows: typedef struct _Device_cb

{

uint8_t (*Init) (void *pdev , uint8_t cfgidx);

uint8_t (*DeInit) (void *pdev , uint8_t cfgidx);

/* Control Endpoints*/

uint8_t (*Setup) (void *pdev , USB_SETUP_REQ *req);

uint8_t (*EP0_TxSent) (void *pdev );

uint8_t (*EP0_RxReady) (void *pdev );

/* Class Specific Endpoints*/

uint8_t (*DataIn) (void *pdev , uint8_t epnum);

uint8_t (*DataOut) (void *pdev , uint8_t epnum);

uint8_t (*SOF) (void *pdev);

uint8_t (*IsoINIncomplete) (void *pdev);

uint8_t (*IsoOUTIncomplete) (void *pdev);

uint8_t *(*GetConfigDescriptor)( uint8_t speed , uint16_t *length);

#ifdef USB_OTG_HS_CORE

uint8_t *(*GetOtherConfigDescriptor)( uint8_t speed , uint16_t

*length);

#endif

#ifdef USB_SUPPORT_USER_STRING_DESC

uint8_t *(*GetUsrStrDescriptor)( uint8_t speed ,uint8_t index, uint16_t

*length);

#endif

} USBD_Class_cb_TypeDef;

Init: this callback is called when the device receives the set configuration request; in this function the endpoints used by the class interface are open.

DeInit: This callback is called when the clear configuration request has been received; this function closes the endpoints used by the class interface.

Setup: This callback is called to handle the specific class setup requests.

EP0_TxSent: This callback is called when the send status is finished.

EP0_RxSent: This callback is called when the receive status is finished.

Doc ID 18153 Rev 3 35/107

advertisement

Was this manual useful for you? Yes No
Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

advertisement

Table of contents