USBD_BulkTxAsync

Description

Sends data on bulk IN endpoint asynchronously.

Files

usbd_core.h/usbd_core.c

Prototype

void  USBD_BulkTxAsync (CPU_INT08U        dev_nbr,
                        CPU_INT08U        ep_addr,
                        void             *p_buf,
                        CPU_INT32U        buf_len,
                        USBD_ASYNC_FNCT   async_fnct,
                        void             *p_async_arg,
                        CPU_BOOLEAN       end,
                        USBD_ERR         *p_err);


Arguments

dev_nbr

Device number.

ep_addr

Endpoint address.

p_buf

Pointer to buffer of data that will be transmitted

buf_len

Number of octets to transmit.

async_fnct

Function that will be invoked upon completion of transmit operation.

p_async_arg

Pointer to argument that will be passed as parameter of async_fnct (see Note #2).

end

End-of-transfer flag (see Note #1).

p_err

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

USBD_ERR_NONE
USBD_ERR_DEV_INVALID_NBR
USBD_ERR_DEV_INVALID_STATE
USBD_ERR_EP_INVALID_ADDR
USBD_ERR_EP_INVALID_STATE
USBD_ERR_EP_INVALID_TYPE
USBD_ERR_OS_TIMEOUT
USBD_ERR_OS_ABORT
USBD_ERR_OS_FAIL

Returned Value

None.

Callers

Classes.

Notes / Warnings

  1. If end-of-transfer is set and transfer length is multiple of maximum packet size, a zero-length packet is transferred to indicate a short transfer to the host.
  2. The callback specified by async_fnct has the following prototype.
void  USB_AsyncFnct (CPU_INT08U   dev_nbr,
                     CPU_INT08U   ep_addr,
                     void        *p_buf,
                     CPU_INT32U   buf_len,
                     CPU_INT32U   xfer_len,
                     void        *p_arg,
                     USBD_ERR     err);


Argument(s):

dev_nbr

Device number.

ep_addr

Endpoint address.

p_buf

Pointer to buffer of data that will be transmitted.

buf_len

Buffer length.

xfer_len

Number of byte transmitted.

p_arg

Pointer to function argument.

err

Error status.

USBD_ERR_NONE
USBD_ERR_EP_ABORT