C API clocks definitions. More...
Classes | |
struct | os_clock_s |
Clock object storage. More... | |
Typedefs | |
typedef struct os_clock_s | os_clock_t |
Clock object storage. | |
Clock handlers | |
void | os_systick_handler (void) |
SysTick interrupt handler. | |
void | os_rtc_handler (void) |
RTC interrupt handler. | |
C API clocks definitions.
typedef struct os_clock_s os_clock_t |
Clock object storage.
This C structure has the same size as the C++ os::rtos::clock
object.
The members of this structure are hidden and should not be used directly, but only through specific functions.
os_clock_t * os_clock_get_hrclock | ( | void | ) |
Get hrclock
(the high resolution clock).
Definition at line 1218 of file os-c-wrapper.cpp.
const char * os_clock_get_name | ( | os_clock_t * | clock | ) |
Get the clock name.
[in] | clock | Pointer to clock object instance. |
Definition at line 1083 of file os-c-wrapper.cpp.
os_clock_offset_t os_clock_get_offset | ( | os_clock_t * | clock | ) |
Get adjustment offset.
[in] | clock | Pointer to clock object instance. |
Definition at line 1164 of file os-c-wrapper.cpp.
os_clock_t * os_clock_get_rtclock | ( | void | ) |
Get rtclock
(the real-time clock).
Definition at line 1206 of file os-c-wrapper.cpp.
os_clock_t * os_clock_get_sysclock | ( | void | ) |
Get sysclock
(the system clock).
Definition at line 1194 of file os-c-wrapper.cpp.
os_clock_timestamp_t os_clock_now | ( | os_clock_t * | clock | ) |
Tell the current time, possibly adjusted for epoch.
[in] | clock | Pointer to clock object instance. |
Definition at line 1096 of file os-c-wrapper.cpp.
os_clock_offset_t os_clock_set_offset | ( | os_clock_t * | clock, |
os_clock_offset_t | offset | ||
) |
Set adjustment offset.
[in] | clock | Pointer to clock object instance. |
[in] | offset | Integer representing the offset to epoch (positive). |
Definition at line 1178 of file os-c-wrapper.cpp.
os_result_t os_clock_sleep_for | ( | os_clock_t * | clock, |
os_clock_duration_t | duration | ||
) |
Sleep for a relative duration.
[in] | clock | Pointer to clock object instance. |
[in] | duration | The number of clock units (ticks or seconds) to sleep. |
ETIMEDOUT | The sleep lasted the entire duration. |
EPERM | Cannot be invoked from an Interrupt Service Routines. |
EINTR | The sleep was interrupted. |
Definition at line 1122 of file os-c-wrapper.cpp.
os_result_t os_clock_sleep_until | ( | os_clock_t * | clock, |
os_clock_timestamp_t | timestamp | ||
) |
Sleep until an absolute timestamp.
[in] | clock | Pointer to clock object instance. |
[in] | timestamp | The absolute moment in time, in clock units. |
ETIMEDOUT | The sleep lasted the entire duration. |
EPERM | Cannot be invoked from an Interrupt Service Routines. |
EINTR | The sleep was interrupted. |
Definition at line 1136 of file os-c-wrapper.cpp.
os_clock_timestamp_t os_clock_steady_now | ( | os_clock_t * | clock | ) |
Tell the current time since startup.
[in] | clock | Pointer to clock object instance. |
Definition at line 1109 of file os-c-wrapper.cpp.
os_result_t os_clock_wait_for | ( | os_clock_t * | clock, |
os_clock_duration_t | timeout | ||
) |
Timed wait for an event.
[in] | clock | Pointer to clock object instance. |
[in] | timeout | The timeout in clock units. |
os_ok | An event occurred before the timeout. |
ETIMEDOUT | The wait lasted the entire duration. |
EPERM | Cannot be invoked from an Interrupt Service Routines. |
EINTR | The sleep was interrupted. |
Definition at line 1150 of file os-c-wrapper.cpp.
void os_rtc_handler | ( | void | ) |
RTC interrupt handler.
Must be called from the physical RTC interrupt handler.
Definition at line 96 of file os-clocks.cpp.
os_clock_timestamp_t os_sysclock_now | ( | void | ) |
Tell the current time since startup.
Definition at line 1232 of file os-c-wrapper.cpp.
os_result_t os_sysclock_sleep_for | ( | os_clock_duration_t | duration | ) |
Sleep for a relative duration.
[in] | duration | The number of clock units (ticks or seconds) to sleep. |
ETIMEDOUT | The sleep lasted the entire duration. |
EPERM | Cannot be invoked from an Interrupt Service Routines. |
EINTR | The sleep was interrupted. |
Definition at line 1244 of file os-c-wrapper.cpp.
os_result_t os_sysclock_sleep_until | ( | os_clock_timestamp_t | timestamp | ) |
Sleep until an absolute timestamp.
[in] | timestamp | The absolute moment in time, in clock units. |
ETIMEDOUT | The sleep lasted the entire duration. |
EPERM | Cannot be invoked from an Interrupt Service Routines. |
EINTR | The sleep was interrupted. |
Definition at line 1256 of file os-c-wrapper.cpp.
|
inline |
Convert microseconds to ticks.
[in] | microsec | The number of microseconds. |
Definition at line 972 of file os-c-api.h.
|
inline |
Convert microseconds to ticks.
[in] | microsec | The number of microseconds. |
Definition at line 994 of file os-c-api.h.
os_result_t os_sysclock_wait_for | ( | os_clock_duration_t | timeout | ) |
Timed wait for an event.
[in] | timeout | The timeout in clock units. |
os_ok | An event occurred before the timeout. |
ETIMEDOUT | The wait lasted the entire duration. |
EPERM | Cannot be invoked from an Interrupt Service Routines. |
EINTR | The sleep was interrupted. |
Definition at line 1268 of file os-c-wrapper.cpp.
void os_systick_handler | ( | void | ) |
SysTick interrupt handler.
Must be called from the physical interrupt handler.
Definition at line 37 of file os-clocks.cpp.