The Real Time Clock (RTC) code header.
More...
#include <basics.h>
#include <graphics.h>
Go to the source code of this file.
|
| int8 | bcd_to_bin (int8 val) |
| | Converts BDC to binary.
|
| int8 | read_rtc_register (int8 reg) |
| | Reads the value from an RTC register.
|
|
void | wait_rtc_update () |
| | Wait till RTC is responding.
|
| int8 | rtc_read_stable (int8 reg) |
| | Reads from a register without tick glitch (more stable).
|
|
void | init_rtc () |
| | Initializes the main RTC for use.
|
| void | update_system_time (int8 *second, int8 *minute, int8 *hour, int8 *day, int8 *month, int16 *year) |
| | Updated the given variable with system time.
|
|
void | display_time () |
| | Displays time in an neat format.
|
| void | sleep (int seconds) |
| | Pauses the OS for set seconds. Use PIT for accuracy.
|
The Real Time Clock (RTC) code header.
- Author
- Pradosh (prado.nosp@m.shga.nosp@m.me@gm.nosp@m.ail..nosp@m.com)
- Version
- 0.1
- Date
- 2025-10-11
- Copyright
- Copyright (c) Pradosh 2025
Definition in file rtc.h.
◆ RTC_CENTURY
Definition at line 29 of file rtc.h.
◆ RTC_DATA
Definition at line 20 of file rtc.h.
◆ RTC_DAY
Definition at line 26 of file rtc.h.
◆ RTC_HOURS
Definition at line 25 of file rtc.h.
◆ RTC_MINUTES
Definition at line 24 of file rtc.h.
◆ RTC_MONTH
Definition at line 27 of file rtc.h.
◆ RTC_PORT
Definition at line 19 of file rtc.h.
◆ RTC_SECONDS
Definition at line 23 of file rtc.h.
◆ RTC_YEAR
Definition at line 28 of file rtc.h.
◆ bcd_to_bin()
| int8 bcd_to_bin |
( |
int8 | val | ) |
|
Converts BDC to binary.
- Parameters
-
- Returns
- int8
◆ read_rtc_register()
| int8 read_rtc_register |
( |
int8 | reg | ) |
|
Reads the value from an RTC register.
- Parameters
-
- Returns
- int8 Value of the Register
◆ rtc_read_stable()
| int8 rtc_read_stable |
( |
int8 | reg | ) |
|
Reads from a register without tick glitch (more stable).
- Parameters
-
- Returns
- int8
◆ sleep()
| void sleep |
( |
int | seconds | ) |
|
Pauses the OS for set seconds. Use PIT for accuracy.
- Parameters
-
◆ update_system_time()
| void update_system_time |
( |
int8 * | second, |
|
|
int8 * | minute, |
|
|
int8 * | hour, |
|
|
int8 * | day, |
|
|
int8 * | month, |
|
|
int16 * | year ) |
Updated the given variable with system time.
- Parameters
-
| second | |
| minute | |
| hour | |
| day | |
| month | |
| year | |