mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[docs] Add missing docs to enum fields (NFC) (#6150)
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
This commit is contained in:
@@ -9,8 +9,11 @@ import edu.wpi.first.hal.DMAJNISample;
|
||||
|
||||
public class DMASample {
|
||||
public enum DMAReadStatus {
|
||||
/** OK status. */
|
||||
kOk(1),
|
||||
/** Timeout status. */
|
||||
kTimeout(2),
|
||||
/** Error status. */
|
||||
kError(3);
|
||||
|
||||
private final int value;
|
||||
|
||||
@@ -21,8 +21,11 @@ import edu.wpi.first.util.sendable.SendableRegistry;
|
||||
public class DoubleSolenoid implements Sendable, AutoCloseable {
|
||||
/** Possible values for a DoubleSolenoid. */
|
||||
public enum Value {
|
||||
/** Off position. */
|
||||
kOff,
|
||||
/** Forward position. */
|
||||
kForward,
|
||||
/** Reverse position. */
|
||||
kReverse
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
/** Provide access to the network communication data to / from the Driver Station. */
|
||||
public final class DriverStation {
|
||||
/** Number of Joystick Ports. */
|
||||
/** Number of Joystick ports. */
|
||||
public static final int kJoystickPorts = 6;
|
||||
|
||||
private static class HALJoystickButtons {
|
||||
@@ -69,14 +69,21 @@ public final class DriverStation {
|
||||
|
||||
/** The robot alliance that the robot is a part of. */
|
||||
public enum Alliance {
|
||||
/** Red alliance. */
|
||||
Red,
|
||||
/** Blue alliance. */
|
||||
Blue
|
||||
}
|
||||
|
||||
/** The type of robot match that the robot is part of. */
|
||||
public enum MatchType {
|
||||
/** None. */
|
||||
None,
|
||||
/** Practice. */
|
||||
Practice,
|
||||
/** Qualification. */
|
||||
Qualification,
|
||||
/** Elimination. */
|
||||
Elimination
|
||||
}
|
||||
|
||||
|
||||
@@ -29,10 +29,15 @@ import edu.wpi.first.util.sendable.SendableRegistry;
|
||||
* before use.
|
||||
*/
|
||||
public class Encoder implements CounterBase, Sendable, AutoCloseable {
|
||||
/** Encoder indexing types. */
|
||||
public enum IndexingType {
|
||||
/** Reset while the signal is high. */
|
||||
kResetWhileHigh(0),
|
||||
/** Reset while the signal is low. */
|
||||
kResetWhileLow(1),
|
||||
/** Reset on falling edge of the signal. */
|
||||
kResetOnFallingEdge(2),
|
||||
/** Reset on rising edge of the signal. */
|
||||
kResetOnRisingEdge(3);
|
||||
|
||||
public final int value;
|
||||
|
||||
@@ -19,30 +19,51 @@ import java.util.Map;
|
||||
* the mapping of ports to hardware buttons depends on the code in the Driver Station.
|
||||
*/
|
||||
public class GenericHID {
|
||||
/** Represents a rumble output on the JoyStick. */
|
||||
/** Represents a rumble output on the Joystick. */
|
||||
public enum RumbleType {
|
||||
/** Left rumble motor. */
|
||||
kLeftRumble,
|
||||
/** Right rumble motor. */
|
||||
kRightRumble,
|
||||
/** Both left and right rumble motors. */
|
||||
kBothRumble
|
||||
}
|
||||
|
||||
/** USB HID interface type. */
|
||||
public enum HIDType {
|
||||
/** Unknown. */
|
||||
kUnknown(-1),
|
||||
/** XInputUnknown. */
|
||||
kXInputUnknown(0),
|
||||
/** XInputGamepad. */
|
||||
kXInputGamepad(1),
|
||||
/** XInputWheel. */
|
||||
kXInputWheel(2),
|
||||
/** XInputArcadeStick. */
|
||||
kXInputArcadeStick(3),
|
||||
/** XInputFlightStick. */
|
||||
kXInputFlightStick(4),
|
||||
/** XInputDancePad. */
|
||||
kXInputDancePad(5),
|
||||
/** XInputGuitar. */
|
||||
kXInputGuitar(6),
|
||||
/** XInputGuitar2. */
|
||||
kXInputGuitar2(7),
|
||||
/** XInputDrumKit. */
|
||||
kXInputDrumKit(8),
|
||||
/** XInputGuitar3. */
|
||||
kXInputGuitar3(11),
|
||||
/** XInputArcadePad. */
|
||||
kXInputArcadePad(19),
|
||||
/** HIDJoystick. */
|
||||
kHIDJoystick(20),
|
||||
/** HIDGamepad. */
|
||||
kHIDGamepad(21),
|
||||
/** HIDDriving. */
|
||||
kHIDDriving(22),
|
||||
/** HIDFlight. */
|
||||
kHIDFlight(23),
|
||||
/** HID1stPerson. */
|
||||
kHID1stPerson(24);
|
||||
|
||||
public final int value;
|
||||
|
||||
@@ -23,8 +23,11 @@ import java.nio.ByteBuffer;
|
||||
* WPILib Known Issues</a> page for details.
|
||||
*/
|
||||
public class I2C implements AutoCloseable {
|
||||
/** I2C connection ports. */
|
||||
public enum Port {
|
||||
/** Onboard I2C port. */
|
||||
kOnboard(0),
|
||||
/** MXP (roboRIO MXP) I2C port. */
|
||||
kMXP(1);
|
||||
|
||||
public final int value;
|
||||
|
||||
@@ -25,10 +25,15 @@ public class Joystick extends GenericHID {
|
||||
|
||||
/** Represents an analog axis on a joystick. */
|
||||
public enum AxisType {
|
||||
/** X axis. */
|
||||
kX(0),
|
||||
/** Y axis. */
|
||||
kY(1),
|
||||
/** Z axis. */
|
||||
kZ(2),
|
||||
/** Twist axis. */
|
||||
kTwist(3),
|
||||
/** Throttle axis. */
|
||||
kThrottle(4);
|
||||
|
||||
public final int value;
|
||||
@@ -40,7 +45,9 @@ public class Joystick extends GenericHID {
|
||||
|
||||
/** Represents a digital button on a joystick. */
|
||||
public enum ButtonType {
|
||||
/** kTrigger. */
|
||||
kTrigger(1),
|
||||
/** kTop. */
|
||||
kTop(2);
|
||||
|
||||
public final int value;
|
||||
|
||||
@@ -34,19 +34,33 @@ public class PS4Controller extends GenericHID {
|
||||
|
||||
/** Represents a digital button on a PS4Controller. */
|
||||
public enum Button {
|
||||
/** Square button. */
|
||||
kSquare(1),
|
||||
/** X button. */
|
||||
kCross(2),
|
||||
/** Circle button. */
|
||||
kCircle(3),
|
||||
/** Triangle button. */
|
||||
kTriangle(4),
|
||||
/** Left Trigger 1 button. */
|
||||
kL1(5),
|
||||
/** Right Trigger 1 button. */
|
||||
kR1(6),
|
||||
/** Left Trigger 2 button. */
|
||||
kL2(7),
|
||||
/** Right Trigger 2 button. */
|
||||
kR2(8),
|
||||
/** Share button. */
|
||||
kShare(9),
|
||||
/** Option button. */
|
||||
kOptions(10),
|
||||
/** Left stick button. */
|
||||
kL3(11),
|
||||
/** Right stick button. */
|
||||
kR3(12),
|
||||
/** PlayStation button. */
|
||||
kPS(13),
|
||||
/** Touchpad click button. */
|
||||
kTouchpad(14);
|
||||
|
||||
public final int value;
|
||||
@@ -75,11 +89,17 @@ public class PS4Controller extends GenericHID {
|
||||
|
||||
/** Represents an axis on a PS4Controller. */
|
||||
public enum Axis {
|
||||
/** Left X axis. */
|
||||
kLeftX(0),
|
||||
/** Left Y axis. */
|
||||
kLeftY(1),
|
||||
/** Right X axis. */
|
||||
kRightX(2),
|
||||
/** Right Y axis. */
|
||||
kRightY(5),
|
||||
/** Left Trigger 2. */
|
||||
kL2(3),
|
||||
/** Right Trigger 2. */
|
||||
kR2(4);
|
||||
|
||||
public final int value;
|
||||
|
||||
@@ -31,19 +31,33 @@ public class PS5Controller extends GenericHID {
|
||||
|
||||
/** Represents a digital button on a PS5Controller. */
|
||||
public enum Button {
|
||||
/** Square button. */
|
||||
kSquare(1),
|
||||
/** X button. */
|
||||
kCross(2),
|
||||
/** Circle button. */
|
||||
kCircle(3),
|
||||
/** Triangle button. */
|
||||
kTriangle(4),
|
||||
/** Left trigger 1 button. */
|
||||
kL1(5),
|
||||
/** Right trigger 1 button. */
|
||||
kR1(6),
|
||||
/** Left trigger 2 button. */
|
||||
kL2(7),
|
||||
/** Right trigger 2 button. */
|
||||
kR2(8),
|
||||
/** Create button. */
|
||||
kCreate(9),
|
||||
/** Options button. */
|
||||
kOptions(10),
|
||||
/** Left stick button. */
|
||||
kL3(11),
|
||||
/** Right stick button. */
|
||||
kR3(12),
|
||||
/** PlayStation button. */
|
||||
kPS(13),
|
||||
/** Touchpad click button. */
|
||||
kTouchpad(14);
|
||||
|
||||
public final int value;
|
||||
@@ -72,11 +86,17 @@ public class PS5Controller extends GenericHID {
|
||||
|
||||
/** Represents an axis on a PS5Controller. */
|
||||
public enum Axis {
|
||||
/** Left X axis. */
|
||||
kLeftX(0),
|
||||
/** Left Y axis. */
|
||||
kLeftY(1),
|
||||
kL2(3),
|
||||
/** Right X axis. */
|
||||
kRightX(2),
|
||||
/** Right Y axis. */
|
||||
kRightY(5),
|
||||
/** Left Trigger 2. */
|
||||
kL2(3),
|
||||
/** Right Trigger 2. */
|
||||
kR2(4);
|
||||
|
||||
public final int value;
|
||||
|
||||
@@ -24,8 +24,11 @@ public class PowerDistribution implements Sendable, AutoCloseable {
|
||||
|
||||
public static final int kDefaultModule = PowerDistributionJNI.DEFAULT_MODULE;
|
||||
|
||||
/** Power distribution module type. */
|
||||
public enum ModuleType {
|
||||
/** CTRE (Cross The Road Electronics) CTRE Power Distribution Panel (PDP). */
|
||||
kCTRE(PowerDistributionJNI.CTRE_TYPE),
|
||||
/** REV Power Distribution Hub (PDH). */
|
||||
kRev(PowerDistributionJNI.REV_TYPE);
|
||||
|
||||
public final int value;
|
||||
|
||||
@@ -44,9 +44,13 @@ public class Relay extends MotorSafety implements Sendable, AutoCloseable {
|
||||
|
||||
/** The state to drive a Relay to. */
|
||||
public enum Value {
|
||||
/** Off. */
|
||||
kOff("Off"),
|
||||
/** On. */
|
||||
kOn("On"),
|
||||
/** Forward. */
|
||||
kForward("Forward"),
|
||||
/** Reverse. */
|
||||
kReverse("Reverse");
|
||||
|
||||
private final String m_prettyValue;
|
||||
@@ -66,11 +70,11 @@ public class Relay extends MotorSafety implements Sendable, AutoCloseable {
|
||||
|
||||
/** The Direction(s) that a relay is configured to operate in. */
|
||||
public enum Direction {
|
||||
/** direction: both directions are valid. */
|
||||
/** Both directions are valid. */
|
||||
kBoth,
|
||||
/** direction: Only forward is valid. */
|
||||
/** Only forward is valid. */
|
||||
kForward,
|
||||
/** direction: only reverse is valid. */
|
||||
/** Only reverse is valid. */
|
||||
kReverse
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,11 @@ package edu.wpi.first.wpilibj;
|
||||
import edu.wpi.first.hal.HALUtil;
|
||||
|
||||
public enum RuntimeType {
|
||||
/** RoboRio 1.0. */
|
||||
kRoboRIO(HALUtil.RUNTIME_ROBORIO),
|
||||
/** RoboRio 2.0. */
|
||||
kRoboRIO2(HALUtil.RUNTIME_ROBORIO2),
|
||||
/** Simulation runtime. */
|
||||
kSimulation(HALUtil.RUNTIME_SIMULATION);
|
||||
|
||||
public final int value;
|
||||
|
||||
@@ -14,11 +14,17 @@ import java.nio.IntBuffer;
|
||||
|
||||
/** Represents an SPI bus port. */
|
||||
public class SPI implements AutoCloseable {
|
||||
/** SPI port. */
|
||||
public enum Port {
|
||||
/** Onboard SPI bus port CS0. */
|
||||
kOnboardCS0(SPIJNI.ONBOARD_CS0_PORT),
|
||||
/** Onboard SPI bus port CS1. */
|
||||
kOnboardCS1(SPIJNI.ONBOARD_CS1_PORT),
|
||||
/** Onboard SPI bus port CS2. */
|
||||
kOnboardCS2(SPIJNI.ONBOARD_CS2_PORT),
|
||||
/** Onboard SPI bus port CS3. */
|
||||
kOnboardCS3(SPIJNI.ONBOARD_CS3_PORT),
|
||||
/** MXP (roboRIO MXP) SPI bus port. */
|
||||
kMXP(SPIJNI.MXP_PORT);
|
||||
|
||||
public final int value;
|
||||
@@ -28,6 +34,7 @@ public class SPI implements AutoCloseable {
|
||||
}
|
||||
}
|
||||
|
||||
/** SPI mode. */
|
||||
public enum Mode {
|
||||
/** Clock idle low, data sampled on rising edge. */
|
||||
kMode0(SPIJNI.SPI_MODE0),
|
||||
|
||||
@@ -13,11 +13,17 @@ import java.nio.charset.StandardCharsets;
|
||||
public class SerialPort implements AutoCloseable {
|
||||
private int m_portHandle;
|
||||
|
||||
/** Serial port. */
|
||||
public enum Port {
|
||||
/** Onboard serial port on the roboRIO. */
|
||||
kOnboard(0),
|
||||
/** MXP (roboRIO MXP) serial port. */
|
||||
kMXP(1),
|
||||
/** USB serial port (same as KUSB1). */
|
||||
kUSB(2),
|
||||
/** USB serial port 1. */
|
||||
kUSB1(2),
|
||||
/** USB serial port 2. */
|
||||
kUSB2(3);
|
||||
|
||||
public final int value;
|
||||
@@ -29,10 +35,15 @@ public class SerialPort implements AutoCloseable {
|
||||
|
||||
/** Represents the parity to use for serial communications. */
|
||||
public enum Parity {
|
||||
/** No parity. */
|
||||
kNone(0),
|
||||
/** Odd parity. */
|
||||
kOdd(1),
|
||||
/** Even parity. */
|
||||
kEven(2),
|
||||
/** Parity bit always on. */
|
||||
kMark(3),
|
||||
/** Parity bit always off. */
|
||||
kSpace(4);
|
||||
|
||||
public final int value;
|
||||
@@ -44,8 +55,11 @@ public class SerialPort implements AutoCloseable {
|
||||
|
||||
/** Represents the number of stop bits to use for Serial Communication. */
|
||||
public enum StopBits {
|
||||
/** One stop bit. */
|
||||
kOne(10),
|
||||
/** One and a half stop bits. */
|
||||
kOnePointFive(15),
|
||||
/** Two stop bits. */
|
||||
kTwo(20);
|
||||
|
||||
public final int value;
|
||||
@@ -57,9 +71,13 @@ public class SerialPort implements AutoCloseable {
|
||||
|
||||
/** Represents what type of flow control to use for serial communication. */
|
||||
public enum FlowControl {
|
||||
/** No flow control. */
|
||||
kNone(0),
|
||||
/** XON/XOFF flow control. */
|
||||
kXonXoff(1),
|
||||
/** RTS/CTS flow control. */
|
||||
kRtsCts(2),
|
||||
/** DTS/DSR flow control. */
|
||||
kDtsDsr(4);
|
||||
|
||||
public final int value;
|
||||
@@ -71,7 +89,9 @@ public class SerialPort implements AutoCloseable {
|
||||
|
||||
/** Represents which type of buffer mode to use when writing to a serial port. */
|
||||
public enum WriteBufferMode {
|
||||
/** Flush the buffer on each access. */
|
||||
kFlushOnAccess(1),
|
||||
/** Flush the buffer when it is full. */
|
||||
kFlushWhenFull(2);
|
||||
|
||||
public final int value;
|
||||
|
||||
@@ -19,20 +19,35 @@ import edu.wpi.first.wpilibj.event.EventLoop;
|
||||
public class StadiaController extends GenericHID {
|
||||
/** Represents a digital button on a StadiaController. */
|
||||
public enum Button {
|
||||
/** A button. */
|
||||
kA(1),
|
||||
/** B button. */
|
||||
kB(2),
|
||||
/** X Button. */
|
||||
kX(3),
|
||||
/** Y Button. */
|
||||
kY(4),
|
||||
/** Left bumper button. */
|
||||
kLeftBumper(5),
|
||||
/** Right bumper button. */
|
||||
kRightBumper(6),
|
||||
/** Left stick button. */
|
||||
kLeftStick(7),
|
||||
/** Right stick button. */
|
||||
kRightStick(8),
|
||||
/** Ellipses button. */
|
||||
kEllipses(9),
|
||||
/** Hamburger button. */
|
||||
kHamburger(10),
|
||||
/** Stadia button. */
|
||||
kStadia(11),
|
||||
/** Right trigger button. */
|
||||
kRightTrigger(12),
|
||||
/** Left trigger button. */
|
||||
kLeftTrigger(13),
|
||||
/** Google button. */
|
||||
kGoogle(14),
|
||||
/** Frame button. */
|
||||
kFrame(15);
|
||||
|
||||
public final int value;
|
||||
@@ -61,9 +76,13 @@ public class StadiaController extends GenericHID {
|
||||
|
||||
/** Represents an axis on a StadiaController. */
|
||||
public enum Axis {
|
||||
/** Left X axis. */
|
||||
kLeftX(0),
|
||||
/** Right X axis. */
|
||||
kRightX(3),
|
||||
/** Left Y axis. */
|
||||
kLeftY(1),
|
||||
/** Right Y axis. */
|
||||
kRightY(4);
|
||||
|
||||
public final int value;
|
||||
|
||||
@@ -23,9 +23,13 @@ public class SynchronousInterrupt implements AutoCloseable {
|
||||
|
||||
/** Event trigger combinations for a synchronous interrupt. */
|
||||
public enum WaitResult {
|
||||
/** Timeout event. */
|
||||
kTimeout(0x0),
|
||||
/** Rising edge event. */
|
||||
kRisingEdge(0x1),
|
||||
/** Falling edge event. */
|
||||
kFallingEdge(0x100),
|
||||
/** Both rising and falling edge events. */
|
||||
kBoth(0x101);
|
||||
|
||||
public final int value;
|
||||
|
||||
@@ -4,10 +4,15 @@
|
||||
|
||||
package edu.wpi.first.wpilibj.counter;
|
||||
|
||||
/** Edge configuration. */
|
||||
public enum EdgeConfiguration {
|
||||
/** No edge configuration (neither rising nor falling). */
|
||||
kNone(false, false),
|
||||
/** Rising edge configuration. */
|
||||
kRisingEdge(true, false),
|
||||
/** Falling edge configuration. */
|
||||
kFallingEdge(false, true),
|
||||
/** Both rising and falling edge configuration. */
|
||||
kBoth(true, true);
|
||||
|
||||
@SuppressWarnings("MemberName")
|
||||
|
||||
@@ -20,12 +20,19 @@ public abstract class RobotDriveBase extends MotorSafety {
|
||||
|
||||
/** The location of a motor on the robot for the purpose of driving. */
|
||||
public enum MotorType {
|
||||
/** Front left motor. */
|
||||
kFrontLeft(0),
|
||||
/** Front right motor. */
|
||||
kFrontRight(1),
|
||||
/** Rear left motor. */
|
||||
kRearLeft(2),
|
||||
/** Reat right motor. */
|
||||
kRearRight(3),
|
||||
/** Left motor. */
|
||||
kLeft(0),
|
||||
/** Right motor. */
|
||||
kRight(1),
|
||||
/** Back motor. */
|
||||
kBack(2);
|
||||
|
||||
public final int value;
|
||||
|
||||
@@ -369,10 +369,15 @@ public class DifferentialDrivetrainSim {
|
||||
* and 16:48 8.45:1 -- 14:50 and 19:45 7.31:1 -- 14:50 and 21:43 5.95:1 -- 14:50 and 24:40
|
||||
*/
|
||||
public enum KitbotGearing {
|
||||
/** Gear ratio of 12.75:1. */
|
||||
k12p75(12.75),
|
||||
/** Gear ratio of 10.71:1. */
|
||||
k10p71(10.71),
|
||||
/** Gear ratio of 8.45:1. */
|
||||
k8p45(8.45),
|
||||
/** Gear ratio of 7.31:1. */
|
||||
k7p31(7.31),
|
||||
/** Gear ratio of 5.95:1. */
|
||||
k5p95(5.95);
|
||||
|
||||
public final double value;
|
||||
@@ -384,13 +389,21 @@ public class DifferentialDrivetrainSim {
|
||||
|
||||
/** Represents common motor layouts of the kit drivetrain. */
|
||||
public enum KitbotMotor {
|
||||
/** One CIM motor per drive side. */
|
||||
kSingleCIMPerSide(DCMotor.getCIM(1)),
|
||||
/** Two CIM motors per drive side. */
|
||||
kDualCIMPerSide(DCMotor.getCIM(2)),
|
||||
/** One Mini CIM motor per drive side. */
|
||||
kSingleMiniCIMPerSide(DCMotor.getMiniCIM(1)),
|
||||
/** Two Mini CIM motors per drive side. */
|
||||
kDualMiniCIMPerSide(DCMotor.getMiniCIM(2)),
|
||||
/** One Falcon 500 motor per drive side. */
|
||||
kSingleFalcon500PerSide(DCMotor.getFalcon500(1)),
|
||||
/** Two Falcon 500 motors per drive side. */
|
||||
kDoubleFalcon500PerSide(DCMotor.getFalcon500(2)),
|
||||
/** One NEO motor per drive side. */
|
||||
kSingleNEOPerSide(DCMotor.getNEO(1)),
|
||||
/** Two NEO motors per drive side. */
|
||||
kDoubleNEOPerSide(DCMotor.getNEO(2));
|
||||
|
||||
public final DCMotor value;
|
||||
@@ -402,8 +415,11 @@ public class DifferentialDrivetrainSim {
|
||||
|
||||
/** Represents common wheel sizes of the kit drivetrain. */
|
||||
public enum KitbotWheelSize {
|
||||
/** Six inch diameter wheels. */
|
||||
kSixInch(Units.inchesToMeters(6)),
|
||||
/** Eight inch diameter wheels. */
|
||||
kEightInch(Units.inchesToMeters(8)),
|
||||
/** Ten inch diameter wheels. */
|
||||
kTenInch(Units.inchesToMeters(10));
|
||||
|
||||
public final double value;
|
||||
|
||||
Reference in New Issue
Block a user