-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalarm.ads
55 lines (42 loc) · 1.17 KB
/
alarm.ads
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
-- Author: A. Ireland
--
-- Address: School Mathematical & Computer Sciences
-- Heriot-Watt University
-- Edinburgh, EH14 4AS
--
-- E-mail: [email protected]
--
-- Last modified: 10.9.2022
--
-- Filename: alarm.ads
--
-- Description: Models the alarm device associated
-- with the BSCU.
pragma SPARK_Mode (On);
package Alarm
is
pragma Elaborate_Body;
State: Boolean;
Cnt: Integer;
-- returns true if alarm state is true, otherwise returns false
function Enabled return Boolean
with
Global => (Input => State),
Depends => (Enabled'Result => State);
-- Sets alarm state to be true
procedure Enable
with
Global => (In_Out => (State, Cnt)),
Depends => (State => State,
Cnt => (Cnt, State));
-- Sets alarm state to be false
procedure Disable
with
Global => (In_Out => State),
Depends => (State => State);
procedure Reset_Cnt
with
Global => (Output => Cnt),
Depends => (Cnt => null);
function Read_Cnt return Integer;
end Alarm;