WPILibC++  2018.4.1-1228-gb9fa3a4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
fpga_clock.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #pragma once
9 
10 #include <chrono>
11 #include <limits>
12 
14 namespace hal {
15 
19 class fpga_clock {
20  public:
21  using rep = std::chrono::microseconds::rep;
22  using period = std::chrono::microseconds::period;
23  using duration = std::chrono::microseconds;
24  using time_point = std::chrono::time_point<fpga_clock>;
25 
26  static fpga_clock::time_point now() noexcept;
27  static constexpr bool is_steady = true;
28 
29  static fpga_clock::time_point epoch() noexcept { return time_point(zero()); }
30 
31  static fpga_clock::duration zero() noexcept { return duration(0); }
32 
33  static const time_point min_time;
34 };
35 } // namespace hal
WPILib Hardware Abstraction Layer (HAL) namespace.
Definition: SimDataValue.h:19
A std::chrono compatible wrapper around the FPGA Timer.
Definition: fpga_clock.h:19