Difference between revisions of "Unit PL031"

From Ultibo.org
Jump to: navigation, search
Line 185: Line 185:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Address'''
+
! Address
 
| The address of the PL031 registers
 
| The address of the PL031 registers
 
|-
 
|-
! '''Name'''
+
! Name
 
| The text description of this device which will show in the device list (Optional)
 
| The text description of this device which will show in the device list (Optional)
 
|-
 
|-
! '''IRQ'''
+
! IRQ
 
| The interrupt number for the PL031
 
| The interrupt number for the PL031
 
|-
 
|-
! '''Return'''
+
! Return
 
| Pointer to the new RTC device or nil if the RTC device could not be created
 
| Pointer to the new RTC device or nil if the RTC device could not be created
 
|-
 
|-
Line 206: Line 206:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''RTC'''
+
! RTC
 
| The RTC device to destroy
 
| The RTC device to destroy
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
Line 224: Line 224:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| Not intended to be called directly by applications, use RTCDeviceStart instead
+
| Not intended to be called directly by applications, use RTCDeviceStart instead.
 
|-
 
|-
 
|}
 
|}
Line 236: Line 236:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| Not intended to be called directly by applications, use RTCDeviceStop instead
+
| Not intended to be called directly by applications, use RTCDeviceStop instead.
 
|-
 
|-
 
|}
 
|}
Line 248: Line 248:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| Not intended to be called directly by applications, use RTCDeviceGetTime instead
+
| Not intended to be called directly by applications, use RTCDeviceGetTime instead.
 
|-
 
|-
 
|}
 
|}
Line 260: Line 260:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| Not intended to be called directly by applications, use RTCDeviceSetTime instead
+
| Not intended to be called directly by applications, use RTCDeviceSetTime instead.
 
|-
 
|-
 
|}
 
|}
Line 275: Line 275:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 287: Line 287:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-

Revision as of 04:43, 24 April 2018

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



[Expand]
PL031 specific constants PL031_*


[Expand]
PL031 RTC control register PL031_RTC_CR_*


[Expand]
PL031 RTC interrupt mask set and clear register PL031_RTC_IMSC_*


[Expand]
PL031 RTC raw interrupt status register PL031_RTC_RIS_*


[Expand]
PL031 RTC masked interrupt status register PL031_RTC_MIS_*


[Expand]
PL031 RTC interrupt clear register PL031_RTC_ICR_*


Type definitions



PL031 real time clock (RTC) registers

[Expand]

PPL031RTCRegisters = ^TPL031RTCRegisters;

TPL031RTCRegisters = record

PL031 real time clock (RTC)

[Expand]

PPL031RTC = ^TPL031RTC;

TPL031RTC = record


Public variables


None defined

Function declarations



PL031 functions

[Expand]
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


[Expand]
function PL031RTCDestroy(RTC:PRTCDevice):LongWord;
Description: Stop, deregister and destroy a PL031 RTC device created by this driver


PL031 RTC functions

[Expand]
function PL031RTCStart(RTC:PRTCDevice):LongWord;
Description: Implementation of RTCDeviceStart API for PL031 RTC


[Expand]
function PL031RTCStop(RTC:PRTCDevice):LongWord;
Description: Implementation of RTCDeviceStop API for PL031 RTC


[Expand]
function PL031RTCGetTime(RTC:PRTCDevice):Int64;
Description: Implementation of RTCDeviceGetTime API for PL031 RTC


[Expand]
function PL031RTCSetTime(RTC:PRTCDevice; const Time:Int64):Int64;
Description: Implementation of RTCDeviceSetTime API for PL031 RTC


PL031 helper functions

[Expand]
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


[Expand]
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


Return to Unit Reference