1 /* Coldfire C Header File
2 * Copyright Freescale Semiconductor Inc
5 * 2008/05/23 Revision: 0.95
7 * (c) Copyright UNIS, a.s. 1997-2008
12 * http : www.processorexpert.com
13 * mail : info@processorexpert.com
16 #ifndef __MCF52221_RTC_H__
17 #define __MCF52221_RTC_H__
20 /*********************************************************************
22 * Real-Time Clock (RTC)
24 *********************************************************************/
26 /* Register read/write macros */
27 #define MCF_RTC_HOURMIN (*(vuint32*)(0x400003C0))
28 #define MCF_RTC_SECONDS (*(vuint32*)(0x400003C4))
29 #define MCF_RTC_ALRM_HM (*(vuint32*)(0x400003C8))
30 #define MCF_RTC_ALRM_SEC (*(vuint32*)(0x400003CC))
31 #define MCF_RTC_RTCCTL (*(vuint32*)(0x400003D0))
32 #define MCF_RTC_RTCISR (*(vuint32*)(0x400003D4))
33 #define MCF_RTC_RTCIENR (*(vuint32*)(0x400003D8))
34 #define MCF_RTC_STPWCH (*(vuint32*)(0x400003DC))
35 #define MCF_RTC_DAYS (*(vuint32*)(0x400003E0))
36 #define MCF_RTC_ALRM_DAY (*(vuint32*)(0x400003E4))
39 /* Bit definitions and macros for MCF_RTC_HOURMIN */
40 #define MCF_RTC_HOURMIN_MINUTES(x) (((x)&0x3F)<<0)
41 #define MCF_RTC_HOURMIN_HOURS(x) (((x)&0x1F)<<0x8)
43 /* Bit definitions and macros for MCF_RTC_SECONDS */
44 #define MCF_RTC_SECONDS_SECONDS(x) (((x)&0x3F)<<0)
46 /* Bit definitions and macros for MCF_RTC_ALRM_HM */
47 #define MCF_RTC_ALRM_HM_MINUTES(x) (((x)&0x3F)<<0)
48 #define MCF_RTC_ALRM_HM_HOURS(x) (((x)&0x1F)<<0x8)
50 /* Bit definitions and macros for MCF_RTC_ALRM_SEC */
51 #define MCF_RTC_ALRM_SEC_SECONDS(x) (((x)&0x3F)<<0)
53 /* Bit definitions and macros for MCF_RTC_RTCCTL */
54 #define MCF_RTC_RTCCTL_SWR (0x1)
55 #define MCF_RTC_RTCCTL_EN (0x80)
57 /* Bit definitions and macros for MCF_RTC_RTCISR */
58 #define MCF_RTC_RTCISR_SW (0x1)
59 #define MCF_RTC_RTCISR_MIN (0x2)
60 #define MCF_RTC_RTCISR_ALM (0x4)
61 #define MCF_RTC_RTCISR_DAY (0x8)
62 #define MCF_RTC_RTCISR_1HZ (0x10)
63 #define MCF_RTC_RTCISR_HR (0x20)
65 /* Bit definitions and macros for MCF_RTC_RTCIENR */
66 #define MCF_RTC_RTCIENR_SW (0x1)
67 #define MCF_RTC_RTCIENR_MIN (0x2)
68 #define MCF_RTC_RTCIENR_ALM (0x4)
69 #define MCF_RTC_RTCIENR_DAY (0x8)
70 #define MCF_RTC_RTCIENR_1HZ (0x10)
71 #define MCF_RTC_RTCIENR_HR (0x20)
73 /* Bit definitions and macros for MCF_RTC_STPWCH */
74 #define MCF_RTC_STPWCH_CNT(x) (((x)&0x3F)<<0)
76 /* Bit definitions and macros for MCF_RTC_DAYS */
77 #define MCF_RTC_DAYS_DAYS(x) (((x)&0xFFFF)<<0)
79 /* Bit definitions and macros for MCF_RTC_ALRM_DAY */
80 #define MCF_RTC_ALRM_DAY_DAYSAL(x) (((x)&0xFFFF)<<0)
83 #endif /* __MCF52221_RTC_H__ */