Quoting maria lobo <[EMAIL PROTECTED]>: > This is a very basic USB question , but I wanted to know if it > is possible to access individual addresses ( registers) in a USB device and > if so how . Could someone please suggest some source of info . i know that > all data transfer is done via URBs but , then how do u access individual > registers .
The exact procedure depends on the hardware of the device you are talking
to. But typically you would use control transfers for that. Each transfer
contains some fixed data fields that you can use (request, index, value),
and you can send some data along as well. For example:
i = usb_control_msg(
device,
usb_sndctrlpipe(device, 0),
req,
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT,
value,
index,
NULL, // No data in this case
0,
HZ);
But you can use other transfer types as well. The USB standard does not
deal with "registers", it only deals with data - it is up to the device to
treat the data as a request to change a register...
To do it right you MUST have the specification on the device, where the
manufacturer clearly explains how to program the device and what transfers
to use to access this or that feature. You can grab a CPiA camera manual
(available somewhere on the Net), it is very detailed and you can learn a
lot about USB devices.
Dmitri
--
panic("esp: Aiee penguin on the SCSI-bus.");
(from linux/drivers/scsi/esp.c)
msg02512/pgp00000.pgp
Description: PGP signature
