Dallas Semiconductor DS80C400 C Libraries Home Page

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

tini400_time.h File Reference


Detailed Description

Date/Time utilities, tailored for the DS80C400 C Libraries.

This library contains functions that provide simple time utilities in conjunction with the RTC C Library. The time base is variable for this library, meaning that the value '0 seconds' can be assigned to 12:00:00am of January 1st for a specific year. Note that this library does not currently support daylight savings time computations or the concept of time zones.

Note that this library will not return correct values for dates before the year 1901 or after the year 2099.

For detailed information on the DS80C400 please see the High-Speed Microcontroller User's Guide: DS80C400 Supplement.

Warning:
The functions in this library are NOT multi-process safe--that is, if you call the same method from two different processes at the same time, the parameters to the function may be destroyed, yielding unpredictable results. Consult each individual funtion's documentation for details on which functions are multi-process safe.

Go to the source code of this file.

Data Structures

struct  tm

Defines

#define TINI400_TIME_VERSION   2

Typedefs

typedef unsigned long time_t

Functions

unsigned int time_version (void)
 Returns the version number of this TIME library.
void time_settimebase (unsigned int year)
 Sets the time base year for the RTC.
time_t mktime (struct tm *timeptr)
 mktime
time_t time (time_t *timer)
 time
tmgmtime (time_t *timer)
 gmtime


Define Documentation

#define TINI400_TIME_VERSION   2
 

Version number associated with this header file. Should be the same as the version number returned by the time_version function.

See also:
time_version


Typedef Documentation

typedef unsigned long time_t
 

Type used for representing time. Our RTC is assumed to be 4 bytes of seconds.

See also:
time


Function Documentation

struct tm* gmtime time_t timer  ) 
 

gmtime

Converts the native time formatted input into a calendar representation.

Parameters:
timer Native represenation of the time to be converted to calendar format.
Returns:
Calendar format of the input time.

time_t mktime struct tm timeptr  ) 
 

mktime

Converts a tm structure (calendar time) into the native time representation of time_t. The time is computed using the hour, minute, second, day of month, month, and year fields of the input structure. The day of year, day of week, and daylight savings time flag are ignored. No bounds checking is performed on the input data.

Parameters:
timeptr Calendar time to be converted to native time representation
Returns:
Native time representation of the calendar.

time_t time time_t timer  ) 
 

time

Gets the current time in its native representation format. Use the function gmtime to get a calendar representation of this time.

Parameters:
timer If non-null, this is also filled in with the return value
Returns:
Native time representation of the current time.

void time_settimebase unsigned int  year  ) 
 

Sets the time base year for the RTC.

Sets the time base year for the real time clock. The recommended time base is the year 2000. The time base must be set before meaningful calculations can occur.

Parameters:
year base year which will be used for time computations

unsigned int time_version void   ) 
 

Returns the version number of this TIME library.

Returns:
Version number of this TIME library.


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