intersil.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:1k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. #ifndef _SUN3_INTERSIL_H
  2. #define _SUN3_INTERSIL_H
  3. /* bits 0 and 1 */
  4. #define INTERSIL_FREQ_32K        0x00
  5. #define INTERSIL_FREQ_1M         0x01
  6. #define INTERSIL_FREQ_2M         0x02
  7. #define INTERSIL_FREQ_4M         0x03
  8. /* bit 2 */
  9. #define INTERSIL_12H_MODE   0x00
  10. #define INTERSIL_24H_MODE   0x04
  11. /* bit 3 */
  12. #define INTERSIL_STOP            0x00
  13. #define INTERSIL_RUN             0x08
  14. /* bit 4 */
  15. #define INTERSIL_INT_ENABLE     0x10
  16. #define INTERSIL_INT_DISABLE    0x00
  17.                 
  18. /* bit 5 */
  19. #define INTERSIL_MODE_NORMAL     0x00
  20. #define INTERSIL_MODE_TEST       0x20
  21. #define INTERSIL_HZ_100_MASK  0x02
  22. struct intersil_dt {
  23. unsigned char csec;
  24. unsigned char hour;
  25. unsigned char minute;
  26. unsigned char second;
  27. unsigned char month;
  28. unsigned char day;
  29. unsigned char year;
  30. unsigned char weekday;
  31. };
  32. struct intersil_7170 {
  33. struct intersil_dt counter;
  34. struct intersil_dt alarm;
  35. unsigned char int_reg;
  36. unsigned char cmd_reg;
  37. };
  38. extern volatile char* clock_va;
  39. #define intersil_clock ((volatile struct intersil_7170 *) clock_va)
  40. #define intersil_clear() (void)intersil_clock->int_reg
  41. #endif