1 /* Coldfire C Header File
\r
2 * Copyright Freescale Semiconductor Inc
\r
3 * All rights reserved.
\r
5 * 2008/04/17 Revision: 0.2
\r
7 * (c) Copyright UNIS, spol. s r.o. 1997-2008
\r
12 * http : www.processorexpert.com
\r
13 * mail : info@processorexpert.com
\r
16 #ifndef __MCF52259_RTC_H__
\r
17 #define __MCF52259_RTC_H__
\r
20 /*********************************************************************
\r
22 * Real-Time Clock (RTC)
\r
24 *********************************************************************/
\r
26 /* Register read/write macros */
\r
27 #define MCF_RTC_HOURMIN (*(vuint32*)(0x40180000))
\r
28 #define MCF_RTC_SECONDS (*(vuint32*)(0x40180004))
\r
29 #define MCF_RTC_ALRM_HM (*(vuint32*)(0x40180008))
\r
30 #define MCF_RTC_ALRM_SEC (*(vuint32*)(0x4018000C))
\r
31 #define MCF_RTC_RTCCTL (*(vuint32*)(0x40180010))
\r
32 #define MCF_RTC_RTCISR (*(vuint32*)(0x40180014))
\r
33 #define MCF_RTC_RTCIENR (*(vuint32*)(0x40180018))
\r
34 #define MCF_RTC_STPWCH (*(vuint32*)(0x4018001C))
\r
35 #define MCF_RTC_DAYS (*(vuint32*)(0x40180020))
\r
36 #define MCF_RTC_ALRM_DAY (*(vuint32*)(0x40180024))
\r
37 #define MCF_RTC_RTCGOCU (*(vuint32*)(0x40180034))
\r
38 #define MCF_RTC_RTCGOCL (*(vuint32*)(0x40180038))
\r
41 /* Bit definitions and macros for MCF_RTC_HOURMIN */
\r
42 #define MCF_RTC_HOURMIN_MINUTES(x) (((x)&0x3F)<<0)
\r
43 #define MCF_RTC_HOURMIN_HOURS(x) (((x)&0x1F)<<0x8)
\r
45 /* Bit definitions and macros for MCF_RTC_SECONDS */
\r
46 #define MCF_RTC_SECONDS_SECONDS(x) (((x)&0x3F)<<0)
\r
48 /* Bit definitions and macros for MCF_RTC_ALRM_HM */
\r
49 #define MCF_RTC_ALRM_HM_MINUTES(x) (((x)&0x3F)<<0)
\r
50 #define MCF_RTC_ALRM_HM_HOURS(x) (((x)&0x1F)<<0x8)
\r
52 /* Bit definitions and macros for MCF_RTC_ALRM_SEC */
\r
53 #define MCF_RTC_ALRM_SEC_SECONDS(x) (((x)&0x3F)<<0)
\r
55 /* Bit definitions and macros for MCF_RTC_RTCCTL */
\r
56 #define MCF_RTC_RTCCTL_SWR (0x1)
\r
57 #define MCF_RTC_RTCCTL_EN (0x80)
\r
59 /* Bit definitions and macros for MCF_RTC_RTCISR */
\r
60 #define MCF_RTC_RTCISR_SW (0x1)
\r
61 #define MCF_RTC_RTCISR_MIN (0x2)
\r
62 #define MCF_RTC_RTCISR_ALM (0x4)
\r
63 #define MCF_RTC_RTCISR_DAY (0x8)
\r
64 #define MCF_RTC_RTCISR_1HZ (0x10)
\r
65 #define MCF_RTC_RTCISR_HR (0x20)
\r
67 /* Bit definitions and macros for MCF_RTC_RTCIENR */
\r
68 #define MCF_RTC_RTCIENR_SW (0x1)
\r
69 #define MCF_RTC_RTCIENR_MIN (0x2)
\r
70 #define MCF_RTC_RTCIENR_ALM (0x4)
\r
71 #define MCF_RTC_RTCIENR_DAY (0x8)
\r
72 #define MCF_RTC_RTCIENR_1HZ (0x10)
\r
73 #define MCF_RTC_RTCIENR_HR (0x20)
\r
75 /* Bit definitions and macros for MCF_RTC_STPWCH */
\r
76 #define MCF_RTC_STPWCH_CNT(x) (((x)&0x3F)<<0)
\r
78 /* Bit definitions and macros for MCF_RTC_DAYS */
\r
79 #define MCF_RTC_DAYS_DAYS(x) (((x)&0xFFFF)<<0)
\r
81 /* Bit definitions and macros for MCF_RTC_ALRM_DAY */
\r
82 #define MCF_RTC_ALRM_DAY_DAYSAL(x) (((x)&0xFFFF)<<0)
\r
84 /* Bit definitions and macros for MCF_RTC_RTCGOCU */
\r
85 #define MCF_RTC_RTCGOCU_RTCGOCNT(x) (((x)&0xFFFF)<<0)
\r
87 /* Bit definitions and macros for MCF_RTC_RTCGOCL */
\r
88 #define MCF_RTC_RTCGOCL_RTCGOCNT(x) (((x)&0xFFFF)<<0)
\r
91 #endif /* __MCF52259_RTC_H__ */
\r