This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Configuring USB device


im using a Windows based environment with a Pentium
CPU as both Host and Target. I need to 

write a device driver for USB

I need to know that how can we get information about
our USB device, how can we detect the 

device, how can we configure it?

I have written a test code for getting device handle
by using the function "cyg_io_lookup" 

but havent been successful in getting the device
handle

-Is it possible to get USB device handle using
'cyg_io_lookup' function?
-If No then which function should I use to get the
device handle.


static void simple_prog(CYG_ADDRESS data)
{
    cyg_uint32 len = 1;
    cyg_io_handle_t handle;
    Cyg_ErrNo err;
    unsigned char 

data[]={0x80,0x06,0x02,USB_CONFIGURATION_DESCRIPTOR_TYPE,0x00,0x00,0x0009};
    int index i=0;
    err = cyg_io_lookup( "/dev/usb0c", &handle );
    printf("USB %d\n",err);

    if (ENOERR == err) 
    {
        printf("Found /dev/haldiag. Writing
string....\n");
  	  for(index=0;index<8;index++)
  	  {
  	  	cyg_io_write( handle, data[index], &len );
   	 	printf("value sent to usb is:
%4x\n",data[index]);
	  }
    }
    

 
}


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]