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

  1. /*
  2.  * RTC Version  2.0           Author :  Vincent Hayward
  3.  *                                      School of Electrical Engineering
  4.  *                                      Purdue University
  5.  *      Dir     : h
  6.  *      File    : rtc.h
  7.  *      Remarks : Robot interface state and command descriptions
  8.  *      Usage   : made available to the user
  9.  */
  10.  
  11. #define VERSION         2
  12.  
  13. #define ADC             16
  14.  
  15. #undef  NO
  16. #undef  YES
  17. #define NO              0
  18. #define YES             1
  19.  
  20. #undef  NJOINTS         6
  21. #define NJOINTS         6
  22. #define DEFAULTRATE     2
  23. #define HARDCLOCK       7       /* basic sample time    */
  24.  
  25. #define STOP            1
  26. #define STOPCAL         2
  27. #define POS             3
  28. #define CUR             4
  29.  
  30. /*
  31.  * global arm state structure, if modified, the pack routine will
  32.  * arrange to reflect the change onto the arm controller
  33.  */
  34.  
  35.  
  36. struct i {
  37.     char set;                /* flag to be set if change requested */
  38.     unsigned short vali;     /* corresponding value */
  39. };
  40.  
  41. struct a {
  42.     char set ;
  43.     unsigned short vala[NJOINTS];
  44. };
  45.  
  46. struct g {
  47.     char set;               /* flag to be set if change requested */
  48.     unsigned short valg;     /* corresponding value */
  49. };
  50.  
  51.  
  52. struct chg {
  53.     struct i i_motion[NJOINTS];      /* case POS - CUR - STOP - STOPCAL */
  54.     struct i i_gravty[NJOINTS];
  55.  
  56.     struct a a_motion;
  57.     struct a a_gravty;
  58.  
  59.     struct g g_adco;                /* open adc channel */
  60.     struct g g_hand;                /* command hand */
  61.     struct g g_rate;                /* rate in 2 ** value * 7 ms */
  62.  
  63.     char end;                       /* termination */
  64.     char stop;                      /* stop on the spot */
  65.     char calib;
  66. };
  67.  
  68.  
  69. /*
  70.  * structure send by the controller on each interrupt
  71.  */
  72.  
  73. struct how {
  74.     short wc;
  75.     unsigned short
  76.         exio,                   /* state of the extern io register */
  77.         pos[NJOINTS];           /* current positions               */
  78. #ifdef ADC
  79.     short
  80.         adcr[ADC];              /* adc readings                    */
  81. #endif
  82.     short   chks;
  83. };
  84.