home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_03_04 / 3n04042a < prev    next >
Text File  |  1992-02-08  |  930b  |  40 lines

  1. LISTING 1
  2. /* -------------- timer.h --------------- */
  3. /*
  4.    command byte
  5. D7  D6    D5  D4    D3 D2 D1   D0  
  6. SC1 SC0   RL1 RL0   M2 M1 M0   BCD
  7.  
  8. SC counter 00,01,10 
  9. 00  counter 0
  10. 01  not used ( counter 1 command addr is different)
  11. 10  counter 2
  12.  
  13. RL r/w latch command 
  14. 00 latch (needed for 16 bits) 
  15. 01 read/write lsb 
  16. 10 read/write msb
  17. 11 read/write both
  18.  
  19. M mode (usually)
  20. mode 3 011 square wave or 
  21. mode 2 010 rate generator
  22.  
  23. BCD  1 for bcd 0 for binary
  24. */
  25.  
  26. /* don't mess with timer1 - ram refresh - */
  27. #define TIMER0 0x40
  28. #define TIMER2 0x42
  29. #define TIMERC 0x43
  30. #define TMODE2 0x34
  31.  
  32. #define RHBTIM0 0  /* read high byte of timer 0 */
  33.  
  34. #define PIC01  0x21   /* 8259A mask register    */
  35. #define PIC00  0x20   /* 8259A command register */
  36. #define EOI    0x20   /* end  of interrupt cmd */
  37. #define OCW3IR 0x0a   /* next read is pending
  38.                   request register on either port */
  39.  
  40.