Elyes HAOUAS | fbf3a47 | 2020-05-09 13:22:30 +0200 | [diff] [blame] | 1 | -- SPDX-License-Identifier: GPL-2.0-only |
Nico Huber | c83239e | 2016-10-05 17:46:49 +0200 | [diff] [blame] | 2 | |
| 3 | with Interfaces.C; |
| 4 | |
| 5 | package body HW.Time.Timer |
| 6 | with Refined_State => (Timer_State => null, |
| 7 | Abstract_Time => null) |
| 8 | is |
| 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 | |
| 35 | end HW.Time.Timer; |