/* ----------------------------------------------------------- */

/* Find all PIO_PISO series cards in this PC system		       */

/* This program is developed by Turbo C 3.0				       */

/* Compiler mode: Large mode							       */

/* step 1 : plug all PIO_PISO cards into PC		      		   */

/* step 2 : run PIO_PISO.EXE				       			   */

/* ----------------------------------------------------------- */



#include "PIO.H"



WORD wBase, wIrq;



int main(int argc,char *argv[])

{

	int  i;

	WORD wBoards, wRetVal;

	WORD wSubVendor, wSubDevice, wSubAux, wSlotBus, wSlotDevice;



	clrscr();

	printf("*** PIO_PISO.EXE Rev. 2.2, Jun.03, 2005 ***\n");



	if ( argc > 1) {

		if (  0 == strcmp(argv[1], "/debug") || 0 == strcmp(argv[1], "/DEBUG")

		   || 0 == strcmp(argv[1], "/Debug")  )

		   PIO_SetDebugMode( 1 );

	}





	wRetVal=PIO_DriverInit(&wBoards,0xff,0xff,0xff);  /* for PIO-PISO */

	printf("\n\nThrer are %d PIO_PISO Cards in this PC, RetVal:%d",wBoards, wRetVal);

	if ( wBoards==0 ) exit(0);



	printf("\n----------------------------------------------------------");

	for(i=0; i<wBoards; i++)

	{

		PIO_GetConfigAddressSpace(i, &wBase, &wIrq, &wSubVendor, &wSubDevice, &wSubAux,

				 &wSlotBus,&wSlotDevice);

		if ((wSubVendor==0x80) && (wSubDevice==0x0C))

			printf("\nCard_%d: wBase=%x,wIrq=%x,subID=[%x,%x],SlotID=[%x,%x]"

				,i,wBase,wIrq,wSubVendor,wSubDevice,wSlotBus,wSlotDevice);

		else

			printf("\nCard_%d: wBase=%x,wIrq=%x,subID=[%x,%x,%x],SlotID=[%x,%x]"

				,i,wBase,wIrq,wSubVendor,wSubDevice,wSubAux,wSlotBus,wSlotDevice);



		printf(" --> ");

		ShowPioPiso(wSubVendor,wSubDevice,wSubAux);

	}



	PIO_DriverClose();

	return 0;

}



