ambaTimer.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:3k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* ambaTimer.h - ARM AMBA timer header */
  2. /* Copyright 1996-1997 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01d,31oct01,rec  integrator AP changes
  7. 01c,24nov97,jpd  renamed from amba.h to ambaTimer.h.
  8. 01b,18aug97,jpd  Added timers 3 and 4, added TC_EXTERNAL definition.
  9. 01a,10jul96,jpd  Written, based on i8253.h version 01b.
  10. */
  11. #ifndef __INCambaTimerh
  12. #define __INCambaTimerh
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. /* default definitions */
  17. /* register definitions */
  18. #ifndef AMBA_BASE_OFFSET
  19. #define AMBA_BASE_OFFSET 0X20
  20. #endif
  21. #define AMBA_TIMER_T1LOAD(base)
  22.     (volatile UINT32 *)((base) + 0x00) /* T1 Load (R/W) */
  23. #define AMBA_TIMER_T1VALUE(base) 
  24.     (volatile UINT32 *)((base) + 0x04) /* T1 Value (R/O) */
  25. #define AMBA_TIMER_T1CTRL(base) 
  26.     (volatile UINT32 *)((base) + 0x08) /* T1 Control (R/W) */
  27. #define AMBA_TIMER_T1CLEAR(base) 
  28.     (volatile UINT32 *)((base) + 0x0C) /* T1 Clear (W/O) */
  29. #define AMBA_TIMER_T2LOAD(base) 
  30.         (volatile UINT32 *)((base) + AMBA_BASE_OFFSET + 0x00)  /* T2 Load (R/W) */
  31. #define AMBA_TIMER_T2VALUE(base) 
  32.         (volatile UINT32 *)((base) + AMBA_BASE_OFFSET + 0x04)  /* T2 Value (R/O) */
  33. #define AMBA_TIMER_T2CTRL(base) 
  34.         (volatile UINT32 *)((base) + AMBA_BASE_OFFSET + 0x08)  /* T2 Control (R/W) */
  35. #define AMBA_TIMER_T2CLEAR(base) 
  36.         (volatile UINT32 *)((base) + AMBA_BASE_OFFSET + 0x0C)  /* T2 Clear (W/O) */
  37. #define AMBA_TIMER_T3LOAD(base) 
  38.         (volatile UINT32 *)((base) + 2 * AMBA_BASE_OFFSET + 0x00)  /* T3 Load (R/W) */
  39. #define AMBA_TIMER_T3VALUE(base) 
  40.         (volatile UINT32 *)((base) + 2 * AMBA_BASE_OFFSET + 0x04)  /* T3 Value (R/O) */
  41. #define AMBA_TIMER_T3CTRL(base) 
  42.         (volatile UINT32 *)((base) + 2 * AMBA_BASE_OFFSET + 0x08)  /* T3 Control (R/W) */
  43. #define AMBA_TIMER_T3CLEAR(base) 
  44.         (volatile UINT32 *)((base) + 2 * AMBA_BASE_OFFSET + 0x0C)  /* T3 Clear (W/O) */
  45. #define AMBA_TIMER_T4LOAD(base) 
  46.         (volatile UINT32 *)((base) + 3 * AMBA_BASE_OFFSET + 0x00)  /* T4 Load (R/W) */
  47. #define AMBA_TIMER_T4VALUE(base) 
  48.         (volatile UINT32 *)((base) + 3 * AMBA_BASE_OFFSET + 0x04)  /* T4 Value (R/O) */
  49. #define AMBA_TIMER_T4CTRL(base) 
  50.         (volatile UINT32 *)((base) + 3 * AMBA_BASE_OFFSET + 0x08)  /* T4 Control (R/W) */
  51. #define AMBA_TIMER_T4CLEAR(base) 
  52.         (volatile UINT32 *)((base) + 3 * AMBA_BASE_OFFSET + 0x0C)  /* T4 Clear (W/O) */
  53. /* Timer Control register bit definitions */
  54. #define TC_DIV1 0
  55. #define TC_DIV16 (1<<2)
  56. #define TC_DIV256 (1<<3)
  57. #define TC_EXTERNAL (3<<2) 
  58. #define TC_PERIODIC (1<<6)
  59. #define TC_FREERUN 0
  60. #define TC_ENABLE (1<<7)
  61. #define TC_DISABLE 0
  62. #ifdef __cplusplus
  63. }
  64. #endif
  65. #endif /* __INCambaTimerh */