Routines for interfacing with the real-time clock.
More...
Routines for interfacing with the real-time clock.
◆ bcd2bin()
static unsigned char bcd2bin |
( |
unsigned char |
bcd | ) |
|
|
inlinestatic |
Transforms a Binary-Coded Decimal (BCD) to decimal.
- Parameters
-
- Returns
- the decimal value.
◆ gettime()
void gettime |
( |
tm_t * |
time | ) |
|
Copies the global time inside the provided variable.
- Parameters
-
time | Pointer where we store the global time. |
◆ is_updating_rtc()
static unsigned int is_updating_rtc |
( |
void |
| ) |
|
|
inlinestatic |
Check if rtc is updating time currently.
- Returns
- 1 if RTC is updating, 0 otherwise.
◆ read_register()
static unsigned char read_register |
( |
unsigned char |
reg | ) |
|
|
inlinestatic |
Reads the given register.
- Parameters
-
- Returns
- the value we read.
◆ rtc_are_different()
static unsigned int rtc_are_different |
( |
tm_t * |
t0, |
|
|
tm_t * |
t1 |
|
) |
| |
|
inlinestatic |
Checks if the two time values are different.
- Parameters
-
t0 | the first time value. |
t1 | the second time value. |
- Returns
- 1 if they are different, 0 otherwise.
◆ rtc_finalize()
int rtc_finalize |
( |
void |
| ) |
|
De-initializes the Real Time Clock (RTC).
- Returns
- 0 on success, 1 on error.
◆ rtc_handler_isr()
static void rtc_handler_isr |
( |
pt_regs * |
f | ) |
|
|
inlinestatic |
Callback for RTC.
- Parameters
-
◆ rtc_initialize()
int rtc_initialize |
( |
void |
| ) |
|
Initializes the Real Time Clock (RTC).
- Returns
- 0 on success, 1 on error.
◆ write_register()
static void write_register |
( |
unsigned char |
reg, |
|
|
unsigned char |
value |
|
) |
| |
|
inlinestatic |
Writes on the given register.
- Parameters
-
reg | the register on which we need to write. |
value | the value we want to write. |