ICP DAS USA PIO-D144 User Manual page 45

Hide thumbs Also See for PIO-D144:
Table of Contents

Advertisement

ГК Атлант Инжиниринг – официальный представитель в РФ и СНГ
+7(495)109-02-08 sales@bbrc.ru www.bbrc.ru
#include "PIO-D144.H"
int main()
{
int
i;
char c;
WORD wBoards;
WORD wBase,wIrq,wSubVendor,wSubDevice,wSubAux,wSlotBus,wSlotDevice;
clrscr();
PIO_DriverInit(&wBoards,0x80,0x01,0x00);
printf("\n(1) Threr are %d PIO-D144 Cards in this PC",wBoards);
if ( wBoards==0 )
putch(0x07);
putch(0x07);
printf("(1) There are no PIO-D144 card in this PC !!!\n");
exit(0);
}
printf("\n(2) The Configuration Space ->
for(i=0; i<wBoards; i++)
PIO_GetConfigAddressSpace(i,&wBase,&wIrq,&wSubVendor,&wSubDevice,
printf("\nCard_%d: wBase=%x,wIrq=%x,subID=[%x,%x,%x],SlotID=[%x,%x]"
,i,wBase,wIrq,wSubVendor,wSubDevice,wSubAux,wSlotBus,wSlotDevice);
}
PIO_GetConfigAddressSpace(0,&wBase,&wIrq,&wSubVendor,&wSubDevice,
printf("\n(3) *** Card_0 D/O test, wBase=%x ***",wBase);
outp(D144,Disable);
outp(D144,Enable);
outp(IO_SCR0,0x00);
while(1)
{
printf("\n");
for(i=1;i<=0x80;i=i<<1) {
printf("\nCN1: PA=%02xH, PB=%02xH, PC=%02xH, press Q to stop",i,i,i);
outp(Act_IOPCR,CN1_PA);
outp(RW_8BitDR,i);
outp(Act_IOPCR,CN1_PB);
outp(RW_8BitDR,i);
outp(Act_IOPCR,CN1_PC);
outp(RW_8BitDR,i);
sleep(1);
}
printf("\n");
for(i=1;i<=0x80;i=i<<1)
printf("\nCN2: PA=%02xH, PB=%02xH, PC=%02xH, press Q to stop",i,i,i);
outp(Act_IOPCR,CN2_PA);
outp(RW_8BitDR,i);
outp(Act_IOPCR,CN2_PB);
outp(RW_8BitDR,i);
outp(Act_IOPCR,CN2_PC);
outp(RW_8BitDR,i);
sleep(1);
}
outp(IO_SCR1,0x00);
printf("\n");
for(i=1;i<=0x80;i=i<<1) {
printf("\nCN3: PA=%02xH, PB=%02xH, PC=%02xH, press Q to stop",i,i,i);
outp(Act_IOPCR,CN3_PA);
outp(RW_8BitDR,i);
outp(Act_IOPCR,CN3_PB);
outp(RW_8BitDR,i);
outp(Act_IOPCR,CN3_PC);
outp(RW_8BitDR,i);
sleep(1);
{
putch(0x07);
{
&wSubAux,&wSlotBus,&wSlotDevice);
&wSubAux,&wSlotBus,&wSlotDevice);
/* Reset DIO of D144 */
{
Version: 2.1
Date: 1999/10
PIO-D144 User's Manual
/* for PIO-D144 */
wBase");
Page 45

Advertisement

Table of Contents
loading

Table of Contents