}
};
+#define NUM_LABPC_1200_AI_RANGES 14
// indicates unipolar ranges
-int labpc_1200_is_unipolar[NUM_LABPC_1200_AI_RANGES] =
+static int labpc_1200_is_unipolar[NUM_LABPC_1200_AI_RANGES] =
{
0,
0,
1,
};
// map range index to gain bits
-int labpc_1200_ai_gain_bits[NUM_LABPC_1200_AI_RANGES] =
+static int labpc_1200_ai_gain_bits[NUM_LABPC_1200_AI_RANGES] =
{
0x00,
0x20,
0x60,
0x70,
};
-comedi_lrange range_labpc_1200_ai = {
+static comedi_lrange range_labpc_1200_ai = {
NUM_LABPC_1200_AI_RANGES,
{
BIP_RANGE(5),
}
};
+/* functions that do inb/outb and readb/writeb so we can use
+ * function pointers to decide which to use */
+static inline unsigned int labpc_inb(unsigned long address)
+{
+ return inb(address);
+}
+static inline void labpc_outb(unsigned int byte, unsigned long address)
+{
+ outb(byte, address);
+}
+static inline unsigned int labpc_readb(unsigned long address)
+{
+ return readb(address);
+}
+static inline void labpc_writeb(unsigned int byte, unsigned long address)
+{
+ writeb(byte, address);
+}
+
static labpc_board labpc_boards[] =
{
{
},
};
+labpc_board labpc_cs_boards[NUM_LABPC_CS_BOARDS] =
+{
+ {
+ name: "daqcard-1200",
+ device_id: 0x103, // 0x10b is manufacturer id, 0x103 is device id
+ ai_speed: 10000,
+ bustype: pcmcia_bustype,
+ register_layout: labpc_1200_layout,
+ has_ao: 1,
+ read_byte: labpc_inb,
+ write_byte: labpc_outb,
+ ai_range_table: &range_labpc_1200_ai,
+ ai_range_code: labpc_1200_ai_gain_bits,
+ ai_range_is_unipolar: labpc_1200_is_unipolar,
+ ai_scan_up: 0,
+ },
+ /* duplicate entry, to support using alternate name */
+ {
+ name: "ni_labpc_cs",
+ device_id: 0x103,
+ ai_speed: 10000,
+ bustype: pcmcia_bustype,
+ register_layout: labpc_1200_layout,
+ has_ao: 1,
+ read_byte: labpc_inb,
+ write_byte: labpc_outb,
+ ai_range_table: &range_labpc_1200_ai,
+ ai_range_code: labpc_1200_ai_gain_bits,
+ ai_range_is_unipolar: labpc_1200_is_unipolar,
+ ai_scan_up: 0,
+ },
+};
+
/*
* Useful for shorthand access to the particular board structure
*/
EXPORT_SYMBOL_GPL( labpc_common_attach );
EXPORT_SYMBOL_GPL( labpc_common_detach );
-EXPORT_SYMBOL_GPL( labpc_1200_is_unipolar );
-EXPORT_SYMBOL_GPL( labpc_1200_ai_gain_bits );
-EXPORT_SYMBOL_GPL( range_labpc_1200_ai );
-EXPORT_SYMBOL_GPL( range_labpc_ao );
+EXPORT_SYMBOL_GPL( labpc_cs_boards );
unsigned int caldac[16]; // stores settings of calibration dacs
}labpc_private;
-//analog input ranges
-// indicates unipolar ranges
-#define NUM_LABPC_1200_AI_RANGES 14
-int labpc_1200_is_unipolar[NUM_LABPC_1200_AI_RANGES];
-// map range index to gain bits
-int labpc_1200_ai_gain_bits[NUM_LABPC_1200_AI_RANGES];
-comedi_lrange range_labpc_1200_ai;
-
-//analog output ranges
-comedi_lrange range_labpc_ao;
+#define NUM_LABPC_CS_BOARDS 2
+labpc_board labpc_cs_boards[NUM_LABPC_CS_BOARDS];
int labpc_common_attach( comedi_device *dev, unsigned long iobase,
int irq, int dma );
int labpc_common_detach( comedi_device *dev );
-/* functions that do inb/outb and readb/writeb so we can use
- * function pointers to decide which to use */
-static inline unsigned int labpc_inb(unsigned long address)
-{
- return inb(address);
-}
-static inline void labpc_outb(unsigned int byte, unsigned long address)
-{
- outb(byte, address);
-}
-static inline unsigned int labpc_readb(unsigned long address)
-{
- return readb(address);
-}
-static inline void labpc_writeb(unsigned int byte, unsigned long address)
-{
- writeb(byte, address);
-}
#endif /* _NI_LABPC_H */
static int labpc_attach(comedi_device *dev,comedi_devconfig *it);
-static labpc_board labpc_boards[] =
-{
- {
- name: "daqcard-1200",
- device_id: 0x103, // 0x10b is manufacturer id, 0x103 is device id
- ai_speed: 10000,
- bustype: pcmcia_bustype,
- register_layout: labpc_1200_layout,
- has_ao: 1,
- read_byte: labpc_inb,
- write_byte: labpc_outb,
- ai_range_table: &range_labpc_1200_ai,
- ai_range_code: labpc_1200_ai_gain_bits,
- ai_range_is_unipolar: labpc_1200_is_unipolar,
- ai_scan_up: 0,
- },
- /* duplicate entry, to support using alternate name */
- {
- name: "ni_labpc_cs",
- device_id: 0x103,
- ai_speed: 10000,
- bustype: pcmcia_bustype,
- register_layout: labpc_1200_layout,
- has_ao: 1,
- read_byte: labpc_inb,
- write_byte: labpc_outb,
- ai_range_table: &range_labpc_1200_ai,
- ai_range_code: labpc_1200_ai_gain_bits,
- ai_range_is_unipolar: labpc_1200_is_unipolar,
- ai_scan_up: 0,
- },
-};
-
/*
* Useful for shorthand access to the particular board structure
*/
static const int dma_buffer_size = 0xff00; // size in bytes of dma buffer
static const int sample_size = 2; // 2 bytes per sample
-#define devpriv ((labpc_private *)dev->private)
-
static comedi_driver driver_labpc_cs =
{
driver_name: "ni_labpc_cs",
module: THIS_MODULE,
attach: labpc_attach,
detach: labpc_common_detach,
- num_names: sizeof(labpc_boards) / sizeof(labpc_board),
- board_name: (char **)labpc_boards,
+ num_names: sizeof(labpc_cs_boards) / sizeof(labpc_board),
+ board_name: (char **)labpc_cs_boards,
offset: sizeof(labpc_board),
};
}
module_init( labpc_init_module );
-module_exit( labpc_exit_module );
\ No newline at end of file
+module_exit( labpc_exit_module );
+