static const struct comedi_lrange range718_unipolar2 = { 1, {UNI_RANGE(2),} };
static const struct comedi_lrange range718_unipolar1 = { 1, {BIP_RANGE(1),} };
-static int pcl818_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pcl818_attach(struct comedi_device * dev, struct comedi_devconfig * it);
static int pcl818_detach(struct comedi_device * dev);
#ifdef unused
static int RTC_timer_lock = 0; /* RTC int lock */
#endif
-typedef struct {
+struct pcl818_board {
+
const char *name; // driver name
int n_ranges; // len of range list
int n_aichan_se; // num of A/D chans in single ended mode
int ao_maxdata; // maxdata for D/A
unsigned char fifo; // 1=board has FIFO
int is_818;
-} boardtype;
+};
+
-static const boardtype boardtypes[] = {
+static const struct pcl818_board boardtypes[] = {
{"pcl818l", 4, 16, 8, 25000, 1, 16, 16, &range_pcl818l_l_ai,
&range_unipolar5, PCLx1x_RANGE, 0x00fc,
0x0a, 0xfff, 0xfff, 0, 1},
0x0a, 0xfff, 0xfff, 0, 1 /* XXX ? */ },
};
-#define n_boardtypes (sizeof(boardtypes)/sizeof(boardtype))
+#define n_boardtypes (sizeof(boardtypes)/sizeof(struct pcl818_board))
static struct comedi_driver driver_pcl818 = {
driver_name:"pcl818",
detach:pcl818_detach,
board_name:&boardtypes[0].name,
num_names:n_boardtypes,
- offset:sizeof(boardtype),
+ offset:sizeof(struct pcl818_board),
};
COMEDI_INITCLEANUP(driver_pcl818);
-typedef struct {
+struct pcl818_private {
+
unsigned int dma; // used DMA, 0=don't use DMA
int dma_rtc; // 1=RTC used with DMA, 0=no RTC alloc
unsigned int io_range;
struct comedi_subdevice *sub_ai; // ptr to AI subdevice
unsigned char usefifo; // 1=use fifo
unsigned int ao_readback[2];
-} pcl818_private;
+};
+
static const unsigned int muxonechan[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, // used for gain list programming
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff
};
-#define devpriv ((pcl818_private *)dev->private)
-#define this_board ((const boardtype *)dev->board_ptr)
+#define devpriv ((struct pcl818_private *)dev->private)
+#define this_board ((const struct pcl818_board *)dev->board_ptr)
/*
==============================================================================
ANALOG INPUT MODE0, 818 cards, slow version
*/
static int pcl818_ai_insn_read(struct comedi_device * dev, struct comedi_subdevice * s,
- comedi_insn * insn, unsigned int * data)
+ struct comedi_insn * insn, unsigned int * data)
{
int n;
int timeout;
only one sample per call is supported
*/
static int pcl818_ao_insn_read(struct comedi_device * dev, struct comedi_subdevice * s,
- comedi_insn * insn, unsigned int * data)
+ struct comedi_insn * insn, unsigned int * data)
{
int n;
int chan = CR_CHAN(insn->chanspec);
}
static int pcl818_ao_insn_write(struct comedi_device * dev, struct comedi_subdevice * s,
- comedi_insn * insn, unsigned int * data)
+ struct comedi_insn * insn, unsigned int * data)
{
int n;
int chan = CR_CHAN(insn->chanspec);
only one sample per call is supported
*/
static int pcl818_di_insn_bits(struct comedi_device * dev, struct comedi_subdevice * s,
- comedi_insn * insn, unsigned int * data)
+ struct comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
only one sample per call is supported
*/
static int pcl818_do_insn_bits(struct comedi_device * dev, struct comedi_subdevice * s,
- comedi_insn * insn, unsigned int * data)
+ struct comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
Initialization
*/
-static int pcl818_attach(struct comedi_device * dev, comedi_devconfig * it)
+static int pcl818_attach(struct comedi_device * dev, struct comedi_devconfig * it)
{
int ret;
unsigned long iobase;
unsigned long pages;
struct comedi_subdevice *s;
- if ((ret = alloc_private(dev, sizeof(pcl818_private))) < 0)
+ if ((ret = alloc_private(dev, sizeof(struct pcl818_private))) < 0)
return ret; /* Can't alloc mem */
/* claim our I/O space */