WPILibC++  2020.3.2-60-g3011ebe
DriverStationTypes.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2018 FIRST. 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 #include "hal/Types.h"
13 
20 #define HAL_IO_CONFIG_DATA_SIZE 32
21 #define HAL_SYS_STATUS_DATA_SIZE 44
22 #define HAL_USER_STATUS_DATA_SIZE \
23  (984 - HAL_IO_CONFIG_DATA_SIZE - HAL_SYS_STATUS_DATA_SIZE)
24 
25 #define HALFRC_NetworkCommunication_DynamicType_DSEnhancedIO_Input 17
26 #define HALFRC_NetworkCommunication_DynamicType_DSEnhancedIO_Output 18
27 #define HALFRC_NetworkCommunication_DynamicType_Kinect_Header 19
28 #define HALFRC_NetworkCommunication_DynamicType_Kinect_Extra1 20
29 #define HALFRC_NetworkCommunication_DynamicType_Kinect_Vertices1 21
30 #define HALFRC_NetworkCommunication_DynamicType_Kinect_Extra2 22
31 #define HALFRC_NetworkCommunication_DynamicType_Kinect_Vertices2 23
32 #define HALFRC_NetworkCommunication_DynamicType_Kinect_Joystick 24
33 #define HALFRC_NetworkCommunication_DynamicType_Kinect_Custom 25
34 
36  uint32_t enabled : 1;
37  uint32_t autonomous : 1;
38  uint32_t test : 1;
39  uint32_t eStop : 1;
40  uint32_t fmsAttached : 1;
41  uint32_t dsAttached : 1;
42  uint32_t control_reserved : 26;
43 };
44 typedef struct HAL_ControlWord HAL_ControlWord;
45 
46 // clang-format off
47 HAL_ENUM(HAL_AllianceStationID) {
48  HAL_AllianceStationID_kRed1,
49  HAL_AllianceStationID_kRed2,
50  HAL_AllianceStationID_kRed3,
51  HAL_AllianceStationID_kBlue1,
52  HAL_AllianceStationID_kBlue2,
53  HAL_AllianceStationID_kBlue3,
54 };
55 
56 HAL_ENUM(HAL_MatchType) {
57  HAL_kMatchType_none,
58  HAL_kMatchType_practice,
59  HAL_kMatchType_qualification,
60  HAL_kMatchType_elimination,
61 };
62 // clang-format on
63 
64 /* The maximum number of axes that will be stored in a single HALJoystickAxes
65  * struct. This is used for allocating buffers, not bounds checking, since
66  * there are usually less axes in practice.
67  */
68 #define HAL_kMaxJoystickAxes 12
69 #define HAL_kMaxJoystickPOVs 12
70 #define HAL_kMaxJoysticks 6
71 
73  int16_t count;
74  float axes[HAL_kMaxJoystickAxes];
75 };
76 typedef struct HAL_JoystickAxes HAL_JoystickAxes;
77 
79  int16_t count;
80  int16_t povs[HAL_kMaxJoystickPOVs];
81 };
82 typedef struct HAL_JoystickPOVs HAL_JoystickPOVs;
83 
85  uint32_t buttons;
86  uint8_t count;
87 };
89 
91  uint8_t isXbox;
92  uint8_t type;
93  char name[256];
94  uint8_t axisCount;
95  uint8_t axisTypes[HAL_kMaxJoystickAxes];
96  uint8_t buttonCount;
97  uint8_t povCount;
98 };
100 
102  char eventName[64];
103  HAL_MatchType matchType;
104  uint16_t matchNumber;
105  uint8_t replayNumber;
106  uint8_t gameSpecificMessage[64];
107  uint16_t gameSpecificMessageSize;
108 };
109 typedef struct HAL_MatchInfo HAL_MatchInfo;
HAL_JoystickAxes
Definition: DriverStationTypes.h:72
HAL_JoystickPOVs
Definition: DriverStationTypes.h:78
HAL_ControlWord
Definition: DriverStationTypes.h:35
HAL_MatchInfo
Definition: DriverStationTypes.h:101
HAL_JoystickButtons
Definition: DriverStationTypes.h:84
HAL_JoystickDescriptor
Definition: DriverStationTypes.h:90