home *** CD-ROM | disk | FTP | other *** search
/ Between Heaven & Hell 2 / BetweenHeavenHell.cdr / 500 / 471 / rccl160 < prev    next >
Text File  |  1987-03-02  |  1KB  |  46 lines

  1. /*
  2.  * MAC  Version 2.0           Author :  Vincent Hayward
  3.  *                                      School of Electrical Engineering
  4.  *                                      Purdue University
  5.  *      Dir     : h
  6.  *      File    : adc.h
  7.  *      Remarks : RTI 1250 not completly understood.
  8.  *      Usage   : provide adc conversion macro, set device addr.
  9.  */
  10.  
  11.  
  12. /*
  13.  * This is the address setting for the RTI 1250
  14.  */
  15.  
  16. #define UNUSED  (short *)0170400
  17. #define GAIN    (short *)0170402
  18. #define MADR    (short *)0170404
  19. #define DATA    (short *)0170406
  20. #define EOC              0100000
  21.  
  22. /*
  23.  * ADCV is a macro to get a conversion done, because of problem
  24.  * with the lsi11/23 of VALII it did not seem to work any more when
  25.  * we installed VALII, probably a timing problem
  26.  * that is why i kept the two versions
  27.  *
  28.  * ADCV(data, channel)
  29.  */
  30.  
  31. #ifdef VALII
  32. #define ADCV(d, ch)     *MADR = ch;             \
  33.             *DATA = -1;             \
  34.             while (*MADR < 0) {     \
  35.                 *MADR = EOC;    \
  36.             }                       \
  37.             d = *DATA;
  38. #else
  39. #define ADCV(d, ch)     *MADR = ch;             \
  40.             *DATA = -1;             \
  41.             do {                    \
  42.                 *MADR = EOC;    \
  43.             } while (*MADR > 0);    \
  44.             d = *DATA;
  45. #endif
  46.