Dallas Semiconductor DS80C400 C Libraries Home Page

Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals

tini_rtc.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------
00002  *  Copyright (C) 2003-2004 Dallas Semiconductor Corporation, 
00003  *  All Rights Reserved.
00004  * 
00005  *  Permission is hereby granted, free of charge, to any person obtaining a
00006  *  copy of this software and associated documentation files (the "Software"),
00007  *  to deal in the Software without restriction, including without limitation
00008  *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
00009  *  and/or sell copies of the Software, and to permit persons to whom the
00010  *  Software is furnished to do so, subject to the following conditions:
00011  * 
00012  *  The above copyright notice and this permission notice shall be included
00013  *  in all copies or substantial portions of the Software.
00014  * 
00015  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00016  *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00017  *  MERCHANTABILITY,  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00018  *  IN NO EVENT SHALL DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES
00019  *  OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00020  *  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00021  *  OTHER DEALINGS IN THE SOFTWARE.
00022  * 
00023  *  Except as contained in this notice, the name of Dallas Semiconductor
00024  *  shall not be used except as stated in the Dallas Semiconductor
00025  *  Branding Policy.
00026  * ---------------------------------------------------------------------------
00027  *
00028  * This file contains function definitions for RTC access functions.
00029  * This file is intended for use with the Keil MicroVision (uVision) C compiler.
00030  *
00031  * ---------------------------------------------------------------------------
00032  */
00033 
00034 #ifndef __tini_rtc_
00035 #define __tini_rtc_
00036 
00055 #define DEVICE_ADDRESS  0xD0
00056 
00061 #define COUNTER_ADDRESS 0x00
00062 
00067 #define CONTROL_ADDRESS 0x04
00068 
00073 #define TRICKLECHARGER_ADDRESS  0x05
00074 
00078 #define TRICKLECHARGER_DISABLE  0xF0
00079 
00082 #define START_CLOCK     0x7F
00083 
00086 #define STOP_CLOCK      0x80
00087 
00091 #define NODIODE_250OHM  0xA5
00092 
00096 #define ONEDIODE_250OHM 0xA9
00097 
00101 #define NODIODE_2KOHM   0xA6
00102 
00106 #define ONEDIODE_2KOHM  0xAA
00107 
00111 #define NODIODE_4KOHM   0xA7
00112 
00116 #define ONEDIODE_4KOHM  0xAB
00117 
00121 #define TINI_RTC_VERSION 1
00122 
00126 //---------------------------------------------------------------------------
00127 int rtc_version();
00128 
00135 //---------------------------------------------------------------------------
00136 int rtc_startclock();
00137 
00144 //---------------------------------------------------------------------------
00145 int rtc_stopclock();
00146 
00154 //---------------------------------------------------------------------------
00155 int rtc_setcontrolregister(unsigned char newvalue);
00156 
00162 //---------------------------------------------------------------------------
00163 int rtc_getcontrolregister(unsigned char*);
00164 
00170 //---------------------------------------------------------------------------
00171 int rtc_disabletricklecharger();
00172 
00179 //---------------------------------------------------------------------------
00180 int rtc_enabletricklecharger0diode250ohm();
00181 
00188 //---------------------------------------------------------------------------
00189 int rtc_enabletricklecharger1diode250ohm();
00190 
00197 //---------------------------------------------------------------------------
00198 int rtc_enabletricklecharger0diode2kohm();
00199 
00206 //---------------------------------------------------------------------------
00207 int rtc_enabletricklecharger1diode2kohm();
00208 
00215 //---------------------------------------------------------------------------
00216 int rtc_enabletricklecharger0diode4kohm();
00217 
00224 //---------------------------------------------------------------------------
00225 int rtc_enabletricklecharger1diode4kohm();
00226 
00234 //---------------------------------------------------------------------------
00235 int rtc_settricklechargerregister(unsigned char newvalue);
00236 
00242 //---------------------------------------------------------------------------
00243 int rtc_gettricklechargerregister(unsigned char*);
00244 
00251 //---------------------------------------------------------------------------
00252 int rtc_getclock(long*);
00260 //---------------------------------------------------------------------------
00261 int rtc_setclock(long newvalue);
00262 #endif
00263 

Copyright 2005 Dallas Semiconductor, Inc.. Documentation generated by Doxygen.