www.beck-ipc.com

@CHIP-RTOS C Library V2.06 - USB API


usbSend

Enqueues a send request to an endpoint's TX queue. In Device mode the data will be transmitted when the Host issues an IN token. In Host mode the data will be transmitted when a SETUP or OUT token is issued using usbHostIssueToken(). When the request has been completed the callback-function will be called with a status of USB_EVENT_SENT.

int usbSend( unsigned char address,

unsigned char epNumber,
void far *buffer,
unsigned length,
UsbBool less );

Parameters

address

Host mode: Address of the device that is to receive the data
Device mode: Must always be 0x00

epNumber

Number of the enpoint via which the data is to be sent

buffer

Data to be sent

length

Length of data to be sent

less

Host mode: Must always be FALSE
Device mode: Set this parameter to TRUE if the host demanded more data than is to be sent. This does only apply to control endpoints.

Return Value

Error code

Comments

The buffer that is used for sending must be allocated by the application and be available while the USB-driver processes the send-request. After it has completed the callback-function will be called with an USB_EVENT_SENT event (or maybe an error event). After that the buffer can be released.

RTOS API

This library function uses a dynamic link to reach the function USB_SERVICE_SEND offered by RTOS USB Software Interrupt.

Related Topics

C-library function usbDeviceConfigEp()
C-library function usbHostIssueToken()
C-library function usbHostClearQueue()
C-library function usbHostReserveEp0()
C-library function usbHostReleaseEp0()
Type UsbCallback

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3
    n/an/an/aV0.90

Supported by @CHIP-RTOS C Library since version

    CLIB
    V2.01

This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document