- From: Ian Abbott <abbotti_at_mev.co.uk>
- Date: Thu, 21 Apr 2005 10:00:17 +0100
On 19/04/2005 14:33, echt_keiner_at_web.de wrote: > Im writing a driver for a pci card which has 48Bit gpdio. They are > partinioned in 3x16Bit. My problem is how do i handle them in the > driver. Can i make on GPDIO with 48Bit? Think the subdevice->state > and subdevice->state[x] are of type integer which allows only 32bit, > right? If i split them into 3 GPDIO devices. How can i safely > distinguish bewteen the 3 DIOs in my "dio_insn_bits" funtion? only by > testing which number of subdevice i it is? comedi_dio_bitfield() (or the INSN_BITS instruction) supports a maximum of 32 channels. You specify the number of the subdevice you wish to operate on in the 2nd parameter of comedi_dio_bitfield() (or the subdev member of the comedi_insn structure). The driver's insn_bits function for the subdevice gets passed a pointer to the subdevice as well as a pointer to the comedi device and a pointer to the comedi_insn structure. > > The n_chan member in the comedi_subdevice structure determines the > number of bits of the dio not the number of channels (like 3 chanels > with 16 bit for example), right? n_chan is the number of channels in the subdevice, so if you split your device into 3 subdevices, you need to set the n_chan member to 16 in each of the 3 subdevices. See the 8555 driver for an example - it uses 3 subdevices, each with 8 channels.
Received on 2005-04-21Z08:00:17