blob: 4962cc955f830ad8165345c488cb8e53815d6c6a [file] [log] [blame]
Parker Schuhd3b7a8872018-02-19 16:42:27 -08001/*----------------------------------------------------------------------------*/
2/* Copyright (c) FIRST 2008-2017. 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
Austin Schuh9950f682021-11-06 15:27:58 -07008#ifndef FRC971_WPILIB_AHAL_UTILITY_H_
9#define FRC971_WPILIB_AHAL_UTILITY_H_
Parker Schuhd3b7a8872018-02-19 16:42:27 -080010
Parker Schuhd3b7a8872018-02-19 16:42:27 -080011#include <string>
12
Parker Schuhd3b7a8872018-02-19 16:42:27 -080013namespace frc {
14
Austin Schuh9950f682021-11-06 15:27:58 -070015// Returns the FPGA Version number. For now, this is the competition year.
Parker Schuhd3b7a8872018-02-19 16:42:27 -080016int GetFPGAVersion();
Austin Schuh9950f682021-11-06 15:27:58 -070017
18// Returns the FPGA Revision number.
19// The format of the revision is 3 numbers.
20// The 12 most significant bits are the Major Revision.
21// the next 8 bits are the Minor Revision.
22// The 12 least significant bits are the Build Number.
Parker Schuhd3b7a8872018-02-19 16:42:27 -080023int64_t GetFPGARevision();
Austin Schuh9950f682021-11-06 15:27:58 -070024
25// Reads the microsecond-resolution timer on the FPGA since reset.
Parker Schuhd3b7a8872018-02-19 16:42:27 -080026uint64_t GetFPGATime();
Austin Schuh9950f682021-11-06 15:27:58 -070027
28// Gets the state of the "USER" button on the roboRIO, returning true if
29// pressed.
Parker Schuhd3b7a8872018-02-19 16:42:27 -080030bool GetUserButton();
Parker Schuhd3b7a8872018-02-19 16:42:27 -080031
32} // namespace frc
Austin Schuh9950f682021-11-06 15:27:58 -070033
34#endif // FRC971_WPILIB_AHAL_UTILITY_H_