Brian Silverman | f7f267a | 2017-02-04 16:16:08 -0800 | [diff] [blame^] | 1 | /*----------------------------------------------------------------------------*/ |
| 2 | /* Copyright (c) FIRST 2013-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 | |
| 8 | #pragma once |
| 9 | |
| 10 | #include <stdint.h> |
| 11 | |
| 12 | #ifndef HAL_USE_LABVIEW |
| 13 | |
| 14 | #include "HAL/Accelerometer.h" |
| 15 | #include "HAL/AnalogAccumulator.h" |
| 16 | #include "HAL/AnalogGyro.h" |
| 17 | #include "HAL/AnalogInput.h" |
| 18 | #include "HAL/AnalogOutput.h" |
| 19 | #include "HAL/AnalogTrigger.h" |
| 20 | #include "HAL/Compressor.h" |
| 21 | #include "HAL/Constants.h" |
| 22 | #include "HAL/Counter.h" |
| 23 | #include "HAL/DIO.h" |
| 24 | #include "HAL/DriverStation.h" |
| 25 | #include "HAL/Errors.h" |
| 26 | #include "HAL/I2C.h" |
| 27 | #include "HAL/Interrupts.h" |
| 28 | #include "HAL/Notifier.h" |
| 29 | #include "HAL/PDP.h" |
| 30 | #include "HAL/PWM.h" |
| 31 | #include "HAL/Ports.h" |
| 32 | #include "HAL/Power.h" |
| 33 | #include "HAL/Relay.h" |
| 34 | #include "HAL/SPI.h" |
| 35 | #include "HAL/SerialPort.h" |
| 36 | #include "HAL/Solenoid.h" |
| 37 | |
| 38 | #endif // HAL_USE_LABVIEW |
| 39 | |
| 40 | #include "FRC_NetworkCommunication/UsageReporting.h" |
| 41 | #include "HAL/Types.h" |
| 42 | |
| 43 | namespace HALUsageReporting = nUsageReporting; |
| 44 | |
| 45 | enum HAL_RuntimeType : int32_t { HAL_Athena, HAL_Mock }; |
| 46 | |
| 47 | #ifdef __cplusplus |
| 48 | extern "C" { |
| 49 | #endif |
| 50 | |
| 51 | const char* HAL_GetErrorMessage(int32_t code); |
| 52 | |
| 53 | int32_t HAL_GetFPGAVersion(int32_t* status); |
| 54 | int64_t HAL_GetFPGARevision(int32_t* status); |
| 55 | |
| 56 | HAL_RuntimeType HAL_GetRuntimeType(); |
| 57 | HAL_Bool HAL_GetFPGAButton(int32_t* status); |
| 58 | |
| 59 | HAL_Bool HAL_GetSystemActive(int32_t* status); |
| 60 | HAL_Bool HAL_GetBrownedOut(int32_t* status); |
| 61 | |
| 62 | void HAL_BaseInitialize(int32_t* status); |
| 63 | |
| 64 | #ifndef HAL_USE_LABVIEW |
| 65 | |
| 66 | HAL_PortHandle HAL_GetPort(int32_t channel); |
| 67 | HAL_PortHandle HAL_GetPortWithModule(int32_t module, int32_t channel); |
| 68 | |
| 69 | uint64_t HAL_GetFPGATime(int32_t* status); |
| 70 | |
| 71 | int32_t HAL_Initialize(int32_t mode); |
| 72 | |
| 73 | // ifdef's definition is to allow for default parameters in C++. |
| 74 | #ifdef __cplusplus |
| 75 | int64_t HAL_Report(int32_t resource, int32_t instanceNumber, |
| 76 | int32_t context = 0, const char* feature = nullptr); |
| 77 | #else |
| 78 | int64_t HAL_Report(int32_t resource, int32_t instanceNumber, int32_t context, |
| 79 | const char* feature); |
| 80 | #endif |
| 81 | |
| 82 | #endif // HAL_USE_LABVIEW |
| 83 | #ifdef __cplusplus |
| 84 | } |
| 85 | #endif |