1#![allow(non_camel_case_types)]
3
4#[repr(i32)]
5#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
6pub enum ErrorCode {
7 OK = 0,
9
10 CAN_MSG_STALE = 1,
12 TxFailed = -1,
14 InvalidParamValue = -2,
16 RxTimeout = -3,
18 TxTimeout = -4,
20 UnexpectedArbId = -5,
22 BufferFull = 6,
24 CAN_OVERFLOW = -6,
25 SensorNotPresent = -7,
27 FirmwareTooOld = -8,
28 CouldNotChangePeriod = -9,
29
30 GeneralError = -100,
33
34 SigNotUpdated = -200,
37 NotAllPIDValuesUpdated = -201,
38
39 GEN_PORT_ERROR = -300,
42 PORT_MODULE_TYPE_MISMATCH = -301,
43
44 GEN_MODULE_ERROR = -400,
47 MODULE_NOT_INIT_SET_ERROR = -401,
48 MODULE_NOT_INIT_GET_ERROR = -402,
49
50 WheelRadiusTooSmall = -500,
52 TicksPerRevZero = -501,
53 DistanceBetweenWheelsTooSmall = -502,
54 GainsAreNotSet = -503,
55
56 IncompatibleMode = -600,
58 InvalidHandle = -601,
60
61 FeatureRequiresHigherFirm = -700,
63 TalonFeatureRequiresHigherFirm = -701,
64
65 PulseWidthSensorNotPresent = 10,
68
69 GeneralWarning = 100,
71 FeatureNotSupported = 101,
73 NotImplemented = 102,
75 FirmVersionCouldNotBeRetrieved = 103,
76 FeaturesNotAvailableYet = 104,
78 ControlModeNotValid = 105,
80 ControlModeNotSupportedYet = 106,
81 AuxiliaryPIDNotSupportedYet = 107,
82 RemoteSensorsNotSupportedYet = 108,
83 MotProfFirmThreshold = 109,
84 MotProfFirmThreshold2 = 110,
85}
86
87#[repr(u32)]
88#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
90pub enum ParamEnum {
91 OnBoot_BrakeMode = 31,
92 QuadFilterEn = 91,
93 QuadIdxPolarity = 108,
94 ClearPositionOnIdx = 100,
95 MotionProfileHasUnderrunErr = 119,
96 MotionProfileTrajectoryPointDurationMs = 120,
97 ClearPosOnLimitF = 144,
98 ClearPosOnLimitR = 145,
99
100 StatusFramePeriod = 300,
101 OpenloopRamp = 301,
102 ClosedloopRamp = 302,
103 NeutralDeadband = 303,
104
105 PeakPosOutput = 305,
106 NominalPosOutput = 306,
107 PeakNegOutput = 307,
108 NominalNegOutput = 308,
109
110 ProfileParamSlot_P = 310,
111 ProfileParamSlot_I = 311,
112 ProfileParamSlot_D = 312,
113 ProfileParamSlot_F = 313,
114 ProfileParamSlot_IZone = 314,
115 ProfileParamSlot_AllowableErr = 315,
116 ProfileParamSlot_MaxIAccum = 316,
117 ProfileParamSlot_PeakOutput = 317,
118
119 ClearPositionOnLimitF = 320,
120 ClearPositionOnLimitR = 321,
121 ClearPositionOnQuadIdx = 322,
122
123 SampleVelocityPeriod = 325,
124 SampleVelocityWindow = 326,
125
126 FeedbackSensorType = 330,
127 SelectedSensorPosition = 331,
128 FeedbackNotContinuous = 332,
129 RemoteSensorSource = 333, RemoteSensorDeviceID = 334,
132 SensorTerm = 335, RemoteSensorClosedLoopDisableNeutralOnLOS = 336,
134 PIDLoopPolarity = 337,
135 PIDLoopPeriod = 338,
136 SelectedSensorCoefficient = 339,
137
138 ForwardSoftLimitThreshold = 340,
139 ReverseSoftLimitThreshold = 341,
140 ForwardSoftLimitEnable = 342,
141 ReverseSoftLimitEnable = 343,
142
143 NominalBatteryVoltage = 350,
144 BatteryVoltageFilterSize = 351,
145
146 ContinuousCurrentLimitAmps = 360,
147 PeakCurrentLimitMs = 361,
148 PeakCurrentLimitAmps = 362,
149
150 ClosedLoopIAccum = 370,
151
152 CustomParam = 380,
153
154 StickyFaults = 390,
155
156 AnalogPosition = 400,
157 QuadraturePosition = 401,
158 PulseWidthPosition = 402,
159
160 MotMag_Accel = 410,
161 MotMag_VelCruise = 411,
162
163 LimitSwitchSource = 421,
165 LimitSwitchNormClosedAndDis = 422,
167 LimitSwitchDisableNeutralOnLOS = 423,
168 LimitSwitchRemoteDevID = 424,
169 SoftLimitDisableNeutralOnLOS = 425,
170
171 PulseWidthPeriod_EdgesPerRot = 430,
172 PulseWidthPeriod_FilterWindowSz = 431,
173
174 YawOffset = 160,
175 CompassOffset = 161,
176 BetaGain = 162,
177 EnableCompassFusion = 163,
178 GyroNoMotionCal = 164,
179 EnterCalibration = 165,
180 FusedHeadingOffset = 166,
181 StatusFrameRate = 169,
182 AccumZ = 170,
183 TempCompDisable = 171,
184 MotionMeas_tap_threshX = 172,
185 MotionMeas_tap_threshY = 173,
186 MotionMeas_tap_threshZ = 174,
187 MotionMeas_tap_count = 175,
188 MotionMeas_tap_time = 176,
189 MotionMeas_tap_time_multi = 177,
190 MotionMeas_shake_reject_thresh = 178,
191 MotionMeas_shake_reject_time = 179,
192 MotionMeas_shake_reject_timeout = 180,
193}