about uddk1.0 beta

bridged with qdn.public.ddk.usb
Post Reply
leon mike

about uddk1.0 beta

Post by leon mike » Sat Mar 22, 2003 2:22 pm

I am doing the same things as TIA, peter.But there are some confusions int the uddk 1.0beta under RTP6.1 .

for example:
What's means of the argu 'handle' int the function usbd_io(),docs said that 'user data',but how to
use? :-<

What's means of the argu 'frame' int the function usbd_setup_isochronous(),etc
And how to sent a vendor command to start the video capturing ?

My device's chipest is ov511+ and UHCI based usb1.1.

Anyone can explain these questions? I will very appreciate!

Peter

Re: about uddk1.0 beta

Post by Peter » Sat Mar 22, 2003 5:49 pm

hi leon,
to do any transaction on the usb subsystem you have to do two things:
setup an urb using usbd_setup_.....()
and usbd_io()
the handle is simply a void pointer which you can use in your callback
function. It's used to pass e.g. device information to the callback.
e.g.
if(0 == usbd_setup_isochronous(urb, URB_ISOCH_ASAP | URB_DIR_IN, 0, databuffer, pdev->vmax_packet_size))

usbd_io(urb, pipe, isoc_handler, address_of_mydevice_structure, timeout);

........

void isoc_handler(struct usbd_urb *urb, struct usbd_pipe *pipe, void *hdl){ struct my_device *pdev = (struct my_device*)hdl;

......bla bla

}

the word frame in the context of USB means 'usb frame'. it has nothing to do with the camera.
the frame number is the starting point (or better trigger) when the usb stack starts transfer.
if you specify URB_ISOCH_ASAP(as soon as possible), the frame number is ignored.

I don't know how to start streaming on a ov511+, its normaly a control (vendor) command.

"leon mike" <yqdu@etang.com> schrieb im Newsbeitrag news:b5hqka$ok$1@inn.qnx.com...
I am doing the same things as TIA, peter.But there are some confusions int the uddk 1.0beta under RTP6.1 .

for example:
What's means of the argu 'handle' int the function usbd_io(),docs said that 'user data',but how to
use? :-<

What's means of the argu 'frame' int the function usbd_setup_isochronous(),etc
And how to sent a vendor command to start the video capturing ?

My device's chipest is ov511+ and UHCI based usb1.1.

Anyone can explain these questions? I will very appreciate!

leon mike

Re: about uddk1.0 beta

Post by leon mike » Sun Mar 23, 2003 2:17 am

Thank you very much!
And another question is docs said a class driver typically performs the following operations:


1.. Connect to the USB stack (usbd_connect()) and provide two callbacks: one for insertion and one for removal.
2.. In the insertion callback:
1.. Connect to the USB device (usbd_attach()).
2.. Get descriptors (usbd_descriptor()).
3.. Select the configuration (usbd_select_config()) and interface (usbd_select_interface()).
4.. Set up communications pipes to the appropriate endpoint (usbd_open_pipe()).
3.. In the removal callback, detach from the USB device (usbd_detach()).
4.. Set up all data communications (e.g. reading and writing data, sending and receiving control information, etc.) via the usbd_setup_*() functions (usbd_setup_bulk(), usbd_setup_interrupt(), etc.).
5.. Initiate data transfer using the usbd_io() function (with completion callbacks if required).
Why you use another callback of void isoc_handler().Is it necc.?How about if I open /dev/usb and read video data?

Peter

Re: about uddk1.0 beta

Post by Peter » Sun Mar 23, 2003 5:29 am

leon,
may you have a look to the documents www.usb.org and the driver examples DDK.
There you will find alot of information about building a usb class driver.
read point 5. below again ;-)
you cant read from /dev/usb directly, it is the usb subsystem stack. You have to write a class driver!
"leon mike" <yqdu@etang.com> schrieb im Newsbeitrag news:b5j4h2$dit$1@inn.qnx.com...
Thank you very much!
And another question is docs said a class driver typically performs the following operations:


1.. Connect to the USB stack (usbd_connect()) and provide two callbacks: one for insertion and one for removal.
2.. In the insertion callback:
1.. Connect to the USB device (usbd_attach()).
2.. Get descriptors (usbd_descriptor()).
3.. Select the configuration (usbd_select_config()) and interface (usbd_select_interface()).
4.. Set up communications pipes to the appropriate endpoint (usbd_open_pipe()).
3.. In the removal callback, detach from the USB device (usbd_detach()).
4.. Set up all data communications (e.g. reading and writing data, sending and receiving control information, etc.) via the usbd_setup_*() functions (usbd_setup_bulk(), usbd_setup_interrupt(), etc.).
5.. Initiate data transfer using the usbd_io() function (with completion callbacks if required).
Why you use another callback of void isoc_handler().Is it necc.?How about if I open /dev/usb and read video data?

leon mike

Re: about uddk1.0 beta

Post by leon mike » Mon Mar 24, 2003 2:47 am

thanks for your advise!:-)

leon mike

Re: about uddk1.0 beta

Post by leon mike » Mon Mar 24, 2003 6:47 am

But where are driver examples?
/usb/src/ not found!:-(

Pano

Re: about uddk1.0 beta

Post by Pano » Mon Mar 24, 2003 8:11 am

Have a look in : /usr/share/cvs_rep/qnx/hardware/devu/class
"leon mike" <yqdu@etang.com> a ¨¦crit dans le message de news: b5m8nb$q59$1@inn.qnx.com...
But where are driver examples?
/usb/src/ not found!:-(

leon mike

Re: about uddk1.0 beta

Post by leon mike » Mon Mar 24, 2003 1:48 pm

thandk you very much!!!!!:-)

Post Reply

Return to “qdn.public.ddk.usb”