#include<stdio.h>
#include"a822.h"

int Base=0x220;
int wCardMode;
void main(void)
{ int err;
  unsigned int Dio;
  wCardMode=A822_SetCardModel(A8112_Mode);
  err=A822_Initialize(0,Base,-1,-1);
  if(err){
     if(err==CheckBoardError){
        printf("Address Error!\n");
     }
     else if(err==CardNumError){
        printf("Card Number Error!(range:0-7)\n");
     }
     return;
  }
  Dio=0x5A5A;
  A822_DO(Dio);
  printf("DO=%4x(Hex)\n",Dio);

  Dio=A822_DI();
  printf("\nDI=%4X(Hex)\n",Dio);
}