00001 //****************************************************************************** 00002 // Code for application report - "Real Time Clock Library" 00003 // 00004 // L.Westlund 00005 // Texas Instruments, Inc 00006 // August 2005 00007 //****************************************************************************** 00008 // THIS PROGRAM IS PROVIDED "AS IS". TI MAKES NO WARRANTIES OR 00009 // REPRESENTATIONS, EITHER EXPRESS, IMPLIED OR STATUTORY, 00010 // INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS 00011 // FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR 00012 // COMPLETENESS OF RESPONSES, RESULTS AND LACK OF NEGLIGENCE. 00013 // TI DISCLAIMS ANY WARRANTY OF TITLE, QUIET ENJOYMENT, QUIET 00014 // POSSESSION, AND NON-INFRINGEMENT OF ANY THIRD PARTY 00015 // INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO THE PROGRAM OR 00016 // YOUR USE OF THE PROGRAM. 00017 // 00018 // IN NO EVENT SHALL TI BE LIABLE FOR ANY SPECIAL, INCIDENTAL, 00019 // CONSEQUENTIAL OR INDIRECT DAMAGES, HOWEVER CAUSED, ON ANY 00020 // THEORY OF LIABILITY AND WHETHER OR NOT TI HAS BEEN ADVISED 00021 // OF THE POSSIBILITY OF SUCH DAMAGES, ARISING IN ANY WAY OUT 00022 // OF THIS AGREEMENT, THE PROGRAM, OR YOUR USE OF THE PROGRAM. 00023 // EXCLUDED DAMAGES INCLUDE, BUT ARE NOT LIMITED TO, COST OF 00024 // REMOVAL OR REINSTALLATION, COMPUTER TIME, LABOR COSTS, LOSS 00025 // OF GOODWILL, LOSS OF PROFITS, LOSS OF SAVINGS, OR LOSS OF 00026 // USE OR INTERRUPTION OF BUSINESS. IN NO EVENT WILL TI'S 00027 // AGGREGATE LIABILITY UNDER THIS AGREEMENT OR ARISING OUT OF 00028 // YOUR USE OF THE PROGRAM EXCEED FIVE HUNDRED DOLLARS 00029 // (U.S.$500). 00030 // 00031 // Unless otherwise stated, the Program written and copyrighted 00032 // by Texas Instruments is distributed as "freeware". You may, 00033 // only under TI's copyright in the Program, use and modify the 00034 // Program without any charge or restriction. You may 00035 // distribute to third parties, provided that you transfer a 00036 // copy of this license to the third party and the third party 00037 // agrees to these terms by its first use of the Program. You 00038 // must reproduce the copyright notice and any other legend of 00039 // ownership on each copy or partial copy, of the Program. 00040 // 00041 // You acknowledge and agree that the Program contains 00042 // copyrighted material, trade secrets and other TI proprietary 00043 // information and is protected by copyright laws, 00044 // international copyright treaties, and trade secret laws, as 00045 // well as other intellectual property laws. To protect TI's 00046 // rights in the Program, you agree not to decompile, reverse 00047 // engineer, disassemble or otherwise translate any object code 00048 // versions of the Program to a human-readable form. You agree 00049 // that in no event will you alter, remove or destroy any 00050 // copyright notice included in the Program. TI reserves all 00051 // rights not specifically granted under this license. Except 00052 // as specifically provided herein, nothing in this agreement 00053 // shall be construed as conferring by implication, estoppel, 00054 // or otherwise, upon you, any license or other right under any 00055 // TI patents, copyrights or trade secrets. 00056 // 00057 // You may not use the Program in non-TI devices. 00058 // 00059 //****************************************************************************** 00060 #ifndef RTC_H 00061 #define RTC_H 00062 00063 #define setTime(H,M,S,P) {TI_second = S; TI_minute = M; TI_hour = H; TI_PM = P;} // encoded as BCD chars 00064 00065 extern unsigned char TI_second; // 0x00 - 0x59 00066 extern unsigned char TI_minute; // 0x00 - 0x59 00067 extern unsigned char TI_hour; // 0x00 - 0x12 00068 extern unsigned char TI_PM; // AM = 0, PM = 1 00069 00070 extern void incrementSeconds(void); 00071 extern void incrementMinutes(void); 00072 extern void incrementHours(void); 00073 extern char get24Hour(unsigned char hour, unsigned char pm); 00074 00075 #endif
1.5.1