From 881cb5429cd2d47ba0bee5f826d14035f1b24b3a Mon Sep 17 00:00:00 2001 From: Nico Nell Date: Wed, 15 Jun 2011 20:46:19 +0100 Subject: [PATCH] Advantech PCI-1739U support Hello, I've added a bit of simple configuration to adv_pci_dio.c in order to make the PCI-1739U work with the adv_pci_dio driver. I have tested inputs only so far but they seem to work. A git style patch is attached. Thanks, -- Nicholas Nell Professional Research Assistant University of Colorado nicholas.nell@colorado.edu 303-492-5661 From c2a97fef832aa70b7fb2eff60de6412829b314ba Mon Sep 17 00:00:00 2001 From: Gene Ray Date: Thu, 2 Jun 2011 12:58:37 -0600 Subject: [PATCH] Added functionality for the Advantech PCI-1739U DIO board --- comedi/drivers/adv_pci_dio.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/comedi/drivers/adv_pci_dio.c b/comedi/drivers/adv_pci_dio.c index d8b91764..34ff38b9 100644 --- a/comedi/drivers/adv_pci_dio.c +++ b/comedi/drivers/adv_pci_dio.c @@ -12,7 +12,7 @@ Description: Advantech PCI-1730, PCI-1733, PCI-1734, PCI-1735U, PCI-1754, PCI-1756, PCI-1762 Author: Michal Dobes Devices: [Advantech] PCI-1730 (adv_pci_dio), PCI-1733, - PCI-1734, PCI-1735U, PCI-1736UP, PCI-1750, + PCI-1734, PCI-1735U, PCI-1736UP, PCI-1739U, PCI-1750, PCI-1751, PCI-1752, PCI-1753, PCI-1753+PCI-1753E, PCI-1754, PCI-1756, PCI-1760, PCI-1762 @@ -49,6 +49,7 @@ Configuration options: // hardware types of the cards typedef enum { TYPE_PCI1730, TYPE_PCI1733, TYPE_PCI1734, TYPE_PCI1735, TYPE_PCI1736, + TYPE_PCI1739, TYPE_PCI1750, TYPE_PCI1751, TYPE_PCI1752, @@ -102,6 +103,12 @@ typedef enum { #define PCI1736_BOARDID 4 /* R: Board I/D switch for 1736UP */ #define PCI1736_MAINREG 0 /* Normal register (2) doesn't work */ +// Advantech PCI-1739U +#define PCI1739_DIO 0 /* R/W: begin of 8255 registers block */ +#define PCI1739_ICR 32 /* W: Interrupt control register */ +#define PCI1739_ISR 32 /* R: Interrupt status register */ +#define PCI1739_BOARDID 8 /* R: Board I/D switch for 1739U */ + // Advantech PCI-1750 #define PCI1750_IDI 0 /* R: Isolated digital input 0-15 */ #define PCI1750_IDO 0 /* W: Isolated digital output 0-15 */ @@ -225,6 +232,7 @@ static DEFINE_PCI_DEVICE_TABLE(pci_dio_pci_table) = { {PCI_VENDOR_ID_ADVANTECH, 0x1734, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {PCI_VENDOR_ID_ADVANTECH, 0x1735, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {PCI_VENDOR_ID_ADVANTECH, 0x1736, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_ADVANTECH, 0x1739, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {PCI_VENDOR_ID_ADVANTECH, 0x1750, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {PCI_VENDOR_ID_ADVANTECH, 0x1751, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {PCI_VENDOR_ID_ADVANTECH, 0x1752, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, @@ -281,6 +289,14 @@ static const boardtype boardtypes[] = { {{0, 0, 0, 0}}, IO_8b, }, + {"pci1739", PCI_VENDOR_ID_ADVANTECH, 0x1739, PCIDIO_MAINREG, + TYPE_PCI1739, + {{0, 0, 0, 0}, {0, 0, 0, 0}}, + {{0, 0, 0, 0}, {0, 0, 0, 0}}, + {{48, PCI1739_DIO, 2, 0}, {0, 0, 0, 0}}, + {0, 0, 0, 0}, + {{0, 0, 0, 0}}, + IO_8b}, {"pci1750", PCI_VENDOR_ID_ADVANTECH, 0x1750, PCIDIO_MAINREG, TYPE_PCI1750, {{0, 0, 0, 0}, {16, PCI1750_IDI, 2, 0}}, @@ -815,6 +831,9 @@ static int pci_dio_reset(comedi_device * dev) outb(0x0f, dev->iobase+PCI1736_3_INT_CLR);// clear interrupts outb(0, dev->iobase+PCI1736_3_INT_RF); // set rising edge trigger break; + case TYPE_PCI1739: + outb(0x88, dev->iobase + PCI1739_ICR); // disable & clear interrupts + break; case TYPE_PCI1750: case TYPE_PCI1751: -- 2.26.2