intersil.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. /* bit 5 */
  18. #define INTERSIL_MODE_NORMAL 0x00
  19. #define INTERSIL_MODE_TEST 0x20
  20. #define INTERSIL_HZ_100_MASK 0x02
  21. struct intersil_dt {
  22. unsigned char csec;
  23. unsigned char hour;
  24. unsigned char minute;
  25. unsigned char second;
  26. unsigned char month;
  27. unsigned char day;
  28. unsigned char year;
  29. unsigned char weekday;
  30. };
  31. struct intersil_7170 {
  32. struct intersil_dt counter;
  33. struct intersil_dt alarm;
  34. unsigned char int_reg;
  35. unsigned char cmd_reg;
  36. };
  37. extern volatile char* clock_va;
  38. #define intersil_clock ((volatile struct intersil_7170 *) clock_va)
  39. #define intersil_clear() (void)intersil_clock->int_reg
  40. #endif