USBD_CtrlTx
Description
Sends data on control IN endpoint.
Files
usbd_core.h/usbd_ep.c
Prototype
CPU_INT32U USBD_CtrlTx (CPU_INT08U dev_nbr, void *p_buf, CPU_INT32U buf_len, CPU_INT16U timeout_ms, CPU_BOOLEAN end, USBD_ERR *p_err);
Arguments
dev_nbr
Device number.
p_buf
Pointer to buffer of data that will be sent
buf_len
Number of octets to transmit.
timeout_ms
Timeout in milliseconds.
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_INVALID_ARG
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
Number of octets transmitted,
if no errors.
0,
otherwise.
Callers
Classes.
Notes / Warnings
- 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.
- This function can be only called from USB device class drivers during class specific setup request callbacks.