001/*
002 * Copyright (C) Cross The Road Electronics.  All rights reserved.
003 * License information can be found in CTRE_LICENSE.txt
004 * For support and suggestions contact support@ctr-electronics.com or file
005 * an issue tracker at https://github.com/CrossTheRoadElec/Phoenix-Releases
006 */
007package com.ctre.phoenixpro.hardware.core;
008
009import com.ctre.phoenixpro.hardware.ParentDevice;
010import com.ctre.phoenixpro.controls.*;
011import com.ctre.phoenixpro.configs.*;
012import com.ctre.phoenix6.StatusCode;
013import com.ctre.phoenix6.jni.ErrorReportingJNI;
014import com.ctre.phoenix6.jni.PlatformJNI;
015import com.ctre.phoenixpro.sim.DeviceType;
016import com.ctre.phoenixpro.sim.TalonFXSimState;
017import com.ctre.phoenixpro.StatusSignalValue;
018import com.ctre.phoenix6.spns.*;
019import com.ctre.phoenixpro.signals.*;
020import com.ctre.phoenixpro.Utils;
021import java.util.HashMap;
022import java.util.Map;
023
024/**
025 * Class description for the Talon FX integrated motor controller that runs on
026 * associated Falcon motors.
027 *
028 * @deprecated Classes in the phoenixpro package will be removed in 2024.
029 *             Users should instead use classes from the phoenix6 package.
030 */
031@Deprecated(forRemoval = true)
032public class CoreTalonFX extends ParentDevice
033{
034    private TalonFXConfigurator _configurator;
035
036    private StatusSignalValue<Integer> _version;
037    private boolean _isVersionOk = false;
038    private double _timeToRefreshVersion = Utils.getCurrentTimeSeconds();
039
040    private StatusSignalValue<Integer> _resetFlags;
041    private double _resetTimestamp = 0;
042
043    private double _creationTime = Utils.getCurrentTimeSeconds();
044
045    @Override
046    protected void reportIfTooOld()
047    {
048        /* If we're not initialized, we can't even check the versions */
049        if (_isVersionOk) {
050            return;
051        }
052        /* Check if we have our versions initialized */
053        if (_version == null) {
054            return;
055        }
056
057        /* get fresh data if enough time has passed */
058        final double currentTime = Utils.getCurrentTimeSeconds();
059        if (currentTime >= _timeToRefreshVersion) {
060            /* Try to refresh again after 250ms */
061            _timeToRefreshVersion = currentTime + 0.25;
062            /* Refresh versions, don't print out if there's an error with refreshing */
063            _version.refresh(false);
064            
065            /* process the fetched version */
066            StatusCode code = StatusCode.OK;
067    
068            /* First check if we have good versions or not */
069            if (_version.getError().isOK()) {
070                final long fullVersion = _version.getValue();
071    
072                if (Utils.isSimulation()) {
073                    /* only check major version in simulation */
074                    final int majorVersion = (int)((fullVersion >> 0x18) & 0xFF);
075    
076                    /* Just check if it's good */
077                    if (majorVersion != 23) {
078                        code = StatusCode.FirmwareTooOld;
079                    }
080                    else {
081                        /* Equal major versions, this is sufficient */
082                    }
083                }
084                else {
085                    /* test the parts individually */
086                    final int majorVersion = (int)((fullVersion >> 0x18) & 0xFF);
087                    final int minorVersion = (int)((fullVersion >> 0x10) & 0xFF);
088                    final int bugfixVersion = (int)((fullVersion >> 0x08) & 0xFF);
089                    final int buildVersion = (int)((fullVersion >> 0x00) & 0xFF);
090    
091                    /* Just check if they're good */
092                    if (majorVersion < 23) {
093                        code = StatusCode.FirmwareTooOld;
094                    }
095                    else if (majorVersion > 23) {
096                    }
097                    else if (minorVersion < 1) {
098                        code = StatusCode.FirmwareTooOld;
099                    }
100                    else if (minorVersion > 1) {
101                    }
102                    else if (bugfixVersion < 0) {
103                        code = StatusCode.FirmwareTooOld;
104                    }
105                    else if (bugfixVersion > 0) {
106                    }
107                    else if (buildVersion < 0) {
108                        code = StatusCode.FirmwareTooOld;
109                    }
110                    else if (buildVersion > 0) {
111                    }
112                    else {
113                        /* Equal versions, this is sufficient */
114                    }
115                }
116            }
117            else {
118                /* don't care why we couldn't get message, just report we didn't get it */
119                code = StatusCode.CouldNotRetrieveProFirmware;
120            }
121    
122            /* how much time has passed */
123            final double deltaTimeSec = currentTime - _creationTime;
124    
125            if (code.isOK()) {
126                /* version is retrieved and healthy */
127                _isVersionOk = true;
128            }
129            else if (code == StatusCode.FirmwareTooOld || deltaTimeSec >= 3.0) {
130                /* report error */
131                ErrorReportingJNI.reportStatusCode(code.value, deviceIdentifier.toString());
132            }
133            else {
134                /* don't start reporting CouldNotRetrieveProFirmware yet, device was likely recently constructed */
135            }
136
137        }
138    }
139
140    
141    /**
142     * Proportional output of PID controller when PID'ing under a
143     * DutyCycle Request
144     *
145     *  <ul>
146     *  <li> <b>Minimum Value:</b> -128.0
147     *  <li> <b>Maximum Value:</b> 127.9990234375
148     *  <li> <b>Default Value:</b> 0
149     *  <li> <b>Units:</b> fractional
150     *  </ul>
151     *
152     * Default Rates:
153     *  <ul>
154     *  <li> <b>CAN:</b> 4.0 Hz
155     *  </ul>
156     *
157     * @return  PIDDutyCycle_ProportionalOutput Status Signal Value object
158     */
159    private StatusSignalValue<Double> getPIDDutyCycle_ProportionalOutput()
160    {
161        return super.lookupStatusSignalValue(SpnValue.PRO_PIDOutput_ProportionalOutput_DC.value, Double.class, "PIDDutyCycle_ProportionalOutput", true);
162    }
163    
164    /**
165     * Proportional output of PID controller when PID'ing under a Voltage
166     * Request
167     *
168     *  <ul>
169     *  <li> <b>Minimum Value:</b> -1310.72
170     *  <li> <b>Maximum Value:</b> 1310.71
171     *  <li> <b>Default Value:</b> 0
172     *  <li> <b>Units:</b> V
173     *  </ul>
174     *
175     * Default Rates:
176     *  <ul>
177     *  <li> <b>CAN:</b> 4.0 Hz
178     *  </ul>
179     *
180     * @return  PIDMotorVoltage_ProportionalOutput Status Signal Value object
181     */
182    private StatusSignalValue<Double> getPIDMotorVoltage_ProportionalOutput()
183    {
184        return super.lookupStatusSignalValue(SpnValue.PRO_PIDOutput_ProportionalOutput_V.value, Double.class, "PIDMotorVoltage_ProportionalOutput", true);
185    }
186    
187    /**
188     * Proportional output of PID controller when PID'ing under a
189     * TorqueCurrent Request
190     *
191     *  <ul>
192     *  <li> <b>Minimum Value:</b> -13107.2
193     *  <li> <b>Maximum Value:</b> 13107.1
194     *  <li> <b>Default Value:</b> 0
195     *  <li> <b>Units:</b> A
196     *  </ul>
197     *
198     * Default Rates:
199     *  <ul>
200     *  <li> <b>CAN:</b> 4.0 Hz
201     *  </ul>
202     *
203     * @return  PIDTorqueCurrent_ProportionalOutput Status Signal Value object
204     */
205    private StatusSignalValue<Double> getPIDTorqueCurrent_ProportionalOutput()
206    {
207        return super.lookupStatusSignalValue(SpnValue.PRO_PIDOutput_ProportionalOutput_A.value, Double.class, "PIDTorqueCurrent_ProportionalOutput", true);
208    }
209    
210    /**
211     * Integrated Accumulator of PID controller when PID'ing under a
212     * DutyCycle Request
213     *
214     *  <ul>
215     *  <li> <b>Minimum Value:</b> -128.0
216     *  <li> <b>Maximum Value:</b> 127.9990234375
217     *  <li> <b>Default Value:</b> 0
218     *  <li> <b>Units:</b> fractional
219     *  </ul>
220     *
221     * Default Rates:
222     *  <ul>
223     *  <li> <b>CAN:</b> 4.0 Hz
224     *  </ul>
225     *
226     * @return  PIDDutyCycle_IntegratedAccum Status Signal Value object
227     */
228    private StatusSignalValue<Double> getPIDDutyCycle_IntegratedAccum()
229    {
230        return super.lookupStatusSignalValue(SpnValue.PRO_PIDStateEnables_IntegratedAccum_DC.value, Double.class, "PIDDutyCycle_IntegratedAccum", true);
231    }
232    
233    /**
234     * Integrated Accumulator of PID controller when PID'ing under a
235     * Voltage Request
236     *
237     *  <ul>
238     *  <li> <b>Minimum Value:</b> -1310.72
239     *  <li> <b>Maximum Value:</b> 1310.71
240     *  <li> <b>Default Value:</b> 0
241     *  <li> <b>Units:</b> V
242     *  </ul>
243     *
244     * Default Rates:
245     *  <ul>
246     *  <li> <b>CAN:</b> 4.0 Hz
247     *  </ul>
248     *
249     * @return  PIDMotorVoltage_IntegratedAccum Status Signal Value object
250     */
251    private StatusSignalValue<Double> getPIDMotorVoltage_IntegratedAccum()
252    {
253        return super.lookupStatusSignalValue(SpnValue.PRO_PIDStateEnables_IntegratedAccum_V.value, Double.class, "PIDMotorVoltage_IntegratedAccum", true);
254    }
255    
256    /**
257     * Integrated Accumulator of PID controller when PID'ing under a
258     * TorqueCurrent Request
259     *
260     *  <ul>
261     *  <li> <b>Minimum Value:</b> -13107.2
262     *  <li> <b>Maximum Value:</b> 13107.1
263     *  <li> <b>Default Value:</b> 0
264     *  <li> <b>Units:</b> A
265     *  </ul>
266     *
267     * Default Rates:
268     *  <ul>
269     *  <li> <b>CAN:</b> 4.0 Hz
270     *  </ul>
271     *
272     * @return  PIDTorqueCurrent_IntegratedAccum Status Signal Value object
273     */
274    private StatusSignalValue<Double> getPIDTorqueCurrent_IntegratedAccum()
275    {
276        return super.lookupStatusSignalValue(SpnValue.PRO_PIDStateEnables_IntegratedAccum_A.value, Double.class, "PIDTorqueCurrent_IntegratedAccum", true);
277    }
278    
279    /**
280     * Feedforward passed to PID controller
281     *
282     *  <ul>
283     *  <li> <b>Minimum Value:</b> -2.0
284     *  <li> <b>Maximum Value:</b> 1.9990234375
285     *  <li> <b>Default Value:</b> 0
286     *  <li> <b>Units:</b> fractional
287     *  </ul>
288     *
289     * Default Rates:
290     *  <ul>
291     *  <li> <b>CAN:</b> 4.0 Hz
292     *  </ul>
293     *
294     * @return  PIDDutyCycle_FeedForward Status Signal Value object
295     */
296    private StatusSignalValue<Double> getPIDDutyCycle_FeedForward()
297    {
298        return super.lookupStatusSignalValue(SpnValue.PRO_PIDStateEnables_FeedForward_DC.value, Double.class, "PIDDutyCycle_FeedForward", true);
299    }
300    
301    /**
302     * Feedforward passed to PID controller
303     *
304     *  <ul>
305     *  <li> <b>Minimum Value:</b> -20.48
306     *  <li> <b>Maximum Value:</b> 20.47
307     *  <li> <b>Default Value:</b> 0
308     *  <li> <b>Units:</b> V
309     *  </ul>
310     *
311     * Default Rates:
312     *  <ul>
313     *  <li> <b>CAN:</b> 4.0 Hz
314     *  </ul>
315     *
316     * @return  PIDMotorVoltage_FeedForward Status Signal Value object
317     */
318    private StatusSignalValue<Double> getPIDMotorVoltage_FeedForward()
319    {
320        return super.lookupStatusSignalValue(SpnValue.PRO_PIDStateEnables_FeedForward_V.value, Double.class, "PIDMotorVoltage_FeedForward", true);
321    }
322    
323    /**
324     * Feedforward passed to PID controller
325     *
326     *  <ul>
327     *  <li> <b>Minimum Value:</b> -409.6
328     *  <li> <b>Maximum Value:</b> 409.40000000000003
329     *  <li> <b>Default Value:</b> 0
330     *  <li> <b>Units:</b> A
331     *  </ul>
332     *
333     * Default Rates:
334     *  <ul>
335     *  <li> <b>CAN:</b> 4.0 Hz
336     *  </ul>
337     *
338     * @return  PIDTorqueCurrent_FeedForward Status Signal Value object
339     */
340    private StatusSignalValue<Double> getPIDTorqueCurrent_FeedForward()
341    {
342        return super.lookupStatusSignalValue(SpnValue.PRO_PIDStateEnables_FeedForward_A.value, Double.class, "PIDTorqueCurrent_FeedForward", true);
343    }
344    
345    /**
346     * Derivative Output of PID controller when PID'ing under a DutyCycle
347     * Request
348     *
349     *  <ul>
350     *  <li> <b>Minimum Value:</b> -128.0
351     *  <li> <b>Maximum Value:</b> 127.9990234375
352     *  <li> <b>Default Value:</b> 0
353     *  <li> <b>Units:</b> fractional
354     *  </ul>
355     *
356     * Default Rates:
357     *  <ul>
358     *  <li> <b>CAN:</b> 4.0 Hz
359     *  </ul>
360     *
361     * @return  PIDDutyCycle_DerivativeOutput Status Signal Value object
362     */
363    private StatusSignalValue<Double> getPIDDutyCycle_DerivativeOutput()
364    {
365        return super.lookupStatusSignalValue(SpnValue.PRO_PIDOutput_DerivativeOutput_DC.value, Double.class, "PIDDutyCycle_DerivativeOutput", true);
366    }
367    
368    /**
369     * Derivative Output of PID controller when PID'ing under a Voltage
370     * Request
371     *
372     *  <ul>
373     *  <li> <b>Minimum Value:</b> -1310.72
374     *  <li> <b>Maximum Value:</b> 1310.71
375     *  <li> <b>Default Value:</b> 0
376     *  <li> <b>Units:</b> V
377     *  </ul>
378     *
379     * Default Rates:
380     *  <ul>
381     *  <li> <b>CAN:</b> 4.0 Hz
382     *  </ul>
383     *
384     * @return  PIDMotorVoltage_DerivativeOutput Status Signal Value object
385     */
386    private StatusSignalValue<Double> getPIDMotorVoltage_DerivativeOutput()
387    {
388        return super.lookupStatusSignalValue(SpnValue.PRO_PIDOutput_DerivativeOutput_V.value, Double.class, "PIDMotorVoltage_DerivativeOutput", true);
389    }
390    
391    /**
392     * Derivative Output of PID controller when PID'ing under a
393     * TorqueCurrent Request
394     *
395     *  <ul>
396     *  <li> <b>Minimum Value:</b> -13107.2
397     *  <li> <b>Maximum Value:</b> 13107.1
398     *  <li> <b>Default Value:</b> 0
399     *  <li> <b>Units:</b> A
400     *  </ul>
401     *
402     * Default Rates:
403     *  <ul>
404     *  <li> <b>CAN:</b> 4.0 Hz
405     *  </ul>
406     *
407     * @return  PIDTorqueCurrent_DerivativeOutput Status Signal Value object
408     */
409    private StatusSignalValue<Double> getPIDTorqueCurrent_DerivativeOutput()
410    {
411        return super.lookupStatusSignalValue(SpnValue.PRO_PIDOutput_DerivativeOutput_A.value, Double.class, "PIDTorqueCurrent_DerivativeOutput", true);
412    }
413    
414    /**
415     * Output of PID controller when PID'ing under a DutyCycle Request
416     *
417     *  <ul>
418     *  <li> <b>Minimum Value:</b> -128.0
419     *  <li> <b>Maximum Value:</b> 127.9990234375
420     *  <li> <b>Default Value:</b> 0
421     *  <li> <b>Units:</b> fractional
422     *  </ul>
423     *
424     * Default Rates:
425     *  <ul>
426     *  <li> <b>CAN:</b> 4.0 Hz
427     *  </ul>
428     *
429     * @return  PIDDutyCycle_Output Status Signal Value object
430     */
431    private StatusSignalValue<Double> getPIDDutyCycle_Output()
432    {
433        return super.lookupStatusSignalValue(SpnValue.PRO_PIDOutput_Output_DC.value, Double.class, "PIDDutyCycle_Output", true);
434    }
435    
436    /**
437     * Output of PID controller when PID'ing under a Voltage Request
438     *
439     *  <ul>
440     *  <li> <b>Minimum Value:</b> -1310.72
441     *  <li> <b>Maximum Value:</b> 1310.71
442     *  <li> <b>Default Value:</b> 0
443     *  <li> <b>Units:</b> V
444     *  </ul>
445     *
446     * Default Rates:
447     *  <ul>
448     *  <li> <b>CAN:</b> 4.0 Hz
449     *  </ul>
450     *
451     * @return  PIDMotorVoltage_Output Status Signal Value object
452     */
453    private StatusSignalValue<Double> getPIDMotorVoltage_Output()
454    {
455        return super.lookupStatusSignalValue(SpnValue.PRO_PIDOutput_Output_V.value, Double.class, "PIDMotorVoltage_Output", true);
456    }
457    
458    /**
459     * Output of PID controller when PID'ing under a TorqueCurrent Request
460     *
461     *  <ul>
462     *  <li> <b>Minimum Value:</b> -13107.2
463     *  <li> <b>Maximum Value:</b> 13107.1
464     *  <li> <b>Default Value:</b> 0
465     *  <li> <b>Units:</b> A
466     *  </ul>
467     *
468     * Default Rates:
469     *  <ul>
470     *  <li> <b>CAN:</b> 4.0 Hz
471     *  </ul>
472     *
473     * @return  PIDTorqueCurrent_Output Status Signal Value object
474     */
475    private StatusSignalValue<Double> getPIDTorqueCurrent_Output()
476    {
477        return super.lookupStatusSignalValue(SpnValue.PRO_PIDOutput_Output_A.value, Double.class, "PIDTorqueCurrent_Output", true);
478    }
479    
480    /**
481     * Input position of PID controller when PID'ing to a position
482     *
483     *  <ul>
484     *  <li> <b>Minimum Value:</b> -10000
485     *  <li> <b>Maximum Value:</b> 10000
486     *  <li> <b>Default Value:</b> 0
487     *  <li> <b>Units:</b> rotations
488     *  </ul>
489     *
490     * Default Rates:
491     *  <ul>
492     *  <li> <b>CAN:</b> 4.0 Hz
493     *  </ul>
494     *
495     * @return  PIDPosition_Reference Status Signal Value object
496     */
497    private StatusSignalValue<Double> getPIDPosition_Reference()
498    {
499        return super.lookupStatusSignalValue(SpnValue.PRO_PIDRefPIDErr_PIDRef_Position.value, Double.class, "PIDPosition_Reference", true);
500    }
501    
502    /**
503     * Input velocity of PID controller when PID'ing to a velocity
504     *
505     *  <ul>
506     *  <li> <b>Minimum Value:</b> -10000
507     *  <li> <b>Maximum Value:</b> 10000
508     *  <li> <b>Default Value:</b> 0
509     *  <li> <b>Units:</b> rotations per second
510     *  </ul>
511     *
512     * Default Rates:
513     *  <ul>
514     *  <li> <b>CAN:</b> 4.0 Hz
515     *  </ul>
516     *
517     * @return  PIDVelocity_Reference Status Signal Value object
518     */
519    private StatusSignalValue<Double> getPIDVelocity_Reference()
520    {
521        return super.lookupStatusSignalValue(SpnValue.PRO_PIDRefPIDErr_PIDRef_Velocity.value, Double.class, "PIDVelocity_Reference", true);
522    }
523    
524    /**
525     * Change in input (velocity) of PID controller when PID'ing to a
526     * position
527     *
528     *  <ul>
529     *  <li> <b>Minimum Value:</b> -512.0
530     *  <li> <b>Maximum Value:</b> 511.984375
531     *  <li> <b>Default Value:</b> 0
532     *  <li> <b>Units:</b> rotations per second
533     *  </ul>
534     *
535     * Default Rates:
536     *  <ul>
537     *  <li> <b>CAN:</b> 4.0 Hz
538     *  </ul>
539     *
540     * @return  PIDPosition_ReferenceSlope Status Signal Value object
541     */
542    private StatusSignalValue<Double> getPIDPosition_ReferenceSlope()
543    {
544        return super.lookupStatusSignalValue(SpnValue.PRO_PIDRefSlopeECUTime_ReferenceSlope_Position.value, Double.class, "PIDPosition_ReferenceSlope", true);
545    }
546    
547    /**
548     * Change in input (acceleration) of PID controller when PID'ing to a
549     * velocity
550     *
551     *  <ul>
552     *  <li> <b>Minimum Value:</b> -512.0
553     *  <li> <b>Maximum Value:</b> 511.984375
554     *  <li> <b>Default Value:</b> 0
555     *  <li> <b>Units:</b> rotations per second²
556     *  </ul>
557     *
558     * Default Rates:
559     *  <ul>
560     *  <li> <b>CAN:</b> 4.0 Hz
561     *  </ul>
562     *
563     * @return  PIDVelocity_ReferenceSlope Status Signal Value object
564     */
565    private StatusSignalValue<Double> getPIDVelocity_ReferenceSlope()
566    {
567        return super.lookupStatusSignalValue(SpnValue.PRO_PIDRefSlopeECUTime_ReferenceSlope_Velocity.value, Double.class, "PIDVelocity_ReferenceSlope", true);
568    }
569    
570    /**
571     * The difference between target position and current position
572     *
573     *  <ul>
574     *  <li> <b>Minimum Value:</b> -10000
575     *  <li> <b>Maximum Value:</b> 10000
576     *  <li> <b>Default Value:</b> 0
577     *  <li> <b>Units:</b> rotations
578     *  </ul>
579     *
580     * Default Rates:
581     *  <ul>
582     *  <li> <b>CAN:</b> 4.0 Hz
583     *  </ul>
584     *
585     * @return  PIDPosition_ClosedLoopError Status Signal Value object
586     */
587    private StatusSignalValue<Double> getPIDPosition_ClosedLoopError()
588    {
589        return super.lookupStatusSignalValue(SpnValue.PRO_PIDRefPIDErr_PIDErr_Position.value, Double.class, "PIDPosition_ClosedLoopError", true);
590    }
591    
592    /**
593     * The difference between target velocity and current velocity
594     *
595     *  <ul>
596     *  <li> <b>Minimum Value:</b> -10000
597     *  <li> <b>Maximum Value:</b> 10000
598     *  <li> <b>Default Value:</b> 0
599     *  <li> <b>Units:</b> rotations per second
600     *  </ul>
601     *
602     * Default Rates:
603     *  <ul>
604     *  <li> <b>CAN:</b> 4.0 Hz
605     *  </ul>
606     *
607     * @return  PIDVelocity_ClosedLoopError Status Signal Value object
608     */
609    private StatusSignalValue<Double> getPIDVelocity_ClosedLoopError()
610    {
611        return super.lookupStatusSignalValue(SpnValue.PRO_PIDRefPIDErr_PIDErr_Velocity.value, Double.class, "PIDVelocity_ClosedLoopError", true);
612    }
613
614    /**
615     * Constructs a new Talon FX motor controller object.
616     * <p>
617     * Constructs the device using the default CAN bus for the system:
618     * <ul>
619     *   <li>"rio" on roboRIO
620     *   <li>"can0" on Linux
621     *   <li>"*" on Windows
622     * </ul>
623     *
624     * @param deviceId    ID of the device, as configured in Phoenix Tuner.
625     *
626     * @deprecated Classes in the phoenixpro package will be removed in 2024.
627     *             Users should instead use classes from the phoenix6 package.
628     */
629    @Deprecated(forRemoval = true)
630    public CoreTalonFX(int deviceId)
631    {
632        this(deviceId, "");
633    }
634    /**
635     * Constructs a new Talon FX motor controller object.
636     *
637     * @param deviceId    ID of the device, as configured in Phoenix Tuner.
638     * @param canbus      Name of the CAN bus this device is on. Possible CAN bus strings are:
639     *                    <ul>
640     *                      <li>"rio" for the native roboRIO CAN bus
641     *                      <li>CANivore name or serial number
642     *                      <li>SocketCAN interface (non-FRC Linux only)
643     *                      <li>"*" for any CANivore seen by the program
644     *                      <li>empty string (default) to select the default for the system:
645     *                      <ul>
646     *                        <li>"rio" on roboRIO
647     *                        <li>"can0" on Linux
648     *                        <li>"*" on Windows
649     *                      </ul>
650     *                    </ul>
651     *
652     * @deprecated Classes in the phoenixpro package will be removed in 2024.
653     *             Users should instead use classes from the phoenix6 package.
654     */
655    @Deprecated(forRemoval = true)
656    public CoreTalonFX(int deviceId, String canbus)
657    {
658        super(deviceId, "talon fx", canbus);
659        _configurator = new TalonFXConfigurator(this.deviceIdentifier);
660        _version = getVersion();
661        _resetFlags = lookupStatusSignalValue(
662                SpnValue.Startup_ResetFlags.value,
663                Integer.class,
664                "ResetFlags",
665                false);
666        PlatformJNI.JNI_SimCreate(DeviceType.PRO_TalonFXType.value, deviceId);
667    }
668
669
670    /**
671     * @return true if device has reset since the previous call of this routine.
672     */
673    public boolean hasResetOccurred() {
674        boolean retval = false;
675
676        /* did we receive an update */
677        _resetFlags.refresh(false);
678        final var timestamp = _resetFlags.getAllTimestamps().getSystemTimestamp();
679        if (timestamp.isValid()) {
680            /* if the update timestamp is new, then the startup frame was sent, indicating a reset occured */
681            if (_resetTimestamp != timestamp.getTime()) {
682                _resetTimestamp = timestamp.getTime();
683                retval = true;
684            }
685        }
686        return retval;
687    }
688
689    /**
690     * Gets the configurator to use with this device's configs
691     *
692     * @return Configurator for this object
693     */
694    public TalonFXConfigurator getConfigurator()
695    {
696        return this._configurator;
697    }
698
699
700    private TalonFXSimState _simState = null;
701    /**
702     * Get the simulation state for this device.
703     * <p>
704     * This function reuses an allocated simulation state
705     * object, so it is safe to call this function multiple
706     * times in a robot loop.
707     *
708     * @return Simulation state
709     */
710    public TalonFXSimState getSimState() {
711        if (_simState == null)
712            _simState = new TalonFXSimState(this);
713        return _simState;
714    }
715
716
717    
718    /**
719     * App Major Version number.
720     *
721     *  <ul>
722     *  <li> <b>Minimum Value:</b> 0
723     *  <li> <b>Maximum Value:</b> 255
724     *  <li> <b>Default Value:</b> 0
725     *  <li> <b>Units:</b> 
726     *  </ul>
727     *
728     * Default Rates:
729     *  <ul>
730     *  <li> <b>CAN:</b> 4.0 Hz
731     *  </ul>
732     *
733     * @return  VersionMajor Status Signal Value object
734     */
735    public StatusSignalValue<Integer> getVersionMajor()
736    {
737        return super.lookupStatusSignalValue(SpnValue.Version_Major.value, Integer.class, "VersionMajor", false);
738    }
739    
740    /**
741     * App Minor Version number.
742     *
743     *  <ul>
744     *  <li> <b>Minimum Value:</b> 0
745     *  <li> <b>Maximum Value:</b> 255
746     *  <li> <b>Default Value:</b> 0
747     *  <li> <b>Units:</b> 
748     *  </ul>
749     *
750     * Default Rates:
751     *  <ul>
752     *  <li> <b>CAN:</b> 4.0 Hz
753     *  </ul>
754     *
755     * @return  VersionMinor Status Signal Value object
756     */
757    public StatusSignalValue<Integer> getVersionMinor()
758    {
759        return super.lookupStatusSignalValue(SpnValue.Version_Minor.value, Integer.class, "VersionMinor", false);
760    }
761    
762    /**
763     * App Bugfix Version number.
764     *
765     *  <ul>
766     *  <li> <b>Minimum Value:</b> 0
767     *  <li> <b>Maximum Value:</b> 255
768     *  <li> <b>Default Value:</b> 0
769     *  <li> <b>Units:</b> 
770     *  </ul>
771     *
772     * Default Rates:
773     *  <ul>
774     *  <li> <b>CAN:</b> 4.0 Hz
775     *  </ul>
776     *
777     * @return  VersionBugfix Status Signal Value object
778     */
779    public StatusSignalValue<Integer> getVersionBugfix()
780    {
781        return super.lookupStatusSignalValue(SpnValue.Version_Bugfix.value, Integer.class, "VersionBugfix", false);
782    }
783    
784    /**
785     * App Build Version number.
786     *
787     *  <ul>
788     *  <li> <b>Minimum Value:</b> 0
789     *  <li> <b>Maximum Value:</b> 255
790     *  <li> <b>Default Value:</b> 0
791     *  <li> <b>Units:</b> 
792     *  </ul>
793     *
794     * Default Rates:
795     *  <ul>
796     *  <li> <b>CAN:</b> 4.0 Hz
797     *  </ul>
798     *
799     * @return  VersionBuild Status Signal Value object
800     */
801    public StatusSignalValue<Integer> getVersionBuild()
802    {
803        return super.lookupStatusSignalValue(SpnValue.Version_Build.value, Integer.class, "VersionBuild", false);
804    }
805    
806    /**
807     * Full Version.  The format is a four byte value.
808     * <p>
809     * Full Version of firmware in device. The format is a four byte
810     * value.
811     *
812     *  <ul>
813     *  <li> <b>Minimum Value:</b> 0
814     *  <li> <b>Maximum Value:</b> 4294967295
815     *  <li> <b>Default Value:</b> 0
816     *  <li> <b>Units:</b> 
817     *  </ul>
818     *
819     * Default Rates:
820     *  <ul>
821     *  <li> <b>CAN:</b> 4.0 Hz
822     *  </ul>
823     *
824     * @return  Version Status Signal Value object
825     */
826    public StatusSignalValue<Integer> getVersion()
827    {
828        return super.lookupStatusSignalValue(SpnValue.Version_Full.value, Integer.class, "Version", false);
829    }
830    
831    /**
832     * Integer representing all faults
833     * <p>
834     * This returns the fault flags reported by the device. These are
835     * device specific and are not used directly in typical applications.
836     * Use the signal specific GetFault_*() methods instead.  
837     *
838     *  <ul>
839     *  <li> <b>Minimum Value:</b> 0
840     *  <li> <b>Maximum Value:</b> 1048575
841     *  <li> <b>Default Value:</b> 0
842     *  <li> <b>Units:</b> 
843     *  </ul>
844     *
845     * Default Rates:
846     *  <ul>
847     *  <li> <b>CAN:</b> 4.0 Hz
848     *  </ul>
849     *
850     * @return  FaultField Status Signal Value object
851     */
852    public StatusSignalValue<Integer> getFaultField()
853    {
854        return super.lookupStatusSignalValue(SpnValue.AllFaults.value, Integer.class, "FaultField", true);
855    }
856    
857    /**
858     * Integer representing all sticky faults
859     * <p>
860     * This returns the persistent "sticky" fault flags reported by the
861     * device. These are device specific and are not used directly in
862     * typical applications. Use the signal specific GetStickyFault_*()
863     * methods instead.  
864     *
865     *  <ul>
866     *  <li> <b>Minimum Value:</b> 0
867     *  <li> <b>Maximum Value:</b> 1048575
868     *  <li> <b>Default Value:</b> 0
869     *  <li> <b>Units:</b> 
870     *  </ul>
871     *
872     * Default Rates:
873     *  <ul>
874     *  <li> <b>CAN:</b> 4.0 Hz
875     *  </ul>
876     *
877     * @return  StickyFaultField Status Signal Value object
878     */
879    public StatusSignalValue<Integer> getStickyFaultField()
880    {
881        return super.lookupStatusSignalValue(SpnValue.AllStickyFaults.value, Integer.class, "StickyFaultField", true);
882    }
883    
884    /**
885     * Forward Limit Pin.
886     *
887     *
888     * Default Rates:
889     *  <ul>
890     *  <li> <b>CAN:</b> 100.0 Hz
891     *  </ul>
892     *
893     * @return  ForwardLimit Status Signal Value object
894     */
895    public StatusSignalValue<ForwardLimitValue> getForwardLimit()
896    {
897        return super.lookupStatusSignalValue(SpnValue.ForwardLimit.value, ForwardLimitValue.class, "ForwardLimit", true);
898    }
899    
900    /**
901     * Reverse Limit Pin.
902     *
903     *
904     * Default Rates:
905     *  <ul>
906     *  <li> <b>CAN:</b> 100.0 Hz
907     *  </ul>
908     *
909     * @return  ReverseLimit Status Signal Value object
910     */
911    public StatusSignalValue<ReverseLimitValue> getReverseLimit()
912    {
913        return super.lookupStatusSignalValue(SpnValue.ReverseLimit.value, ReverseLimitValue.class, "ReverseLimit", true);
914    }
915    
916    /**
917     * The applied rotor polarity.  This typically is determined by the
918     * Inverted config, but can be overridden if using Follower features.
919     *
920     *
921     * Default Rates:
922     *  <ul>
923     *  <li> <b>CAN:</b> 100.0 Hz
924     *  </ul>
925     *
926     * @return  AppliedRotorPolarity Status Signal Value object
927     */
928    public StatusSignalValue<AppliedRotorPolarityValue> getAppliedRotorPolarity()
929    {
930        return super.lookupStatusSignalValue(SpnValue.PRO_MotorOutput_RotorPolarity.value, AppliedRotorPolarityValue.class, "AppliedRotorPolarity", true);
931    }
932    
933    /**
934     * The applied motor duty cycle.
935     *
936     *  <ul>
937     *  <li> <b>Minimum Value:</b> -2.0
938     *  <li> <b>Maximum Value:</b> 1.9990234375
939     *  <li> <b>Default Value:</b> 0
940     *  <li> <b>Units:</b> fractional
941     *  </ul>
942     *
943     * Default Rates:
944     *  <ul>
945     *  <li> <b>CAN:</b> 100.0 Hz
946     *  </ul>
947     *
948     * @return  DutyCycle Status Signal Value object
949     */
950    public StatusSignalValue<Double> getDutyCycle()
951    {
952        return super.lookupStatusSignalValue(SpnValue.PRO_MotorOutput_DutyCycle.value, Double.class, "DutyCycle", true);
953    }
954    
955    /**
956     * Current corresponding to the torque output by the motor. Similar to
957     * StatorCurrent. Users will likely prefer this current to calculate
958     * the applied torque to the rotor.
959     * <p>
960     * Stator current where positive current means torque is applied in
961     * the forward direction as determined by the Inverted setting
962     *
963     *  <ul>
964     *  <li> <b>Minimum Value:</b> -327.68
965     *  <li> <b>Maximum Value:</b> 327.67
966     *  <li> <b>Default Value:</b> 0
967     *  <li> <b>Units:</b> A
968     *  </ul>
969     *
970     * Default Rates:
971     *  <ul>
972     *  <li> <b>CAN:</b> 100.0 Hz
973     *  </ul>
974     *
975     * @return  TorqueCurrent Status Signal Value object
976     */
977    public StatusSignalValue<Double> getTorqueCurrent()
978    {
979        return super.lookupStatusSignalValue(SpnValue.PRO_MotorOutput_TorqueCurrent.value, Double.class, "TorqueCurrent", true);
980    }
981    
982    /**
983     * Current corresponding to the stator windings. Similar to
984     * TorqueCurrent. Users will likely prefer TorqueCurrent over
985     * StatorCurrent.
986     * <p>
987     * Stator current where Positive current indicates motoring regardless
988     * of direction. Negative current indicates regenerative braking
989     * regardless of direction.
990     *
991     *  <ul>
992     *  <li> <b>Minimum Value:</b> -327.68
993     *  <li> <b>Maximum Value:</b> 327.67
994     *  <li> <b>Default Value:</b> 0
995     *  <li> <b>Units:</b> A
996     *  </ul>
997     *
998     * Default Rates:
999     *  <ul>
1000     *  <li> <b>CAN 2.0:</b> 5.0 Hz
1001     *  <li> <b>CAN FD:</b> 100.0 Hz
1002     *  </ul>
1003     *
1004     * @return  StatorCurrent Status Signal Value object
1005     */
1006    public StatusSignalValue<Double> getStatorCurrent()
1007    {
1008        return super.lookupStatusSignalValue(SpnValue.PRO_SupplyAndTemp_StatorCurrent.value, Double.class, "StatorCurrent", true);
1009    }
1010    
1011    /**
1012     * Measured supply side current
1013     *
1014     *  <ul>
1015     *  <li> <b>Minimum Value:</b> -327.68
1016     *  <li> <b>Maximum Value:</b> 327.67
1017     *  <li> <b>Default Value:</b> 0
1018     *  <li> <b>Units:</b> A
1019     *  </ul>
1020     *
1021     * Default Rates:
1022     *  <ul>
1023     *  <li> <b>CAN 2.0:</b> 5.0 Hz
1024     *  <li> <b>CAN FD:</b> 100.0 Hz
1025     *  </ul>
1026     *
1027     * @return  SupplyCurrent Status Signal Value object
1028     */
1029    public StatusSignalValue<Double> getSupplyCurrent()
1030    {
1031        return super.lookupStatusSignalValue(SpnValue.PRO_SupplyAndTemp_SupplyCurrent.value, Double.class, "SupplyCurrent", true);
1032    }
1033    
1034    /**
1035     * Measured supply voltage to the TalonFX.
1036     *
1037     *  <ul>
1038     *  <li> <b>Minimum Value:</b> 4.0
1039     *  <li> <b>Maximum Value:</b> 16.75
1040     *  <li> <b>Default Value:</b> 4
1041     *  <li> <b>Units:</b> V
1042     *  </ul>
1043     *
1044     * Default Rates:
1045     *  <ul>
1046     *  <li> <b>CAN 2.0:</b> 5.0 Hz
1047     *  <li> <b>CAN FD:</b> 100.0 Hz
1048     *  </ul>
1049     *
1050     * @return  SupplyVoltage Status Signal Value object
1051     */
1052    public StatusSignalValue<Double> getSupplyVoltage()
1053    {
1054        return super.lookupStatusSignalValue(SpnValue.PRO_SupplyAndTemp_SupplyVoltage.value, Double.class, "SupplyVoltage", true);
1055    }
1056    
1057    /**
1058     * Temperature of device
1059     * <p>
1060     * This is the temperature that the device measures itself to be at.
1061     * Similar to Processor Temperature.
1062     *
1063     *  <ul>
1064     *  <li> <b>Minimum Value:</b> 0.0
1065     *  <li> <b>Maximum Value:</b> 255.0
1066     *  <li> <b>Default Value:</b> 0
1067     *  <li> <b>Units:</b> ℃
1068     *  </ul>
1069     *
1070     * Default Rates:
1071     *  <ul>
1072     *  <li> <b>CAN 2.0:</b> 5.0 Hz
1073     *  <li> <b>CAN FD:</b> 100.0 Hz
1074     *  </ul>
1075     *
1076     * @return  DeviceTemp Status Signal Value object
1077     */
1078    public StatusSignalValue<Double> getDeviceTemp()
1079    {
1080        return super.lookupStatusSignalValue(SpnValue.PRO_SupplyAndTemp_DeviceTemp.value, Double.class, "DeviceTemp", true);
1081    }
1082    
1083    /**
1084     * Temperature of the processor
1085     * <p>
1086     * This is the temperature that the processor measures itself to be
1087     * at. Similar to Device Temperature.
1088     *
1089     *  <ul>
1090     *  <li> <b>Minimum Value:</b> 0.0
1091     *  <li> <b>Maximum Value:</b> 255.0
1092     *  <li> <b>Default Value:</b> 0
1093     *  <li> <b>Units:</b> ℃
1094     *  </ul>
1095     *
1096     * Default Rates:
1097     *  <ul>
1098     *  <li> <b>CAN 2.0:</b> 5.0 Hz
1099     *  <li> <b>CAN FD:</b> 100.0 Hz
1100     *  </ul>
1101     *
1102     * @return  ProcessorTemp Status Signal Value object
1103     */
1104    public StatusSignalValue<Double> getProcessorTemp()
1105    {
1106        return super.lookupStatusSignalValue(SpnValue.PRO_SupplyAndTemp_ProcessorTemp.value, Double.class, "ProcessorTemp", true);
1107    }
1108    
1109    /**
1110     * Velocity of motor rotor.
1111     *
1112     *  <ul>
1113     *  <li> <b>Minimum Value:</b> -512.0
1114     *  <li> <b>Maximum Value:</b> 511.998046875
1115     *  <li> <b>Default Value:</b> 0
1116     *  <li> <b>Units:</b> rotations per second
1117     *  </ul>
1118     *
1119     * Default Rates:
1120     *  <ul>
1121     *  <li> <b>CAN 2.0:</b> 5.0 Hz
1122     *  <li> <b>CAN FD:</b> 100.0 Hz
1123     *  </ul>
1124     *
1125     * @return  RotorVelocity Status Signal Value object
1126     */
1127    public StatusSignalValue<Double> getRotorVelocity()
1128    {
1129        return super.lookupStatusSignalValue(SpnValue.PRO_RotorPosAndVel_Velocity.value, Double.class, "RotorVelocity", true);
1130    }
1131    
1132    /**
1133     * Position of motor rotor.
1134     *
1135     *  <ul>
1136     *  <li> <b>Minimum Value:</b> -16384.0
1137     *  <li> <b>Maximum Value:</b> 16383.999755859375
1138     *  <li> <b>Default Value:</b> 0
1139     *  <li> <b>Units:</b> rotations
1140     *  </ul>
1141     *
1142     * Default Rates:
1143     *  <ul>
1144     *  <li> <b>CAN 2.0:</b> 5.0 Hz
1145     *  <li> <b>CAN FD:</b> 100.0 Hz
1146     *  </ul>
1147     *
1148     * @return  RotorPosition Status Signal Value object
1149     */
1150    public StatusSignalValue<Double> getRotorPosition()
1151    {
1152        return super.lookupStatusSignalValue(SpnValue.PRO_RotorPosAndVel_Position.value, Double.class, "RotorPosition", true);
1153    }
1154    
1155    /**
1156     * Velocity of device.
1157     *
1158     *  <ul>
1159     *  <li> <b>Minimum Value:</b> -512.0
1160     *  <li> <b>Maximum Value:</b> 511.998046875
1161     *  <li> <b>Default Value:</b> 0
1162     *  <li> <b>Units:</b> rotations per second
1163     *  </ul>
1164     *
1165     * Default Rates:
1166     *  <ul>
1167     *  <li> <b>CAN 2.0:</b> 50.0 Hz
1168     *  <li> <b>CAN FD:</b> 100.0 Hz
1169     *  </ul>
1170     *
1171     * @return  Velocity Status Signal Value object
1172     */
1173    public StatusSignalValue<Double> getVelocity()
1174    {
1175        return super.lookupStatusSignalValue(SpnValue.PRO_PosAndVel_Velocity.value, Double.class, "Velocity", true);
1176    }
1177    
1178    /**
1179     * Position of device.
1180     *
1181     *  <ul>
1182     *  <li> <b>Minimum Value:</b> -16384.0
1183     *  <li> <b>Maximum Value:</b> 16383.999755859375
1184     *  <li> <b>Default Value:</b> 0
1185     *  <li> <b>Units:</b> rotations
1186     *  </ul>
1187     *
1188     * Default Rates:
1189     *  <ul>
1190     *  <li> <b>CAN 2.0:</b> 50.0 Hz
1191     *  <li> <b>CAN FD:</b> 100.0 Hz
1192     *  </ul>
1193     *
1194     * @return  Position Status Signal Value object
1195     */
1196    public StatusSignalValue<Double> getPosition()
1197    {
1198        return super.lookupStatusSignalValue(SpnValue.PRO_PosAndVel_Position.value, Double.class, "Position", true);
1199    }
1200    
1201    /**
1202     * The active control mode of the motor controller
1203     *
1204     *
1205     * Default Rates:
1206     *  <ul>
1207     *  <li> <b>CAN 2.0:</b> 5.0 Hz
1208     *  <li> <b>CAN FD:</b> 100.0 Hz
1209     *  </ul>
1210     *
1211     * @return  ControlMode Status Signal Value object
1212     */
1213    public StatusSignalValue<ControlModeValue> getControlMode()
1214    {
1215        return super.lookupStatusSignalValue(SpnValue.TalonFX_ControlMode.value, ControlModeValue.class, "ControlMode", true);
1216    }
1217    
1218    /**
1219     * Check if Motion Magic® is running.  This is equivalent to checking
1220     * that the reported control mode is a Motion Magic® based mode.
1221     *
1222     *
1223     * Default Rates:
1224     *  <ul>
1225     *  <li> <b>CAN 2.0:</b> 5.0 Hz
1226     *  <li> <b>CAN FD:</b> 100.0 Hz
1227     *  </ul>
1228     *
1229     * @return  MotionMagicIsRunning Status Signal Value object
1230     */
1231    public StatusSignalValue<MotionMagicIsRunningValue> getMotionMagicIsRunning()
1232    {
1233        return super.lookupStatusSignalValue(SpnValue.PRO_PIDStateEnables_IsMotionMagicRunning.value, MotionMagicIsRunningValue.class, "MotionMagicIsRunning", true);
1234    }
1235    
1236    /**
1237     * Indicates if device is actuator enabled.
1238     *
1239     *
1240     * Default Rates:
1241     *  <ul>
1242     *  <li> <b>CAN 2.0:</b> 5.0 Hz
1243     *  <li> <b>CAN FD:</b> 100.0 Hz
1244     *  </ul>
1245     *
1246     * @return  DeviceEnable Status Signal Value object
1247     */
1248    public StatusSignalValue<DeviceEnableValue> getDeviceEnable()
1249    {
1250        return super.lookupStatusSignalValue(SpnValue.PRO_PIDStateEnables_DeviceEnable.value, DeviceEnableValue.class, "DeviceEnable", true);
1251    }
1252    
1253    /**
1254     * Closed loop slot in use
1255     * <p>
1256     * This is the slot that the closed loop PID is using.
1257     *
1258     *  <ul>
1259     *  <li> <b>Minimum Value:</b> 0
1260     *  <li> <b>Maximum Value:</b> 2
1261     *  <li> <b>Default Value:</b> 0
1262     *  <li> <b>Units:</b> 
1263     *  </ul>
1264     *
1265     * Default Rates:
1266     *  <ul>
1267     *  <li> <b>CAN 2.0:</b> 5.0 Hz
1268     *  <li> <b>CAN FD:</b> 100.0 Hz
1269     *  </ul>
1270     *
1271     * @return  ClosedLoopSlot Status Signal Value object
1272     */
1273    public StatusSignalValue<Integer> getClosedLoopSlot()
1274    {
1275        return super.lookupStatusSignalValue(SpnValue.PRO_PIDOutput_Slot.value, Integer.class, "ClosedLoopSlot", true);
1276    }
1277    
1278    /**
1279     * The applied output of the bridge.
1280     *
1281     *
1282     * Default Rates:
1283     *  <ul>
1284     *  <li> <b>CAN:</b> 100.0 Hz
1285     *  </ul>
1286     *
1287     * @return  BridgeOuput Status Signal Value object
1288     */
1289    public StatusSignalValue<BridgeOuputValue> getBridgeOuput()
1290    {
1291        return super.lookupStatusSignalValue(SpnValue.PRO_MotorOutput_BridgeType_Public.value, BridgeOuputValue.class, "BridgeOuput", true);
1292    }
1293    
1294    /**
1295     * Hardware fault occurred
1296     *
1297     *  <ul>
1298     *  <li> <b>Default Value:</b> False
1299     *  </ul>
1300     *
1301     * Default Rates:
1302     *  <ul>
1303     *  <li> <b>CAN:</b> 4.0 Hz
1304     *  </ul>
1305     *
1306     * @return  Fault_Hardware Status Signal Value object
1307     */
1308    public StatusSignalValue<Boolean> getFault_Hardware()
1309    {
1310        return super.lookupStatusSignalValue(SpnValue.Fault_Hardware.value, Boolean.class, "Fault_Hardware", true);
1311    }
1312    
1313    /**
1314     * Hardware fault occurred
1315     *
1316     *  <ul>
1317     *  <li> <b>Default Value:</b> False
1318     *  </ul>
1319     *
1320     * Default Rates:
1321     *  <ul>
1322     *  <li> <b>CAN:</b> 4.0 Hz
1323     *  </ul>
1324     *
1325     * @return  StickyFault_Hardware Status Signal Value object
1326     */
1327    public StatusSignalValue<Boolean> getStickyFault_Hardware()
1328    {
1329        return super.lookupStatusSignalValue(SpnValue.StickyFault_Hardware.value, Boolean.class, "StickyFault_Hardware", true);
1330    }
1331    
1332    /**
1333     * Processor temperature exceeded limit
1334     *
1335     *  <ul>
1336     *  <li> <b>Default Value:</b> False
1337     *  </ul>
1338     *
1339     * Default Rates:
1340     *  <ul>
1341     *  <li> <b>CAN:</b> 4.0 Hz
1342     *  </ul>
1343     *
1344     * @return  Fault_ProcTemp Status Signal Value object
1345     */
1346    public StatusSignalValue<Boolean> getFault_ProcTemp()
1347    {
1348        return super.lookupStatusSignalValue(SpnValue.Fault_ProcTemp.value, Boolean.class, "Fault_ProcTemp", true);
1349    }
1350    
1351    /**
1352     * Processor temperature exceeded limit
1353     *
1354     *  <ul>
1355     *  <li> <b>Default Value:</b> False
1356     *  </ul>
1357     *
1358     * Default Rates:
1359     *  <ul>
1360     *  <li> <b>CAN:</b> 4.0 Hz
1361     *  </ul>
1362     *
1363     * @return  StickyFault_ProcTemp Status Signal Value object
1364     */
1365    public StatusSignalValue<Boolean> getStickyFault_ProcTemp()
1366    {
1367        return super.lookupStatusSignalValue(SpnValue.StickyFault_ProcTemp.value, Boolean.class, "StickyFault_ProcTemp", true);
1368    }
1369    
1370    /**
1371     * Device temperature exceeded limit
1372     *
1373     *  <ul>
1374     *  <li> <b>Default Value:</b> False
1375     *  </ul>
1376     *
1377     * Default Rates:
1378     *  <ul>
1379     *  <li> <b>CAN:</b> 4.0 Hz
1380     *  </ul>
1381     *
1382     * @return  Fault_DeviceTemp Status Signal Value object
1383     */
1384    public StatusSignalValue<Boolean> getFault_DeviceTemp()
1385    {
1386        return super.lookupStatusSignalValue(SpnValue.Fault_DeviceTemp.value, Boolean.class, "Fault_DeviceTemp", true);
1387    }
1388    
1389    /**
1390     * Device temperature exceeded limit
1391     *
1392     *  <ul>
1393     *  <li> <b>Default Value:</b> False
1394     *  </ul>
1395     *
1396     * Default Rates:
1397     *  <ul>
1398     *  <li> <b>CAN:</b> 4.0 Hz
1399     *  </ul>
1400     *
1401     * @return  StickyFault_DeviceTemp Status Signal Value object
1402     */
1403    public StatusSignalValue<Boolean> getStickyFault_DeviceTemp()
1404    {
1405        return super.lookupStatusSignalValue(SpnValue.StickyFault_DeviceTemp.value, Boolean.class, "StickyFault_DeviceTemp", true);
1406    }
1407    
1408    /**
1409     * Device supply voltage dropped to near brownout levels
1410     *
1411     *  <ul>
1412     *  <li> <b>Default Value:</b> False
1413     *  </ul>
1414     *
1415     * Default Rates:
1416     *  <ul>
1417     *  <li> <b>CAN:</b> 4.0 Hz
1418     *  </ul>
1419     *
1420     * @return  Fault_Undervoltage Status Signal Value object
1421     */
1422    public StatusSignalValue<Boolean> getFault_Undervoltage()
1423    {
1424        return super.lookupStatusSignalValue(SpnValue.Fault_Undervoltage.value, Boolean.class, "Fault_Undervoltage", true);
1425    }
1426    
1427    /**
1428     * Device supply voltage dropped to near brownout levels
1429     *
1430     *  <ul>
1431     *  <li> <b>Default Value:</b> False
1432     *  </ul>
1433     *
1434     * Default Rates:
1435     *  <ul>
1436     *  <li> <b>CAN:</b> 4.0 Hz
1437     *  </ul>
1438     *
1439     * @return  StickyFault_Undervoltage Status Signal Value object
1440     */
1441    public StatusSignalValue<Boolean> getStickyFault_Undervoltage()
1442    {
1443        return super.lookupStatusSignalValue(SpnValue.StickyFault_Undervoltage.value, Boolean.class, "StickyFault_Undervoltage", true);
1444    }
1445    
1446    /**
1447     * Device boot while detecting the enable signal
1448     *
1449     *  <ul>
1450     *  <li> <b>Default Value:</b> False
1451     *  </ul>
1452     *
1453     * Default Rates:
1454     *  <ul>
1455     *  <li> <b>CAN:</b> 4.0 Hz
1456     *  </ul>
1457     *
1458     * @return  Fault_BootDuringEnable Status Signal Value object
1459     */
1460    public StatusSignalValue<Boolean> getFault_BootDuringEnable()
1461    {
1462        return super.lookupStatusSignalValue(SpnValue.Fault_BootDuringEnable.value, Boolean.class, "Fault_BootDuringEnable", true);
1463    }
1464    
1465    /**
1466     * Device boot while detecting the enable signal
1467     *
1468     *  <ul>
1469     *  <li> <b>Default Value:</b> False
1470     *  </ul>
1471     *
1472     * Default Rates:
1473     *  <ul>
1474     *  <li> <b>CAN:</b> 4.0 Hz
1475     *  </ul>
1476     *
1477     * @return  StickyFault_BootDuringEnable Status Signal Value object
1478     */
1479    public StatusSignalValue<Boolean> getStickyFault_BootDuringEnable()
1480    {
1481        return super.lookupStatusSignalValue(SpnValue.StickyFault_BootDuringEnable.value, Boolean.class, "StickyFault_BootDuringEnable", true);
1482    }
1483    
1484    /**
1485     * An unlicensed feature is in use, device may not behave as expected.
1486     *
1487     *  <ul>
1488     *  <li> <b>Default Value:</b> False
1489     *  </ul>
1490     *
1491     * Default Rates:
1492     *  <ul>
1493     *  <li> <b>CAN:</b> 4.0 Hz
1494     *  </ul>
1495     *
1496     * @return  Fault_UnlicensedFeatureInUse Status Signal Value object
1497     */
1498    public StatusSignalValue<Boolean> getFault_UnlicensedFeatureInUse()
1499    {
1500        return super.lookupStatusSignalValue(SpnValue.Fault_UnlicensedFeatureInUse.value, Boolean.class, "Fault_UnlicensedFeatureInUse", true);
1501    }
1502    
1503    /**
1504     * An unlicensed feature is in use, device may not behave as expected.
1505     *
1506     *  <ul>
1507     *  <li> <b>Default Value:</b> False
1508     *  </ul>
1509     *
1510     * Default Rates:
1511     *  <ul>
1512     *  <li> <b>CAN:</b> 4.0 Hz
1513     *  </ul>
1514     *
1515     * @return  StickyFault_UnlicensedFeatureInUse Status Signal Value object
1516     */
1517    public StatusSignalValue<Boolean> getStickyFault_UnlicensedFeatureInUse()
1518    {
1519        return super.lookupStatusSignalValue(SpnValue.StickyFault_UnlicensedFeatureInUse.value, Boolean.class, "StickyFault_UnlicensedFeatureInUse", true);
1520    }
1521    
1522    /**
1523     * Supply Voltage has exceeded the maximum voltage rating of device.
1524     *
1525     *  <ul>
1526     *  <li> <b>Default Value:</b> False
1527     *  </ul>
1528     *
1529     * Default Rates:
1530     *  <ul>
1531     *  <li> <b>CAN:</b> 4.0 Hz
1532     *  </ul>
1533     *
1534     * @return  Fault_OverSupplyV Status Signal Value object
1535     */
1536    public StatusSignalValue<Boolean> getFault_OverSupplyV()
1537    {
1538        return super.lookupStatusSignalValue(SpnValue.Fault_TALONFX_OverSupplyV.value, Boolean.class, "Fault_OverSupplyV", true);
1539    }
1540    
1541    /**
1542     * Supply Voltage has exceeded the maximum voltage rating of device.
1543     *
1544     *  <ul>
1545     *  <li> <b>Default Value:</b> False
1546     *  </ul>
1547     *
1548     * Default Rates:
1549     *  <ul>
1550     *  <li> <b>CAN:</b> 4.0 Hz
1551     *  </ul>
1552     *
1553     * @return  StickyFault_OverSupplyV Status Signal Value object
1554     */
1555    public StatusSignalValue<Boolean> getStickyFault_OverSupplyV()
1556    {
1557        return super.lookupStatusSignalValue(SpnValue.StickyFault_TALONFX_OverSupplyV.value, Boolean.class, "StickyFault_OverSupplyV", true);
1558    }
1559    
1560    /**
1561     * Supply Voltage is unstable.  Ensure you are using a battery and
1562     * current limited power supply.
1563     *
1564     *  <ul>
1565     *  <li> <b>Default Value:</b> False
1566     *  </ul>
1567     *
1568     * Default Rates:
1569     *  <ul>
1570     *  <li> <b>CAN:</b> 4.0 Hz
1571     *  </ul>
1572     *
1573     * @return  Fault_UnstableSupplyV Status Signal Value object
1574     */
1575    public StatusSignalValue<Boolean> getFault_UnstableSupplyV()
1576    {
1577        return super.lookupStatusSignalValue(SpnValue.Fault_TALONFX_UnstableSupplyV.value, Boolean.class, "Fault_UnstableSupplyV", true);
1578    }
1579    
1580    /**
1581     * Supply Voltage is unstable.  Ensure you are using a battery and
1582     * current limited power supply.
1583     *
1584     *  <ul>
1585     *  <li> <b>Default Value:</b> False
1586     *  </ul>
1587     *
1588     * Default Rates:
1589     *  <ul>
1590     *  <li> <b>CAN:</b> 4.0 Hz
1591     *  </ul>
1592     *
1593     * @return  StickyFault_UnstableSupplyV Status Signal Value object
1594     */
1595    public StatusSignalValue<Boolean> getStickyFault_UnstableSupplyV()
1596    {
1597        return super.lookupStatusSignalValue(SpnValue.StickyFault_TALONFX_UnstableSupplyV.value, Boolean.class, "StickyFault_UnstableSupplyV", true);
1598    }
1599    
1600    /**
1601     * Reverse limit switch has been asserted.  Output is set to neutral.
1602     *
1603     *  <ul>
1604     *  <li> <b>Default Value:</b> False
1605     *  </ul>
1606     *
1607     * Default Rates:
1608     *  <ul>
1609     *  <li> <b>CAN:</b> 4.0 Hz
1610     *  </ul>
1611     *
1612     * @return  Fault_ReverseHardLimit Status Signal Value object
1613     */
1614    public StatusSignalValue<Boolean> getFault_ReverseHardLimit()
1615    {
1616        return super.lookupStatusSignalValue(SpnValue.Fault_TALONFX_ReverseHardLimit.value, Boolean.class, "Fault_ReverseHardLimit", true);
1617    }
1618    
1619    /**
1620     * Reverse limit switch has been asserted.  Output is set to neutral.
1621     *
1622     *  <ul>
1623     *  <li> <b>Default Value:</b> False
1624     *  </ul>
1625     *
1626     * Default Rates:
1627     *  <ul>
1628     *  <li> <b>CAN:</b> 4.0 Hz
1629     *  </ul>
1630     *
1631     * @return  StickyFault_ReverseHardLimit Status Signal Value object
1632     */
1633    public StatusSignalValue<Boolean> getStickyFault_ReverseHardLimit()
1634    {
1635        return super.lookupStatusSignalValue(SpnValue.StickyFault_TALONFX_ReverseHardLimit.value, Boolean.class, "StickyFault_ReverseHardLimit", true);
1636    }
1637    
1638    /**
1639     * Forward limit switch has been asserted.  Output is set to neutral.
1640     *
1641     *  <ul>
1642     *  <li> <b>Default Value:</b> False
1643     *  </ul>
1644     *
1645     * Default Rates:
1646     *  <ul>
1647     *  <li> <b>CAN:</b> 4.0 Hz
1648     *  </ul>
1649     *
1650     * @return  Fault_ForwardHardLimit Status Signal Value object
1651     */
1652    public StatusSignalValue<Boolean> getFault_ForwardHardLimit()
1653    {
1654        return super.lookupStatusSignalValue(SpnValue.Fault_TALONFX_ForwardHardLimit.value, Boolean.class, "Fault_ForwardHardLimit", true);
1655    }
1656    
1657    /**
1658     * Forward limit switch has been asserted.  Output is set to neutral.
1659     *
1660     *  <ul>
1661     *  <li> <b>Default Value:</b> False
1662     *  </ul>
1663     *
1664     * Default Rates:
1665     *  <ul>
1666     *  <li> <b>CAN:</b> 4.0 Hz
1667     *  </ul>
1668     *
1669     * @return  StickyFault_ForwardHardLimit Status Signal Value object
1670     */
1671    public StatusSignalValue<Boolean> getStickyFault_ForwardHardLimit()
1672    {
1673        return super.lookupStatusSignalValue(SpnValue.StickyFault_TALONFX_ForwardHardLimit.value, Boolean.class, "StickyFault_ForwardHardLimit", true);
1674    }
1675    
1676    /**
1677     * Reverse soft limit has been asserted.  Output is set to neutral.
1678     *
1679     *  <ul>
1680     *  <li> <b>Default Value:</b> False
1681     *  </ul>
1682     *
1683     * Default Rates:
1684     *  <ul>
1685     *  <li> <b>CAN:</b> 4.0 Hz
1686     *  </ul>
1687     *
1688     * @return  Fault_ReverseSoftLimit Status Signal Value object
1689     */
1690    public StatusSignalValue<Boolean> getFault_ReverseSoftLimit()
1691    {
1692        return super.lookupStatusSignalValue(SpnValue.Fault_TALONFX_ReverseSoftLimit.value, Boolean.class, "Fault_ReverseSoftLimit", true);
1693    }
1694    
1695    /**
1696     * Reverse soft limit has been asserted.  Output is set to neutral.
1697     *
1698     *  <ul>
1699     *  <li> <b>Default Value:</b> False
1700     *  </ul>
1701     *
1702     * Default Rates:
1703     *  <ul>
1704     *  <li> <b>CAN:</b> 4.0 Hz
1705     *  </ul>
1706     *
1707     * @return  StickyFault_ReverseSoftLimit Status Signal Value object
1708     */
1709    public StatusSignalValue<Boolean> getStickyFault_ReverseSoftLimit()
1710    {
1711        return super.lookupStatusSignalValue(SpnValue.StickyFault_TALONFX_ReverseSoftLimit.value, Boolean.class, "StickyFault_ReverseSoftLimit", true);
1712    }
1713    
1714    /**
1715     * Forward soft limit has been asserted.  Output is set to neutral.
1716     *
1717     *  <ul>
1718     *  <li> <b>Default Value:</b> False
1719     *  </ul>
1720     *
1721     * Default Rates:
1722     *  <ul>
1723     *  <li> <b>CAN:</b> 4.0 Hz
1724     *  </ul>
1725     *
1726     * @return  Fault_ForwardSoftLimit Status Signal Value object
1727     */
1728    public StatusSignalValue<Boolean> getFault_ForwardSoftLimit()
1729    {
1730        return super.lookupStatusSignalValue(SpnValue.Fault_TALONFX_ForwardSoftLimit.value, Boolean.class, "Fault_ForwardSoftLimit", true);
1731    }
1732    
1733    /**
1734     * Forward soft limit has been asserted.  Output is set to neutral.
1735     *
1736     *  <ul>
1737     *  <li> <b>Default Value:</b> False
1738     *  </ul>
1739     *
1740     * Default Rates:
1741     *  <ul>
1742     *  <li> <b>CAN:</b> 4.0 Hz
1743     *  </ul>
1744     *
1745     * @return  StickyFault_ForwardSoftLimit Status Signal Value object
1746     */
1747    public StatusSignalValue<Boolean> getStickyFault_ForwardSoftLimit()
1748    {
1749        return super.lookupStatusSignalValue(SpnValue.StickyFault_TALONFX_ForwardSoftLimit.value, Boolean.class, "StickyFault_ForwardSoftLimit", true);
1750    }
1751    
1752    /**
1753     * The remote sensor is not present on CAN Bus.
1754     *
1755     *  <ul>
1756     *  <li> <b>Default Value:</b> False
1757     *  </ul>
1758     *
1759     * Default Rates:
1760     *  <ul>
1761     *  <li> <b>CAN:</b> 4.0 Hz
1762     *  </ul>
1763     *
1764     * @return  Fault_MissingRemoteSensor Status Signal Value object
1765     */
1766    public StatusSignalValue<Boolean> getFault_MissingRemoteSensor()
1767    {
1768        return super.lookupStatusSignalValue(SpnValue.Fault_TALONFX_MissingRemoteSensor.value, Boolean.class, "Fault_MissingRemoteSensor", true);
1769    }
1770    
1771    /**
1772     * The remote sensor is not present on CAN Bus.
1773     *
1774     *  <ul>
1775     *  <li> <b>Default Value:</b> False
1776     *  </ul>
1777     *
1778     * Default Rates:
1779     *  <ul>
1780     *  <li> <b>CAN:</b> 4.0 Hz
1781     *  </ul>
1782     *
1783     * @return  StickyFault_MissingRemoteSensor Status Signal Value object
1784     */
1785    public StatusSignalValue<Boolean> getStickyFault_MissingRemoteSensor()
1786    {
1787        return super.lookupStatusSignalValue(SpnValue.StickyFault_TALONFX_MissingRemoteSensor.value, Boolean.class, "StickyFault_MissingRemoteSensor", true);
1788    }
1789    
1790    /**
1791     * The remote sensor used for fusion has fallen out of sync to the
1792     * local sensor. A re-synchronization has occurred, which may cause a
1793     * discontinuity. This typically happens if there is significant slop
1794     * in the mechanism, or if the RotorToSensorRatio configuration
1795     * parameter is incorrect.
1796     *
1797     *  <ul>
1798     *  <li> <b>Default Value:</b> False
1799     *  </ul>
1800     *
1801     * Default Rates:
1802     *  <ul>
1803     *  <li> <b>CAN:</b> 4.0 Hz
1804     *  </ul>
1805     *
1806     * @return  Fault_FusedSensorOutOfSync Status Signal Value object
1807     */
1808    public StatusSignalValue<Boolean> getFault_FusedSensorOutOfSync()
1809    {
1810        return super.lookupStatusSignalValue(SpnValue.Fault_TALONFX_FusedSensorOutOfSync.value, Boolean.class, "Fault_FusedSensorOutOfSync", true);
1811    }
1812    
1813    /**
1814     * The remote sensor used for fusion has fallen out of sync to the
1815     * local sensor. A re-synchronization has occurred, which may cause a
1816     * discontinuity. This typically happens if there is significant slop
1817     * in the mechanism, or if the RotorToSensorRatio configuration
1818     * parameter is incorrect.
1819     *
1820     *  <ul>
1821     *  <li> <b>Default Value:</b> False
1822     *  </ul>
1823     *
1824     * Default Rates:
1825     *  <ul>
1826     *  <li> <b>CAN:</b> 4.0 Hz
1827     *  </ul>
1828     *
1829     * @return  StickyFault_FusedSensorOutOfSync Status Signal Value object
1830     */
1831    public StatusSignalValue<Boolean> getStickyFault_FusedSensorOutOfSync()
1832    {
1833        return super.lookupStatusSignalValue(SpnValue.StickyFault_TALONFX_FusedSensorOutOfSync.value, Boolean.class, "StickyFault_FusedSensorOutOfSync", true);
1834    }
1835    
1836    /**
1837     * Stator current limit occured.
1838     *
1839     *  <ul>
1840     *  <li> <b>Default Value:</b> False
1841     *  </ul>
1842     *
1843     * Default Rates:
1844     *  <ul>
1845     *  <li> <b>CAN:</b> 4.0 Hz
1846     *  </ul>
1847     *
1848     * @return  Fault_StatorCurrLimit Status Signal Value object
1849     */
1850    public StatusSignalValue<Boolean> getFault_StatorCurrLimit()
1851    {
1852        return super.lookupStatusSignalValue(SpnValue.Fault_TALONFX_StatorCurrLimit.value, Boolean.class, "Fault_StatorCurrLimit", true);
1853    }
1854    
1855    /**
1856     * Stator current limit occured.
1857     *
1858     *  <ul>
1859     *  <li> <b>Default Value:</b> False
1860     *  </ul>
1861     *
1862     * Default Rates:
1863     *  <ul>
1864     *  <li> <b>CAN:</b> 4.0 Hz
1865     *  </ul>
1866     *
1867     * @return  StickyFault_StatorCurrLimit Status Signal Value object
1868     */
1869    public StatusSignalValue<Boolean> getStickyFault_StatorCurrLimit()
1870    {
1871        return super.lookupStatusSignalValue(SpnValue.StickyFault_TALONFX_StatorCurrLimit.value, Boolean.class, "StickyFault_StatorCurrLimit", true);
1872    }
1873    
1874    /**
1875     * Supply current limit occured.
1876     *
1877     *  <ul>
1878     *  <li> <b>Default Value:</b> False
1879     *  </ul>
1880     *
1881     * Default Rates:
1882     *  <ul>
1883     *  <li> <b>CAN:</b> 4.0 Hz
1884     *  </ul>
1885     *
1886     * @return  Fault_SupplyCurrLimit Status Signal Value object
1887     */
1888    public StatusSignalValue<Boolean> getFault_SupplyCurrLimit()
1889    {
1890        return super.lookupStatusSignalValue(SpnValue.Fault_TALONFX_SupplyCurrLimit.value, Boolean.class, "Fault_SupplyCurrLimit", true);
1891    }
1892    
1893    /**
1894     * Supply current limit occured.
1895     *
1896     *  <ul>
1897     *  <li> <b>Default Value:</b> False
1898     *  </ul>
1899     *
1900     * Default Rates:
1901     *  <ul>
1902     *  <li> <b>CAN:</b> 4.0 Hz
1903     *  </ul>
1904     *
1905     * @return  StickyFault_SupplyCurrLimit Status Signal Value object
1906     */
1907    public StatusSignalValue<Boolean> getStickyFault_SupplyCurrLimit()
1908    {
1909        return super.lookupStatusSignalValue(SpnValue.StickyFault_TALONFX_SupplyCurrLimit.value, Boolean.class, "StickyFault_SupplyCurrLimit", true);
1910    }
1911    
1912    /**
1913     * Using Fused CANcoder feature while unlicensed. Device has fallen
1914     * back to remote CANcoder.
1915     *
1916     *  <ul>
1917     *  <li> <b>Default Value:</b> False
1918     *  </ul>
1919     *
1920     * Default Rates:
1921     *  <ul>
1922     *  <li> <b>CAN:</b> 4.0 Hz
1923     *  </ul>
1924     *
1925     * @return  Fault_UsingFusedCANcoderWhileUnlicensed Status Signal Value object
1926     */
1927    public StatusSignalValue<Boolean> getFault_UsingFusedCANcoderWhileUnlicensed()
1928    {
1929        return super.lookupStatusSignalValue(SpnValue.Fault_TALONFX_UsingFusedCCWhileUnlicensed.value, Boolean.class, "Fault_UsingFusedCANcoderWhileUnlicensed", true);
1930    }
1931    
1932    /**
1933     * Using Fused CANcoder feature while unlicensed. Device has fallen
1934     * back to remote CANcoder.
1935     *
1936     *  <ul>
1937     *  <li> <b>Default Value:</b> False
1938     *  </ul>
1939     *
1940     * Default Rates:
1941     *  <ul>
1942     *  <li> <b>CAN:</b> 4.0 Hz
1943     *  </ul>
1944     *
1945     * @return  StickyFault_UsingFusedCANcoderWhileUnlicensed Status Signal Value object
1946     */
1947    public StatusSignalValue<Boolean> getStickyFault_UsingFusedCANcoderWhileUnlicensed()
1948    {
1949        return super.lookupStatusSignalValue(SpnValue.StickyFault_TALONFX_UsingFusedCCWhileUnlicensed.value, Boolean.class, "StickyFault_UsingFusedCANcoderWhileUnlicensed", true);
1950    }
1951    
1952    /**
1953     * Closed loop proportional component
1954     * <p>
1955     * The portion of the closed loop output that is the proportional to
1956     * the error. Alternatively, the p-Contribution of the closed loop
1957     * output.
1958     *
1959     * Default Rates:
1960     *  <ul>
1961     *  <li> <b>CAN 2.0:</b> 5.0 Hz
1962     *  <li> <b>CAN FD:</b> 100.0 Hz
1963     *  </ul>
1964     *
1965     * @return  ClosedLoopProportionalOutput Status Signal Value object
1966     */
1967    public StatusSignalValue<Double> getClosedLoopProportionalOutput()
1968    {
1969        MapGenerator<Double> mapFiller = ()->{
1970            Map<Integer, StatusSignalValue<Double>> toAdd = new HashMap<Integer, StatusSignalValue<Double>>();
1971            toAdd.put(ControlModeValue.PositionDutyCycle.value, getPIDDutyCycle_ProportionalOutput());
1972            toAdd.put(ControlModeValue.PositionDutyCycleFOC.value, getPIDDutyCycle_ProportionalOutput());
1973            toAdd.put(ControlModeValue.VelocityDutyCycle.value, getPIDDutyCycle_ProportionalOutput());
1974            toAdd.put(ControlModeValue.VelocityDutyCycleFOC.value, getPIDDutyCycle_ProportionalOutput());
1975            toAdd.put(ControlModeValue.MotionMagicDutyCycle.value, getPIDDutyCycle_ProportionalOutput());
1976            toAdd.put(ControlModeValue.MotionMagicDutyCycleFOC.value, getPIDDutyCycle_ProportionalOutput());
1977            toAdd.put(ControlModeValue.PositionVoltage.value, getPIDMotorVoltage_ProportionalOutput());
1978            toAdd.put(ControlModeValue.PositionVoltageFOC.value, getPIDMotorVoltage_ProportionalOutput());
1979            toAdd.put(ControlModeValue.VelocityVoltage.value, getPIDMotorVoltage_ProportionalOutput());
1980            toAdd.put(ControlModeValue.VelocityVoltageFOC.value, getPIDMotorVoltage_ProportionalOutput());
1981            toAdd.put(ControlModeValue.MotionMagicVoltage.value, getPIDMotorVoltage_ProportionalOutput());
1982            toAdd.put(ControlModeValue.MotionMagicVoltageFOC.value, getPIDMotorVoltage_ProportionalOutput());
1983            toAdd.put(ControlModeValue.PositionTorqueCurrentFOC.value, getPIDTorqueCurrent_ProportionalOutput());
1984            toAdd.put(ControlModeValue.VelocityTorqueCurrentFOC.value, getPIDTorqueCurrent_ProportionalOutput());
1985            toAdd.put(ControlModeValue.MotionMagicTorqueCurrentFOC.value, getPIDTorqueCurrent_ProportionalOutput());
1986            return toAdd;
1987        };
1988        return super.lookupStatusSignalValue(SpnValue.TalonFX_ControlMode.value, Double.class, 1, mapFiller, "ClosedLoopProportionalOutput", true);
1989    }
1990    
1991    /**
1992     * Closed loop integrated component
1993     * <p>
1994     * The portion of the closed loop output that is proportional to the
1995     * integrated error. Alternatively, the i-Contribution of the closed
1996     * loop output.
1997     *
1998     * Default Rates:
1999     *  <ul>
2000     *  <li> <b>CAN 2.0:</b> 5.0 Hz
2001     *  <li> <b>CAN FD:</b> 100.0 Hz
2002     *  </ul>
2003     *
2004     * @return  ClosedLoopIntegratedOutput Status Signal Value object
2005     */
2006    public StatusSignalValue<Double> getClosedLoopIntegratedOutput()
2007    {
2008        MapGenerator<Double> mapFiller = ()->{
2009            Map<Integer, StatusSignalValue<Double>> toAdd = new HashMap<Integer, StatusSignalValue<Double>>();
2010            toAdd.put(ControlModeValue.PositionDutyCycle.value, getPIDDutyCycle_IntegratedAccum());
2011            toAdd.put(ControlModeValue.PositionDutyCycleFOC.value, getPIDDutyCycle_IntegratedAccum());
2012            toAdd.put(ControlModeValue.VelocityDutyCycle.value, getPIDDutyCycle_IntegratedAccum());
2013            toAdd.put(ControlModeValue.VelocityDutyCycleFOC.value, getPIDDutyCycle_IntegratedAccum());
2014            toAdd.put(ControlModeValue.MotionMagicDutyCycle.value, getPIDDutyCycle_IntegratedAccum());
2015            toAdd.put(ControlModeValue.MotionMagicDutyCycleFOC.value, getPIDDutyCycle_IntegratedAccum());
2016            toAdd.put(ControlModeValue.PositionVoltage.value, getPIDMotorVoltage_IntegratedAccum());
2017            toAdd.put(ControlModeValue.PositionVoltageFOC.value, getPIDMotorVoltage_IntegratedAccum());
2018            toAdd.put(ControlModeValue.VelocityVoltage.value, getPIDMotorVoltage_IntegratedAccum());
2019            toAdd.put(ControlModeValue.VelocityVoltageFOC.value, getPIDMotorVoltage_IntegratedAccum());
2020            toAdd.put(ControlModeValue.MotionMagicVoltage.value, getPIDMotorVoltage_IntegratedAccum());
2021            toAdd.put(ControlModeValue.MotionMagicVoltageFOC.value, getPIDMotorVoltage_IntegratedAccum());
2022            toAdd.put(ControlModeValue.PositionTorqueCurrentFOC.value, getPIDTorqueCurrent_IntegratedAccum());
2023            toAdd.put(ControlModeValue.VelocityTorqueCurrentFOC.value, getPIDTorqueCurrent_IntegratedAccum());
2024            toAdd.put(ControlModeValue.MotionMagicTorqueCurrentFOC.value, getPIDTorqueCurrent_IntegratedAccum());
2025            return toAdd;
2026        };
2027        return super.lookupStatusSignalValue(SpnValue.TalonFX_ControlMode.value, Double.class, 2, mapFiller, "ClosedLoopIntegratedOutput", true);
2028    }
2029    
2030    /**
2031     * Feed Forward passed by the user
2032     * <p>
2033     * This is the general feed forward that the user provides for the
2034     * closed loop.
2035     *
2036     * Default Rates:
2037     *  <ul>
2038     *  <li> <b>CAN 2.0:</b> 5.0 Hz
2039     *  <li> <b>CAN FD:</b> 100.0 Hz
2040     *  </ul>
2041     *
2042     * @return  ClosedLoopFeedForward Status Signal Value object
2043     */
2044    public StatusSignalValue<Double> getClosedLoopFeedForward()
2045    {
2046        MapGenerator<Double> mapFiller = ()->{
2047            Map<Integer, StatusSignalValue<Double>> toAdd = new HashMap<Integer, StatusSignalValue<Double>>();
2048            toAdd.put(ControlModeValue.PositionDutyCycle.value, getPIDDutyCycle_FeedForward());
2049            toAdd.put(ControlModeValue.PositionDutyCycleFOC.value, getPIDDutyCycle_FeedForward());
2050            toAdd.put(ControlModeValue.VelocityDutyCycle.value, getPIDDutyCycle_FeedForward());
2051            toAdd.put(ControlModeValue.VelocityDutyCycleFOC.value, getPIDDutyCycle_FeedForward());
2052            toAdd.put(ControlModeValue.MotionMagicDutyCycle.value, getPIDDutyCycle_FeedForward());
2053            toAdd.put(ControlModeValue.MotionMagicDutyCycleFOC.value, getPIDDutyCycle_FeedForward());
2054            toAdd.put(ControlModeValue.PositionVoltage.value, getPIDMotorVoltage_FeedForward());
2055            toAdd.put(ControlModeValue.PositionVoltageFOC.value, getPIDMotorVoltage_FeedForward());
2056            toAdd.put(ControlModeValue.VelocityVoltage.value, getPIDMotorVoltage_FeedForward());
2057            toAdd.put(ControlModeValue.VelocityVoltageFOC.value, getPIDMotorVoltage_FeedForward());
2058            toAdd.put(ControlModeValue.MotionMagicVoltage.value, getPIDMotorVoltage_FeedForward());
2059            toAdd.put(ControlModeValue.MotionMagicVoltageFOC.value, getPIDMotorVoltage_FeedForward());
2060            toAdd.put(ControlModeValue.PositionTorqueCurrentFOC.value, getPIDTorqueCurrent_FeedForward());
2061            toAdd.put(ControlModeValue.VelocityTorqueCurrentFOC.value, getPIDTorqueCurrent_FeedForward());
2062            toAdd.put(ControlModeValue.MotionMagicTorqueCurrentFOC.value, getPIDTorqueCurrent_FeedForward());
2063            return toAdd;
2064        };
2065        return super.lookupStatusSignalValue(SpnValue.TalonFX_ControlMode.value, Double.class, 3, mapFiller, "ClosedLoopFeedForward", true);
2066    }
2067    
2068    /**
2069     * Closed loop derivative component
2070     * <p>
2071     * The portion of the closed loop output that is the proportional to
2072     * the deriviative the error. Alternatively, the d-Contribution of the
2073     * closed loop output.
2074     *
2075     * Default Rates:
2076     *  <ul>
2077     *  <li> <b>CAN 2.0:</b> 5.0 Hz
2078     *  <li> <b>CAN FD:</b> 100.0 Hz
2079     *  </ul>
2080     *
2081     * @return  ClosedLoopDerivativeOutput Status Signal Value object
2082     */
2083    public StatusSignalValue<Double> getClosedLoopDerivativeOutput()
2084    {
2085        MapGenerator<Double> mapFiller = ()->{
2086            Map<Integer, StatusSignalValue<Double>> toAdd = new HashMap<Integer, StatusSignalValue<Double>>();
2087            toAdd.put(ControlModeValue.PositionDutyCycle.value, getPIDDutyCycle_DerivativeOutput());
2088            toAdd.put(ControlModeValue.PositionDutyCycleFOC.value, getPIDDutyCycle_DerivativeOutput());
2089            toAdd.put(ControlModeValue.VelocityDutyCycle.value, getPIDDutyCycle_DerivativeOutput());
2090            toAdd.put(ControlModeValue.VelocityDutyCycleFOC.value, getPIDDutyCycle_DerivativeOutput());
2091            toAdd.put(ControlModeValue.MotionMagicDutyCycle.value, getPIDDutyCycle_DerivativeOutput());
2092            toAdd.put(ControlModeValue.MotionMagicDutyCycleFOC.value, getPIDDutyCycle_DerivativeOutput());
2093            toAdd.put(ControlModeValue.PositionVoltage.value, getPIDMotorVoltage_DerivativeOutput());
2094            toAdd.put(ControlModeValue.PositionVoltageFOC.value, getPIDMotorVoltage_DerivativeOutput());
2095            toAdd.put(ControlModeValue.VelocityVoltage.value, getPIDMotorVoltage_DerivativeOutput());
2096            toAdd.put(ControlModeValue.VelocityVoltageFOC.value, getPIDMotorVoltage_DerivativeOutput());
2097            toAdd.put(ControlModeValue.MotionMagicVoltage.value, getPIDMotorVoltage_DerivativeOutput());
2098            toAdd.put(ControlModeValue.MotionMagicVoltageFOC.value, getPIDMotorVoltage_DerivativeOutput());
2099            toAdd.put(ControlModeValue.PositionTorqueCurrentFOC.value, getPIDTorqueCurrent_DerivativeOutput());
2100            toAdd.put(ControlModeValue.VelocityTorqueCurrentFOC.value, getPIDTorqueCurrent_DerivativeOutput());
2101            toAdd.put(ControlModeValue.MotionMagicTorqueCurrentFOC.value, getPIDTorqueCurrent_DerivativeOutput());
2102            return toAdd;
2103        };
2104        return super.lookupStatusSignalValue(SpnValue.TalonFX_ControlMode.value, Double.class, 4, mapFiller, "ClosedLoopDerivativeOutput", true);
2105    }
2106    
2107    /**
2108     * Closed loop total output
2109     * <p>
2110     * The total output of the closed loop output.
2111     *
2112     * Default Rates:
2113     *  <ul>
2114     *  <li> <b>CAN 2.0:</b> 5.0 Hz
2115     *  <li> <b>CAN FD:</b> 100.0 Hz
2116     *  </ul>
2117     *
2118     * @return  ClosedLoopOutput Status Signal Value object
2119     */
2120    public StatusSignalValue<Double> getClosedLoopOutput()
2121    {
2122        MapGenerator<Double> mapFiller = ()->{
2123            Map<Integer, StatusSignalValue<Double>> toAdd = new HashMap<Integer, StatusSignalValue<Double>>();
2124            toAdd.put(ControlModeValue.PositionDutyCycle.value, getPIDDutyCycle_Output());
2125            toAdd.put(ControlModeValue.PositionDutyCycleFOC.value, getPIDDutyCycle_Output());
2126            toAdd.put(ControlModeValue.VelocityDutyCycle.value, getPIDDutyCycle_Output());
2127            toAdd.put(ControlModeValue.VelocityDutyCycleFOC.value, getPIDDutyCycle_Output());
2128            toAdd.put(ControlModeValue.MotionMagicDutyCycle.value, getPIDDutyCycle_Output());
2129            toAdd.put(ControlModeValue.MotionMagicDutyCycleFOC.value, getPIDDutyCycle_Output());
2130            toAdd.put(ControlModeValue.PositionVoltage.value, getPIDMotorVoltage_Output());
2131            toAdd.put(ControlModeValue.PositionVoltageFOC.value, getPIDMotorVoltage_Output());
2132            toAdd.put(ControlModeValue.VelocityVoltage.value, getPIDMotorVoltage_Output());
2133            toAdd.put(ControlModeValue.VelocityVoltageFOC.value, getPIDMotorVoltage_Output());
2134            toAdd.put(ControlModeValue.MotionMagicVoltage.value, getPIDMotorVoltage_Output());
2135            toAdd.put(ControlModeValue.MotionMagicVoltageFOC.value, getPIDMotorVoltage_Output());
2136            toAdd.put(ControlModeValue.PositionTorqueCurrentFOC.value, getPIDTorqueCurrent_Output());
2137            toAdd.put(ControlModeValue.VelocityTorqueCurrentFOC.value, getPIDTorqueCurrent_Output());
2138            toAdd.put(ControlModeValue.MotionMagicTorqueCurrentFOC.value, getPIDTorqueCurrent_Output());
2139            return toAdd;
2140        };
2141        return super.lookupStatusSignalValue(SpnValue.TalonFX_ControlMode.value, Double.class, 5, mapFiller, "ClosedLoopOutput", true);
2142    }
2143    
2144    /**
2145     * Value that the closed loop is targeting
2146     * <p>
2147     * This is the value that the closed loop PID controller targets.
2148     *
2149     * Default Rates:
2150     *  <ul>
2151     *  <li> <b>CAN 2.0:</b> 5.0 Hz
2152     *  <li> <b>CAN FD:</b> 100.0 Hz
2153     *  </ul>
2154     *
2155     * @return  ClosedLoopReference Status Signal Value object
2156     */
2157    public StatusSignalValue<Double> getClosedLoopReference()
2158    {
2159        MapGenerator<Double> mapFiller = ()->{
2160            Map<Integer, StatusSignalValue<Double>> toAdd = new HashMap<Integer, StatusSignalValue<Double>>();
2161            toAdd.put(ControlModeValue.PositionDutyCycle.value, getPIDPosition_Reference());
2162            toAdd.put(ControlModeValue.PositionDutyCycleFOC.value, getPIDPosition_Reference());
2163            toAdd.put(ControlModeValue.MotionMagicDutyCycle.value, getPIDPosition_Reference());
2164            toAdd.put(ControlModeValue.MotionMagicDutyCycleFOC.value, getPIDPosition_Reference());
2165            toAdd.put(ControlModeValue.PositionVoltage.value, getPIDPosition_Reference());
2166            toAdd.put(ControlModeValue.PositionVoltageFOC.value, getPIDPosition_Reference());
2167            toAdd.put(ControlModeValue.MotionMagicVoltage.value, getPIDPosition_Reference());
2168            toAdd.put(ControlModeValue.MotionMagicVoltageFOC.value, getPIDPosition_Reference());
2169            toAdd.put(ControlModeValue.PositionTorqueCurrentFOC.value, getPIDPosition_Reference());
2170            toAdd.put(ControlModeValue.MotionMagicTorqueCurrentFOC.value, getPIDPosition_Reference());
2171            toAdd.put(ControlModeValue.VelocityDutyCycle.value, getPIDVelocity_Reference());
2172            toAdd.put(ControlModeValue.VelocityDutyCycleFOC.value, getPIDVelocity_Reference());
2173            toAdd.put(ControlModeValue.VelocityVoltage.value, getPIDVelocity_Reference());
2174            toAdd.put(ControlModeValue.VelocityVoltageFOC.value, getPIDVelocity_Reference());
2175            toAdd.put(ControlModeValue.VelocityTorqueCurrentFOC.value, getPIDVelocity_Reference());
2176            return toAdd;
2177        };
2178        return super.lookupStatusSignalValue(SpnValue.TalonFX_ControlMode.value, Double.class, 6, mapFiller, "ClosedLoopReference", true);
2179    }
2180    
2181    /**
2182     * Derivative of the target that the closed loop is targeting
2183     * <p>
2184     * This is the change in the closed loop reference. This may be used
2185     * in the feed-forward calculation, the derivative-error, or in
2186     * application of the signage for kS. Typically, this represents the
2187     * target velocity during Motion Magic®.
2188     *
2189     * Default Rates:
2190     *  <ul>
2191     *  <li> <b>CAN 2.0:</b> 5.0 Hz
2192     *  <li> <b>CAN FD:</b> 100.0 Hz
2193     *  </ul>
2194     *
2195     * @return  ClosedLoopReferenceSlope Status Signal Value object
2196     */
2197    public StatusSignalValue<Double> getClosedLoopReferenceSlope()
2198    {
2199        MapGenerator<Double> mapFiller = ()->{
2200            Map<Integer, StatusSignalValue<Double>> toAdd = new HashMap<Integer, StatusSignalValue<Double>>();
2201            toAdd.put(ControlModeValue.PositionDutyCycle.value, getPIDPosition_ReferenceSlope());
2202            toAdd.put(ControlModeValue.PositionDutyCycleFOC.value, getPIDPosition_ReferenceSlope());
2203            toAdd.put(ControlModeValue.MotionMagicDutyCycle.value, getPIDPosition_ReferenceSlope());
2204            toAdd.put(ControlModeValue.MotionMagicDutyCycleFOC.value, getPIDPosition_ReferenceSlope());
2205            toAdd.put(ControlModeValue.PositionVoltage.value, getPIDPosition_ReferenceSlope());
2206            toAdd.put(ControlModeValue.PositionVoltageFOC.value, getPIDPosition_ReferenceSlope());
2207            toAdd.put(ControlModeValue.MotionMagicVoltage.value, getPIDPosition_ReferenceSlope());
2208            toAdd.put(ControlModeValue.MotionMagicVoltageFOC.value, getPIDPosition_ReferenceSlope());
2209            toAdd.put(ControlModeValue.PositionTorqueCurrentFOC.value, getPIDPosition_ReferenceSlope());
2210            toAdd.put(ControlModeValue.MotionMagicTorqueCurrentFOC.value, getPIDPosition_ReferenceSlope());
2211            toAdd.put(ControlModeValue.VelocityDutyCycle.value, getPIDVelocity_ReferenceSlope());
2212            toAdd.put(ControlModeValue.VelocityDutyCycleFOC.value, getPIDVelocity_ReferenceSlope());
2213            toAdd.put(ControlModeValue.VelocityVoltage.value, getPIDVelocity_ReferenceSlope());
2214            toAdd.put(ControlModeValue.VelocityVoltageFOC.value, getPIDVelocity_ReferenceSlope());
2215            toAdd.put(ControlModeValue.VelocityTorqueCurrentFOC.value, getPIDVelocity_ReferenceSlope());
2216            return toAdd;
2217        };
2218        return super.lookupStatusSignalValue(SpnValue.TalonFX_ControlMode.value, Double.class, 7, mapFiller, "ClosedLoopReferenceSlope", true);
2219    }
2220    
2221    /**
2222     * The difference between target reference and current measurement
2223     * <p>
2224     * This is the value that is treated as the error in the PID loop.
2225     *
2226     * Default Rates:
2227     *  <ul>
2228     *  <li> <b>CAN 2.0:</b> 5.0 Hz
2229     *  <li> <b>CAN FD:</b> 100.0 Hz
2230     *  </ul>
2231     *
2232     * @return  ClosedLoopError Status Signal Value object
2233     */
2234    public StatusSignalValue<Double> getClosedLoopError()
2235    {
2236        MapGenerator<Double> mapFiller = ()->{
2237            Map<Integer, StatusSignalValue<Double>> toAdd = new HashMap<Integer, StatusSignalValue<Double>>();
2238            toAdd.put(ControlModeValue.PositionDutyCycle.value, getPIDPosition_ClosedLoopError());
2239            toAdd.put(ControlModeValue.PositionDutyCycleFOC.value, getPIDPosition_ClosedLoopError());
2240            toAdd.put(ControlModeValue.MotionMagicDutyCycle.value, getPIDPosition_ClosedLoopError());
2241            toAdd.put(ControlModeValue.MotionMagicDutyCycleFOC.value, getPIDPosition_ClosedLoopError());
2242            toAdd.put(ControlModeValue.PositionVoltage.value, getPIDPosition_ClosedLoopError());
2243            toAdd.put(ControlModeValue.PositionVoltageFOC.value, getPIDPosition_ClosedLoopError());
2244            toAdd.put(ControlModeValue.MotionMagicVoltage.value, getPIDPosition_ClosedLoopError());
2245            toAdd.put(ControlModeValue.MotionMagicVoltageFOC.value, getPIDPosition_ClosedLoopError());
2246            toAdd.put(ControlModeValue.PositionTorqueCurrentFOC.value, getPIDPosition_ClosedLoopError());
2247            toAdd.put(ControlModeValue.MotionMagicTorqueCurrentFOC.value, getPIDPosition_ClosedLoopError());
2248            toAdd.put(ControlModeValue.VelocityDutyCycle.value, getPIDVelocity_ClosedLoopError());
2249            toAdd.put(ControlModeValue.VelocityDutyCycleFOC.value, getPIDVelocity_ClosedLoopError());
2250            toAdd.put(ControlModeValue.VelocityVoltage.value, getPIDVelocity_ClosedLoopError());
2251            toAdd.put(ControlModeValue.VelocityVoltageFOC.value, getPIDVelocity_ClosedLoopError());
2252            toAdd.put(ControlModeValue.VelocityTorqueCurrentFOC.value, getPIDVelocity_ClosedLoopError());
2253            return toAdd;
2254        };
2255        return super.lookupStatusSignalValue(SpnValue.TalonFX_ControlMode.value, Double.class, 8, mapFiller, "ClosedLoopError", true);
2256    }
2257
2258    
2259    /**
2260     * Request a specified motor duty cycle.
2261     * <p>
2262     * This control mode will output a proportion of the supplied voltage
2263     * which is supplied by the user.
2264     *
2265     * <ul>
2266     * <li> <b>DutyCycleOut Parameters:</b> 
2267     *  <ul>
2268     *  <li> <b>Output:</b> Proportion of supply voltage to apply in fractional units
2269     *                    between -1 and +1
2270     *  <li> <b>EnableFOC:</b> Set to true to use FOC commutation, which increases
2271     *                       peak power by ~15%. Set to false to use trapezoidal
2272     *                       commutation.  FOC improves motor performance by
2273     *                       leveraging torque (current) control.  However, this may
2274     *                       be inconvenient for applications that require
2275     *                       specifying duty cycle or voltage.  CTR-Electronics has
2276     *                       developed a hybrid method that combines the
2277     *                       performances gains of FOC while still allowing
2278     *                       applications to provide duty cycle or voltage demand. 
2279     *                       This not to be confused with simple sinusoidal control
2280     *                       or phase voltage control which lacks the performance
2281     *                       gains.
2282     *  <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor
2283     *                                     when output is zero (or within deadband).
2284     *                                      Set to false to use the NeutralMode
2285     *                                     configuration setting (default). This
2286     *                                     flag exists to provide the fundamental
2287     *                                     behavior of this control when output is
2288     *                                     zero, which is to provide 0V to the
2289     *                                     motor.
2290     *  </ul>
2291     * </ul>
2292     *
2293     * @param request                Control object to request of the device
2294     * @return Code response of the request
2295     */
2296    public StatusCode setControl(DutyCycleOut request)
2297    {
2298        return setControlPrivate(request);
2299    }
2300    
2301    /**
2302     * Request a specified motor current (field oriented control).
2303     * <p>
2304     * This control request will drive the motor to the requested motor
2305     * (stator) current value.  This leverages field oriented control
2306     * (FOC), which means greater peak power than what is documented. 
2307     * This scales to torque based on Motor's kT constant.
2308     *
2309     * <ul>
2310     * <li> <b>TorqueCurrentFOC Parameters:</b> 
2311     *  <ul>
2312     *  <li> <b>Output:</b> Amount of motor current in Amperes
2313     *  <li> <b>MaxAbsDutyCycle:</b> The maximum absolute motor output that can be
2314     *                             applied, which effectively limits the velocity.
2315     *                             For example, 0.50 means no more than 50% output
2316     *                             in either direction.  This is useful for
2317     *                             preventing the motor from spinning to its
2318     *                             terminal velocity when there is no external
2319     *                             torque applied unto the rotor.  Note this is
2320     *                             absolute maximum, so the value should be between
2321     *                             zero and one.
2322     *  <li> <b>Deadband:</b> Deadband in Amperes.  If torque request is within
2323     *                      deadband, the bridge output is neutral. If deadband is
2324     *                      set to zero then there is effectively no deadband. Note
2325     *                      if deadband is zero, a free spinning motor will spin for
2326     *                      quite a while as the firmware attempts to hold the
2327     *                      motor's bemf. If user expects motor to cease spinning
2328     *                      quickly with a demand of zero, we recommend a deadband
2329     *                      of one Ampere. This value will be converted to an
2330     *                      integral value of amps.
2331     *  <li> <b>OverrideCoastDurNeutral:</b> Set to true to coast the rotor when
2332     *                                     output is zero (or within deadband).  Set
2333     *                                     to false to use the NeutralMode
2334     *                                     configuration setting (default). This
2335     *                                     flag exists to provide the fundamental
2336     *                                     behavior of this control when output is
2337     *                                     zero, which is to provide 0A (zero
2338     *                                     torque).
2339     *  </ul>
2340     * </ul>
2341     *
2342     * @param request                Control object to request of the device
2343     * @return Code response of the request
2344     */
2345    public StatusCode setControl(TorqueCurrentFOC request)
2346    {
2347        return setControlPrivate(request);
2348    }
2349    
2350    /**
2351     * Request a specified voltage.
2352     * <p>
2353     * This control mode will attempt to apply the specified voltage to
2354     * the motor. If the supply voltage is below the requested voltage,
2355     * the motor controller will output the supply voltage.
2356     *
2357     * <ul>
2358     * <li> <b>VoltageOut Parameters:</b> 
2359     *  <ul>
2360     *  <li> <b>Output:</b> Voltage to attempt to drive at
2361     *  <li> <b>EnableFOC:</b> Set to true to use FOC commutation, which increases
2362     *                       peak power by ~15%. Set to false to use trapezoidal
2363     *                       commutation.  FOC improves motor performance by
2364     *                       leveraging torque (current) control.  However, this may
2365     *                       be inconvenient for applications that require
2366     *                       specifying duty cycle or voltage.  CTR-Electronics has
2367     *                       developed a hybrid method that combines the
2368     *                       performances gains of FOC while still allowing
2369     *                       applications to provide duty cycle or voltage demand. 
2370     *                       This not to be confused with simple sinusoidal control
2371     *                       or phase voltage control which lacks the performance
2372     *                       gains.
2373     *  <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor
2374     *                                     when output is zero (or within deadband).
2375     *                                      Set to false to use the NeutralMode
2376     *                                     configuration setting (default). This
2377     *                                     flag exists to provide the fundamental
2378     *                                     behavior of this control when output is
2379     *                                     zero, which is to provide 0V to the
2380     *                                     motor.
2381     *  </ul>
2382     * </ul>
2383     *
2384     * @param request                Control object to request of the device
2385     * @return Code response of the request
2386     */
2387    public StatusCode setControl(VoltageOut request)
2388    {
2389        return setControlPrivate(request);
2390    }
2391    
2392    /**
2393     * Request PID to target position with duty cycle feedforward.
2394     * <p>
2395     * This control mode will set the motor's position setpoint to the
2396     * position specified by the user. In addition, it will apply an
2397     * additional duty cycle as an arbitrary feedforward value.
2398     *
2399     * <ul>
2400     * <li> <b>PositionDutyCycle Parameters:</b> 
2401     *  <ul>
2402     *  <li> <b>Position:</b> Position to drive toward in rotations.
2403     *  <li> <b>EnableFOC:</b> Set to true to use FOC commutation, which increases
2404     *                       peak power by ~15%. Set to false to use trapezoidal
2405     *                       commutation.  FOC improves motor performance by
2406     *                       leveraging torque (current) control.  However, this may
2407     *                       be inconvenient for applications that require
2408     *                       specifying duty cycle or voltage.  CTR-Electronics has
2409     *                       developed a hybrid method that combines the
2410     *                       performances gains of FOC while still allowing
2411     *                       applications to provide duty cycle or voltage demand. 
2412     *                       This not to be confused with simple sinusoidal control
2413     *                       or phase voltage control which lacks the performance
2414     *                       gains.
2415     *  <li> <b>FeedForward:</b> Feedforward to apply in fractional units between -1
2416     *                         and +1.
2417     *  <li> <b>Slot:</b> Select which gains are applied by selecting the slot.  Use
2418     *                  the configuration api to set the gain values for the
2419     *                  selected slot before enabling this feature. Slot must be
2420     *                  within [0,2].
2421     *  <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor
2422     *                                     when output is zero (or within deadband).
2423     *                                      Set to false to use the NeutralMode
2424     *                                     configuration setting (default). This
2425     *                                     flag exists to provide the fundamental
2426     *                                     behavior of this control when output is
2427     *                                     zero, which is to provide 0V to the
2428     *                                     motor.
2429     *  </ul>
2430     * </ul>
2431     *
2432     * @param request                Control object to request of the device
2433     * @return Code response of the request
2434     */
2435    public StatusCode setControl(PositionDutyCycle request)
2436    {
2437        return setControlPrivate(request);
2438    }
2439    
2440    /**
2441     * Request PID to target position with voltage feedforward
2442     * <p>
2443     * This control mode will set the motor's position setpoint to the
2444     * position specified by the user. In addition, it will apply an
2445     * additional voltage as an arbitrary feedforward value.
2446     *
2447     * <ul>
2448     * <li> <b>PositionVoltage Parameters:</b> 
2449     *  <ul>
2450     *  <li> <b>Position:</b> Position to drive toward in rotations.
2451     *  <li> <b>EnableFOC:</b> Set to true to use FOC commutation, which increases
2452     *                       peak power by ~15%. Set to false to use trapezoidal
2453     *                       commutation.  FOC improves motor performance by
2454     *                       leveraging torque (current) control.  However, this may
2455     *                       be inconvenient for applications that require
2456     *                       specifying duty cycle or voltage.  CTR-Electronics has
2457     *                       developed a hybrid method that combines the
2458     *                       performances gains of FOC while still allowing
2459     *                       applications to provide duty cycle or voltage demand. 
2460     *                       This not to be confused with simple sinusoidal control
2461     *                       or phase voltage control which lacks the performance
2462     *                       gains.
2463     *  <li> <b>FeedForward:</b> Feedforward to apply in volts
2464     *  <li> <b>Slot:</b> Select which gains are applied by selecting the slot.  Use
2465     *                  the configuration api to set the gain values for the
2466     *                  selected slot before enabling this feature. Slot must be
2467     *                  within [0,2].
2468     *  <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor
2469     *                                     when output is zero (or within deadband).
2470     *                                      Set to false to use the NeutralMode
2471     *                                     configuration setting (default). This
2472     *                                     flag exists to provide the fundamental
2473     *                                     behavior of this control when output is
2474     *                                     zero, which is to provide 0V to the
2475     *                                     motor.
2476     *  </ul>
2477     * </ul>
2478     *
2479     * @param request                Control object to request of the device
2480     * @return Code response of the request
2481     */
2482    public StatusCode setControl(PositionVoltage request)
2483    {
2484        return setControlPrivate(request);
2485    }
2486    
2487    /**
2488     * Request PID to target position with torque current feedforward.
2489     * <p>
2490     * This control mode will set the motor's position setpoint to the
2491     * position specified by the user. In addition, it will apply an
2492     * additional torque current as an arbitrary feedforward value.
2493     *
2494     * <ul>
2495     * <li> <b>PositionTorqueCurrentFOC Parameters:</b> 
2496     *  <ul>
2497     *  <li> <b>Position:</b> Position to drive toward in rotations.
2498     *  <li> <b>FeedForward:</b> Feedforward to apply in torque current in Amperes. 
2499     *                         User can use motor's kT to scale Newton-meter to
2500     *                         Amperes.
2501     *  <li> <b>Slot:</b> Select which gains are applied by selecting the slot.  Use
2502     *                  the configuration api to set the gain values for the
2503     *                  selected slot before enabling this feature. Slot must be
2504     *                  within [0,2].
2505     *  <li> <b>OverrideCoastDurNeutral:</b> Set to true to coast the rotor when
2506     *                                     output is zero (or within deadband).  Set
2507     *                                     to false to use the NeutralMode
2508     *                                     configuration setting (default). This
2509     *                                     flag exists to provide the fundamental
2510     *                                     behavior of this control when output is
2511     *                                     zero, which is to provide 0A (zero
2512     *                                     torque).
2513     *  </ul>
2514     * </ul>
2515     *
2516     * @param request                Control object to request of the device
2517     * @return Code response of the request
2518     */
2519    public StatusCode setControl(PositionTorqueCurrentFOC request)
2520    {
2521        return setControlPrivate(request);
2522    }
2523    
2524    /**
2525     * Request PID to target velocity with duty cycle feedforward.
2526     * <p>
2527     * This control mode will set the motor's velocity setpoint to the
2528     * velocity specified by the user. In addition, it will apply an
2529     * additional voltage as an arbitrary feedforward value.
2530     *
2531     * <ul>
2532     * <li> <b>VelocityDutyCycle Parameters:</b> 
2533     *  <ul>
2534     *  <li> <b>Velocity:</b> Velocity to drive toward in rotations per second.
2535     *  <li> <b>EnableFOC:</b> Set to true to use FOC commutation, which increases
2536     *                       peak power by ~15%. Set to false to use trapezoidal
2537     *                       commutation.  FOC improves motor performance by
2538     *                       leveraging torque (current) control.  However, this may
2539     *                       be inconvenient for applications that require
2540     *                       specifying duty cycle or voltage.  CTR-Electronics has
2541     *                       developed a hybrid method that combines the
2542     *                       performances gains of FOC while still allowing
2543     *                       applications to provide duty cycle or voltage demand. 
2544     *                       This not to be confused with simple sinusoidal control
2545     *                       or phase voltage control which lacks the performance
2546     *                       gains.
2547     *  <li> <b>FeedForward:</b> Feedforward to apply in fractional units between -1
2548     *                         and +1.
2549     *  <li> <b>Slot:</b> Select which gains are applied by selecting the slot.  Use
2550     *                  the configuration api to set the gain values for the
2551     *                  selected slot before enabling this feature. Slot must be
2552     *                  within [0,2].
2553     *  <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor
2554     *                                     when output is zero (or within deadband).
2555     *                                      Set to false to use the NeutralMode
2556     *                                     configuration setting (default). This
2557     *                                     flag exists to provide the fundamental
2558     *                                     behavior of this control when output is
2559     *                                     zero, which is to provide 0V to the
2560     *                                     motor.
2561     *  </ul>
2562     * </ul>
2563     *
2564     * @param request                Control object to request of the device
2565     * @return Code response of the request
2566     */
2567    public StatusCode setControl(VelocityDutyCycle request)
2568    {
2569        return setControlPrivate(request);
2570    }
2571    
2572    /**
2573     * Request PID to target velocity with voltage feedforward.
2574     * <p>
2575     * This control mode will set the motor's velocity setpoint to the
2576     * velocity specified by the user. In addition, it will apply an
2577     * additional voltage as an arbitrary feedforward value.
2578     *
2579     * <ul>
2580     * <li> <b>VelocityVoltage Parameters:</b> 
2581     *  <ul>
2582     *  <li> <b>Velocity:</b> Velocity to drive toward in rotations per second.
2583     *  <li> <b>EnableFOC:</b> Set to true to use FOC commutation, which increases
2584     *                       peak power by ~15%. Set to false to use trapezoidal
2585     *                       commutation.  FOC improves motor performance by
2586     *                       leveraging torque (current) control.  However, this may
2587     *                       be inconvenient for applications that require
2588     *                       specifying duty cycle or voltage.  CTR-Electronics has
2589     *                       developed a hybrid method that combines the
2590     *                       performances gains of FOC while still allowing
2591     *                       applications to provide duty cycle or voltage demand. 
2592     *                       This not to be confused with simple sinusoidal control
2593     *                       or phase voltage control which lacks the performance
2594     *                       gains.
2595     *  <li> <b>FeedForward:</b> Feedforward to apply in volts
2596     *  <li> <b>Slot:</b> Select which gains are applied by selecting the slot.  Use
2597     *                  the configuration api to set the gain values for the
2598     *                  selected slot before enabling this feature. Slot must be
2599     *                  within [0,2].
2600     *  <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor
2601     *                                     when output is zero (or within deadband).
2602     *                                      Set to false to use the NeutralMode
2603     *                                     configuration setting (default). This
2604     *                                     flag exists to provide the fundamental
2605     *                                     behavior of this control when output is
2606     *                                     zero, which is to provide 0V to the
2607     *                                     motor.
2608     *  </ul>
2609     * </ul>
2610     *
2611     * @param request                Control object to request of the device
2612     * @return Code response of the request
2613     */
2614    public StatusCode setControl(VelocityVoltage request)
2615    {
2616        return setControlPrivate(request);
2617    }
2618    
2619    /**
2620     * Request PID to target velocity with torque current feedforward.
2621     * <p>
2622     * This control mode will set the motor's velocity setpoint to the
2623     * velocity specified by the user. In addition, it will apply an
2624     * additional torque current as an arbitrary feedforward value.
2625     *
2626     * <ul>
2627     * <li> <b>VelocityTorqueCurrentFOC Parameters:</b> 
2628     *  <ul>
2629     *  <li> <b>Velocity:</b> Velocity to drive toward in rotations per second.
2630     *  <li> <b>FeedForward:</b> Feedforward to apply in torque current in Amperes. 
2631     *                         User can use motor's kT to scale Newton-meter to
2632     *                         Amperes.
2633     *  <li> <b>Slot:</b> Select which gains are applied by selecting the slot.  Use
2634     *                  the configuration api to set the gain values for the
2635     *                  selected slot before enabling this feature. Slot must be
2636     *                  within [0,2].
2637     *  <li> <b>OverrideCoastDurNeutral:</b> Set to true to coast the rotor when
2638     *                                     output is zero (or within deadband).  Set
2639     *                                     to false to use the NeutralMode
2640     *                                     configuration setting (default). This
2641     *                                     flag exists to provide the fundamental
2642     *                                     behavior of this control when output is
2643     *                                     zero, which is to provide 0A (zero
2644     *                                     torque).
2645     *  </ul>
2646     * </ul>
2647     *
2648     * @param request                Control object to request of the device
2649     * @return Code response of the request
2650     */
2651    public StatusCode setControl(VelocityTorqueCurrentFOC request)
2652    {
2653        return setControlPrivate(request);
2654    }
2655    
2656    /**
2657     * Requests Motion Magic® to target a final position using a motion
2658     * profile.  Users can optionally provide a duty cycle feedforward.
2659     * <p>
2660     * Motion Magic® produces a motion profile in real-time while
2661     * attempting to honor the Cruise Velocity, Acceleration, and Jerk
2662     * value specified via the Motion Magic® configuration values.  Target
2663     * position can be changed on-the-fly and Motion Magic® will do its
2664     * best to adjust the profile.  This control mode is duty cycled
2665     * based, so relevant closed-loop gains will use fractional duty cycle
2666     * for the numerator:  +1.0 represents full forward output.
2667     *
2668     * <ul>
2669     * <li> <b>MotionMagicDutyCycle Parameters:</b> 
2670     *  <ul>
2671     *  <li> <b>Position:</b> Position to drive toward in rotations.
2672     *  <li> <b>EnableFOC:</b> Set to true to use FOC commutation, which increases
2673     *                       peak power by ~15%. Set to false to use trapezoidal
2674     *                       commutation.  FOC improves motor performance by
2675     *                       leveraging torque (current) control.  However, this may
2676     *                       be inconvenient for applications that require
2677     *                       specifying duty cycle or voltage.  CTR-Electronics has
2678     *                       developed a hybrid method that combines the
2679     *                       performances gains of FOC while still allowing
2680     *                       applications to provide duty cycle or voltage demand. 
2681     *                       This not to be confused with simple sinusoidal control
2682     *                       or phase voltage control which lacks the performance
2683     *                       gains.
2684     *  <li> <b>FeedForward:</b> Feedforward to apply in fractional units between -1
2685     *                         and +1.
2686     *  <li> <b>Slot:</b> Select which gains are applied by selecting the slot.  Use
2687     *                  the configuration api to set the gain values for the
2688     *                  selected slot before enabling this feature. Slot must be
2689     *                  within [0,2].
2690     *  <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor
2691     *                                     when output is zero (or within deadband).
2692     *                                      Set to false to use the NeutralMode
2693     *                                     configuration setting (default). This
2694     *                                     flag exists to provide the fundamental
2695     *                                     behavior of this control when output is
2696     *                                     zero, which is to provide 0V to the
2697     *                                     motor.
2698     *  </ul>
2699     * </ul>
2700     *
2701     * @param request                Control object to request of the device
2702     * @return Code response of the request
2703     */
2704    public StatusCode setControl(MotionMagicDutyCycle request)
2705    {
2706        return setControlPrivate(request);
2707    }
2708    
2709    /**
2710     * Requests Motion Magic® to target a final position using a motion
2711     * profile.  Users can optionally provide a voltage feedforward.
2712     * <p>
2713     * Motion Magic® produces a motion profile in real-time while
2714     * attempting to honor the Cruise Velocity, Acceleration, and Jerk
2715     * value specified via the Motion Magic® configuration values.  Target
2716     * position can be changed on-the-fly and Motion Magic® will do its
2717     * best to adjust the profile.  This control mode is voltage-based, so
2718     * relevant closed-loop gains will use Volts for the numerator.
2719     *
2720     * <ul>
2721     * <li> <b>MotionMagicVoltage Parameters:</b> 
2722     *  <ul>
2723     *  <li> <b>Position:</b> Position to drive toward in rotations.
2724     *  <li> <b>EnableFOC:</b> Set to true to use FOC commutation, which increases
2725     *                       peak power by ~15%. Set to false to use trapezoidal
2726     *                       commutation.  FOC improves motor performance by
2727     *                       leveraging torque (current) control.  However, this may
2728     *                       be inconvenient for applications that require
2729     *                       specifying duty cycle or voltage.  CTR-Electronics has
2730     *                       developed a hybrid method that combines the
2731     *                       performances gains of FOC while still allowing
2732     *                       applications to provide duty cycle or voltage demand. 
2733     *                       This not to be confused with simple sinusoidal control
2734     *                       or phase voltage control which lacks the performance
2735     *                       gains.
2736     *  <li> <b>FeedForward:</b> Feedforward to apply in volts
2737     *  <li> <b>Slot:</b> Select which gains are applied by selecting the slot.  Use
2738     *                  the configuration api to set the gain values for the
2739     *                  selected slot before enabling this feature. Slot must be
2740     *                  within [0,2].
2741     *  <li> <b>OverrideBrakeDurNeutral:</b> Set to true to static-brake the rotor
2742     *                                     when output is zero (or within deadband).
2743     *                                      Set to false to use the NeutralMode
2744     *                                     configuration setting (default). This
2745     *                                     flag exists to provide the fundamental
2746     *                                     behavior of this control when output is
2747     *                                     zero, which is to provide 0V to the
2748     *                                     motor.
2749     *  </ul>
2750     * </ul>
2751     *
2752     * @param request                Control object to request of the device
2753     * @return Code response of the request
2754     */
2755    public StatusCode setControl(MotionMagicVoltage request)
2756    {
2757        return setControlPrivate(request);
2758    }
2759    
2760    /**
2761     * Requests Motion Magic® to target a final position using a motion
2762     * profile.  Users can optionally provide a torque current
2763     * feedforward.
2764     * <p>
2765     * Motion Magic® produces a motion profile in real-time while
2766     * attempting to honor the Cruise Velocity, Acceleration, and Jerk
2767     * value specified via the Motion Magic® configuration values.  Target
2768     * position can be changed on-the-fly and Motion Magic® will do its
2769     * best to adjust the profile.  This control mode is based on torque
2770     * current, so relevant closed-loop gains will use Amperes for the
2771     * numerator.
2772     *
2773     * <ul>
2774     * <li> <b>MotionMagicTorqueCurrentFOC Parameters:</b> 
2775     *  <ul>
2776     *  <li> <b>Position:</b> Position to drive toward in rotations.
2777     *  <li> <b>FeedForward:</b> Feedforward to apply in torque current in Amperes. 
2778     *                         User can use motor's kT to scale Newton-meter to
2779     *                         Amperes.
2780     *  <li> <b>Slot:</b> Select which gains are applied by selecting the slot.  Use
2781     *                  the configuration api to set the gain values for the
2782     *                  selected slot before enabling this feature. Slot must be
2783     *                  within [0,2].
2784     *  <li> <b>OverrideCoastDurNeutral:</b> Set to true to coast the rotor when
2785     *                                     output is zero (or within deadband).  Set
2786     *                                     to false to use the NeutralMode
2787     *                                     configuration setting (default). This
2788     *                                     flag exists to provide the fundamental
2789     *                                     behavior of this control when output is
2790     *                                     zero, which is to provide 0A (zero
2791     *                                     torque).
2792     *  </ul>
2793     * </ul>
2794     *
2795     * @param request                Control object to request of the device
2796     * @return Code response of the request
2797     */
2798    public StatusCode setControl(MotionMagicTorqueCurrentFOC request)
2799    {
2800        return setControlPrivate(request);
2801    }
2802    
2803    /**
2804     * Follow the motor output of another Talon.
2805     * <p>
2806     * If Talon is in torque control, the torque is copied - which will
2807     * increase the total torque applied. If Talon is in percent supply
2808     * output control, the duty cycle is matched.  Motor direction either
2809     * matches master's configured direction or opposes it based on
2810     * OpposeMasterDirection.
2811     *
2812     * <ul>
2813     * <li> <b>Follower Parameters:</b> 
2814     *  <ul>
2815     *  <li> <b>MasterID:</b> Device ID of the master to follow.
2816     *  <li> <b>OpposeMasterDirection:</b> Set to false for motor invert to match the
2817     *                                   master's configured Invert - which is
2818     *                                   typical when master and follower are
2819     *                                   mechanically linked and spin in the same
2820     *                                   direction.  Set to true for motor invert to
2821     *                                   oppose the master's configured Invert -
2822     *                                   this is typical where the the master and
2823     *                                   follower mechanically spin in opposite
2824     *                                   directions.
2825     *  </ul>
2826     * </ul>
2827     *
2828     * @param request                Control object to request of the device
2829     * @return Code response of the request
2830     */
2831    public StatusCode setControl(Follower request)
2832    {
2833        return setControlPrivate(request);
2834    }
2835    
2836    /**
2837     * Follow the motor output of another Talon while ignoring the
2838     * master's invert setting.
2839     * <p>
2840     * If Talon is in torque control, the torque is copied - which will
2841     * increase the total torque applied. If Talon is in percent supply
2842     * output control, the duty cycle is matched.  Motor direction is
2843     * strictly determined by the configured invert and not the master. 
2844     * If you want motor direction to match or oppose the master, use
2845     * FollowerRequest instead.
2846     *
2847     * <ul>
2848     * <li> <b>StrictFollower Parameters:</b> 
2849     *  <ul>
2850     *  <li> <b>MasterID:</b> Device ID of the master to follow.
2851     *  </ul>
2852     * </ul>
2853     *
2854     * @param request                Control object to request of the device
2855     * @return Code response of the request
2856     */
2857    public StatusCode setControl(StrictFollower request)
2858    {
2859        return setControlPrivate(request);
2860    }
2861    
2862    /**
2863     * Request neutral output of actuator. The applied brake type is
2864     * determined by the NeutralMode configuration.
2865     *
2866     * <ul>
2867     * <li> <b>NeutralOut Parameters:</b> 
2868     * </ul>
2869     *
2870     * @param request                Control object to request of the device
2871     * @return Code response of the request
2872     */
2873    public StatusCode setControl(NeutralOut request)
2874    {
2875        return setControlPrivate(request);
2876    }
2877    
2878    /**
2879     * Request coast neutral output of actuator.  The bridge is disabled
2880     * and the rotor is allowed to coast.
2881     *
2882     * <ul>
2883     * <li> <b>CoastOut Parameters:</b> 
2884     * </ul>
2885     *
2886     * @param request                Control object to request of the device
2887     * @return Code response of the request
2888     */
2889    public StatusCode setControl(CoastOut request)
2890    {
2891        return setControlPrivate(request);
2892    }
2893    
2894    /**
2895     * Applies full neutral-brake by shorting motor leads together.
2896     *
2897     * <ul>
2898     * <li> <b>StaticBrake Parameters:</b> 
2899     * </ul>
2900     *
2901     * @param request                Control object to request of the device
2902     * @return Code response of the request
2903     */
2904    public StatusCode setControl(StaticBrake request)
2905    {
2906        return setControlPrivate(request);
2907    }
2908
2909    /**
2910     * Control motor with generic control request object.
2911     * <p>
2912     * User must make sure the specified object is castable to a valid control request,
2913     * otherwise this function will fail at run-time and return the NotSupported StatusCode
2914     *
2915     * @param request                Control object to request of the device
2916     * @return Status Code of the request, 0 is OK
2917     */
2918    public StatusCode setControl(ControlRequest request)
2919    {
2920        if (request instanceof DutyCycleOut)
2921            return setControl((DutyCycleOut)request);
2922        if (request instanceof TorqueCurrentFOC)
2923            return setControl((TorqueCurrentFOC)request);
2924        if (request instanceof VoltageOut)
2925            return setControl((VoltageOut)request);
2926        if (request instanceof PositionDutyCycle)
2927            return setControl((PositionDutyCycle)request);
2928        if (request instanceof PositionVoltage)
2929            return setControl((PositionVoltage)request);
2930        if (request instanceof PositionTorqueCurrentFOC)
2931            return setControl((PositionTorqueCurrentFOC)request);
2932        if (request instanceof VelocityDutyCycle)
2933            return setControl((VelocityDutyCycle)request);
2934        if (request instanceof VelocityVoltage)
2935            return setControl((VelocityVoltage)request);
2936        if (request instanceof VelocityTorqueCurrentFOC)
2937            return setControl((VelocityTorqueCurrentFOC)request);
2938        if (request instanceof MotionMagicDutyCycle)
2939            return setControl((MotionMagicDutyCycle)request);
2940        if (request instanceof MotionMagicVoltage)
2941            return setControl((MotionMagicVoltage)request);
2942        if (request instanceof MotionMagicTorqueCurrentFOC)
2943            return setControl((MotionMagicTorqueCurrentFOC)request);
2944        if (request instanceof Follower)
2945            return setControl((Follower)request);
2946        if (request instanceof StrictFollower)
2947            return setControl((StrictFollower)request);
2948        if (request instanceof NeutralOut)
2949            return setControl((NeutralOut)request);
2950        if (request instanceof CoastOut)
2951            return setControl((CoastOut)request);
2952        if (request instanceof StaticBrake)
2953            return setControl((StaticBrake)request);
2954        return StatusCode.NotSupported;
2955    }
2956
2957    
2958    /**
2959     * The position to set the rotor position to right now.
2960     *
2961     * @param newValue Value to set to.
2962     * @param timeoutSeconds Maximum time to wait up to in seconds.
2963     * @return StatusCode of the set command
2964     */
2965    public StatusCode setRotorPosition(double newValue, double timeoutSeconds) {
2966        return getConfigurator().setRotorPosition(newValue, timeoutSeconds);
2967    }
2968    /**
2969     * The position to set the rotor position to right now.
2970     * <p>
2971     * This will wait up to 0.050 seconds (50ms) by default.
2972     *
2973     * @param newValue Value to set to.
2974     * @return StatusCode of the set command
2975     */
2976    public StatusCode setRotorPosition(double newValue) {
2977        return setRotorPosition(newValue, 0.050);
2978    }
2979    
2980    /**
2981     * Clear the sticky faults in the device.
2982     * <p>
2983     * This typically has no impact on the device functionality.  Instead,
2984     * it just clears telemetry faults that are accessible via API and
2985     * Tuner Self-Test.
2986     * @param timeoutSeconds Maximum time to wait up to in seconds.
2987     * @return StatusCode of the set command
2988     */
2989    public StatusCode clearStickyFaults(double timeoutSeconds) {
2990        return getConfigurator().clearStickyFaults(timeoutSeconds);
2991    }
2992    /**
2993     * Clear the sticky faults in the device.
2994     * <p>
2995     * This typically has no impact on the device functionality.  Instead,
2996     * it just clears telemetry faults that are accessible via API and
2997     * Tuner Self-Test.
2998     * <p>
2999     * This will wait up to 0.050 seconds (50ms) by default.
3000     * @return StatusCode of the set command
3001     */
3002    public StatusCode clearStickyFaults() {
3003        return clearStickyFaults(0.050);
3004    }
3005}
3006