PatchworkOS
Loading...
Searching...
No Matches

Real Time Clock. More...

Macros

#define CMOS_ADDRESS   0x70
 CMOS address port.
 
#define CMOS_DATA   0x71
 CMOS data port.
 

Functions

void rtc_read (struct tm *time)
 Reads the current time from the RTC.
 

Detailed Description

Real Time Clock.

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

See also
OSDev CMOS

Macro Definition Documentation

◆ CMOS_ADDRESS

#define CMOS_ADDRESS   0x70

CMOS address port.

Definition at line 20 of file rtc.h.

◆ CMOS_DATA

#define CMOS_DATA   0x71

CMOS data port.

Definition at line 25 of file rtc.h.

Function Documentation

◆ rtc_read()

void rtc_read ( struct tm time)

Reads the current time from the RTC.

Parameters
timePointer to a struct tm to store the current time. If NULL, the function does nothing.

Definition at line 15 of file rtc.c.

References bcd_to_bin(), cmos_read(), NULL, and time().

Referenced by timer_init().