MityDSP Documentation Index

MityDSP::tcDspRtcBase Class Reference

The tcDspRtcBase class is a virtual base class to provide consistent access to various real-time clock devices. More...

#include <core/DspRtcBase.h>

Inheritance diagram for MityDSP::tcDspRtcBase:
MityDSP::tcDspRtcDS1305 MityDSP::tcDspRtcM41T81

List of all members.

Public Member Functions

 tcDspRtcBase (unsigned int anEpochYear=Y2K)
 This constructor is used to initialize the real-time clock base class.
virtual ~tcDspRtcBase ()
 Default Destructor.
virtual tsCLTime get_time (unsigned short *apHundredths=NULL)=0
virtual void set_time (tsCLTime asTime)=0
virtual void set_time (unsigned int anYear, unsigned int anMonth, unsigned int anDay, unsigned int anHour, unsigned int anMin, unsigned int anSec)=0
void convert_time (unsigned int anYear, unsigned int anMonth, unsigned int anDay, unsigned int anHour, unsigned int anMin, unsigned int anSec, tsCLTime &arTime)
 This routine converts from discrete year, month, day, hours, minutes and seconds to a tsCLTime value.
void convert_time (tsCLTime asTime, unsigned int &arYear, unsigned int &arMonth, unsigned int &arDay, unsigned int &arHour, unsigned int &arMin, unsigned int &arSec)
 This routine converts from a tsCLTime value to discrete year, month, day, hours, minutes and seconds.
unsigned int convert_time (tsCLTime asTime)
 This routine converts from a tsCLTime value to a number of seconds since the start of the current epoch.
tsCLTime convert_time (unsigned int anSecsSinceEpoch)
 This routine converts from the number of seconds since the start of the current epoch to a tsCLTime value.
bool isLeapYear (unsigned int anYear)
 This routine determines if the specified year is a leap year.

Static Public Attributes

static const int gaMonthdays [13]
static const int gnDaysPerYear = 365
static const int gnHoursPerDay = 24
static const int gnSecsPerHour = 3600

Protected Attributes

SEM_Handle mhMutex
 Used to serialize access.
unsigned int mnEpoch
 Epoch year used in CL-Time structure.

Detailed Description

The tcDspRtcBase class is a virtual base class to provide consistent access to various real-time clock devices.

It provides functions for converting time formats, as well as getting and setting the current time.

See also:
tcDspRtcBase Page

Constructor & Destructor Documentation

tcDspRtcBase::tcDspRtcBase ( unsigned int  anYear = Y2K  ) 

This constructor is used to initialize the real-time clock base class.

Parameters:
[in] anYear Base year (epoch) for this real-time clock.
tcDspRtcBase::~tcDspRtcBase (  )  [virtual]

Default Destructor.


Member Function Documentation

virtual tsCLTime MityDSP::tcDspRtcBase::get_time ( unsigned short *  apHundredths = NULL  )  [pure virtual]
virtual void MityDSP::tcDspRtcBase::set_time ( tsCLTime  asTime  )  [pure virtual]
virtual void MityDSP::tcDspRtcBase::set_time ( unsigned int  anYear,
unsigned int  anMonth,
unsigned int  anDay,
unsigned int  anHour,
unsigned int  anMin,
unsigned int  anSec 
) [pure virtual]
void tcDspRtcBase::convert_time ( unsigned int  anYear,
unsigned int  anMonth,
unsigned int  anDay,
unsigned int  anHour,
unsigned int  anMin,
unsigned int  anSec,
tsCLTime arTime 
)

This routine converts from discrete year, month, day, hours, minutes and seconds to a tsCLTime value.

Parameters:
[in] anYear Current year.
[in] anMonth Current month (1-12).
[in] anDay Current day (1-31).
[in] anHour Current hour in 24-hour time (0-23).
[in] anMin Current Minute (0-59).
[in] anSec Current Seconds (0-59).
[out] arTime Reference to a tsCLTime struct.
void tcDspRtcBase::convert_time ( tsCLTime  asTime,
unsigned int &  arYear,
unsigned int &  arMonth,
unsigned int &  arDay,
unsigned int &  arHour,
unsigned int &  arMin,
unsigned int &  arSec 
)

This routine converts from a tsCLTime value to discrete year, month, day, hours, minutes and seconds.

Parameters:
[in] asTime a tsCLTime structure to convert.
[out] arYear Current year.
[out] arMonth Current month (1-12).
[out] arDay Current day (1-31).
[out] arHour Current hour in 24-hour time (0-23).
[out] arMin Current Minute (0-59).
[out] arSec Current Seconds (0-59).
unsigned int tcDspRtcBase::convert_time ( tsCLTime  asTime  ) 

This routine converts from a tsCLTime value to a number of seconds since the start of the current epoch.

Parameters:
[in] asTime a tsCLTime structure to convert.
Returns:
Seconds since midnight on January 1 of the Epoch year.
tsCLTime tcDspRtcBase::convert_time ( unsigned int  anSecsSinceEpoch  ) 

This routine converts from the number of seconds since the start of the current epoch to a tsCLTime value.

Parameters:
[in] anSecsSinceEpoch Seconds since start of the Epoch year.
Returns:
The resulting tsCLTime structure.
bool tcDspRtcBase::isLeapYear ( unsigned int  anYear  ) 

This routine determines if the specified year is a leap year.

Parameters:
[in] anYear The year to test.
Returns:
True if the year is a leap year.

Member Data Documentation

const int tcDspRtcBase::gaMonthdays [static]
Initial value:
 {  0, 31, 28, 31, 30, 31, 30, 
                                            31, 31, 30, 31, 30, 31 }
const int tcDspRtcBase::gnDaysPerYear = 365 [static]
const int tcDspRtcBase::gnHoursPerDay = 24 [static]
const int tcDspRtcBase::gnSecsPerHour = 3600 [static]
SEM_Handle MityDSP::tcDspRtcBase::mhMutex [protected]

Used to serialize access.

unsigned int MityDSP::tcDspRtcBase::mnEpoch [protected]

Epoch year used in CL-Time structure.


  
Generated on Fri Sep 23 16:33:54 2011 for MityDSP Core by  Doxygen Version 1.6.1
Copyright © 2009, Critical Link LLC, All rights reserved.