RTEMS CPU Kit with SuperCore  4.11.3
Data Structures | Macros | Functions | Variables
todimpl.h File Reference

Time of Day Handler API. More...

#include <rtems/score/tod.h>
#include <rtems/score/timestamp.h>
#include <rtems/score/timecounterimpl.h>
#include <sys/time.h>
#include <time.h>
Include dependency graph for todimpl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  TOD_Control
 TOD control. More...
 

Macros

#define TOD_SECONDS_PER_MINUTE   (uint32_t)60
 This constant represents the number of seconds in a minute.
 
#define TOD_MINUTES_PER_HOUR   (uint32_t)60
 This constant represents the number of minutes per hour.
 
#define TOD_MONTHS_PER_YEAR   (uint32_t)12
 This constant represents the number of months in a year.
 
#define TOD_DAYS_PER_YEAR   (uint32_t)365
 This constant represents the number of days in a non-leap year.
 
#define TOD_HOURS_PER_DAY   (uint32_t)24
 This constant represents the number of hours per day.
 
#define TOD_SECONDS_PER_DAY
 This constant represents the number of seconds in a day which does not include a leap second. More...
 
#define TOD_SECONDS_PER_NON_LEAP_YEAR   (365 * TOD_SECONDS_PER_DAY)
 This constant represents the number of seconds in a non-leap year.
 
#define TOD_MILLISECONDS_PER_SECOND   (uint32_t)1000
 This constant represents the number of millisecond in a second.
 
#define TOD_MICROSECONDS_PER_SECOND   (uint32_t)1000000
 This constant represents the number of microseconds in a second.
 
#define TOD_NANOSECONDS_PER_SECOND   (uint32_t)1000000000
 This constant represents the number of nanoseconds in a second.
 
#define TOD_NANOSECONDS_PER_MICROSECOND   (uint32_t)1000
 This constant represents the number of nanoseconds in a mircosecond.
 
#define TOD_SECONDS_1970_THROUGH_1988
 Seconds from January 1, 1970 to January 1, 1988. More...
 
#define TOD_BASE_YEAR   1988
 Earliest year to which an time of day can be initialized. More...
 
#define TOD_TICKS_PER_SECOND   TOD_TICKS_PER_SECOND_method()
 Gets number of ticks in a second. More...
 

Functions

void _TOD_Handler_initialization (void)
 Initializes the time of day handler. More...
 
void _TOD_Set_with_timestamp (const Timestamp_Control *tod_as_timestamp)
 Sets the time of day from timestamp. More...
 
void _TOD_Tickle_ticks (void)
 Increments time of day at each clock tick. More...
 
uint32_t TOD_TICKS_PER_SECOND_method (void)
 Gets number of ticks in a second. More...
 
RTEMS_INLINE_ROUTINE void _TOD_Get_timeval (struct timeval *time)
 This routine returns a timeval based upon the internal timespec format TOD.
 
void _TOD_Adjust (const Timestamp_Control timestamp)
 Adjust the Time of Time. More...
 
RTEMS_INLINE_ROUTINE bool _TOD_Is_set (void)
 Check if the TOD is Set. More...
 

Variables

SCORE_EXTERN TOD_Control _TOD
 

Detailed Description

Time of Day Handler API.

Macro Definition Documentation

◆ TOD_BASE_YEAR

#define TOD_BASE_YEAR   1988

Earliest year to which an time of day can be initialized.

The following constant define the earliest year to which an time of day can be initialized. This is considered the epoch.

◆ TOD_SECONDS_1970_THROUGH_1988

#define TOD_SECONDS_1970_THROUGH_1988
Value:
(((1987 - 1970 + 1) * TOD_SECONDS_PER_NON_LEAP_YEAR) + \
#define TOD_SECONDS_PER_DAY
This constant represents the number of seconds in a day which does not include a leap second...
Definition: todimpl.h:71
#define TOD_SECONDS_PER_NON_LEAP_YEAR
This constant represents the number of seconds in a non-leap year.
Definition: todimpl.h:78

Seconds from January 1, 1970 to January 1, 1988.

Used to account for differences between POSIX API and RTEMS core. The timespec format time is kept in POSIX compliant form.