Omega OME-PIO-D56 User Manual page 39

Pci-bus digital i/o board
Table of Contents

Advertisement

3.3.8
Read/Write 8-bit data Register
(Read/Write):wBase+0xc0/0xc4/0xc8/0xd0/0xd4
Bit 7
Bit 6
D7
D6
Note. Refer to Sec. 3.1 for more information about wBase.
There are five/three 8-bit I/O ports in the OME-PIO-D56/OME-PIO-D24. Each
port is easy to read/write to by access to their own data registers.
outportb(wBase+0xc0,Val);
Val=inportb(wBase+0xc0);
outportb(wBase+0xcc,0x07);
outportb(wBase+0xc0,i1);
outportb(wBase+0xc0,i2);
outportb(wBase+0xc0,i3);
outportb(wBase+0xcc,0x01);
outportb(wBase+0xc0,i1);
j2=inportb(wBase+0xc4);
j3=inportb(wBase+0xc8);
l=inportb(wBase+0xd0);
h=inportb(wBase+0xd4);
Val=(h<<8)+l;
outportb(wBase+0xd0,Val);
outportb(wBase+0xd4,(Val>>8)); /* write to CON1 high byte
OME-PIO-D56/OME-PIO-D24 User Manual (Ver.2.1, Oct/2003)
Bit 5
Bit 4
D5
D4
/* write to D/O port
/* read from D/I port
/* configure Port0~Port2 as DO port */
/* write to Port0
/* write to Port1
/* write to Port2
/* configure Port0 as DO port
/* Port1~Port2 as DI port
/* write to Port0
/* read Port1
/* read Port2
/* read CON2 Low byte
/* read CON2 High byte
/* Val is 16 bit data
/* write to CON1 Low byte
Bit 3
Bit 2
D3
D2
Bit 1
Bit 0
D1
D0
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
---- 37

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ome-pio-d24

Table of Contents