001/*----------------------------------------------------------------------------*/
002/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
003/* Open Source Software - may be modified and shared by FRC teams. The code   */
004/* must be accompanied by the FIRST BSD license file in the root directory of */
005/* the project.                                                               */
006/*----------------------------------------------------------------------------*/
007
008package edu.wpi.first.wpilibj;
009
010import edu.wpi.first.wpilibj.hal.PowerJNI;
011
012/**
013 * Old Controller PR class.
014 * @deprecated Use RobotController class instead
015 */
016@Deprecated
017public class ControllerPower {
018  /**
019   * Get the input voltage to the robot controller.
020   *
021   * @return The controller input voltage value in Volts
022   */
023  @Deprecated
024  public static double getInputVoltage() {
025    return PowerJNI.getVinVoltage();
026  }
027
028  /**
029   * Get the input current to the robot controller.
030   *
031   * @return The controller input current value in Amps
032   */
033  @Deprecated
034  public static double getInputCurrent() {
035    return PowerJNI.getVinCurrent();
036  }
037
038  /**
039   * Get the voltage of the 3.3V rail.
040   *
041   * @return The controller 3.3V rail voltage value in Volts
042   */
043  @Deprecated
044  public static double getVoltage3V3() {
045    return PowerJNI.getUserVoltage3V3();
046  }
047
048  /**
049   * Get the current output of the 3.3V rail.
050   *
051   * @return The controller 3.3V rail output current value in Volts
052   */
053  @Deprecated
054  public static double getCurrent3V3() {
055    return PowerJNI.getUserCurrent3V3();
056  }
057
058  /**
059   * Get the enabled state of the 3.3V rail. The rail may be disabled due to a controller brownout,
060   * a short circuit on the rail, or controller over-voltage.
061   *
062   * @return The controller 3.3V rail enabled value
063   */
064  @Deprecated
065  public static boolean getEnabled3V3() {
066    return PowerJNI.getUserActive3V3();
067  }
068
069  /**
070   * Get the count of the total current faults on the 3.3V rail since the controller has booted.
071   *
072   * @return The number of faults
073   */
074  @Deprecated
075  public static int getFaultCount3V3() {
076    return PowerJNI.getUserCurrentFaults3V3();
077  }
078
079  /**
080   * Get the voltage of the 5V rail.
081   *
082   * @return The controller 5V rail voltage value in Volts
083   */
084  @Deprecated
085  public static double getVoltage5V() {
086    return PowerJNI.getUserVoltage5V();
087  }
088
089  /**
090   * Get the current output of the 5V rail.
091   *
092   * @return The controller 5V rail output current value in Amps
093   */
094  @Deprecated
095  public static double getCurrent5V() {
096    return PowerJNI.getUserCurrent5V();
097  }
098
099  /**
100   * Get the enabled state of the 5V rail. The rail may be disabled due to a controller brownout, a
101   * short circuit on the rail, or controller over-voltage.
102   *
103   * @return The controller 5V rail enabled value
104   */
105  @Deprecated
106  public static boolean getEnabled5V() {
107    return PowerJNI.getUserActive5V();
108  }
109
110  /**
111   * Get the count of the total current faults on the 5V rail since the controller has booted.
112   *
113   * @return The number of faults
114   */
115  @Deprecated
116  public static int getFaultCount5V() {
117    return PowerJNI.getUserCurrentFaults5V();
118  }
119
120  /**
121   * Get the voltage of the 6V rail.
122   *
123   * @return The controller 6V rail voltage value in Volts
124   */
125  @Deprecated
126  public static double getVoltage6V() {
127    return PowerJNI.getUserVoltage6V();
128  }
129
130  /**
131   * Get the current output of the 6V rail.
132   *
133   * @return The controller 6V rail output current value in Amps
134   */
135  @Deprecated
136  public static double getCurrent6V() {
137    return PowerJNI.getUserCurrent6V();
138  }
139
140  /**
141   * Get the enabled state of the 6V rail. The rail may be disabled due to a controller brownout, a
142   * short circuit on the rail, or controller over-voltage.
143   *
144   * @return The controller 6V rail enabled value
145   */
146  @Deprecated
147  public static boolean getEnabled6V() {
148    return PowerJNI.getUserActive6V();
149  }
150
151  /**
152   * Get the count of the total current faults on the 6V rail since the controller has booted.
153   *
154   * @return The number of faults
155   */
156  @Deprecated
157  public static int getFaultCount6V() {
158    return PowerJNI.getUserCurrentFaults6V();
159  }
160}