Comtrol eCos User Manual

Page 716

Advertising
background image

Writing a USB Device Driver

usbs_testing_endpoint usbs_testing_endpoints[] = {

{

endpoint_type

: USB_ENDPOINT_DESCRIPTOR_ATTR_CONTROL,

endpoint_number

: 0,

endpoint_direction

: USB_ENDPOINT_DESCRIPTOR_ENDPOINT_IN,

endpoint

: (void*) &ep0.common,

devtab_entry

: (const char*) 0,

min_size

: 1,

max_size

: 0x0FFFF,

max_in_padding

: 0,

alignment

: 0

},

...,

USBS_TESTING_ENDPOINTS_TERMINATOR

};

Note: The use of a single array

usbs_testing_endpoints

limits USB testing to platforms with a single USB

device: if there were multiple devices, each defining their own instance of this array, then there would a collision
at link time. In practice this should not be a major problem since typical USB peripherals only interact with a
single host machine via a single slave port. In addition, even if a peripheral did have multiple slave ports the
current USB testing code would not support this since it would not know which port to use.

612

Advertising