Time Of Day (TOD) Handler


Defines

#define _TOD_Seconds_since_epoch   (_TOD_Now.tv_sec)
 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.
#define TOD_MILLISECONDS_TO_MICROSECONDS(_ms)   ((uint32_t)(_ms) * 1000L)
 TOD_MILLISECONDS_TO_MICROSECONDS.
#define TOD_MICROSECONDS_TO_TICKS(_us)   ((_us) / _TOD_Microseconds_per_tick)
 TOD_MICROSECONDS_TO_TICKS.
#define TOD_MILLISECONDS_TO_TICKS(_ms)   (TOD_MILLISECONDS_TO_MICROSECONDS(_ms) / _TOD_Microseconds_per_tick)
 TOD_MILLISECONDS_TO_TICKS.
#define TOD_TICKS_PER_SECOND   (TOD_MICROSECONDS_PER_SECOND / _TOD_Microseconds_per_tick)
 Ticks per Second.
#define TOD_TICKS_PER_SECOND   (TOD_MICROSECONDS_PER_SECOND / _TOD_Microseconds_per_tick)
 Ticks per Second.

Functions

void _TOD_Handler_initialization (uint32_t microseconds_per_tick)
 _TOD_Handler_initialization
void _TOD_Set (const struct timespec *time)
 _TOD_Set
void _TOD_Get (struct timespec *time)
 _TOD_Get
void _TOD_Get_uptime (struct timespec *time)
 _TOD_Get_uptime
void _TOD_Tickle_ticks (void)
RTEMS_INLINE_ROUTINE void _TOD_Deactivate (void)
RTEMS_INLINE_ROUTINE void _TOD_Activate ()
RTEMS_INLINE_ROUTINE void _TOD_Get_timeval (struct timeval *time)

Variables

SCORE_EXTERN boolean _TOD_Is_set
 Is the Time Of Day Set.
SCORE_EXTERN struct timespec _TOD_Now
 Current Time of Day (Timespec) The following contains the current time of day.
SCORE_EXTERN struct timespec _TOD_Uptime
 Current Time of Day (Timespec) The following contains the running uptime.
SCORE_EXTERN uint32_t _TOD_Microseconds_per_tick
 Microseconds per Clock Tick.

Detailed Description

This handler encapsulates functionality used to manage time of day.

Define Documentation

#define TOD_MICROSECONDS_TO_TICKS ( _us   )     ((_us) / _TOD_Microseconds_per_tick)

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.

#define TOD_MILLISECONDS_TO_MICROSECONDS ( _ms   )     ((uint32_t)(_ms) * 1000L)

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.

#define TOD_MILLISECONDS_TO_TICKS ( _ms   )     (TOD_MILLISECONDS_TO_MICROSECONDS(_ms) / _TOD_Microseconds_per_tick)

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.

#define TOD_TICKS_PER_SECOND   (TOD_MICROSECONDS_PER_SECOND / _TOD_Microseconds_per_tick)

Ticks per Second.

How many ticks in a second?

This macro calculates the number of ticks per second.

This macro returns the number of ticks in a second.

Note:
If the clock tick value does not multiply evenly into a second then this number of ticks will be slightly shorter than a second.

#define TOD_TICKS_PER_SECOND   (TOD_MICROSECONDS_PER_SECOND / _TOD_Microseconds_per_tick)

Ticks per Second.

How many ticks in a second?

This macro calculates the number of ticks per second.

This macro returns the number of ticks in a second.

Note:
If the clock tick value does not multiply evenly into a second then this number of ticks will be slightly shorter than a second.


Function Documentation

RTEMS_INLINE_ROUTINE void _TOD_Activate (  ) 

This routine activates updating of the current time of day.

RTEMS_INLINE_ROUTINE void _TOD_Deactivate ( void   ) 

This routine deactivates updating of the current time of day.

void _TOD_Get ( struct timespec *  time  ) 

_TOD_Get

This routine returns the current time of day with potential accuracy to the nanosecond.

Parameters:
[in] time is a pointer to the time to be returned

Referenced by _TOD_Get_timeval().

RTEMS_INLINE_ROUTINE void _TOD_Get_timeval ( struct timeval *  time  ) 

This routine returns a timeval based upon the internal timespec format TOD.

References _ISR_Disable, _ISR_Enable, _TOD_Get(), and TOD_NANOSECONDS_PER_MICROSECOND.

void _TOD_Get_uptime ( struct timespec *  time  ) 

_TOD_Get_uptime

This routine returns the system uptime with potential accuracy to the nanosecond.

Parameters:
[in] time is a pointer to the uptime to be returned

void _TOD_Handler_initialization ( uint32_t  microseconds_per_tick  ) 

_TOD_Handler_initialization

This routine performs the initialization necessary for this handler.

void _TOD_Set ( const struct timespec *  time  ) 

_TOD_Set

This routine sets the current time of day to time and the equivalent SECONDS_SINCE_EPOCH.

void _TOD_Tickle_ticks ( void   ) 

This routine increments the ticks field of the current time of day at each clock tick.


Variable Documentation

SCORE_EXTERN boolean _TOD_Is_set

Is the Time Of Day Set.

This is TRUE if the application has set the current time of day, and FALSE otherwise.

SCORE_EXTERN uint32_t _TOD_Microseconds_per_tick

Microseconds per Clock Tick.

The following contains the number of microseconds per tick.


Generated on Sat Jul 5 12:16:34 2008 for RTEMSSuperCore by  doxygen 1.5.6