PatchworkOS  966e257
A non-POSIX operating system.
Loading...
Searching...
No Matches

Real Time Clock. More...

Collaboration diagram for RTC:

Detailed Description

Real Time Clock.

The RTC driver provides functions to read the current time from the CMOS RTC.

See also
OSDev CMOS

Functions

static uint8_t rtc_read (uint8_t reg)
 
static int rtc_update_in_progress (void)
 
static uint8_t rtc_bcd_to_bin (uint8_t bcd)
 
static time_t rtc_read_epoch (void)
 
static uint64_t rtc_init (const char *deviceName)
 

Variables

static uint8_t centuryRegister = 0
 
static port_t addressPort = 0
 
static port_t dataPort = 0
 
static lock_t lock = LOCK_CREATE()
 
static clock_source_t source
 

Function Documentation

◆ rtc_read()

static uint8_t rtc_read ( uint8_t  reg)
static

Definition at line 29 of file rtc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rtc_update_in_progress()

static int rtc_update_in_progress ( void  )
static

Definition at line 35 of file rtc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rtc_bcd_to_bin()

static uint8_t rtc_bcd_to_bin ( uint8_t  bcd)
static

Definition at line 40 of file rtc.c.

Here is the caller graph for this function:

◆ rtc_read_epoch()

static time_t rtc_read_epoch ( void  )
static

Definition at line 45 of file rtc.c.

Here is the call graph for this function:

◆ rtc_init()

static uint64_t rtc_init ( const char *  deviceName)
static

Definition at line 91 of file rtc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ centuryRegister

uint8_t centuryRegister = 0
static

Definition at line 23 of file rtc.c.

◆ addressPort

port_t addressPort = 0
static

Definition at line 25 of file rtc.c.

◆ dataPort

port_t dataPort = 0
static

Definition at line 26 of file rtc.c.

◆ lock

lock_t lock = LOCK_CREATE()
static

Definition at line 27 of file rtc.c.

◆ source

clock_source_t source
static
Initial value:
= {
.name = "CMOS RTC",
.precision = CLOCKS_PER_SEC,
.read_ns = NULL,
.read_epoch = rtc_read_epoch,
}
#define CLOCKS_PER_SEC
Definition clock_t.h:15
static time_t rtc_read_epoch(void)
Definition rtc.c:45
#define NULL
Pointer error value.
Definition NULL.h:23

Definition at line 84 of file rtc.c.