PIO-D64

Visitor 171 Last updated Wednesday, 13-Aug-2003 16:58:52 CST

Supported Models
PIO-821
PIO-D144
PIO-D168
PIO-D24
PIO-D48
PIO-D56
PIO-D64
PIO-D96
PIO-DA16/DA8/DA4
PISO-725
PISO-730
PISO-730A
PISO-813
PISO-A64
PISO-C64
PISO-DA2
PISO-ENC300/600
PISO-P32A32
PISO-P32C32
PISO-P64
PISO-P8R8/P8SSR8AC/P8SSR8DC
PISO-PS300
Valid XHTML 1.0! Valid CSS!

Source Codes Tour
Device File
ioctl Commands
Data Types
Registers
Examples

Device File

/dev/ixpion

The n is the PIO device number.

ioctl Commands

IXPIO_GET_INFO
Retrieve a device's information, and put it into the ixpio_devinfo (ixpio_devinfo_t) structure.
IXPIO_REG_READ
Read a specified register's value, and put the value into the ixpio_reg (ixpio_reg_t) structure.
IXPIO_REG_WRITE
Write a given value to a specified register.
IXPIO_SIG
Set an interrupt signal plan. If there already signal plans are listed, This command will remove them all then install the new one.
IXPIO_SIG_ADD
Add an interrupt signal plan. If there already signal plans are listed, this command will append the new one to the list.
IXPIO_SIG_DEL
Delete the specified signal plan.
IXPIO_SIG_DEL_ALL
Delete all signal plans listed in the device.
IXPIO_KEEP_ALIVE
This command prevent the signal plans or analog output patterns to be deleted when closing the device.
IXPIO_NO_KEEP_ALIVE
Cancel the KEEP_ALIVE command.
IXPIO_DIGITAL_IN
Read from all digital channels.
IXPIO_DIGITAL_OUT
Write to all digital channels.

Data Types

ixpio_devinfo_t
The data type of structure ixpio_devinfo which contains information to represent a device (card). This structure is generally used by the ioctl IXPIO_GET_INFO command.
ixpio_reg_t
The data type of structure ixpio_reg that contains a register's id and value. This structure is used by the ioctl IXPIO_REG* commands.
ixpio_signal_t
The data type of structure ixpio_signal that contains process id, signal id, and signaling condictions. This structure is used by the ioctl IXPIO_SIG* commands.
ixpio_digital_t
The data type of structure ixpio_digital that contains digital data and processing flags. This structure is generally used by the ioctl IXPIO_DIGITAL* commands.

Registers

Available registers which can be used in structure ixpio_reg for the PIO-D64.

IXPIO_RCR
Reset Control Register (R/W)
IXPIO_ACR
AUX Control Register (R/W)
IXPIO_ADR
AUX Data Register (R/W)
IXPIO_IMCR
INT Mask Control Register (R/W)
IXPIO_ASR
AUX Pin Status Register (R/W) The ASR is directly handled by device driver. Write to the register is not recommended! Instead of directly write to it, use the IXPIO_SIG ioctl command to set the interrupt signaling condictions.
IXPIO_IPCR
Interrupt Polarity Control Register (R/W) The IPCR is directly heandled by device driver. Write to the register is not recommended! Instead of directly write to it, use the IXPIO_SIG ioctl command to set the interrupt signaling condictions.
IXPIO_DI
The whole digital inputs (R)
IXPIO_DO
The whole digital outputs (W)
IXPIO_DIO
The whole digital IO (R/W)
IXPIO_DIO_a
Digital IO group a. The a is the port group number, which generally represents an 8-bit digital port. For example, the IXPIO_DIO_A represents the DIO0-7, the IXPIO_DIO_B represents the DIO8-15, and so on in the same rule. Some devices (cards) have four groups (A, B, C, D), some haven't, which can be found from the hardware manual.
IXPIO_8254C0    IXPIO_82541C0
8254 chip 1 counter 0 (R/W)
IXPIO_8254C1    IXPIO_82541C1
8254 chip 1 counter 1 (R/W)
IXPIO_8254C2    IXPIO_82541C2
8254 chip 1 counter 2 (R/W)
IXPIO_8254CW    IXPIO_82541CW
8254 chip 1 control word (R/W)
IXPIO_82542C0
8254 chip 2 counter 0 (R/W)
IXPIO_82542C1
8254 chip 2 counter 1 (R/W)
IXPIO_82542C2
8254 chip 2 counter 2 (R/W)
IXPIO_82542CW
8254 chip 2 control word (R/W)

Examples

list.c
An example for gatting device information.
piod64/counter.c
An example for 8254 counter manipulation and setting up an interrupt signaling condiction by the ioctl IXPIO_SIG command.
piod64/dio.c
An example for reading and writing registers by the ioclt IXPIO_READ_REG and IXPIO_WRITE_REG commands. This example uses IXPIO_DIO_A/B/C/D registers.
piod64/dio2.c
This example uses IXPIO_DIO register.
piod64/dio3.c
An example for doing digital IO by the ioctl IXPIO_DIGITAL_IN and IXPIO_DIGITAL_OUT commands.
piod64/int.c
An example to the EXTIRQ irq facility.
piod64/int2.c
An example of interrupt handling. This program configures driver to send signals in different signal id for two interrupt channels (TMRIRQ/EXTIRQ).
piod64/int3.c
An example of interrupt handling. This program is similar to the int2.c but uses two handlers.

Emmy Tsai <emmy@omega.com> | We are at Your Service <service@omega.com>