Go to the source code of this file.
Defines | |||||||||||||
#define | RTC_EPOCH_YEAR 1970 | ||||||||||||
The base epoch year. | |||||||||||||
#define | EPOCH_DAY 0 | ||||||||||||
The base epoch day (Jan 1). | |||||||||||||
#define | RTC_SECONDS 0 | ||||||||||||
RTC port for seconds. | |||||||||||||
#define | RTC_MINUTES 2 | ||||||||||||
RTC port for minutes. | |||||||||||||
#define | RTC_HOURS 4 | ||||||||||||
RTC port for hours. | |||||||||||||
#define | RTC_DAY_OF_WEEK 6 | ||||||||||||
RTC port for the day of the week. | |||||||||||||
#define | RTC_DAY_OF_MONTH 7 | ||||||||||||
RTC port for the month. | |||||||||||||
#define | RTC_MONTH 8 | ||||||||||||
RTC port for month. | |||||||||||||
#define | RTC_YEAR 9 | ||||||||||||
RTC port for year. | |||||||||||||
#define | RTC_REG_A 10 | ||||||||||||
RTC control register A. | |||||||||||||
#define | RTC_REG_B 11 | ||||||||||||
RTC control register B. | |||||||||||||
#define | RTC_REG_C 12 | ||||||||||||
RTC control register C. | |||||||||||||
#define | RTC_REG_D 13 | ||||||||||||
RTC control register D. | |||||||||||||
#define | BCD2BIN(n) ( ((n) >> 4) * 10 + ((n) & 0x0F) ) | ||||||||||||
Macro to convert from BCD to binary format. | |||||||||||||
#define | BIN2BCD(n) ( (((n) / 10) << 4) + ((n) % 10) ) | ||||||||||||
Macro to convert from binary to BCD format. | |||||||||||||
#define | CMOS_CTRL 0x70 | ||||||||||||
CMOS control register. | |||||||||||||
#define | CMOS_DATA 0x71 | ||||||||||||
CMOS data register. | |||||||||||||
#define | CMOS_READ(port) | ||||||||||||
Read a value from the CMOS.
| |||||||||||||
#define | CMOS_WRITE(port, val) | ||||||||||||
Write a value to the CMOS.
| |||||||||||||
#define | RTC_FREQ_SELECT RTC_REG_A | ||||||||||||
RTC update frequency register. | |||||||||||||
#define | RTC_UIP 0x80 | ||||||||||||
Update-in-progress - set to "1" 244 microsecs before RTC goes off the bus, reset after update (may take 1.984ms @ 32768Hz RefClock) is complete, totalling to a max high interval of 2.228 ms. | |||||||||||||
#define | RTC_DIV_RESET1 0x60 | ||||||||||||
#define | RTC_DIV_RESET2 0x70 | ||||||||||||
#define | RTC_CONTROL RTC_REG_B | ||||||||||||
RTC status register. | |||||||||||||
#define | RTC_SET 0x80 | ||||||||||||
Disable updates for clock setting. | |||||||||||||
#define | RTC_DM_BINARY 0x04 | ||||||||||||
RTC binary date; all time/date values are BCD if clear. | |||||||||||||
#define | RTC_24H 0x02 | ||||||||||||
Typedefs | |||||||||||||
typedef unsigned long | time_t | ||||||||||||
Time variable type. | |||||||||||||
Functions | |||||||||||||
__inline__ unsigned long | mktime (unsigned int year, unsigned int mon, unsigned int day, unsigned int hour, unsigned int min, unsigned int sec) | ||||||||||||
Converts Gregorian date to seconds since 1970-01-01 00:00:00.
| |||||||||||||
void | time_init () | ||||||||||||
Initialize the Real-Time Clock. | |||||||||||||
time_t | time_read () | ||||||||||||
Get the seconds passed since midnight 1970-01-01 (Unix timestamp).
|
Definition in file time.h.
|
Macro to convert from BCD to binary format.
|
|
Macro to convert from binary to BCD format.
|
|
CMOS control register.
|
|
CMOS data register.
|
|
Value: Read a value from the CMOS.
|
|
Value: Write a value to the CMOS.
|
|
The base epoch day (Jan 1).
|
|
|
|
RTC status register.
|
|
RTC port for the month.
|
|
RTC port for the day of the week.
|
|
|
|
|
|
RTC binary date; all time/date values are BCD if clear.
|
|
The base epoch year.
|
|
RTC update frequency register.
|
|
RTC port for hours.
|
|
RTC port for minutes.
|
|
RTC port for month.
|
|
RTC control register A.
|
|
RTC control register B.
|
|
RTC control register C.
|
|
RTC control register D.
|
|
RTC port for seconds.
|
|
Disable updates for clock setting.
|
|
Update-in-progress - set to "1" 244 microsecs before RTC goes off the bus, reset after update (may take 1.984ms @ 32768Hz RefClock) is complete, totalling to a max high interval of 2.228 ms.
|
|
RTC port for year.
|
|
Time variable type.
|