Omega Engineering OME-PIO-D96 Computer Hardware User Manual


 
3.3.8 Read/Write 8-bit data Register
(Read/Write):wBase+0xc0/0xc4/0xc8/0xd0/0xd4/0xd8/
0xe0/0xe4/0xe8/0xf0/0xf4/0xf8/
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
D7 D6 D5 D4 D3 D2 D1 D0
Note. Refer to Sec. 3.1 for more information about wBase.
There are twelve 8-bit I/O port in the OME-PIO-D96. Every I/O port can be
programmed as D/I or D/O port. Refer to Sec. 3.3.8 for D/I or D/O selection. When
the PC is power-up, all twelve ports are used as D/I port.
outportb(wBase+0xc0,Val); /* write to Port0 */
Val=inportb(wBase+0xc0); /* read from Port0 */
outportb(wBase+0xcc,0x07); /* set port0~port2 as D/O ports */
outportb(wBase+0xc0,i1); /* write to Port0 */
outportb(wBase+0xc4,i2); /* write to Port1 */
outportb(wBase+0xc8,i3); /* write to Port2 */
outportb(wBase+0xec,0x04); /* set Port6 & Port7 as D/I ports */
/* set Port8 as D/O port */
j1=inportb(wBase+0xe0); /* read Port6 */
j2=inportb(wBase+0xe4); /* read Port7 */
outportb(wBase+0xe8,j3); /* write to Port8 */
NOTE: Make sure the I/O port configuration (DI or DO) before performing
read/write to the data register. (Refer to sec. 3.3.7)
OME-PIO-D96 User Manual (Ver.1.1, Mar/2003) ---- 35