Nut/OS  4.10.3
API Reference
at91_rtc.h
Go to the documentation of this file.
00001 #ifndef _ARCH_ARM_RTC_H_
00002 #define _ARCH_ARM_RTC_H_
00003 /*
00004  * Copyright (C) 2006-2007 by egnite Software GmbH. All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions
00008  * are met:
00009  *
00010  * 1. Redistributions of source code must retain the above copyright
00011  *    notice, this list of conditions and the following disclaimer.
00012  * 2. Redistributions in binary form must reproduce the above copyright
00013  *    notice, this list of conditions and the following disclaimer in the
00014  *    documentation and/or other materials provided with the distribution.
00015  * 3. Neither the name of the copyright holders nor the names of
00016  *    contributors may be used to endorse or promote products derived
00017  *    from this software without specific prior written permission.
00018  *
00019  * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
00020  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00021  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00022  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
00023  * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00024  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00025  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00026  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00027  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00028  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00029  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00030  * SUCH DAMAGE.
00031  *
00032  * For additional information see http://www.ethernut.de/
00033  */
00034 
00048 
00049 #ifdef RTC_BASE
00050 
00053 #define RTC_CR                (RTC_BASE + 0x00)      
00054 #define RTC_UPDTIM            0x00000001             
00055 #define RTC_UPDCAL            0x00000002             
00056 #define RTC_TIMEVSEL_MIN      0x00000008             
00057 #define RTC_TIMEVSEL_HR       0x00000008             
00058 #define RTC_TIMEVSEL_MIDN     0x00000008             
00059 #define RTC_TIMEVSEL_NOON     0x00000008             
00060 #define RTC_CALEVSEL_WEEK     0x00000000             
00061 #define RTC_CALEVSEL_MONTH    0x00000001             
00062 #define RTC_CALEVSEL_YEAR     0x00000003             
00064 
00065 
00067 #define RTC_MR                (RTC_BASE + 0x04)      
00068 #define RTC_HRMOD_24          0x00000000             
00069 #define RTC_HRMOD_12          0x00000001             
00071 
00072 
00074 #define RTC_TIMR                (RTC_BASE + 0x08)    
00075 #define RTC_SEC                 0x0000007F           
00076 #define RTC_SEC_LSB             0                    
00077 #define RTC_MIN                 0x00007F00           
00078 #define RTC_MIN_LSB             8                    
00079 #define RTC_HOUR                0x003F0000           
00080 #define RTC_HOUR_LSB            16                   
00081 #define RTC_AM                  0x00000000           
00082 #define RTC_PM                  0x00400000           
00084 
00085 
00087 #define RTC_CALR                (RTC_BASE + 0x0C)    
00088 #define RTC_CENT                0x0000007F           
00089 #define RTC_CENT_LSB            0                    
00090 #define RTC_YEAR                0x0000FF00           
00091 #define RTC_YEAR_LSB            8                    
00092 #define RTC_MONTH               0x001F0000           
00093 #define RTC_MONTH_LSB           16                   
00094 #define RTC_DAY                 0x00E00000           
00095 #define RTC_DAY_LSB             21                   
00096 #define RTC_DATE                0x3F000000           
00097 #define RTC_DATE_LSB            24                   
00099 
00100 
00102 #define RTC_TIMALR              (RTC_BASE + 0x10)    
00103 #define RTC_SECEN             0x00000080           
00104 #define RTC_MINEN             0x00008000           
00105 #define RTC_HOUREN            0x00800000           
00107 
00108 
00110 #define RTC_CALALR              (RTC_BASE + 0x14)    
00111 #define RTC_DATEEN              0x80000000           
00112 #define RTC_MTHEN               0x00800000           
00114 
00115 
00117 #define RTC_SR                  (RTC_BASE + 0x18)    
00118 #define RTC_ACKUPD              0x00000001           
00119 #define RTC_ALARM               0x00000002           
00120 #define RTC_SECEV               0x00000004           
00121 #define RTC_TIMEV               0x00000008           
00122 #define RTC_CALEV               0x00000010           
00124 
00125 
00127 #define RTC_SCCR                (RTC_BASE + 0x1C)    
00128 #define RTC_ACKCLR              0x00000001           
00129 #define RTC_ALRCLR              0x00000002           
00130 #define RTC_SECCLR              0x00000004           
00131 #define RTC_TIMCLR              0x00000008           
00132 #define RTC_CALCLR              0x00000010           
00134 
00135 
00137 #define RTC_IER                (RTC_BASE + 0x20)    
00138 #define RTC_IDR                (RTC_BASE + 0x24)    
00139 #define RTC_IMR                (RTC_BASE + 0x28)    
00140 #define RTC_ACKINT             0x00000001           
00141 #define RTC_ALRINT             0x00000002           
00142 #define RTC_SECINT             0x00000004           
00143 #define RTC_TIMINT             0x00000008           
00144 #define RTC_CALINT             0x00000010           
00146 
00147 
00149 #define RTC_VER                (RTC_BASE + 0x2C)    
00150 #define RTC_NVTIM              0x00000001           
00151 #define RTC_NVCAL              0x00000002           
00152 #define RTC_NVTIMALR           0x00000004           
00153 #define RTC_NVCALALR           0x00000008           
00155 
00156 #endif
00157 
00160 #endif                          /* _ARCH_ARM_RTC_H_ */