Difference between revisions of "Unit RTC"
From Ultibo.org
Line 12: | Line 12: | ||
---- | ---- | ||
− | '' | + | |
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''RTC specific constants''' <code> RTC_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>RTC_NAME_PREFIX = 'RTC';</code> | ||
+ | | Name prefix for RTC Devices | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''RTC device type constants''' <code> RTC_TYPE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>RTC_TYPE_NONE = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''RTC device state constants''' <code> RTC_STATE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>RTC_STATE_DISABLED = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>RTC_STATE_ENABLED = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''RTC device flag constants''' <code> RTC_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>RTC_FLAG_NONE = $00000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>RTC_FLAG_ALARM = $00000001;</code> | ||
+ | | Device supports one or more alarms | ||
+ | |- | ||
+ | | <code>RTC_FLAG_WATCHDOG = $00000002;</code> | ||
+ | | Device has a watchdog timer function | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''RTC logging constants''' <code> RTC_LOG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>RTC_LOG_LEVEL_DEBUG = LOG_LEVEL_DEBUG;</code> | ||
+ | | RTC debugging messages | ||
+ | |- | ||
+ | | <code>RTC_LOG_LEVEL_INFO = LOG_LEVEL_INFO;</code> | ||
+ | | RTC informational messages, such as a device being attached or detached | ||
+ | |- | ||
+ | | <code>RTC_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;</code> | ||
+ | | RTC error messages | ||
+ | |- | ||
+ | | <code>RTC_LOG_LEVEL_NONE = LOG_LEVEL_NONE;</code> | ||
+ | | No RTC messages | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Type definitions === | === Type definitions === |
Revision as of 04:54, 28 November 2016
Return to Unit Reference
Contents
[hide]Description
The RTC unit provides the device interface for real time clock modules to be registered with Ultibo core. Each RTC module requires a driver that communicates with the specific hardware to implement the device interface although many devices may use the same chip and will be covered by a single driver.
This unit registers the RTCGetTime
and RTCSetTime
functions with the Platform unit to enable hardware independent access to a real time clock module.
Constants
[Expand]
RTC specific constants
RTC_*
[Expand]
RTC device type constants
RTC_TYPE_*
[Expand]
RTC device state constants
RTC_STATE_*
[Expand]
RTC device flag constants
RTC_FLAG_*
[Expand]
RTC logging constants
RTC_LOG_*
Type definitions
To be documented
Public variables
To be documented
Function declarations
Initialization functions
RTC functions
[Expand]
function RTCDeviceSetTime(RTC:PRTCDevice; const Time:Int64):Int64;
Description: To be documented
[Expand]
function RTCDeviceProperties(RTC:PRTCDevice; Properties:PRTCProperties):LongWord;
Description: To be documented
[Expand]
function RTCDeviceDestroy(RTC:PRTCDevice):LongWord;
Description: Destroy an existing RTC entry
[Expand]
function RTCDeviceRegister(RTC:PRTCDevice):LongWord;
Description: Register a new RTC in the RTC table
[Expand]
function RTCDeviceDeregister(RTC:PRTCDevice):LongWord;
Description: Deregister a RTC from the RTC table
[Expand]
function RTCDeviceFindByName(const Name:String):PRTCDevice; inline;
Description: To be documented
[Expand]
function RTCDeviceFindByDescription(const Description:String):PRTCDevice; inline;
Description: To be documented
[Expand]
function RTCDeviceEnumerate(Callback:TRTCEnumerate; Data:Pointer):LongWord;
Description: To be documented
[Expand]
function RTCDeviceNotification(RTC:PRTCDevice; Callback:TRTCNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: To be documented
RTL RTC functions
[Expand]
function SysRTCSetTime(const Time:Int64):Int64;
Description: Set the current time for a RTC device
RTC helper functions
[Expand]
function RTCDeviceGetDefault:PRTCDevice; inline;
Description: Get the current default RTC device
[Expand]
function RTCDeviceSetDefault(RTC:PRTCDevice):LongWord;
Description: Set the current default RTC device
[Expand]
function RTCDeviceCheck(RTC:PRTCDevice):PRTCDevice;
Description: Check if the supplied RTC is in the RTC table
[Expand]
function RTCSystemTimeToFileTime(const SystemTime:TSystemTime; var FileTime:Int64):Boolean;
Description: System time is assumed to be UTC and returned file time is UTC
[Expand]
function RTCFileTimeToSystemTime(const FileTime:Int64; var SystemTime:TSystemTime):Boolean;
Description: File time is assumed to be UTC and returned system time is UTC
[Expand]
procedure RTCLog(Level:LongWord; RTC:PRTCDevice; const AText:String);
Description: To be documented
[Expand]
procedure RTCLogInfo(RTC:PRTCDevice; const AText:String); inline;
Description: To be documented
[Expand]
procedure RTCLogError(RTC:PRTCDevice; const AText:String); inline;
Description: To be documented
[Expand]
procedure RTCLogDebug(RTC:PRTCDevice; const AText:String); inline;
Description: To be documented
Return to Unit Reference