home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / UNIX3862.ZIP / U386-06.ZIP / U386-6.TD0 / usr / include / sys / pit.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-26  |  2.2 KB  |  64 lines

  1. /*    Copyright (c) 1984, 1986, 1987, 1988 AT&T    */
  2. /*      All Rights Reserved      */
  3.  
  4. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  5. /*    The copyright notice above does not evidence any       */
  6. /*    actual or intended publication of such source code.    */
  7.  
  8.  
  9. #ident    "@(#)head.sys:pit.h    1.3"
  10.  
  11. /*
  12.  *         INTEL CORPORATION PROPRIETARY INFORMATION
  13.  *
  14.  *     This software is supplied under the terms of a license 
  15.  *    agreement or nondisclosure agreement with Intel Corpo-
  16.  *    ration and may not be copied or disclosed except in
  17.  *    accordance with the terms of that agreement.
  18.  */
  19.  
  20. #ifdef MB1
  21. /* Definitions for 8254 Programmable Interrupt Timer ports on 386/20 */
  22. #define    PITCTR0_PORT    0xD0        /* counter 0 port */    
  23. #define    PITCTR1_PORT    0xD2        /* counter 1 port */    
  24. #define    PITCTR2_PORT    0xD4        /* counter 2 port */    
  25. #define    PITCTL_PORT    0xD6        /* PIT control port */
  26. #endif
  27. #ifdef AT386
  28. /* Definitions for 8254 Programmable Interrupt Timer ports on AT 386 */
  29. #define    PITCTR0_PORT    0x40        /* counter 0 port */    
  30. #define    PITCTR1_PORT    0x41        /* counter 1 port */    
  31. #define    PITCTR2_PORT    0x42        /* counter 2 port */    
  32. #define    PITCTL_PORT    0x43        /* PIT control port */
  33. #define    PITAUX_PORT    0x61        /* PIT auxiliary port */
  34. #endif /* AT386 */
  35.  
  36. /* Definitions for 8254 commands */
  37.  
  38. /* Following are used for Timer 0 */
  39. #define PIT_C0          0x00            /* select counter 0 */
  40. #define    PIT_LOADMODE    0x30        /* load least significant byte followed
  41.                      * by most significant byte */
  42. #define PIT_NDIVMODE    0x04        /*divide by N counter */
  43. #define    PIT_SQUAREMODE    0x06        /* square-wave mode */
  44.  
  45. /* Used for Timer 1. Used for delay calculations in countdown mode */
  46. #define PIT_C1          0x40            /* select counter 1 */
  47. #define    PIT_READMODE    0x30        /* read or load least significant byte
  48.                      * followed by most significant byte */
  49. #define    PIT_RATEMODE    0x06        /* square-wave mode for USART */
  50.  
  51. #ifdef MB1
  52. #define CLKNUM 12300            /* clock speed for the timer in hz 
  53.                      * divided by the constant HZ
  54.                      * ( defined in param.h )
  55.                      */
  56. #endif
  57. #ifdef AT386
  58. #define    CLKNUM    (1193167/HZ)        /* clock speed for timer */
  59. /* bits used in auxiliary control port for timer 2 */
  60. #define    PITAUX_GATE2    0x01        /* aux port, PIT gate 2 input */
  61. #define    PITAUX_OUT2    0x02        /* aux port, PIT clock out 2 enable */
  62. #endif /* AT386 */
  63.  
  64.