Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame] | 1 | /*----------------------------------------------------------------------------*/ |
| 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 Schuh | 9950f68 | 2021-11-06 15:27:58 -0700 | [diff] [blame] | 8 | #ifndef FRC971_WPILIB_AHAL_UTILITY_H_ |
| 9 | #define FRC971_WPILIB_AHAL_UTILITY_H_ |
Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame] | 10 | |
Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame] | 11 | #include <string> |
| 12 | |
Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame] | 13 | namespace frc { |
| 14 | |
Austin Schuh | 9950f68 | 2021-11-06 15:27:58 -0700 | [diff] [blame] | 15 | // Returns the FPGA Version number. For now, this is the competition year. |
Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame] | 16 | int GetFPGAVersion(); |
Austin Schuh | 9950f68 | 2021-11-06 15:27:58 -0700 | [diff] [blame] | 17 | |
| 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 Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame] | 23 | int64_t GetFPGARevision(); |
Austin Schuh | 9950f68 | 2021-11-06 15:27:58 -0700 | [diff] [blame] | 24 | |
| 25 | // Reads the microsecond-resolution timer on the FPGA since reset. |
Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame] | 26 | uint64_t GetFPGATime(); |
Austin Schuh | 9950f68 | 2021-11-06 15:27:58 -0700 | [diff] [blame] | 27 | |
| 28 | // Gets the state of the "USER" button on the roboRIO, returning true if |
| 29 | // pressed. |
Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame] | 30 | bool GetUserButton(); |
Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame] | 31 | |
| 32 | } // namespace frc |
Austin Schuh | 9950f68 | 2021-11-06 15:27:58 -0700 | [diff] [blame] | 33 | |
| 34 | #endif // FRC971_WPILIB_AHAL_UTILITY_H_ |