www.beck-ipc.com

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


usbHostInit

This function registers a user driver and initialises the RTOS USB-driver for Host mode if no other user driver has already done this. There can be several user drivers loaded in Host mode. Each driver registers a callback-function which is called when an event (e.g. completed transaction) appears on a device that the driver is assigned to. User drivers are assigned to Interfaces which allows a device with two different functions and thus two different Interfaces to be handled by two different drivers. The criteria for the assignment of user drivers to Interfaces are the codes handed to this function.

int usbHostInit( UsbCallback callback,

unsigned char classCode,
unsigned char subClassCode,
unsigned char protocolCode,
unsigned vendorId,
unsigned productId,
unsigned versionBcd );

Parameters

callback

Callback function

classCode

Class code

subClassCode

Subclass code

protocolCode

Protocol code
If the user driver can handle devices of one of the Device Classes, these arguements identify the class, subclass and protocol. If the user driver handles vendor-specific protocols, set these arguments to 0.

vendorId

Vendor ID

productId

Product ID

versionBcd

Product version in BCD code
If the user driver handles devices using a vendor-specific protocol, these arguements identify the Vendor and Product ID of the resp. device as well as the maximum product version that the driver can handle. If the user driver can handle devices of one of the Device Classes, set these arguments to 0.

Return Value

Assigned driver ID or Error code ; The driver ID will be needed for other API functions.

Comments

This function must not be called from within the callback-function.

RTOS API

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

Related Topics

C-library function usbHostDeinit()

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3
    n/an/an/aV1.06

Supported by @CHIP-RTOS C Library since version

    CLIB
    V2.05

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


End of document