USBD_Vendor_WrAsync

Decription

Send data to host through Bulk IN endpoint. This function is non-blocking. It returns immediately after transfer preparation. Upon transfer completion, a callback provided by the application will be called to finalize the transfer.

Files

usbd_vendor.h / usbd_vendor.c

Prototype

void  USBD_Vendor_WrAsync (CPU_INT08U               class_nbr,
                           void                    *p_buf,
                           CPU_INT32U               buf_len,
                           USBD_VENDOR_ASYNC_FNCT   async_fnct,
                           void                    *p_async_arg,
                           CPU_BOOLEAN              end,
                           USBD_ERR                *p_err);


Arguments

class_nbr

Class instance number.

p_buf

Pointer to transmit buffer.

buf_len

Transmit buffer length in octets.

async_fnct

Transmit callback.

p_async_arg

Additional argument provided by application for transmit callback.

end

End-of-transfer flag.

p_err

Pointer to variable that will receive the return error code from this function.

USBD_ERR_NONE
USBD_ERR_NULL_PTR
USBD_ERR_INVALID_ARG
USBD_ERR_INVALID_CLASS_STATE
USBD_ERR_DEV_INVALID_NBR
USBD_ERR_EP_INVALID_NBR
USBD_ERR_DEV_INVALID_STATE
USBD_ERR_EP_INVALID_TYPE
USBD_ERR_EP_INVALID_STATE

Returned Value

Number of octets sent, if NO error(s).

0, otherwise.

Callers

Application.

Notes / Warnings

If end-of-transfer flag is set and transfer length is multiple of maximum packet size, a zero-length packet is transferred to indicate the end of transfer to the host.