forked from jackmiller1/ece391-kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrtc.h
More file actions
executable file
·50 lines (34 loc) · 990 Bytes
/
rtc.h
File metadata and controls
executable file
·50 lines (34 loc) · 990 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* rtc.h - Function Header File for "rtc.c"
*/
#ifndef _RTC_H
#define _RTC_H
#include "types.h"
/* This defines both the index and data port on the RTC
* Names are given according to both RTC Data Sheet
* and names taken from OSDev
*/
#define RTC_PORT 0x70 //Index Register
#define CMOS_PORT 0x71 //Data Register
/* Registers on the RTC */
#define RTC_REGISTER_A 0x0A
#define RTC_REGISTER_B 0x0B
#define RTC_REGISTER_C 0x0C
#define RTC_REGISTER_D 0x0D
/* PIC Interrupt Line */
#define RTC_IRQ_LINE 8
/* Initialize RTC */
void init_rtc(void);
/* Open the RTC */
int32_t rtc_open(const uint8_t* filename);
/* Read the RTC */
int32_t rtc_read(int32_t fd, void* buf, int32_t nbytes);
/* Write to the RTC */
int32_t rtc_write(int32_t fd, const void* buf, int32_t nbytes);
/* Set Frequency on RTC */
void rtc_set_freq(int32_t freq);
/* Close the RTC */
int32_t rtc_close(int32_t fd);
/* Test Interrupts used for Checkpoint 1 */
void rtc_interrupt_handler(void);
#endif