Repository navigation
Expand file tree
/
Copy pathrp-rtc.ads
More file actions
70 lines (56 loc) · 1.71 KB
/
Copy pathrp-rtc.ads
File metadata and controls
70 lines (56 loc) · 1.71 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
--
-- Copyright 2021 (C) Jeremy Grosser <jeremy@synack.me>
--
-- SPDX-License-Identifier: BSD-3-Clause
--
with RP_Interrupts;
with HAL.Real_Time_Clock;
package RP.RTC is
type RTC_Device is new HAL.Real_Time_Clock.RTC_Device with null record;
-- Configure the RTC and start it.
-- If the RTC is already running, this procedure resets the time to zero.
procedure Configure
(This : in out RTC_Device);
function Running
(This : RTC_Device)
return Boolean;
procedure Pause
(This : in out RTC_Device);
procedure Resume
(This : in out RTC_Device);
type RTC_Alarm_Mask is record
Year : Boolean := True;
Month : Boolean := True;
Day : Boolean := True;
Day_Of_Week : Boolean := True;
Hour : Boolean := True;
Min : Boolean := True;
Sec : Boolean := True;
end record;
procedure Delay_Until
(This : in out RTC_Device;
Time : HAL.Real_Time_Clock.RTC_Time;
Date : HAL.Real_Time_Clock.RTC_Date;
Mask : RTC_Alarm_Mask);
-- Mask bits set to False will match any value.
overriding
procedure Set
(This : in out RTC_Device;
Time : HAL.Real_Time_Clock.RTC_Time;
Date : HAL.Real_Time_Clock.RTC_Date);
overriding
procedure Get
(This : in out RTC_Device;
Time : out HAL.Real_Time_Clock.RTC_Time;
Date : out HAL.Real_Time_Clock.RTC_Date);
overriding
function Get_Time
(This : RTC_Device)
return HAL.Real_Time_Clock.RTC_Time;
overriding
function Get_Date
(This : RTC_Device)
return HAL.Real_Time_Clock.RTC_Date;
procedure IRQ_Handler
(Id : RP_Interrupts.Interrupt_ID);
end RP.RTC;