/******************************************************************\

   IOE_DGL.C

   BL11xx/Little Giant with I/O Expansion board

   Always run exp_init () first to initialize the PPI.

   int exp_init (int ppia, int ppib, int ppicl, int ppicu);

   Use 0 to specify as output.  Use -1 to specify as inputs.

   Digital I/O is accomplished by reading and writing to the 
   appropriate I/O registers.  Place a jumper between two of the
   J8 pins and observe change in output.
   
\******************************************************************/

main()
{
   long i;

   exp_init (-1,-1,-1,-1);                         /* PPI all inputs */

   while(1)
   {
   	hitwd();
      printf("PPIDA inputs=%x\n",inport(PPIA));
      printf("PPIDB inputs=%x\n",inport(PPIB));
      printf("PPIDC inputs=%x\n",inport(PPIC));    /* opto isolated inputs */
      printf("U1 inputs=%x\n",inport(RDTTL));      /* ttl inputs */

      for (i = 20000L;--i;) hitwd();                       /* pause */
   }
}

/***************************************** End of IOE_DGL.C ************/
