Author: Reed Lai
Description: PCI-1602/1802/1602 device driver for Linux
Keywords: driver,pci-1602,pci1602,pci-1802,pci1802,pci-1602,pci1602

# PCI-1602

Visitor 409 | Last updated Monday, 10-Mar-2003 12:16:23 CST

Supported Models
PCI-1002 PCI-1202 PCI-1602 PCI-1800/1802 PCI-P16R16/P16C16/P16POR16 PCI-P8R8 PCI-TMC12

Source Code Tour for IxPCI
Device ID
Device File
ioctl Commands
Data Structures
Registers
Examples

### Device ID

PCI_1602

### Device File

/dev/ixpcin

The n is the IXPCI device number.

### ioctl Commands

IXPCI_GET_INFO
  Retrieve a device's information, and put it into the ixpci_devinfo (ixpci_devinfo_t) structure. Example: list.c.
IXPCI_READ_REG
  Read a specified register's value, and put the value into the ixpci_reg (ixpci_reg_t) structure Example: ixpci1800/dio.c.
IXPCI_WRITE_REG
  Write a given value to a specified register. Example: ixpci1800/dio.c.
IXPCI_RESET
  Reset device.
  - Stop the timer0/1/2.
  - Reset the control register.
    - A/D channel 0, Gain control PGA = 1.
    - Input range control = PGA (+/- 5V.)
    - Reset the MagicScan controller.
    - Assert the MagicScan handshake control bit (bit-13.)
    - Clear FIFO.
  - Clear DO to 0.
  - Clear DA1/2 to 0.
  Example: ixpci1800/reset.c.
IXPCI_TIME_SPAN IXPCI_BLOCK IXPCI_DELAY IXPCI_WAIT
  IXPCI_TIME_SPAN uses the 8254 counter-2 to be the machine-indepent-timer by the internal 8 MHz clock. Command will be blocked before the countering has finished. The maximum counter value is 8190 micro-seconds. IXPCI_TIME_SPAN, IXPCI_BLOCK, IXPCI_DELAY, and IXPCI_WAIT all are identical. Example ixpci1602/time_span.c.

### Data Structures

ixpci_devinfo_t
  The data type of structure ixpci_devinfo which contains a device's id, base address, and so on. Example: list.c.
ixpci_reg_t
  The data type of structure ixpci_reg which contains a register's id and value. Example: pci1602/port.c.

### Registers

R=Readable W=Writable

Available registers which can be used in structure ixpci_reg for PCI-1602.

IXPCI_8254C0 R W
  8254 Counter 0. IXPCI_8254C0 is the short term of IXPCI_8254_COUNTER_0.
IXPCI_8254C1 R W
  8254 Counter 0. IXPCI_8254C1 is the short term of IXPCI_8254_COUNTER_1.
IXPCI_8254C2 R W
  8254 Counter 2. IXPCI_8254C2 is the short term of IXPCI_8254_COUNTER_2.
IXPCI_8254CR R W
  8254 Control Register. IXPCI_8254CR is the short term of IXPCI_8254_CONTROL_REGISTER.
IXPCI_CR R W
  Control Register. IXPCI_CR is the short term of IXPCI_CONTROL_REGISTER.
IXPCI_SR R W
  Status Register. IXPCI_SR is the short term of IXPCI_STATUS_REGISTER.
IXPCI_ADST R W
  AD Software Trigger Register. IXPCI_ADST is the short term of IXPCI_AD_SOFTWARE_TRIGGER_REGISTER.
IXPCI_DI R W
  Digital Input. IXPCI_DI is the short term of IXPCI_DI_PORT.
IXPCI_DO R W
  Digital Input Port. IXPCI_DO is the short term of IXPCI_DO_PORT.
IXPCI_AD R W
  Analog to Digital Port. IXPCI_AD is the short term of IXPCI_AD_PORT.
IXPCI_DA1 R W
  Digital to Analog Channel 1. IXPCI_DA1 is the short term of IXPCI_DA_CHANNEL_1.
IXPCI_DA2 R W
  Digital to Analog Channel 2. IXPCI_DA2 is the short term of IXPCI_DA_CHANNEL_2.

### Examples

PCI-1602 and PCI-180x shares same device id, examples can be found at ixpci1800 directory.

list.c
  An example for ioctl command IXPCI_GET_INFO.
ixpci1800/dio.c
  An example for reading and writing registers by ioctl commands IXPCI_READ_REG and IXPCI_WRITE_REG.
ixpci1800/reset.c
  An example for ioctl command IXPCI_RESET.
ixpci1800/time_span.c
  An example for ioctl command IXPCI_TIME_SPAN.