LPCOpen Platform for LPC112X microcontrollers  112X
LPCOpen Platform for the NXP LPC112X family of Microcontrollers
Macros | Functions
CHIP: RTC tick to (a more) Universal Time conversion functions

Detailed Description

This driver converts between a RTC 1-second tick value and a Universal time format in a structure of type 'struct tm'.

Macros

#define TM_YEAR_BASE   (1900)
 
#define TM_DAYOFWEEK   (1)
 

Functions

void ConvertRtcTime (uint32_t rtcTick, struct tm *pTime)
 Converts a RTC tick time to Universal time. More...
 
void ConvertTimeRtc (struct tm *pTime, uint32_t *rtcTick)
 Converts a Universal time to RTC tick time. More...
 

Macro Definition Documentation

#define TM_DAYOFWEEK   (1)

Definition at line 54 of file rtc_ut.h.

#define TM_YEAR_BASE   (1900)

Definition at line 53 of file rtc_ut.h.

Function Documentation

void ConvertRtcTime ( uint32_t  rtcTick,
struct tm *  pTime 
)

Converts a RTC tick time to Universal time.

Parameters
rtcTick: Current RTC time value
pTime: Pointer to time structure to fill
Returns
Nothing
Note
When setting time, the 'tm_wday', 'tm_yday', and 'tm_isdst' fields are not used.

Definition at line 130 of file rtc_ut.c.

void ConvertTimeRtc ( struct tm *  pTime,
uint32_t *  rtcTick 
)

Converts a Universal time to RTC tick time.

Parameters
pTime: Pointer to time structure to use
rtcTick: Pointer to RTC time value to fill
Returns
Nothing
Note
When converting time, the 'tm_isdst' field is not populated by the conversion function.

Definition at line 154 of file rtc_ut.c.