WPILibC++ 2025.0.0-alpha-1-9-ga2beb75
fpga_clock.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7#include <chrono>
8
9/** WPILib Hardware Abstraction Layer (HAL) namespace */
10namespace hal {
11
12/**
13 * A std::chrono compatible wrapper around the FPGA Timer.
14 */
16 public:
17 using rep = std::chrono::microseconds::rep;
18 using period = std::chrono::microseconds::period;
19 using duration = std::chrono::microseconds;
20 using time_point = std::chrono::time_point<fpga_clock>;
21
22 static fpga_clock::time_point now() noexcept;
23 static constexpr bool is_steady = true;
24
25 static fpga_clock::time_point epoch() noexcept { return time_point(zero()); }
26
27 static fpga_clock::duration zero() noexcept { return duration(0); }
28
29 static const time_point min_time;
30};
31} // namespace hal
A std::chrono compatible wrapper around the FPGA Timer.
Definition: fpga_clock.h:15
static fpga_clock::duration zero() noexcept
Definition: fpga_clock.h:27
static const time_point min_time
Definition: fpga_clock.h:29
static fpga_clock::time_point epoch() noexcept
Definition: fpga_clock.h:25
std::chrono::microseconds::period period
Definition: fpga_clock.h:18
std::chrono::time_point< fpga_clock > time_point
Definition: fpga_clock.h:20
std::chrono::microseconds duration
Definition: fpga_clock.h:19
static fpga_clock::time_point now() noexcept
static constexpr bool is_steady
Definition: fpga_clock.h:23
std::chrono::microseconds::rep rep
Definition: fpga_clock.h:17
WPILib Hardware Abstraction Layer (HAL) namespace.
Definition: InterruptManager.h:13