diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2004-11-01 13:22:41 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2004-11-01 13:22:41 +0000 |
commit | baff4dafe1ff85d128a55e7b73780ca28f5c7faf (patch) | |
tree | e2acdf92de467f283ecd11fe621a67e79301e1cc /cpukit/score/include/rtems/score/tod.h | |
parent | 2004-11-01 Ralf Corsepius <ralf_corsepius@rtems.org> (diff) | |
download | rtems-baff4dafe1ff85d128a55e7b73780ca28f5c7faf.tar.bz2 |
2004-11-01 Joel Sherrill <joel@oarcorp.com>
* score/cpu/no_cpu/rtems/score/cpu.h, score/include/rtems/debug.h,
score/include/rtems/seterr.h, score/include/rtems/system.h,
score/include/rtems/score/address.h,
score/include/rtems/score/apiext.h,
score/include/rtems/score/apimutex.h,
score/include/rtems/score/bitfield.h,
score/include/rtems/score/chain.h,
score/include/rtems/score/context.h,
score/include/rtems/score/copyrt.h,
score/include/rtems/score/coremsg.h,
score/include/rtems/score/coremutex.h,
score/include/rtems/score/coresem.h,
score/include/rtems/score/heap.h, score/include/rtems/score/interr.h,
score/include/rtems/score/isr.h, score/include/rtems/score/mpci.h,
score/include/rtems/score/mppkt.h,
score/include/rtems/score/objectmp.h,
score/include/rtems/score/priority.h,
score/include/rtems/score/stack.h,
score/include/rtems/score/states.h,
score/include/rtems/score/sysstate.h,
score/include/rtems/score/thread.h,
score/include/rtems/score/threadmp.h,
score/include/rtems/score/threadq.h, score/include/rtems/score/tod.h,
score/include/rtems/score/tqdata.h,
score/include/rtems/score/userext.h,
score/include/rtems/score/watchdog.h,
score/include/rtems/score/wkspace.h,
score/inline/rtems/score/address.inl,
score/inline/rtems/score/chain.inl,
score/inline/rtems/score/coremsg.inl,
score/inline/rtems/score/coremutex.inl,
score/inline/rtems/score/coresem.inl,
score/inline/rtems/score/heap.inl, score/inline/rtems/score/isr.inl,
score/inline/rtems/score/mppkt.inl,
score/inline/rtems/score/objectmp.inl,
score/inline/rtems/score/priority.inl,
score/inline/rtems/score/stack.inl,
score/inline/rtems/score/states.inl,
score/inline/rtems/score/sysstate.inl,
score/inline/rtems/score/thread.inl,
score/inline/rtems/score/threadmp.inl,
score/inline/rtems/score/tod.inl,
score/inline/rtems/score/tqdata.inl,
score/inline/rtems/score/userext.inl,
score/inline/rtems/score/watchdog.inl,
score/inline/rtems/score/wkspace.inl: Add Doxygen comments -- working
modifications which are not complete and may have broken code.
Committing so work and testing can proceed.
* score/Doxyfile, score/mainpage.h: New files.
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/include/rtems/score/tod.h | 198 |
1 files changed, 115 insertions, 83 deletions
diff --git a/cpukit/score/include/rtems/score/tod.h b/cpukit/score/include/rtems/score/tod.h index 8966c8b06c..b938899293 100644 --- a/cpukit/score/include/rtems/score/tod.h +++ b/cpukit/score/include/rtems/score/tod.h @@ -1,9 +1,12 @@ -/* tod.h +/** + * @file tod.h * * This include file contains all the constants and structures associated * with the Time of Day Handler. - * - * COPYRIGHT (c) 1989-1999. + */ + +/* + * COPYRIGHT (c) 1989-2004. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -16,6 +19,13 @@ #ifndef __TIME_OF_DAY_h #define __TIME_OF_DAY_h +/** + * @defgroup ScoreTOD Time Of Day (TOD) Handler + * + * This group contains functionality which XXX + */ +/**@{*/ + #ifdef __cplusplus extern "C" { #endif @@ -23,93 +33,142 @@ extern "C" { #include <rtems/score/object.h> #include <rtems/score/watchdog.h> -/* +/** @defgroup ScoreTODConstants TOD Constants * The following constants are related to the time of day. */ +/**@{*/ +/** + * XXX + */ #define TOD_SECONDS_PER_MINUTE (uint32_t )60 + +/** + * XXX + */ #define TOD_MINUTES_PER_HOUR (uint32_t )60 + +/** + * XXX + */ #define TOD_MONTHS_PER_YEAR (uint32_t )12 + +/** + * XXX + */ #define TOD_DAYS_PER_YEAR (uint32_t )365 + +/** + * XXX + */ #define TOD_HOURS_PER_DAY (uint32_t )24 + +/** + * XXX + */ #define TOD_SECONDS_PER_DAY (uint32_t ) (TOD_SECONDS_PER_MINUTE * \ TOD_MINUTES_PER_HOUR * \ TOD_HOURS_PER_DAY) + +/** + * XXX + */ #define TOD_SECONDS_PER_NON_LEAP_YEAR (365 * TOD_SECONDS_PER_DAY) +/** + * XXX + */ #define TOD_MILLISECONDS_PER_SECOND (uint32_t )1000 + +/** + * XXX + */ #define TOD_MICROSECONDS_PER_SECOND (uint32_t )1000000 + +/** + * XXX + */ #define TOD_NANOSECONDS_PER_SECOND (uint32_t )1000000000 + +/** + * XXX + */ #define TOD_NANOSECONDS_PER_MICROSECOND (uint32_t )1000 -/* +/**@}*/ + +/** @brief RTEMS Epoch Year + * * The following constant define the earliest year to which an * time of day can be initialized. This is considered the * epoch. */ - #define TOD_BASE_YEAR 1988 -/* +/** * The following record defines the time of control block. This * control block is used to maintain the current time of day. + * + * @note This is an RTEID style time/date. */ - -typedef struct { /* RTEID style time/date */ - uint32_t year; /* year, A.D. */ - uint32_t month; /* month, 1 -> 12 */ - uint32_t day; /* day, 1 -> 31 */ - uint32_t hour; /* hour, 0 -> 23 */ - uint32_t minute; /* minute, 0 -> 59 */ - uint32_t second; /* second, 0 -> 59 */ - uint32_t ticks; /* elapsed ticks between secs */ +typedef struct { + /** This field is the year, A.D. */ + uint32_t year; + /** This field is the month, 1 -> 12 */ + uint32_t month; + /** This field is the day, 1 -> 31 */ + uint32_t day; + /** This field is the hour, 0 -> 23 */ + uint32_t hour; + /** This field is the minute, 0 -> 59 */ + uint32_t minute; + /** This field is the second, 0 -> 59 */ + uint32_t second; + /** This field is the elapsed ticks between secs */ + uint32_t ticks; } TOD_Control; -/* - * The following is TRUE if the application has set the current +/** @brief Is the Time Of Day Set + * + * This is TRUE if the application has set the current * time of day, and FALSE otherwise. */ - SCORE_EXTERN boolean _TOD_Is_set; -/* +/** @brief Current Time of Day * The following contains the current time of day. */ - SCORE_EXTERN TOD_Control _TOD_Current; -/* +/** @brief Seconds Since RTEMS Epoch * The following contains the number of seconds from 00:00:00 * January 1, TOD_BASE_YEAR until the current time of day. */ - SCORE_EXTERN Watchdog_Interval _TOD_Seconds_since_epoch; -/* +/** @brief Microseconds per Clock Tick + * * The following contains the number of microseconds per tick. */ - SCORE_EXTERN uint32_t _TOD_Microseconds_per_tick; -/* - * The following contains the number of clock ticks per second. +/** @brief Clock Ticks per Second * - * NOTE: + * The following contains the number of clock ticks per second. * - * If one second is NOT evenly divisible by the number of microseconds + * @note If one second is NOT evenly divisible by the number of microseconds * per clock tick, this value will contain only the integer portion * of the division. This means that the interval between clock ticks * can be a source of error in the current time of day. */ - SCORE_EXTERN uint32_t _TOD_Ticks_per_second; -/* +/** @brief Watchdog Set Managed by Seconds + * * This is the control structure for the watchdog timer which * fires to service the seconds chain. */ - SCORE_EXTERN Watchdog_Control _TOD_Seconds_watchdog; #ifdef SCORE_INIT @@ -120,7 +179,6 @@ SCORE_EXTERN Watchdog_Control _TOD_Seconds_watchdog; * The second dimension should range from 1 to 12 for January to * February, respectively. */ - const uint32_t _TOD_Days_per_month[ 2 ][ 13 ] = { { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } @@ -131,7 +189,6 @@ const uint32_t _TOD_Days_per_month[ 2 ][ 13 ] = { * up to the month indicated by the index of the second dimension. * The first dimension should be 1 for leap years, and 0 otherwise. */ - const uint16_t _TOD_Days_to_date[2][13] = { { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }, { 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 } @@ -143,122 +200,95 @@ const uint16_t _TOD_Days_to_date[2][13] = { * years, and the number of years since the beginning of a leap * year otherwise. */ - const uint16_t _TOD_Days_since_last_leap_year[4] = { 0, 366, 731, 1096 }; #else +/** @brief + * + */ extern const uint16_t _TOD_Days_to_date[2][13]; /* Julian days */ + +/** @brief + * + */ extern const uint16_t _TOD_Days_since_last_leap_year[4]; + +/** @brief + * + */ extern const uint32_t _TOD_Days_per_month[2][13]; #endif -/* - * _TOD_Handler_initialization - * - * DESCRIPTION: +/** @brief _TOD_Handler_initialization * * This routine performs the initialization necessary for this handler. */ - void _TOD_Handler_initialization( uint32_t microseconds_per_tick ); -/* - * _TOD_Set - * - * DESCRIPTION: +/** @brief _TOD_Set * * This routine sets the current time of day to THE_TOD and * the equivalent SECONDS_SINCE_EPOCH. */ - void _TOD_Set( TOD_Control *the_tod, Watchdog_Interval seconds_since_epoch ); -/* - * _TOD_Validate - * - * DESCRIPTION: +/** @brief _TOD_Validate * * This function returns TRUE if THE_TOD contains * a valid time of day, and FALSE otherwise. */ - boolean _TOD_Validate( TOD_Control *the_tod ); -/* - * _TOD_To_seconds - * - * DESCRIPTION: +/** @brief _TOD_To_seconds * * This function returns the number seconds between the epoch and THE_TOD. */ - Watchdog_Interval _TOD_To_seconds( TOD_Control *the_tod ); -/* - * _TOD_Tickle - * - * DESCRIPTION: +/** @brief _TOD_Tickle * * This routine is scheduled as a watchdog function and is invoked at * each second boundary. It updates the current time of day to indicate * that a second has passed and processes the seconds watchdog chain. */ - void _TOD_Tickle( Objects_Id id, void *ignored ); -/* - * TOD_MILLISECONDS_TO_MICROSECONDS - * - * DESCRIPTION: +/** @brief TOD_MILLISECONDS_TO_MICROSECONDS * * This routine converts an interval expressed in milliseconds to microseconds. * - * NOTE: - * - * This must be a macro so it can be used in "static" tables. + * @note This must be a macro so it can be used in "static" tables. */ - #define TOD_MILLISECONDS_TO_MICROSECONDS(_ms) ((_ms) * 1000) -/* - * TOD_MICROSECONDS_TO_TICKS - * - * DESCRIPTION: +/** @brief TOD_MICROSECONDS_TO_TICKS * * This routine converts an interval expressed in microseconds to ticks. * - * NOTE: - * - * This must be a macro so it can be used in "static" tables. + * @note This must be a macro so it can be used in "static" tables. */ - #define TOD_MICROSECONDS_TO_TICKS(_us) \ ((_us) / _TOD_Microseconds_per_tick) -/* - * TOD_MILLISECONDS_TO_TICKS - * - * DESCRIPTION: +/** @brief TOD_MILLISECONDS_TO_TICKS * * This routine converts an interval expressed in milliseconds to ticks. * - * NOTE: - * - * This must be a macro so it can be used in "static" tables. + * @note This must be a macro so it can be used in "static" tables. */ #define TOD_MILLISECONDS_TO_TICKS(_ms) \ @@ -272,5 +302,7 @@ void _TOD_Tickle( } #endif +/**@}*/ + #endif /* end of include file */ |