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

VxWorks

开发平台:

C/C++

  1. /* hd146818.h - Hitachi 146818 RTC Real Time Clock header */
  2. /* Copyright 1991-1992 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01e,22sep92,rrr  added support for c++
  7. 01d,26may92,rrr  the tree shuffle
  8. 01c,04oct91,rrr  passed through the ansification filter
  9.   -fixed #else and #endif
  10.   -changed ASMLANGUAGE to _ASMLANGUAGE
  11.   -changed copyright notice
  12. 01b,07jun91,hdn  defined HD146818_REG_OFFSET.
  13. 01a,26feb91,hdn  written.
  14. */
  15. #ifndef __INChd146818h
  16. #define __INChd146818h
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. #define HD146818_REG_OFFSET 3
  21. #ifndef _ASMLANGUAGE
  22. typedef struct
  23.     {
  24.     UCHAR pad0[HD146818_REG_OFFSET];
  25.     UCHAR seconds;
  26.     UCHAR pad1[HD146818_REG_OFFSET];
  27.     UCHAR secAlarm;
  28.     UCHAR pad2[HD146818_REG_OFFSET];
  29.     UCHAR minutes;
  30.     UCHAR pad3[HD146818_REG_OFFSET];
  31.     UCHAR minAlarm;
  32.     UCHAR pad4[HD146818_REG_OFFSET];
  33.     UCHAR hours;
  34.     UCHAR pad5[HD146818_REG_OFFSET];
  35.     UCHAR hrAlarm;
  36.     UCHAR pad6[HD146818_REG_OFFSET];
  37.     UCHAR dayOfWeek;
  38.     UCHAR pad7[HD146818_REG_OFFSET];
  39.     UCHAR date;
  40.     UCHAR pad8[HD146818_REG_OFFSET];
  41.     UCHAR month;
  42.     UCHAR pad9[HD146818_REG_OFFSET];
  43.     UCHAR year;
  44.     UCHAR pad10[HD146818_REG_OFFSET];
  45.     UCHAR controlA;
  46.     UCHAR pad11[HD146818_REG_OFFSET];
  47.     UCHAR controlB;
  48.     UCHAR pad12[HD146818_REG_OFFSET];
  49.     UCHAR controlC;
  50.     UCHAR pad13[HD146818_REG_OFFSET];
  51.     UCHAR controlD;
  52.     } RTC;
  53. #endif /* _ASMLANGUAGE */
  54. /* bit values for control register A */
  55. #define RTC_UIP 0x80
  56. #define RTC_1MHZ 0x10
  57. #define RTC_32KHZ 0x20
  58. #define RTC_DV_RESET 0x60
  59. /* bit values for control register B */
  60. #define RTC_SET 0x80
  61. #define RTC_PIE 0x40
  62. #define RTC_AIE 0x20
  63. #define RTC_UIE 0x10
  64. #define RTC_SQWE 0x08
  65. #define RTC_DM 0x04
  66. #define RTC_24 0x02
  67. #define RTC_DSE 0x01
  68. /* bit values for control register C */
  69. #define RTC_IRQF 0x80
  70. #define RTC_PF 0x40
  71. #define RTC_AF 0x20
  72. #define RTC_UF 0x10
  73. #ifdef __cplusplus
  74. }
  75. #endif
  76. #endif /* __INChd146818h */