MityDSP Documentation Index
Public Member Functions
MityDSP::tcDspRtcDS1305 Class Reference

Instances of this class handle access to the DS1305 real-time clock chip. More...

#include <core/DspRtcDS1305.h>

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

List of all members.

Public Member Functions

 tcDspRtcDS1305 (tcDspMcbsp *apMcbsp, tcDspOutputLatch *apLatch, unsigned int anCSID, unsigned int anYear=Y2K)
 This constructor is used to initialize a DS1305 real-time clock over a specified McBSP interface.
 ~tcDspRtcDS1305 ()
 Default Destructor.
tsCLTime get_time (unsigned short *apHundredths=NULL)
 This routine reads the current time from the real-time clock and returns it as a 32-bit tsCLTime value.
void set_time (tsCLTime asTime)
 This routine provides an alternate interface to the set_time routine, using a tsCLTime value.
void set_time (unsigned int anYear, unsigned int anMonth, unsigned int anDay, unsigned int anHour, unsigned int anMin, unsigned int anSec)
 This routine sets the current time of the real-time clock using discrete year, month, day, hour, minute and second values.
- Public Member Functions inherited from MityDSP::tcDspRtcBase
 tcDspRtcBase (unsigned int anEpochYear=Y2K)
 This constructor is used to initialize the real-time clock base class.
virtual ~tcDspRtcBase ()
 Default Destructor.
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.

Additional Inherited Members

- Static Public Attributes inherited from MityDSP::tcDspRtcBase
static const int gaMonthdays [13]
static const int gnDaysPerYear = 365
static const int gnHoursPerDay = 24
static const int gnSecsPerHour = 3600
- Protected Attributes inherited from MityDSP::tcDspRtcBase
SEM_Handle mhMutex
 Used to serialize access.
unsigned int mnEpoch
 Epoch year used in CL-Time structure.

Detailed Description

Instances of this class handle access to the DS1305 real-time clock chip.

See also:
tcDspRtcDS1305 Page

Constructor & Destructor Documentation

tcDspRtcDS1305::tcDspRtcDS1305 ( tcDspMcbsp apMcbsp,
tcDspOutputLatch apLatch,
unsigned int  anCSID,
unsigned int  anYear = Y2K 
)

This constructor is used to initialize a DS1305 real-time clock over a specified McBSP interface.

Parameters:
[in]apMcbspThe tcDspMcbsp object to use for communication.
[in]apLatchThe tcDspOutputLatch to use for McBSP chip select.
[in]anCSIDThe chip select ID to use with apLatch.
[in]anYearBase year for this real-time clock.
tcDspRtcDS1305::~tcDspRtcDS1305 ( )

Default Destructor.


Member Function Documentation

tsCLTime tcDspRtcDS1305::get_time ( unsigned short *  apHundredths = NULL)
virtual

This routine reads the current time from the real-time clock and returns it as a 32-bit tsCLTime value.

Returns:
a tsCLTime instance holding the current time.

Implements MityDSP::tcDspRtcBase.

void tcDspRtcDS1305::set_time ( tsCLTime  asTime)
virtual

This routine provides an alternate interface to the set_time routine, using a tsCLTime value.

Parameters:
[in]asTimeA tsCLTime structure representing the current time.

Implements MityDSP::tcDspRtcBase.

void tcDspRtcDS1305::set_time ( unsigned int  anYear,
unsigned int  anMonth,
unsigned int  anDay,
unsigned int  anHour,
unsigned int  anMin,
unsigned int  anSec 
)
virtual

This routine sets the current time of the real-time clock using discrete year, month, day, hour, minute and second values.

The current epoch is updated if required.

Parameters:
[in]anYearCurrent year.
[in]anMonthCurrent month (1-12).
[in]anDayCurrent day (0-31).
[in]anHourCurrent hour in 24-hour time (0-24).
[in]anMinCurrent Minute (0-60).
[in]anSecCurrent Seconds (0-60).

Implements MityDSP::tcDspRtcBase.


  
Generated on Mon Apr 22 2013 11:33:04 for MityDSP Core by  Doxygen Version 1.8.1.1
Copyright © 2009, Critical Link LLC, All rights reserved.