Difference between revisions of "Unit RTC"
From Ultibo.org
| Line 269: | Line 269: | ||
! '''Note''' | ! '''Note''' | ||
| Time and returned time is 100 nanosecond ticks since 1 January 1601 | | Time and returned time is 100 nanosecond ticks since 1 January 1601 | ||
| + | |- | ||
| + | |} | ||
| + | </div></div> | ||
| + | <br /> | ||
| + | |||
| + | '''RTC helper functions''' | ||
| + | |||
| + | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
| + | <pre style="border: 0; padding-bottom:0px;">function RTCGetCount:LongWord; inline;</pre> | ||
| + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current RTC count</div> | ||
| + | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
| + | {| class="wikitable" style="font-size: 14px; background: white;" | ||
| + | |- | ||
| + | ! '''Note''' | ||
| + | | To be documented | ||
| + | |- | ||
| + | |} | ||
| + | </div></div> | ||
| + | <br /> | ||
| + | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
| + | <pre style="border: 0; padding-bottom:0px;">function RTCDeviceGetDefault:PRTCDevice; inline;</pre> | ||
| + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current default RTC device</div> | ||
| + | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
| + | {| class="wikitable" style="font-size: 14px; background: white;" | ||
| + | |- | ||
| + | ! '''Note''' | ||
| + | | To be documented | ||
| + | |- | ||
| + | |} | ||
| + | </div></div> | ||
| + | <br /> | ||
| + | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
| + | <pre style="border: 0; padding-bottom:0px;">function RTCDeviceSetDefault(RTC:PRTCDevice):LongWord;</pre> | ||
| + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the current default RTC device</div> | ||
| + | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
| + | {| class="wikitable" style="font-size: 14px; background: white;" | ||
| + | |- | ||
| + | ! '''Note''' | ||
| + | | To be documented | ||
| + | |- | ||
| + | |} | ||
| + | </div></div> | ||
| + | <br /> | ||
| + | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
| + | <pre style="border: 0; padding-bottom:0px;">function RTCDeviceCheck(RTC:PRTCDevice):PRTCDevice;</pre> | ||
| + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check if the supplied RTC is in the RTC table</div> | ||
| + | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
| + | {| class="wikitable" style="font-size: 14px; background: white;" | ||
| + | |- | ||
| + | ! '''Note''' | ||
| + | | To be documented | ||
| + | |- | ||
| + | |} | ||
| + | </div></div> | ||
| + | <br /> | ||
| + | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
| + | <pre style="border: 0; padding-bottom:0px;">function RTCTimeIsValid(const Time:TSystemTime):Boolean;</pre> | ||
| + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
| + | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
| + | {| class="wikitable" style="font-size: 14px; background: white;" | ||
| + | |- | ||
| + | ! '''Note''' | ||
| + | | To be documented | ||
| + | |- | ||
| + | |} | ||
| + | </div></div> | ||
| + | <br /> | ||
| + | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
| + | <pre style="border: 0; padding-bottom:0px;">function RTCSystemTimeToFileTime(const SystemTime:TSystemTime; var FileTime:Int64):Boolean;</pre> | ||
| + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' System time is assumed to be UTC and returned file time is UTC</div> | ||
| + | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
| + | {| class="wikitable" style="font-size: 14px; background: white;" | ||
| + | |- | ||
| + | ! '''Note''' | ||
| + | | To be documented | ||
| + | |- | ||
| + | |} | ||
| + | </div></div> | ||
| + | <br /> | ||
| + | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
| + | <pre style="border: 0; padding-bottom:0px;">function RTCFileTimeToSystemTime(const FileTime:Int64; var SystemTime:TSystemTime):Boolean;</pre> | ||
| + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' File time is assumed to be UTC and returned system time is UTC</div> | ||
| + | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
| + | {| class="wikitable" style="font-size: 14px; background: white;" | ||
| + | |- | ||
| + | ! '''Note''' | ||
| + | | To be documented | ||
| + | |- | ||
| + | |} | ||
| + | </div></div> | ||
| + | <br /> | ||
| + | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
| + | <pre style="border: 0; padding-bottom:0px;">procedure RTCLog(Level:LongWord; RTC:PRTCDevice; const AText:String);</pre> | ||
| + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
| + | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
| + | {| class="wikitable" style="font-size: 14px; background: white;" | ||
| + | |- | ||
| + | ! '''Note''' | ||
| + | | To be documented | ||
| + | |- | ||
| + | |} | ||
| + | </div></div> | ||
| + | <br /> | ||
| + | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
| + | <pre style="border: 0; padding-bottom:0px;">procedure RTCLogInfo(RTC:PRTCDevice; const AText:String); inline;</pre> | ||
| + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
| + | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
| + | {| class="wikitable" style="font-size: 14px; background: white;" | ||
| + | |- | ||
| + | ! '''Note''' | ||
| + | | To be documented | ||
| + | |- | ||
| + | |} | ||
| + | </div></div> | ||
| + | <br /> | ||
| + | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
| + | <pre style="border: 0; padding-bottom:0px;">procedure RTCLogError(RTC:PRTCDevice; const AText:String); inline;</pre> | ||
| + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
| + | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
| + | {| class="wikitable" style="font-size: 14px; background: white;" | ||
| + | |- | ||
| + | ! '''Note''' | ||
| + | | To be documented | ||
| + | |- | ||
| + | |} | ||
| + | </div></div> | ||
| + | <br /> | ||
| + | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
| + | <pre style="border: 0; padding-bottom:0px;">procedure RTCLogDebug(RTC:PRTCDevice; const AText:String); inline;</pre> | ||
| + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
| + | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
| + | {| class="wikitable" style="font-size: 14px; background: white;" | ||
| + | |- | ||
| + | ! '''Note''' | ||
| + | | To be documented | ||
|- | |- | ||
|} | |} | ||
Revision as of 04:15, 2 September 2016
Return to Unit Reference
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
To be documented
Type definitions
To be documented
Public variables
To be documented
Function declarations
Initialization functions
procedure RTCInit;
Description: To be documented
| Note | To be documented |
|---|
RTC functions
function RTCDeviceStart(RTC:PRTCDevice):LongWord;
Description: To be documented
| Note | To be documented |
|---|
function RTCDeviceStop(RTC:PRTCDevice):LongWord;
Description: To be documented
| Note | To be documented |
|---|
function RTCDeviceGetTime(RTC:PRTCDevice):Int64;
Description: To be documented
| Note | To be documented |
|---|
function RTCDeviceSetTime(RTC:PRTCDevice; const Time:Int64):Int64;
Description: To be documented
| Note | To be documented |
|---|
function RTCDeviceProperties(RTC:PRTCDevice; Properties:PRTCProperties):LongWord;
Description: To be documented
| Note | To be documented |
|---|
function RTCDeviceCreate:PRTCDevice;
Description: Create a new RTC entry
| Return | Pointer to new RTC entry or nil if RTC could not be created |
|---|
function RTCDeviceCreateEx(Size:LongWord):PRTCDevice;
Description: Create a new RTC entry
| Size | Size in bytes to allocate for new RTC (Including the RTC entry) |
|---|---|
| Return | Pointer to new RTC entry or nil if RTC could not be created |
function RTCDeviceDestroy(RTC:PRTCDevice):LongWord;
Description: Destroy an existing RTC entry
| Note | To be documented |
|---|
function RTCDeviceRegister(RTC:PRTCDevice):LongWord;
Description: Register a new RTC in the RTC table
| Note | To be documented |
|---|
function RTCDeviceDeregister(RTC:PRTCDevice):LongWord;
Description: Deregister a RTC from the RTC table
| Note | To be documented |
|---|
function RTCDeviceFind(RTCId:LongWord):PRTCDevice;
Description: To be documented
| Note | To be documented |
|---|
function RTCDeviceFindByName(const Name:String):PRTCDevice; inline;
Description: To be documented
| Note | To be documented |
|---|
function RTCDeviceFindByDescription(const Description:String):PRTCDevice; inline;
Description: To be documented
| Note | To be documented |
|---|
function RTCDeviceEnumerate(Callback:TRTCEnumerate; Data:Pointer):LongWord;
Description: To be documented
| Note | To be documented |
|---|
function RTCDeviceNotification(RTC:PRTCDevice; Callback:TRTCNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: To be documented
| Note | To be documented |
|---|
RTL RTC functions
function SysRTCAvailable:Boolean;
Description: Check if an RTC device is available
| Note | To be documented |
|---|
function SysRTCGetTime:Int64;
Description: Get the current time from a RTC device
| Note | Returned time is 100 nanosecond ticks since 1 January 1601 |
|---|
function SysRTCSetTime(const Time:Int64):Int64;
Description: Set the current time for a RTC device
| Time | The time to be set |
|---|---|
| Return | The device time after setting (or 0 on failure) |
| Note | Time and returned time is 100 nanosecond ticks since 1 January 1601 |
RTC helper functions
function RTCGetCount:LongWord; inline;
Description: Get the current RTC count
| Note | To be documented |
|---|
function RTCDeviceGetDefault:PRTCDevice; inline;
Description: Get the current default RTC device
| Note | To be documented |
|---|
function RTCDeviceSetDefault(RTC:PRTCDevice):LongWord;
Description: Set the current default RTC device
| Note | To be documented |
|---|
function RTCDeviceCheck(RTC:PRTCDevice):PRTCDevice;
Description: Check if the supplied RTC is in the RTC table
| Note | To be documented |
|---|
function RTCTimeIsValid(const Time:TSystemTime):Boolean;
Description: To be documented
| Note | To be documented |
|---|
function RTCSystemTimeToFileTime(const SystemTime:TSystemTime; var FileTime:Int64):Boolean;
Description: System time is assumed to be UTC and returned file time is UTC
| Note | To be documented |
|---|
function RTCFileTimeToSystemTime(const FileTime:Int64; var SystemTime:TSystemTime):Boolean;
Description: File time is assumed to be UTC and returned system time is UTC
| Note | To be documented |
|---|
procedure RTCLog(Level:LongWord; RTC:PRTCDevice; const AText:String);
Description: To be documented
| Note | To be documented |
|---|
procedure RTCLogInfo(RTC:PRTCDevice; const AText:String); inline;
Description: To be documented
| Note | To be documented |
|---|
procedure RTCLogError(RTC:PRTCDevice; const AText:String); inline;
Description: To be documented
| Note | To be documented |
|---|
procedure RTCLogDebug(RTC:PRTCDevice; const AText:String); inline;
Description: To be documented
| Note | To be documented |
|---|
Return to Unit Reference