USBD_DrvEP_Tx

Description

Configure endpoint with buffer to transmit data.

Files

Every device driver’s usbd_drv.c

Prototype

static  CPU_INT32U  USBD_DrvEP_Tx (USBD_DRV    *p_drv,
                                   CPU_INT08U   ep_addr,
                                   CPU_INT08U  *p_buf,
                                   CPU_INT32U   buf_len,
                                   USBD_ERR    *p_err);


Arguments

p_drv

Pointer to USB device driver structure.

ep_addr

Endpoint address.

p_buf

Pointer to data buffer.

buf_len

Length of the buffer.

p_err

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

Returned Value

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

0, otherwise.

Callers

USB device core layer.

Notes / Warnings

  1. Typically, the function to configure the endpoint receive transaction performs the following operations:
    1. Check if data can be transmitted.
    2. Write data to device endpoint.
    3. Configure the packet length in USB device controller. This is often necessary when the packet is shorter than the maximum packet size. Depending on the USB controller, this operation may need to be performed prior to writing the data to the device endpoint.