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

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  *  Registers for the SGS-Thomson M48T35 Timekeeper RAM chip
  3.  */
  4. #ifndef _ASM_M48T35_H
  5. #define _ASM_M48T35_H
  6. struct m48t35_rtc {
  7.         volatile u8         pad[0x7ff8];    /* starts at 0x7ff8 */
  8.         volatile u8         control;
  9.         volatile u8         sec;
  10.         volatile u8         min;
  11.         volatile u8         hour;
  12.         volatile u8         day;
  13.         volatile u8         date;
  14.         volatile u8         month;
  15.         volatile u8         year;
  16. };
  17. #define M48T35_RTC_SET      0x80
  18. #define M48T35_RTC_STOPPED  0x80
  19. #define M48T35_RTC_READ     0x40
  20. #ifndef BCD_TO_BIN
  21. #define BCD_TO_BIN(x)   ((x)=((x)&15) + ((x)>>4)*10)
  22. #endif
  23. #ifndef BIN_TO_BCD
  24. #define BIN_TO_BCD(x)   ((x)=(((x)/10)<<4) + (x)%10)
  25. #endif
  26. #endif