USB Device Interface (UDI) for Vendor Class Device provides an interface for the configuration and management of USB Vendor Device.
The outline of this documentation is as follows:
For more details for Atmel® Software Framework (ASF) USB Device Stack, and USB Device Vendor, refer to following application notes:
Data Structures | |
struct | udi_vendor_desc_t |
Interface descriptor structure for vendor Class interface. More... | |
Interface with USB Device Core (UDC) | |
UDC_DESC_STORAGE udi_api_t | udi_api_vendor |
Global structure which contains standard UDI interface for UDC. More... | |
USB Interface Descriptors | |
The following structures provide predefined USB interface descriptors. It must be used to define the final USB descriptors. | |
#define | UDI_VENDOR_EPS_INT_DESC |
Endpoint descriptors. More... | |
#define | UDI_VENDOR_EPS_INT_DESC_FS |
#define | UDI_VENDOR_EPS_INT_DESC_HS |
#define | UDI_VENDOR_EPS_BULK_DESC |
#define | UDI_VENDOR_EPS_BULK_DESC_FS |
#define | UDI_VENDOR_EPS_BULK_DESC_HS |
#define | UDI_VENDOR_EPS_ISO_DESC |
#define | UDI_VENDOR_EPS_ISO_DESC_FS |
#define | UDI_VENDOR_EPS_ISO_DESC_HS |
#define | UDI_VENDOR_STRING_ID 0 |
By default no string is associated to this interface. More... | |
#define | UDI_VENDOR_EP_NB_INT ((UDI_VENDOR_EPS_SIZE_INT_FS)?2:0) |
Maximum six endpoints used by vendor interface. More... | |
#define | UDI_VENDOR_EP_NB_BULK ((UDI_VENDOR_EPS_SIZE_BULK_FS)?2:0) |
#define | UDI_VENDOR_EP_NB_ISO ((UDI_VENDOR_EPS_SIZE_ISO_FS)?2:0) |
#define | UDI_VENDOR_EP_NB (UDI_VENDOR_EP_NB_INT+UDI_VENDOR_EP_NB_BULK+UDI_VENDOR_EP_NB_ISO) |
#define | UDI_VENDOR_DESC |
Content of vendor interface descriptor for all speeds. More... | |
#define | UDI_VENDOR_DESC_FS |
Content of vendor interface descriptor for full speed only. More... | |
#define | UDI_VENDOR_DESC_HS |
Content of vendor interface descriptor for high speed only. More... | |
USB Device Interface (UDI) for Vendor Class | |
Common APIs used by high level application to use this USB class. These routines are used to transfer data to/from USB VENDOR endpoints. See Quick start guide for USB Device vendor module. | |
bool | udi_vendor_interrupt_in_run (uint8_t *buf, iram_size_t buf_size, udd_callback_trans_t callback) |
Start a transfer on interrupt IN. More... | |
bool | udi_vendor_interrupt_out_run (uint8_t *buf, iram_size_t buf_size, udd_callback_trans_t callback) |
Start a transfer on interrupt OUT. More... | |
bool | udi_vendor_bulk_in_run (uint8_t *buf, iram_size_t buf_size, udd_callback_trans_t callback) |
Start a transfer on bulk IN. More... | |
bool | udi_vendor_bulk_out_run (uint8_t *buf, iram_size_t buf_size, udd_callback_trans_t callback) |
Start a transfer on bulk OUT. More... | |
bool | udi_vendor_iso_in_run (uint8_t *buf, iram_size_t buf_size, udd_callback_trans_t callback) |
Start a transfer on isochronous IN. More... | |
bool | udi_vendor_iso_out_run (uint8_t *buf, iram_size_t buf_size, udd_callback_trans_t callback) |
Start a transfer on isochronous OUT. More... | |
#define UDI_VENDOR_DESC |
Content of vendor interface descriptor for all speeds.
#define UDI_VENDOR_DESC_FS |
Content of vendor interface descriptor for full speed only.
#define UDI_VENDOR_DESC_HS |
Content of vendor interface descriptor for high speed only.
#define UDI_VENDOR_EP_NB (UDI_VENDOR_EP_NB_INT+UDI_VENDOR_EP_NB_BULK+UDI_VENDOR_EP_NB_ISO) |
#define UDI_VENDOR_EP_NB_BULK ((UDI_VENDOR_EPS_SIZE_BULK_FS)?2:0) |
#define UDI_VENDOR_EP_NB_INT ((UDI_VENDOR_EPS_SIZE_INT_FS)?2:0) |
Maximum six endpoints used by vendor interface.
#define UDI_VENDOR_EP_NB_ISO ((UDI_VENDOR_EPS_SIZE_ISO_FS)?2:0) |
#define UDI_VENDOR_EPS_BULK_DESC |
#define UDI_VENDOR_EPS_BULK_DESC_FS |
#define UDI_VENDOR_EPS_BULK_DESC_HS |
#define UDI_VENDOR_EPS_INT_DESC |
Endpoint descriptors.
Support and FAQ: visit Microchip Support
#define UDI_VENDOR_EPS_INT_DESC_FS |
#define UDI_VENDOR_EPS_INT_DESC_HS |
#define UDI_VENDOR_EPS_ISO_DESC |
#define UDI_VENDOR_EPS_ISO_DESC_FS |
#define UDI_VENDOR_EPS_ISO_DESC_HS |
#define UDI_VENDOR_STRING_ID 0 |
By default no string is associated to this interface.
bool udi_vendor_bulk_in_run | ( | uint8_t * | buf, |
iram_size_t | buf_size, | ||
udd_callback_trans_t | callback | ||
) |
Start a transfer on bulk IN.
When the transfer is finished or aborted (stall, reset, ...), the callback is called. The callback returns the transfer status and eventually the number of byte transferred.
[in] | buf | Buffer on Internal RAM to send or fill. It must be align, then use COMPILER_WORD_ALIGNED. |
[in] | buf_size | Buffer size to send or fill |
[in] | callback | NULL or function to call at the end of transfer |
1
if function was successfully done, otherwise 0
. bool udi_vendor_bulk_out_run | ( | uint8_t * | buf, |
iram_size_t | buf_size, | ||
udd_callback_trans_t | callback | ||
) |
Start a transfer on bulk OUT.
When the transfer is finished or aborted (stall, reset, ...), the callback is called. The callback returns the transfer status and eventually the number of byte transferred.
[in] | buf | Buffer on Internal RAM to send or fill. It must be align, then use COMPILER_WORD_ALIGNED. |
[in] | buf_size | Buffer size to send or fill |
[in] | callback | NULL or function to call at the end of transfer |
1
if function was successfully done, otherwise 0
. bool udi_vendor_interrupt_in_run | ( | uint8_t * | buf, |
iram_size_t | buf_size, | ||
udd_callback_trans_t | callback | ||
) |
Start a transfer on interrupt IN.
When the transfer is finished or aborted (stall, reset, ...), the callback is called. The callback returns the transfer status and eventually the number of byte transferred.
[in] | buf | Buffer on Internal RAM to send or fill. It must be align, then use COMPILER_WORD_ALIGNED. |
[in] | buf_size | Buffer size to send or fill |
[in] | callback | NULL or function to call at the end of transfer |
1
if function was successfully done, otherwise 0
. bool udi_vendor_interrupt_out_run | ( | uint8_t * | buf, |
iram_size_t | buf_size, | ||
udd_callback_trans_t | callback | ||
) |
Start a transfer on interrupt OUT.
When the transfer is finished or aborted (stall, reset, ...), the callback is called. The callback returns the transfer status and eventually the number of byte transferred.
[in] | buf | Buffer on Internal RAM to send or fill. It must be align, then use COMPILER_WORD_ALIGNED. |
[in] | buf_size | Buffer size to send or fill |
[in] | callback | NULL or function to call at the end of transfer |
1
if function was successfully done, otherwise 0
. bool udi_vendor_iso_in_run | ( | uint8_t * | buf, |
iram_size_t | buf_size, | ||
udd_callback_trans_t | callback | ||
) |
Start a transfer on isochronous IN.
When the transfer is finished or aborted (stall, reset, ...), the callback is called. The callback returns the transfer status and eventually the number of byte transferred.
[in] | buf | Buffer on Internal RAM to send or fill. It must be align, then use COMPILER_WORD_ALIGNED. |
[in] | buf_size | Buffer size to send or fill |
[in] | callback | NULL or function to call at the end of transfer |
1
if function was successfully done, otherwise 0
. bool udi_vendor_iso_out_run | ( | uint8_t * | buf, |
iram_size_t | buf_size, | ||
udd_callback_trans_t | callback | ||
) |
Start a transfer on isochronous OUT.
When the transfer is finished or aborted (stall, reset, ...), the callback is called. The callback returns the transfer status and eventually the number of byte transferred.
[in] | buf | Buffer on Internal RAM to send or fill. It must be align, then use COMPILER_WORD_ALIGNED. |
[in] | buf_size | Buffer size to send or fill |
[in] | callback | NULL or function to call at the end of transfer |
1
if function was successfully done, otherwise 0
. UDC_DESC_STORAGE udi_api_t udi_api_vendor |
Global structure which contains standard UDI interface for UDC.