LPCOpen Platform for LPC112X microcontrollers  112X
LPCOpen Platform for the NXP LPC112X family of Microcontrollers
rtc_ut.h
Go to the documentation of this file.
1 /*
2  * @brief RTC tick to (a more) Universal Time
3  * Adds conversion functions to use an RTC that only provides a
4  * seconds capability to provide "struct tm" support.
5  *
6  * @note
7  * Copyright(C) NXP Semiconductors, 2014
8  * All rights reserved.
9  *
10  * @par
11  * Software that is described herein is for illustrative purposes only
12  * which provides customers with programming information regarding the
13  * LPC products. This software is supplied "AS IS" without any warranties of
14  * any kind, and NXP Semiconductors and its licenser disclaim any and
15  * all warranties, express or implied, including all implied warranties of
16  * merchantability, fitness for a particular purpose and non-infringement of
17  * intellectual property rights. NXP Semiconductors assumes no responsibility
18  * or liability for the use of the software, conveys no license or rights under any
19  * patent, copyright, mask work right, or any other intellectual property rights in
20  * or to any products. NXP Semiconductors reserves the right to make changes
21  * in the software without notification. NXP Semiconductors also makes no
22  * representation or warranty that such application will be suitable for the
23  * specified use without further testing or modification.
24  *
25  * @par
26  * Permission to use, copy, modify, and distribute this software and its
27  * documentation is hereby granted, under NXP Semiconductors' and its
28  * licensor's relevant copyrights in the software, without fee, provided that it
29  * is used in conjunction with NXP Semiconductors microcontrollers. This
30  * copyright, permission, and disclaimer notice must appear in all copies of
31  * this code.
32  */
33 
34 #ifndef __RTC_UT_H_
35 #define __RTC_UT_H_
36 
37 #include "chip.h"
38 #include <stdlib.h>
39 #include <time.h>
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
52 /* Starting year and starting day of week for the driver */
53 #define TM_YEAR_BASE (1900)
54 #define TM_DAYOFWEEK (1)
55 
64 void ConvertRtcTime(uint32_t rtcTick, struct tm *pTime);
65 
74 void ConvertTimeRtc(struct tm *pTime, uint32_t *rtcTick);
75 
80 #ifdef __cplusplus
81 }
82 #endif
83 
84 #endif /* __RTC_UT_H_ */