Ultibo API
C/C++ API for Ultibo Core
Loading...
Searching...
No Matches
pl031.h File Reference
#include "ultibo/rtc.h"

Go to the source code of this file.

Data Structures

struct  _PL031_RTC_REGISTERS
struct  _PL031_RTC

Macros

#define PL031_RTC_DESCRIPTION   "ARM PrimeCell PL031 Real Time Clock"
 Description of PL031 device.
#define PL031_MIN_TIME   TIME_TICKS_TO_1970
 Time starts at 01/01/1970 00:00:00 (MM/DD/YY HH:MM:SS).
#define PL031_MAX_TIME   137919572470000000
 Time ends at 19/1/2038 03:14:07 (MM/DD/YY HH:MM:SS).
#define PL031_RTC_CR_EN   (1 << 0)
 If set to 1, the RTC is enabled. Once it is enabled, any writes to this bit have no effect on the RTC until a system reset. A read returns the status of the RTC.
#define PL031_RTC_IMSC_INTR_SET   (1 << 0)
#define PL031_RTC_IMSC_INTR_CLEAR   (0 << 0)
#define PL031_RTC_RIS_INTR   (1 << 0)
#define PL031_RTC_MIS_INTR   (1 << 0)
#define PL031_RTC_ICR_INTR   (1 << 0)

Typedefs

typedef struct _PL031_RTC_REGISTERS PL031_RTC_REGISTERS
typedef struct _PL031_RTC PL031_RTC

Functions

RTC_DEVICE *STDCALL pl031_rtc_create (size_t address, char *name, uint32_t irq)
 Create, register and start a new PL031 RTC device which can be accessed using the RTC API.
uint32_t STDCALL pl031_rtc_destroy (RTC_DEVICE *rtc)
 Stop, deregister and destroy a PL031 RTC device created by this driver.

Macro Definition Documentation

◆ PL031_RTC_DESCRIPTION

#define PL031_RTC_DESCRIPTION   "ARM PrimeCell PL031 Real Time Clock"

Description of PL031 device.

PL031 specific constants

◆ PL031_MIN_TIME

#define PL031_MIN_TIME   TIME_TICKS_TO_1970

Time starts at 01/01/1970 00:00:00 (MM/DD/YY HH:MM:SS).

◆ PL031_MAX_TIME

#define PL031_MAX_TIME   137919572470000000

Time ends at 19/1/2038 03:14:07 (MM/DD/YY HH:MM:SS).

◆ PL031_RTC_CR_EN

#define PL031_RTC_CR_EN   (1 << 0)

If set to 1, the RTC is enabled. Once it is enabled, any writes to this bit have no effect on the RTC until a system reset. A read returns the status of the RTC.

PL031 RTC Control register bits

◆ PL031_RTC_IMSC_INTR_SET

#define PL031_RTC_IMSC_INTR_SET   (1 << 0)

PL031 RTC Interrupt mask set and clear register bits

◆ PL031_RTC_IMSC_INTR_CLEAR

#define PL031_RTC_IMSC_INTR_CLEAR   (0 << 0)

◆ PL031_RTC_RIS_INTR

#define PL031_RTC_RIS_INTR   (1 << 0)

PL031 RTC Raw interrupt status register bits

◆ PL031_RTC_MIS_INTR

#define PL031_RTC_MIS_INTR   (1 << 0)

PL031 RTC Masked interrupt status register bits

◆ PL031_RTC_ICR_INTR

#define PL031_RTC_ICR_INTR   (1 << 0)

PL031 RTC Interrupt clear register bits

Typedef Documentation

◆ PL031_RTC_REGISTERS

◆ PL031_RTC

typedef struct _PL031_RTC PL031_RTC

Function Documentation

◆ pl031_rtc_create()

RTC_DEVICE *STDCALL pl031_rtc_create ( size_t address,
char * name,
uint32_t irq )

Create, register and start a new PL031 RTC device which can be accessed using the RTC API.

PL031 Functions

Parameters
AddressThe address of the PL031 registers
NameThe text description of this device which will show in the device list (Optional)
IRQThe interrupt number for the PL031
Returns
Pointer to the new RTC device or nil if the RTC device could not be created

◆ pl031_rtc_destroy()

uint32_t STDCALL pl031_rtc_destroy ( RTC_DEVICE * rtc)

Stop, deregister and destroy a PL031 RTC device created by this driver.

Parameters
RTCThe RTC device to destroy
Returns
ERROR_SUCCESS if completed or another error code on failure