WPILibC++  2018.4.1-20180823210227-1173-gde212a9
 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  typedef std::chrono::microseconds::rep rep;
22  typedef std::chrono::microseconds::period period;
23  typedef std::chrono::microseconds duration;
24  typedef std::chrono::time_point<fpga_clock> time_point;
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: NotifyListenerVector.h:18
A std::chrono compatible wrapper around the FPGA Timer.
Definition: fpga_clock.h:19