Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - USB question about callbacks and approach: (1 Item)
   
USB question about callbacks and approach  
I am new to writing drivers in QNX.

The documentation mentions that, it is possible to use usbd_attach() in callback or in loop. As far as i understand the 
loop method, I totally don`t get the callback one. The problem lies in callback parameters. The documentation provides 
callback prototype: void (*insertion)(struct usbd_connection *, usbd_device_instance_t *instance). I dont know where to 
get the second one, should I fill up the struct on my own or what?

I will be very grateful if you could provide me any simple example of how should the callbacks look like.

The other thing I`d like to ask is the approach in writing drivers for usb devices. Do I have to use the usbd_* 
interface or can I get access to the USB controller (via pci_* interface functions) and then use in()/out() functions to
 perform IO operations, by writing to the base address of USB controller?

Thanks!