WPILibC++  unspecified
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
HAL.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) FIRST 2013-2016. 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 "FRC_NetworkCommunication/UsageReporting.h"
15 #include "HAL/Accelerometer.h"
16 #include "HAL/AnalogAccumulator.h"
17 #include "HAL/AnalogGyro.h"
18 #include "HAL/AnalogInput.h"
19 #include "HAL/AnalogOutput.h"
20 #include "HAL/AnalogTrigger.h"
21 #include "HAL/Compressor.h"
22 #include "HAL/Constants.h"
23 #include "HAL/Counter.h"
24 #include "HAL/DIO.h"
25 #include "HAL/DriverStation.h"
26 #include "HAL/Errors.h"
27 #include "HAL/I2C.h"
28 #include "HAL/Interrupts.h"
29 #include "HAL/Notifier.h"
30 #include "HAL/PDP.h"
31 #include "HAL/PWM.h"
32 #include "HAL/Ports.h"
33 #include "HAL/Power.h"
34 #include "HAL/Relay.h"
35 #include "HAL/SPI.h"
36 #include "HAL/SerialPort.h"
37 #include "HAL/Solenoid.h"
38 
39 #endif // HAL_USE_LABVIEW
40 
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