NAME | SYNOPSIS | FEATURES | DESCRIPTION | EXTENDED DESCRIPTION | ATTRIBUTES | SEE ALSO
#include <ddi/rtc/rtc.h>
DDI
The Real Time Clock (RTC) interface is used to get/set the current date stored in non-volatile memory, generally powered by a battery.
typedef struct { RtcVersion version; KnError (*set_date) (RtcId device_id, RtcDate* rtc_date); KnError (*get_date) (RtcId device_id, RtcDate* rtc_date); } RtcDevOps;
A pointer to the RtcDevOps structure is exported by a driver via the svDeviceRegister microkernel call. A driver client invokes the svDeviceLookup and svDeviceEntry microkernel calls in order to obtain a pointer to the device service routines vector. Once the pointer is obtained, the driver client is able to invoke the driver service routines (via the indirect function call) in order to read the current date (get_date function), or write it (set_date function).
set_date
The set_date function updates the current date stored in the RTC device specified by device_id.
Arguments:
Specifies the RTC device identifier (returned by svDeviceEntry).
Specifies the memory location containing the new date to be written.
The set_date function returns the following results:
The operation succeeded.
The operation has failed, the RTC device is busy.
The rtc_date is invalid.
get_date
The get_date function reads the current date stored in the RTC device specified by device_id, and stores it at the memory location pointed to by rtc_date.
Arguments:
Specifies the RTC device identifier.
Specifies the memory location to be filled with the current date value.
The get_date function returns the following results:
The operation succeeded.
The RTC device has failed to read the current date or rtc_date is null.
Both the set_date and get_date functions must be called from base level.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
svDeviceRegister(9DKI), svDriverRegister(9DKI), svDeviceLookup(9DKI), svDeviceEntry(9DKI), svDeviceRelease(9DKI)
NAME | SYNOPSIS | FEATURES | DESCRIPTION | EXTENDED DESCRIPTION | ATTRIBUTES | SEE ALSO