Difference between revisions of "Unit PL031"

From Ultibo.org
Jump to: navigation, search
Line 31: Line 31:
 
----
 
----
  
''To be documented''
 
  
 +
'''PL031 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 PL031RTCCreate(Address:LongWord; const Name:String; IRQ:LongWord):PRTCDevice;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create, register and start a new PL031 RTC device which can be accessed using the RTC API</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Address'''
 +
| The address of the PL031 registers
 +
|-
 +
! '''Name'''
 +
| The text description of this device which will show in the device list (Optional)
 +
|-
 +
! '''IRQ'''
 +
| The interrupt number for the PL031
 +
|-
 +
! '''Return'''
 +
| Pointer to the new RTC device or nil if the RTC device could not be created
 +
|-
 +
|}
 +
</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 PL031RTCDestroy(RTC:PRTCDevice):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Stop, deregister and destroy a PL031 RTC device created by this driver</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''RTC'''
 +
| The RTC device to destroy
 +
|-
 +
! '''Return'''
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 +
'''PL031 RTC 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 PL031RTCStart(RTC:PRTCDevice):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of RTCDeviceStart API for PL031 RTC</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| Not intended to be called directly by applications, use RTCDeviceStart instead
 +
|-
 +
|}
 +
</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 PL031RTCStop(RTC:PRTCDevice):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of RTCDeviceStop API for PL031 RTC</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| Not intended to be called directly by applications, use RTCDeviceStop instead
 +
|-
 +
|}
 +
</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 PL031RTCGetTime(RTC:PRTCDevice):Int64;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of RTCDeviceGetTime API for PL031 RTC</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| Not intended to be called directly by applications, use RTCDeviceGetTime instead
 +
|-
 +
|}
 +
</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 PL031RTCSetTime(RTC:PRTCDevice; const Time:Int64):Int64;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of RTCDeviceSetTime API for PL031 RTC</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| Not intended to be called directly by applications, use RTCDeviceSetTime instead
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 +
'''PL031 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 PL031FileTimeToRTCTime(RTC:PRTCDevice; const FileTime:Int64; var RTCTime:LongWord):Boolean;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a FileTime value in 100 nanosecond ticks since 1 January 1601 to the time format of the PL031 RTC which is seconds since 1 January 1970</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| None 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 PL031RTCTimeToFileTime(RTC:PRTCDevice; RTCTime:LongWord; var FileTime:Int64):Boolean;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a PL031 RTC time value in seconds since 1 January 1970 to the FileTime format which is 100 nanosecond ticks since 1 January 1601</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
Return to [[Unit_Reference|Unit Reference]]
 
Return to [[Unit_Reference|Unit Reference]]

Revision as of 05:11, 23 April 2017

Return to Unit Reference


Description


ARM PrimeCell PL031 Real Time Clock Driver unit

The PL031 is a simple memory mapped Real Time Clock (RTC) device that supports a single 32-bit time counter based on the Unix time format which starts at 1 Jan 1970 and runs out at 19 Jan 2038.

The device also includes a single alarm value which can trigger an interrupt when the selected time is reached.

This driver currently does not support reading or setting the alarm value.

Constants


To be documented

Type definitions


To be documented

Public variables


None defined

Function declarations



PL031 functions

function PL031RTCCreate(Address:LongWord; const Name:String; IRQ:LongWord):PRTCDevice;
Description: Create, register and start a new PL031 RTC device which can be accessed using the RTC API
Address The address of the PL031 registers
Name The text description of this device which will show in the device list (Optional)
IRQ The interrupt number for the PL031
Return Pointer to the new RTC device or nil if the RTC device could not be created


function PL031RTCDestroy(RTC:PRTCDevice):LongWord;
Description: Stop, deregister and destroy a PL031 RTC device created by this driver
RTC The RTC device to destroy
Return ERROR_SUCCESS if completed or another error code on failure


PL031 RTC functions

function PL031RTCStart(RTC:PRTCDevice):LongWord;
Description: Implementation of RTCDeviceStart API for PL031 RTC
Note Not intended to be called directly by applications, use RTCDeviceStart instead


function PL031RTCStop(RTC:PRTCDevice):LongWord;
Description: Implementation of RTCDeviceStop API for PL031 RTC
Note Not intended to be called directly by applications, use RTCDeviceStop instead


function PL031RTCGetTime(RTC:PRTCDevice):Int64;
Description: Implementation of RTCDeviceGetTime API for PL031 RTC
Note Not intended to be called directly by applications, use RTCDeviceGetTime instead


function PL031RTCSetTime(RTC:PRTCDevice; const Time:Int64):Int64;
Description: Implementation of RTCDeviceSetTime API for PL031 RTC
Note Not intended to be called directly by applications, use RTCDeviceSetTime instead


PL031 helper functions

function PL031FileTimeToRTCTime(RTC:PRTCDevice; const FileTime:Int64; var RTCTime:LongWord):Boolean;
Description: Convert a FileTime value in 100 nanosecond ticks since 1 January 1601 to the time format of the PL031 RTC which is seconds since 1 January 1970
Note None documented


function PL031RTCTimeToFileTime(RTC:PRTCDevice; RTCTime:LongWord; var FileTime:Int64):Boolean;
Description: Convert a PL031 RTC time value in seconds since 1 January 1970 to the FileTime format which is 100 nanosecond ticks since 1 January 1601
Note None documented


Return to Unit Reference