45 #include "../comedidev.h"
50 #define DRIVER_NAME "ni_6527"
52 #define NI6527_DIO_SIZE 4096
53 #define NI6527_MITE_SIZE 4096
55 #define Port_Register(x) (0x00+(x))
56 #define ID_Register 0x06
58 #define Clear_Register 0x07
60 #define ClrOverflow 0x04
61 #define ClrFilter 0x02
62 #define ClrInterval 0x01
64 #define Filter_Interval(x) (0x08+(x))
65 #define Filter_Enable(x) (0x0c+(x))
67 #define Change_Status 0x14
68 #define MasterInterruptStatus 0x04
70 #define EdgeStatus 0x01
72 #define Master_Interrupt_Control 0x15
73 #define FallingEdgeIntEnable 0x10
74 #define RisingEdgeIntEnable 0x08
75 #define MasterInterruptEnable 0x04
76 #define OverflowIntEnable 0x02
77 #define EdgeIntEnable 0x01
79 #define Rising_Edge_Detection_Enable(x) (0x018+(x))
80 #define Falling_Edge_Detection_Enable(x) (0x020+(x))
99 #define this_board ((const struct ni6527_board *)dev->board_ptr)
115 #define devpriv ((struct ni6527_private *)dev->private)
131 interval = (data[1] + 100) / 200;
132 data[1] = interval * 200;
134 if (interval !=
devpriv->filter_interval) {
137 writeb((interval >> 8) & 0xff,
139 writeb((interval >> 16) & 0x0f,
148 devpriv->filter_enable |= 1 << chan;
150 devpriv->filter_enable &= ~(1 << chan);
179 s->
state &= ~data[0];
180 s->
state |= (data[0] & data[1]);
184 if (data[0] & 0x0000ff) {
188 if (data[0] & 0x00ff00) {
192 if (data[0] & 0xff0000) {
311 static int ni6527_intr_insn_config(
struct comedi_device *dev,
343 for (n = 0; n <
ARRAY_SIZE(ni6527_boards); n++) {
345 if (board->
dev_id == dev_id)
361 dev->
board_ptr = ni6527_find_boardinfo(pcidev);
408 s->
do_cmd = ni6527_intr_cmd;
409 s->
cancel = ni6527_intr_cancel;
447 .attach_pci = ni6527_attach_pci,
448 .detach = ni6527_detach,
462 static struct pci_driver ni6527_pci_driver = {
464 .id_table = ni6527_pci_table,
465 .probe = ni6527_pci_probe,