#include<conio.h>
#include<stdlib.h>
#include "..\..\lib\vp2k.h" //I-8000 Series Function Call Definition
/*
This demo program is the basic function.
Let you know how to get the card information in the MCU(main control unit) of I-8000 series.
including :
    1.card module name -> 8051 == 51
    2.card module type -> serial(87051) or parallel(8051)
    	different type module have different control method.
    3.How many slots -> 4 or 8 slots
    4.Net ID
    // The *NameOfModule and *ModuleType are the Global variable.
    // They are defined in the "8000.h".
*/

void main()
{
    int Addr8000,addr,data,SlotType;
    unsigned count;
    int ReadInit;
    
    InitLib();    
    ReadInit = ReadInitPin();//Get Init Pin
    Print("Init Pin Value = %d\n\r",ReadInit);
    SlotType = GetNumberOfSlot();//Slot Type ,slot4 or slot8
    if (SlotType==3)
    {
        Print("Current Module Type => VP-2111 , 3 slots \n\r");
    }
   
	
	for(addr=0;addr< SlotType;addr++)
	{
        // Find a module
        if(NameOfModule[addr] != 0xff)
        {
            //8k or 87k ?
            if((ModuleType[addr]&0x80) == 0x80)
            {
                Print("Slot(%d) Find 80%02d -- Parallel\n\r",addr,NameOfModule[addr]);
            }
            else
            {
                Print("Slot(%d) Find 870%02d -- Series\n\r",addr,NameOfModule[addr]);
            }
        }
        else
        {
    	    Print("Slot(%d) No Find\n\r",addr);
        }
    }
}