Real-Time Clock¶
API for Real-Time Clocks.
Enums
Functions
-
uint64_t
metal_rtc_get_rate
(const struct metal_rtc *const rtc)¶ Get the rate of the RTC.
- Return
The rate in Hz
-
uint64_t
metal_rtc_set_rate
(const struct metal_rtc *const rtc, const uint64_t rate)¶ Set (if possible) the rate of the RTC.
- Return
The new rate of the RTC (not guaranteed to be the same as requested)
-
uint64_t
metal_rtc_get_compare
(const struct metal_rtc *const rtc)¶ Get the compare value of the RTC.
- Return
The compare value
-
uint64_t
metal_rtc_set_compare
(const struct metal_rtc *const rtc, const uint64_t compare)¶ Set the compare value of the RTC.
The RTC device might impose limits on the maximum compare value or the granularity of the compare value.
- Return
The set compare value (not guaranteed to be exactly the requested value)
-
uint64_t
metal_rtc_get_count
(const struct metal_rtc *const rtc)¶ Get the current count of the RTC.
- Return
The count
-
uint64_t
metal_rtc_set_count
(const struct metal_rtc *const rtc, const uint64_t count)¶ Set the current count of the RTC.
The RTC device might impose limits on the maximum value of the count
- Return
The set value of the count (not guaranteed to be exactly the requested value)
-
int
metal_rtc_run
(const struct metal_rtc *const rtc, const enum metal_rtc_run_option option)¶ Start or stop the RTC.
- Return
0 if the RTC was successfully started/stopped
-
struct metal_interrupt *
metal_rtc_get_interrupt
(const struct metal_rtc *const rtc)¶ Get the interrupt handle for the RTC compare.
- Return
The interrupt handle
-
struct
metal_rtc
¶ - #include <rtc.h>
Handle for a Real-Time Clock.