Time of Day Handler.
More...
Time of Day Handler.
The following constants are related to the time of day and are independent of RTEMS.
This handler encapsulates functionality used to manage time of day.
◆ TOD_DAYS_PER_YEAR
#define TOD_DAYS_PER_YEAR (uint32_t)365 |
This constant represents the number of days in a non-leap year.
◆ TOD_HOURS_PER_DAY
#define TOD_HOURS_PER_DAY (uint32_t)24 |
This constant represents the number of hours per day.
◆ TOD_MICROSECONDS_PER_SECOND
#define TOD_MICROSECONDS_PER_SECOND (uint32_t)1000000 |
This constant represents the number of microseconds in a second.
◆ TOD_MILLISECONDS_PER_SECOND
#define TOD_MILLISECONDS_PER_SECOND (uint32_t)1000 |
This constant represents the number of millisecond in a second.
◆ TOD_MINUTES_PER_HOUR
#define TOD_MINUTES_PER_HOUR (uint32_t)60 |
This constant represents the number of minutes per hour.
◆ TOD_MONTHS_PER_YEAR
#define TOD_MONTHS_PER_YEAR (uint32_t)12 |
This constant represents the number of months in a year.
◆ TOD_NANOSECONDS_PER_MICROSECOND
#define TOD_NANOSECONDS_PER_MICROSECOND (uint32_t)1000 |
This constant represents the number of nanoseconds in a mircosecond.
◆ TOD_NANOSECONDS_PER_SECOND
#define TOD_NANOSECONDS_PER_SECOND (uint32_t)1000000000 |
This constant represents the number of nanoseconds in a second.
◆ TOD_SECONDS_PER_DAY
#define TOD_SECONDS_PER_DAY |
Value:#define TOD_HOURS_PER_DAY
Definition: todimpl.h:69
#define TOD_SECONDS_PER_MINUTE
Definition: todimpl.h:49
#define TOD_MINUTES_PER_HOUR
Definition: todimpl.h:54
This constant represents the number of seconds in a day which does not include a leap second.
◆ TOD_SECONDS_PER_MINUTE
#define TOD_SECONDS_PER_MINUTE (uint32_t)60 |
This constant represents the number of seconds in a minute.
◆ TOD_SECONDS_PER_NON_LEAP_YEAR
This constant represents the number of seconds in a non-leap year.
◆ TOD_TICKS_PER_SECOND
Gets number of ticks in a second.
This method exists to hide the fact that TOD_TICKS_PER_SECOND can not be implemented as a macro in a .h file due to visibility issues. The Configuration Table is not available to SuperCore .h files but is available to their .c files.
◆ _TOD_Adjust()
void _TOD_Adjust |
( |
const struct timespec * |
delta | ) |
|
Adjusts the Time of Time.
This method is used to adjust the current time of day by the specified amount.
- Parameters
-
delta | is the amount to adjust. |
◆ _TOD_Get_timeval()
This routine returns a timeval based upon the internal timespec format TOD.
- Parameters
-
[out] | time | The timeval to be filled in by the method. |
◆ _TOD_Is_set()
Check if the TOD is Set.
- Return values
-
true | The time is set. |
false | The time is not set. |
◆ _TOD_Set()
Status_Control _TOD_Set |
( |
const struct timespec * |
tod, |
|
|
ISR_lock_Context * |
lock_context |
|
) |
| |
Sets the time of day.
The caller must be the owner of the TOD lock.
- Parameters
-
tod | The new time of day in timespec format representing the time since UNIX Epoch. |
lock_context | The ISR lock context used for the corresponding _TOD_Acquire(). The caller must be the owner of the TOD lock. This function will release the TOD lock. |
- Return values
-
STATUS_SUCCESSFUL | Successful operation. |
other | Some error occurred. |
◆ TOD_TICKS_PER_SECOND_method()
uint32_t TOD_TICKS_PER_SECOND_method |
( |
void |
| ) |
|
Gets number of ticks in a second.
This method 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.
- Returns
- The number of ticks in a second.