Author: Reed Lai
Description: PCI-1202 device driver for Linux
Keywords: driver,pci-1202,pci1202

# PCI-1202

Visitor 699 | Last updated Monday, 19-Apr-2004 13:09:33 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_1202

### 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: ixpci1202/dio.c
IXPCI_WRITE_REG
  Write a given value to a specified register. Example: ixpci1202/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: ixpci1202/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: ixpci1202/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: pci1202/port.c

### Registers

R=Readable W=Writable

Available registers that can be used in structure ixpci_reg for PCI-1202.

IXPCI_8254C0 R W
  8254 Counter 0.
IXPCI_8254C1 R W
  8254 Counter 0.
IXPCI_8254C2 R W
  8254 Counter 2.
IXPCI_8254CR R W
  8254 Control Register.
IXPCI_CR R W
  Control Register.
IXPCI_SR R W
  Status Register.
IXPCI_ADST R W
  AD Software Trigger.
IXPCI_DI R W
  Digital Input.
IXPCI_DO R W
  Digital Output.
IXPCI_AD R W
  Analog to Digital Port.
IXPCI_DA1 R W
  Digital to Analog Channel 1.
IXPCI_DA2 R W
  Digital to Analog Channel 2.

### Examples

list.c
  An example for ioctl command IXPCI_GET_INFO.
ixpci1202/ai_soft.c
  An example for analog input by software trigger.
ixpci1202/dio.c
  An example for reading and writing registers by ioctl commands IXPCI_READ_REG and IXPCI_WRITE_REG.
ixpci1202/reset.c
  An example for ioctl command IXPCI_RESET.
pci1202/time_span.c
  An example for ioctl command IXPCI_TIME_SPAN.