blob: 1d1e5d4c4cb90df3446d6c7f607072a8e147760c [file] [log] [blame]
Elyes HAOUASfbf3a472020-05-09 13:22:30 +02001-- SPDX-License-Identifier: GPL-2.0-only
Nico Huberc83239e2016-10-05 17:46:49 +02002
3with Interfaces.C;
4
5package body HW.Time.Timer
6 with Refined_State => (Timer_State => null,
7 Abstract_Time => null)
8is
9
10 procedure Timer_Monotonic_Get (MT : out Interfaces.C.long);
11 pragma Import (C, Timer_Monotonic_Get, "timer_monotonic_get");
12
13 function Raw_Value_Min return T
14 with
15 SPARK_Mode => Off
16 is
17 Microseconds : Interfaces.C.long;
18 begin
19 Timer_Monotonic_Get (Microseconds);
20 return T (Microseconds);
21 end Raw_Value_Min;
22
23 function Raw_Value_Max return T
24 is
25 begin
26 return Raw_Value_Min + 1;
27 end Raw_Value_Max;
28
29 function Hz return T
30 is
31 begin
32 return 1_000_000;
33 end Hz;
34
35end HW.Time.Timer;