Data Structures |
struct | USBDTransferBuffer |
| Buffer struct used for multi-buffer-listed transfer. More...
|
struct | _USBDDmaDescriptor |
| Struct used for USBD DMA Link List Transfer Descriptor, must be 16-bytes aligned. More...
|
struct | USBDDriverDescriptors |
struct | USBDDriver |
Modules |
| USB device API return codes |
| USB device states |
Typedefs |
typedef void(* | TransferCallback )(void *pArg, uint8_t status, uint32_t transferred, uint32_t remaining) |
typedef void(* | MblTransferCallback )(void *pArg, uint8_t status) |
Functions |
void | USBD_SuspendHandler (void) |
void | USBD_ResumeHandler (void) |
void | USBD_ResetHandler () |
void | USBD_RequestHandler (uint8_t bEndpoint, const USBGenericRequest *pRequest) |
void | USBD_ConfigureEndpoint (const USBEndpointDescriptor *pDescriptor) |
uint8_t | USBD_Write (uint8_t bEndpoint, const void *pData, uint32_t dLength, TransferCallback fCallback, void *pArgument) |
uint8_t | USBD_Read (uint8_t bEndpoint, void *pData, uint32_t dLength, TransferCallback fCallback, void *pArgument) |
void | USBD_Halt (uint8_t bEndpoint) |
void | USBD_Unhalt (uint8_t bEndpoint) |
uint8_t | USBD_IsHalted (uint8_t bEndpoint) |
uint8_t | USBD_IsHighSpeed (void) |
uint8_t | USBD_Stall (uint8_t bEndpoint) |
void | USBD_SetAddress (uint8_t address) |
void | USBD_SetConfiguration (uint8_t cfgnum) |
void | USBD_RemoteWakeUp (void) |
void | USBD_Connect (void) |
void | USBD_Disconnect (void) |
void | USBD_Init (void) |
uint8_t | USBD_GetState (void) |
void | USBD_Test (uint8_t bIndex) |
void | USBD_ForceFullSpeed (void) |
WEAK void | USBDCallbacks_Initialized (void) |
WEAK void | USBDCallbacks_Reset (void) |
WEAK void | USBDCallbacks_Suspended (void) |
WEAK void | USBDCallbacks_Resumed (void) |
WEAK void | USBDCallbacks_RequestReceived (const USBGenericRequest *request) |
USBDDriver * | USBD_GetDriver (void) |
void | USBDDriver_Initialize (USBDDriver *pDriver, const USBDDriverDescriptors *pDescriptors, uint8_t *pInterfaces) |
USBConfigurationDescriptor * | USBDDriver_GetCfgDescriptors (USBDDriver *pDriver, uint8_t cfgNum) |
void | USBDDriver_RequestHandler (USBDDriver *pDriver, const USBGenericRequest *pRequest) |
uint8_t | USBDDriver_IsRemoteWakeUpEnabled (const USBDDriver *pDriver) |
uint8_t | USBDDriver_returnOTGFeatures (const USBDDriver *pDriver) |
void | USBDDriver_clearOTGFeatures (USBDDriver *pDriver) |
WEAK void | USBDDriverCallbacks_ConfigurationChanged (uint8_t cfgnum) |
WEAK void | USBDDriverCallbacks_InterfaceSettingChanged (uint8_t interface, uint8_t setting) |
struct _USBDDmaDescriptor | __attribute__ ((aligned(16))) USBDDmaDescriptor |
| Struct used for USBD DMA Link List Transfer Descriptor, must be 16-bytes aligned.
|
Variables |
uint8_t | ForceFS = 0 |
uint8_t USBD_Read |
( |
uint8_t |
bEndpoint, |
|
|
void * |
pData, |
|
|
uint32_t |
dLength, |
|
|
TransferCallback |
fCallback, |
|
|
void * |
pArgument | |
|
) |
| | |
Reads incoming data on an USB endpoint This methods sets the transfer descriptor and activate the endpoint interrupt. The actual transfer is then carried out by the endpoint interrupt handler. The Read operation finishes either when the buffer is full, or a short packet (inferior to endpoint maximum size) is received.
*The buffer must be kept allocated until the transfer is finished*.
- Parameters:
-
| bEndpoint | Endpoint number. |
| pData | Pointer to a data buffer. |
| dLength | Size of the data buffer in bytes. |
| fCallback | Optional end-of-transfer callback function. |
| pArgument | Optional argument to the callback function. |
- Returns:
- USBD_STATUS_SUCCESS if the read operation has been started; otherwise, the corresponding error code.
Definition at line 318 of file USBD.c.
uint8_t USBD_Write |
( |
uint8_t |
bEndpoint, |
|
|
const void * |
pData, |
|
|
uint32_t |
dLength, |
|
|
TransferCallback |
fCallback, |
|
|
void * |
pArgument | |
|
) |
| | |
Sends data through a USB endpoint. Sets up the transfer descriptor, writes one or two data payloads (depending on the number of FIFO bank for the endpoint) and then starts the actual transfer. The operation is complete when all the data has been sent.
*If the size of the buffer is greater than the size of the endpoint (or twice the size if the endpoint has two FIFO banks), then the buffer must be kept allocated until the transfer is finished*. This means that it is not possible to declare it on the stack (i.e. as a local variable of a function which returns after starting a transfer).
- Parameters:
-
| bEndpoint | Endpoint number. |
| pData | Pointer to a buffer with the data to send. |
| dLength | Size of the data buffer. |
| fCallback | Optional callback function to invoke when the transfer is complete. |
| pArgument | Optional argument to the callback function. |
- Returns:
- USBD_STATUS_SUCCESS if the transfer has been started; otherwise, the corresponding error status code.
Definition at line 191 of file USBD.c.