From 13f4460e00d4ff925c5cb0ab9475b52908176a9e Mon Sep 17 00:00:00 2001 From: m10653 Date: Fri, 5 Jan 2024 00:36:26 -0500 Subject: [PATCH] [docs] Add missing docs to enum fields (NFC) (#6150) Co-authored-by: Tyler Veness --- .../edu/wpi/first/cscore/CameraServerJNI.java | 2 + .../java/edu/wpi/first/cscore/HttpCamera.java | 4 ++ .../java/edu/wpi/first/cscore/VideoEvent.java | 21 ++++++++ .../edu/wpi/first/cscore/VideoProperty.java | 6 +++ .../java/edu/wpi/first/cscore/VideoSink.java | 5 ++ .../edu/wpi/first/cscore/VideoSource.java | 5 ++ cscore/src/main/native/include/cscore_oo.h | 16 ++++++ .../java/edu/wpi/first/hal/CANAPITypes.java | 30 ++++++++++++ .../java/edu/wpi/first/hal/SimDevice.java | 4 ++ hal/src/main/native/include/hal/CANAPITypes.h | 30 ++++++++++++ .../first/networktables/NetworkTableType.java | 12 +++++ .../include/networktables/NetworkTableType.h | 12 +++++ .../src/main/native/include/frc/DMASample.h | 3 ++ .../main/native/include/frc/DoubleSolenoid.h | 12 ++++- .../main/native/include/frc/DriverStation.h | 26 +++++++++- wpilibc/src/main/native/include/frc/Encoder.h | 7 +++ .../src/main/native/include/frc/GenericHID.h | 32 +++++++++++- wpilibc/src/main/native/include/frc/I2C.h | 10 +++- .../src/main/native/include/frc/Joystick.h | 27 +++++++++- .../main/native/include/frc/PS4Controller.h | 26 ++++++++++ .../main/native/include/frc/PS5Controller.h | 26 ++++++++++ .../native/include/frc/PowerDistribution.h | 11 ++++- wpilibc/src/main/native/include/frc/Relay.h | 27 +++++++++- wpilibc/src/main/native/include/frc/SPI.h | 34 ++++++++++--- .../src/main/native/include/frc/SerialPort.h | 49 +++++++++++++++++-- .../native/include/frc/StadiaController.h | 25 ++++++++++ .../native/include/frc/SynchronousInterrupt.h | 4 ++ .../include/frc/counter/EdgeConfiguration.h | 7 +++ .../native/include/frc/drive/RobotDriveBase.h | 7 +++ .../simulation/DifferentialDrivetrainSim.h | 22 +++++++++ .../java/edu/wpi/first/wpilibj/DMASample.java | 3 ++ .../edu/wpi/first/wpilibj/DoubleSolenoid.java | 3 ++ .../edu/wpi/first/wpilibj/DriverStation.java | 9 +++- .../java/edu/wpi/first/wpilibj/Encoder.java | 5 ++ .../edu/wpi/first/wpilibj/GenericHID.java | 23 ++++++++- .../main/java/edu/wpi/first/wpilibj/I2C.java | 3 ++ .../java/edu/wpi/first/wpilibj/Joystick.java | 7 +++ .../edu/wpi/first/wpilibj/PS4Controller.java | 20 ++++++++ .../edu/wpi/first/wpilibj/PS5Controller.java | 22 ++++++++- .../wpi/first/wpilibj/PowerDistribution.java | 3 ++ .../java/edu/wpi/first/wpilibj/Relay.java | 10 ++-- .../edu/wpi/first/wpilibj/RuntimeType.java | 3 ++ .../main/java/edu/wpi/first/wpilibj/SPI.java | 7 +++ .../edu/wpi/first/wpilibj/SerialPort.java | 20 ++++++++ .../wpi/first/wpilibj/StadiaController.java | 19 +++++++ .../first/wpilibj/SynchronousInterrupt.java | 4 ++ .../wpilibj/counter/EdgeConfiguration.java | 5 ++ .../first/wpilibj/drive/RobotDriveBase.java | 7 +++ .../simulation/DifferentialDrivetrainSim.java | 16 ++++++ 49 files changed, 665 insertions(+), 26 deletions(-) diff --git a/cscore/src/main/java/edu/wpi/first/cscore/CameraServerJNI.java b/cscore/src/main/java/edu/wpi/first/cscore/CameraServerJNI.java index 3dcf66f79e..0d534b0db7 100644 --- a/cscore/src/main/java/edu/wpi/first/cscore/CameraServerJNI.java +++ b/cscore/src/main/java/edu/wpi/first/cscore/CameraServerJNI.java @@ -304,7 +304,9 @@ public class CameraServerJNI { // Telemetry Functions // public enum TelemetryKind { + /** kSourceBytesReceived. */ kSourceBytesReceived(1), + /** kSourceFramesReceived. */ kSourceFramesReceived(2); private final int value; diff --git a/cscore/src/main/java/edu/wpi/first/cscore/HttpCamera.java b/cscore/src/main/java/edu/wpi/first/cscore/HttpCamera.java index 8c72350e63..e74b4ed338 100644 --- a/cscore/src/main/java/edu/wpi/first/cscore/HttpCamera.java +++ b/cscore/src/main/java/edu/wpi/first/cscore/HttpCamera.java @@ -7,9 +7,13 @@ package edu.wpi.first.cscore; /** A source that represents a MJPEG-over-HTTP (IP) camera. */ public class HttpCamera extends VideoCamera { public enum HttpCameraKind { + /** Unknown camera kind. */ kUnknown(0), + /** MJPG Streamer camera. */ kMJPGStreamer(1), + /** CS Core camera. */ kCSCore(2), + /** Axis camera. */ kAxis(3); private final int value; diff --git a/cscore/src/main/java/edu/wpi/first/cscore/VideoEvent.java b/cscore/src/main/java/edu/wpi/first/cscore/VideoEvent.java index 0c60d6df32..55ba6e929c 100644 --- a/cscore/src/main/java/edu/wpi/first/cscore/VideoEvent.java +++ b/cscore/src/main/java/edu/wpi/first/cscore/VideoEvent.java @@ -8,26 +8,47 @@ package edu.wpi.first.cscore; @SuppressWarnings("MemberName") public class VideoEvent { public enum Kind { + /** Unknown video event. */ kUnknown(0x0000), + /** Source Created event. */ kSourceCreated(0x0001), + /** Source Destroyed event. */ kSourceDestroyed(0x0002), + /** Source Connected event. */ kSourceConnected(0x0004), + /** Source Disconnected event. */ kSourceDisconnected(0x0008), + /** Source Video Modes Updated event. */ kSourceVideoModesUpdated(0x0010), + /** Source VideoMode Changed event. */ kSourceVideoModeChanged(0x0020), + /** Source Property Created event. */ kSourcePropertyCreated(0x0040), + /** Source Property Value Updated event. */ kSourcePropertyValueUpdated(0x0080), + /** Source Property Choices Updated event. */ kSourcePropertyChoicesUpdated(0x0100), + /** Sink Source Changed event. */ kSinkSourceChanged(0x0200), + /** Sink Created event. */ kSinkCreated(0x0400), + /** Sink Destroyed event. */ kSinkDestroyed(0x0800), + /** Sink Enabled event. */ kSinkEnabled(0x1000), + /** Sink Disabled event. */ kSinkDisabled(0x2000), + /** Network Interfaces Changed event. */ kNetworkInterfacesChanged(0x4000), + /** Telemetry Updated event. */ kTelemetryUpdated(0x8000), + /** Sink Property Created event. */ kSinkPropertyCreated(0x10000), + /** Sink Property Value Updated event. */ kSinkPropertyValueUpdated(0x20000), + /** Sink Property Choices Updated event. */ kSinkPropertyChoicesUpdated(0x40000), + /** Usb Cameras Changed event. */ kUsbCamerasChanged(0x80000); private final int value; diff --git a/cscore/src/main/java/edu/wpi/first/cscore/VideoProperty.java b/cscore/src/main/java/edu/wpi/first/cscore/VideoProperty.java index 8179ba3c3d..da436f339c 100644 --- a/cscore/src/main/java/edu/wpi/first/cscore/VideoProperty.java +++ b/cscore/src/main/java/edu/wpi/first/cscore/VideoProperty.java @@ -6,11 +6,17 @@ package edu.wpi.first.cscore; /** A source or sink property. */ public class VideoProperty { + /** VideoProperty property types. */ public enum Kind { + /** No specific property. */ kNone(0), + /** Boolean property. */ kBoolean(1), + /** Integer property. */ kInteger(2), + /** String property. */ kString(4), + /** Enum property. */ kEnum(8); private final int value; diff --git a/cscore/src/main/java/edu/wpi/first/cscore/VideoSink.java b/cscore/src/main/java/edu/wpi/first/cscore/VideoSink.java index 8b07f4634f..4540618198 100644 --- a/cscore/src/main/java/edu/wpi/first/cscore/VideoSink.java +++ b/cscore/src/main/java/edu/wpi/first/cscore/VideoSink.java @@ -9,10 +9,15 @@ package edu.wpi.first.cscore; * (e.g. from a stereo or depth camera); these are called channels. */ public class VideoSink implements AutoCloseable { + /** Video sink types. */ public enum Kind { + /** Unknown video sink type. */ kUnknown(0), + /** MJPEG video sink. */ kMjpeg(2), + /** CV video sink. */ kCv(4), + /** Raw video sink. */ kRaw(8); private final int value; diff --git a/cscore/src/main/java/edu/wpi/first/cscore/VideoSource.java b/cscore/src/main/java/edu/wpi/first/cscore/VideoSource.java index 32c784998a..cee5eaaba9 100644 --- a/cscore/src/main/java/edu/wpi/first/cscore/VideoSource.java +++ b/cscore/src/main/java/edu/wpi/first/cscore/VideoSource.java @@ -12,10 +12,15 @@ import edu.wpi.first.util.PixelFormat; */ public class VideoSource implements AutoCloseable { public enum Kind { + /** Unknown video source. */ kUnknown(0), + /** USB video source. */ kUsb(1), + /** HTTP video source. */ kHttp(2), + /** CV video source. */ kCv(4), + /** Raw video source. */ kRaw(8); private final int value; diff --git a/cscore/src/main/native/include/cscore_oo.h b/cscore/src/main/native/include/cscore_oo.h index f13a6fd977..6fca373cc3 100644 --- a/cscore/src/main/native/include/cscore_oo.h +++ b/cscore/src/main/native/include/cscore_oo.h @@ -44,10 +44,15 @@ class VideoProperty { public: enum Kind { + /// No specific property. kNone = CS_PROP_NONE, + /// Boolean property. kBoolean = CS_PROP_BOOLEAN, + /// Integer property. kInteger = CS_PROP_INTEGER, + /// String property. kString = CS_PROP_STRING, + /// Enum property. kEnum = CS_PROP_ENUM }; @@ -100,9 +105,13 @@ class VideoSource { public: enum Kind { + /// Unknown video source. kUnknown = CS_SOURCE_UNKNOWN, + /// USB video source. kUsb = CS_SOURCE_USB, + /// HTTP video source. kHttp = CS_SOURCE_HTTP, + /// CV video source. kCv = CS_SOURCE_CV }; @@ -471,9 +480,13 @@ class UsbCamera : public VideoCamera { class HttpCamera : public VideoCamera { public: enum HttpCameraKind { + /// Unknown camera kind. kUnknown = CS_HTTP_UNKNOWN, + /// MJPG Streamer camera. kMJPGStreamer = CS_HTTP_MJPGSTREAMER, + /// CS Core camera. kCSCore = CS_HTTP_CSCORE, + /// Axis camera. kAxis = CS_HTTP_AXIS }; @@ -716,8 +729,11 @@ class VideoSink { public: enum Kind { + /// Unknown sink type. kUnknown = CS_SINK_UNKNOWN, + /// MJPEG video sink. kMjpeg = CS_SINK_MJPEG, + /// CV video sink. kCv = CS_SINK_CV }; diff --git a/hal/src/main/java/edu/wpi/first/hal/CANAPITypes.java b/hal/src/main/java/edu/wpi/first/hal/CANAPITypes.java index e2114b944b..5a8a3e6f86 100644 --- a/hal/src/main/java/edu/wpi/first/hal/CANAPITypes.java +++ b/hal/src/main/java/edu/wpi/first/hal/CANAPITypes.java @@ -23,18 +23,31 @@ public final class CANAPITypes { * Device Types */ public enum CANDeviceType { + /** Broadcast. */ kBroadcast(0), + /** Robot controller. */ kRobotController(1), + /** Motor controller. */ kMotorController(2), + /** Relay controller. */ kRelayController(3), + /** Gyro sensor. */ kGyroSensor(4), + /** Accelerometer. */ kAccelerometer(5), + /** Ultrasonic sensor. */ kUltrasonicSensor(6), + /** Gear tooth sensor. */ kGearToothSensor(7), + /** Power distribution. */ kPowerDistribution(8), + /** Pneumatics. */ kPneumatics(9), + /** Miscellaneous. */ kMiscellaneous(10), + /** IO breakout. */ kIOBreakout(11), + /** Firmware update. */ kFirmwareUpdate(31); @SuppressWarnings("PMD.MemberName") @@ -56,22 +69,39 @@ public final class CANAPITypes { * Manufacturer IDs */ public enum CANManufacturer { + /** Broadcast. */ kBroadcast(0), + /** National Instruments. */ kNI(1), + /** Luminary Micro. */ kLM(2), + /** DEKA Research and Development Corp. */ kDEKA(3), + /** Cross the Road Electronics. */ kCTRE(4), + /** REV Robotics. */ kREV(5), + /** Grapple. */ kGrapple(6), + /** MindSensors. */ kMS(7), + /** Team use. */ kTeamUse(8), + /** Kauai Labs. */ kKauaiLabs(9), + /** Copperforge. */ kCopperforge(10), + /** Playing With Fusion. */ kPWF(11), + /** Studica. */ kStudica(12), + /** TheThriftyBot. */ kTheThriftyBot(13), + /** Redux Robotics. */ kReduxRobotics(14), + /** AndyMark. */ kAndyMark(15), + /** Vivid-Hosting. */ kVividHosting(16); @SuppressWarnings("PMD.MemberName") diff --git a/hal/src/main/java/edu/wpi/first/hal/SimDevice.java b/hal/src/main/java/edu/wpi/first/hal/SimDevice.java index 21ac69aaaa..4c57d05595 100644 --- a/hal/src/main/java/edu/wpi/first/hal/SimDevice.java +++ b/hal/src/main/java/edu/wpi/first/hal/SimDevice.java @@ -16,9 +16,13 @@ package edu.wpi.first.hal; * edu.wpi.first.wpilibj.ADXRS450_Gyro} for an example implementation. */ public class SimDevice implements AutoCloseable { + /** Sim device direction. */ public enum Direction { + /** Input direction for simulation devices. */ kInput(SimDeviceJNI.kInput), + /** Output direction for simulation devices. */ kOutput(SimDeviceJNI.kOutput), + /** Bidirectional direction for simulation devices. */ kBidir(SimDeviceJNI.kBidir); public final int m_value; diff --git a/hal/src/main/native/include/hal/CANAPITypes.h b/hal/src/main/native/include/hal/CANAPITypes.h index e4a44f4ca7..247732c895 100644 --- a/hal/src/main/native/include/hal/CANAPITypes.h +++ b/hal/src/main/native/include/hal/CANAPITypes.h @@ -20,18 +20,31 @@ * Teams should use HAL_CAN_Dev_kMiscellaneous */ HAL_ENUM(HAL_CANDeviceType) { + /// Broadcast. HAL_CAN_Dev_kBroadcast = 0, + /// Robot controller. HAL_CAN_Dev_kRobotController = 1, + /// Motor controller. HAL_CAN_Dev_kMotorController = 2, + /// Relay controller. HAL_CAN_Dev_kRelayController = 3, + /// Gyro sensor. HAL_CAN_Dev_kGyroSensor = 4, + /// Accelerometer. HAL_CAN_Dev_kAccelerometer = 5, + /// Ultrasonic sensor. HAL_CAN_Dev_kUltrasonicSensor = 6, + /// Gear tooth sensor. HAL_CAN_Dev_kGearToothSensor = 7, + /// Power distribution. HAL_CAN_Dev_kPowerDistribution = 8, + /// Pneumatics. HAL_CAN_Dev_kPneumatics = 9, + /// Miscellaneous. HAL_CAN_Dev_kMiscellaneous = 10, + /// IO breakout. HAL_CAN_Dev_kIOBreakout = 11, + /// Firmware update. HAL_CAN_Dev_kFirmwareUpdate = 31 }; @@ -41,22 +54,39 @@ HAL_ENUM(HAL_CANDeviceType) { * Teams should use HAL_CAN_Man_kTeamUse. */ HAL_ENUM(HAL_CANManufacturer) { + /// Broadcast. HAL_CAN_Man_kBroadcast = 0, + /// National Instruments. HAL_CAN_Man_kNI = 1, + /// Luminary Micro. HAL_CAN_Man_kLM = 2, + /// DEKA Research and Development Corp. HAL_CAN_Man_kDEKA = 3, + /// Cross the Road Electronics. HAL_CAN_Man_kCTRE = 4, + /// REV robotics. HAL_CAN_Man_kREV = 5, + /// Grapple. HAL_CAN_Man_kGrapple = 6, + /// MindSensors. HAL_CAN_Man_kMS = 7, + /// Team use. HAL_CAN_Man_kTeamUse = 8, + /// Kauai Labs. HAL_CAN_Man_kKauaiLabs = 9, + /// Copperforge. HAL_CAN_Man_kCopperforge = 10, + /// Playing With Fusion. HAL_CAN_Man_kPWF = 11, + /// Studica. HAL_CAN_Man_kStudica = 12, + /// TheThriftyBot. HAL_CAN_Man_kTheThriftyBot = 13, + /// Redux Robotics. HAL_CAN_Man_kReduxRobotics = 14, + /// AndyMark. HAL_CAN_Man_kAndyMark = 15, + /// Vivid-Hosting. HAL_CAN_Man_kVividHosting = 16 }; /** @} */ diff --git a/ntcore/src/main/java/edu/wpi/first/networktables/NetworkTableType.java b/ntcore/src/main/java/edu/wpi/first/networktables/NetworkTableType.java index 2350b49bba..3fea5a3dd0 100644 --- a/ntcore/src/main/java/edu/wpi/first/networktables/NetworkTableType.java +++ b/ntcore/src/main/java/edu/wpi/first/networktables/NetworkTableType.java @@ -6,17 +6,29 @@ package edu.wpi.first.networktables; /** Network table data types. */ public enum NetworkTableType { + /** Unassigned data type. */ kUnassigned(0, ""), + /** Boolean data type. */ kBoolean(0x01, "boolean"), + /** Double precision floating-point data type. */ kDouble(0x02, "double"), + /** String data type. */ kString(0x04, "string"), + /** Raw data type. */ kRaw(0x08, "raw"), + /** Boolean array data type. */ kBooleanArray(0x10, "boolean[]"), + /** Double precision floating-point array data type. */ kDoubleArray(0x20, "double[]"), + /** String array data type. */ kStringArray(0x40, "string[]"), + /** Integer data type. */ kInteger(0x100, "int"), + /** Single precision floating-point data type. */ kFloat(0x200, "float"), + /** Integer array data type. */ kIntegerArray(0x400, "int[]"), + /** Single precision floating-point array data type. */ kFloatArray(0x800, "float[]"); private final int m_value; diff --git a/ntcore/src/main/native/include/networktables/NetworkTableType.h b/ntcore/src/main/native/include/networktables/NetworkTableType.h index 4b60454365..3b3e086155 100644 --- a/ntcore/src/main/native/include/networktables/NetworkTableType.h +++ b/ntcore/src/main/native/include/networktables/NetworkTableType.h @@ -13,17 +13,29 @@ namespace nt { * @ingroup ntcore_cpp_api */ enum class NetworkTableType { + /// Unassigned data type. kUnassigned = NT_UNASSIGNED, + /// Boolean data type. kBoolean = NT_BOOLEAN, + /// Double precision floating-point data type. kDouble = NT_DOUBLE, + /// String data type. kString = NT_STRING, + /// Raw data type. kRaw = NT_RAW, + /// Boolean array data type. kBooleanArray = NT_BOOLEAN_ARRAY, + /// Double precision floating-point array data type. kDoubleArray = NT_DOUBLE_ARRAY, + /// String array data type. kStringArray = NT_STRING_ARRAY, + /// Integer data type. kInteger = NT_INTEGER, + /// Single precision floating-point data type. kFloat = NT_FLOAT, + /// Integer array data type. kIntegerArray = NT_INTEGER_ARRAY, + /// Single precision floating-point array data type. kFloatArray = NT_FLOAT_ARRAY }; diff --git a/wpilibc/src/main/native/include/frc/DMASample.h b/wpilibc/src/main/native/include/frc/DMASample.h index 48a0a9e9ca..7159246506 100644 --- a/wpilibc/src/main/native/include/frc/DMASample.h +++ b/wpilibc/src/main/native/include/frc/DMASample.h @@ -20,8 +20,11 @@ namespace frc { class DMASample : public HAL_DMASample { public: enum class DMAReadStatus { + /// OK status. kOk = HAL_DMA_OK, + /// Timeout status. kTimeout = HAL_DMA_TIMEOUT, + /// Error status. kError = HAL_DMA_ERROR }; diff --git a/wpilibc/src/main/native/include/frc/DoubleSolenoid.h b/wpilibc/src/main/native/include/frc/DoubleSolenoid.h index f02ba5a194..57c2c11d82 100644 --- a/wpilibc/src/main/native/include/frc/DoubleSolenoid.h +++ b/wpilibc/src/main/native/include/frc/DoubleSolenoid.h @@ -25,7 +25,17 @@ namespace frc { class DoubleSolenoid : public wpi::Sendable, public wpi::SendableHelper { public: - enum Value { kOff, kForward, kReverse }; + /** + * Possible values for a DoubleSolenoid. + */ + enum Value { + /// Off position. + kOff, + /// Forward position. + kForward, + /// Reverse position. + kReverse + }; /** * Constructs a double solenoid for a specified module of a specific module diff --git a/wpilibc/src/main/native/include/frc/DriverStation.h b/wpilibc/src/main/native/include/frc/DriverStation.h index 3b2b3df86d..dcaf4ad215 100644 --- a/wpilibc/src/main/native/include/frc/DriverStation.h +++ b/wpilibc/src/main/native/include/frc/DriverStation.h @@ -22,9 +22,31 @@ namespace frc { */ class DriverStation final { public: - enum Alliance { kRed, kBlue }; - enum MatchType { kNone, kPractice, kQualification, kElimination }; + /** + * The robot alliance that the robot is a part of. + */ + enum Alliance { + /// Red alliance. + kRed, + /// Blue alliance. + kBlue + }; + /** + * The type of robot match that the robot is part of. + */ + enum MatchType { + /// None. + kNone, + /// Practice. + kPractice, + /// Qualification. + kQualification, + /// Elimination. + kElimination + }; + + /// Number of Joystick ports. static constexpr int kJoystickPorts = 6; /** diff --git a/wpilibc/src/main/native/include/frc/Encoder.h b/wpilibc/src/main/native/include/frc/Encoder.h index 7315e1638a..8d6c10a455 100644 --- a/wpilibc/src/main/native/include/frc/Encoder.h +++ b/wpilibc/src/main/native/include/frc/Encoder.h @@ -42,10 +42,17 @@ class Encoder : public CounterBase, friend class DMASample; public: + /** + * Encoder indexing types. + */ enum IndexingType { + /// Reset while the signal is high. kResetWhileHigh, + /// Reset while the signal is low. kResetWhileLow, + /// Reset on falling edge of the signal. kResetOnFallingEdge, + /// Reset on rising edge of the signal. kResetOnRisingEdge }; diff --git a/wpilibc/src/main/native/include/frc/GenericHID.h b/wpilibc/src/main/native/include/frc/GenericHID.h index f6db94c374..aac4bec702 100644 --- a/wpilibc/src/main/native/include/frc/GenericHID.h +++ b/wpilibc/src/main/native/include/frc/GenericHID.h @@ -23,25 +23,55 @@ class EventLoop; */ class GenericHID { public: - enum RumbleType { kLeftRumble, kRightRumble, kBothRumble }; + /** + * Represents a rumble output on the Joystick. + */ + enum RumbleType { + /// Left rumble motor. + kLeftRumble, + /// Right rumble motor. + kRightRumble, + /// Both left and right rumble motors. + kBothRumble + }; + /** + * USB HID interface type. + */ 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 }; diff --git a/wpilibc/src/main/native/include/frc/I2C.h b/wpilibc/src/main/native/include/frc/I2C.h index 9489fcfb3e..54c70d5c8f 100644 --- a/wpilibc/src/main/native/include/frc/I2C.h +++ b/wpilibc/src/main/native/include/frc/I2C.h @@ -22,7 +22,15 @@ namespace frc { */ class I2C { public: - enum Port { kOnboard = 0, kMXP }; + /** + * I2C connection ports. + */ + enum Port { + /// Onboard I2C port. + kOnboard = 0, + /// MXP (roboRIO MXP) I2C port. + kMXP + }; /** * Constructor. diff --git a/wpilibc/src/main/native/include/frc/Joystick.h b/wpilibc/src/main/native/include/frc/Joystick.h index a955718c3b..f8e7e2f7cb 100644 --- a/wpilibc/src/main/native/include/frc/Joystick.h +++ b/wpilibc/src/main/native/include/frc/Joystick.h @@ -28,8 +28,31 @@ class Joystick : public GenericHID { static constexpr int kDefaultTwistChannel = 2; static constexpr int kDefaultThrottleChannel = 3; - enum AxisType { kXAxis, kYAxis, kZAxis, kTwistAxis, kThrottleAxis }; - enum ButtonType { kTriggerButton, kTopButton }; + /** + * Represents an analog axis on a joystick. + */ + enum AxisType { + /// X axis. + kXAxis, + /// Y axis. + kYAxis, + /// Z axis. + kZAxis, + /// Twist axis. + kTwistAxis, + /// Throttle axis. + kThrottleAxis + }; + + /** + * Represents a digital button on a joystick. + */ + enum ButtonType { + /// kTrigger. + kTriggerButton, + /// kTop. + kTopButton + }; /** * Construct an instance of a joystick. diff --git a/wpilibc/src/main/native/include/frc/PS4Controller.h b/wpilibc/src/main/native/include/frc/PS4Controller.h index 0a72f7fb72..881f8564f2 100644 --- a/wpilibc/src/main/native/include/frc/PS4Controller.h +++ b/wpilibc/src/main/native/include/frc/PS4Controller.h @@ -503,29 +503,55 @@ class PS4Controller : public GenericHID { */ BooleanEvent Touchpad(EventLoop* loop) const; + /** + * Represents a digital button on a PS4Controller. + */ struct Button { + /// Square button. static constexpr int kSquare = 1; + /// X button. static constexpr int kCross = 2; + /// Circle button. static constexpr int kCircle = 3; + /// Triangle button. static constexpr int kTriangle = 4; + /// Left Trigger 1 button. static constexpr int kL1 = 5; + /// Right Trigger 1 button. static constexpr int kR1 = 6; + /// Left Trigger 2 button. static constexpr int kL2 = 7; + /// Right Trigger 2 button. static constexpr int kR2 = 8; + /// Share button. static constexpr int kShare = 9; + /// Option button. static constexpr int kOptions = 10; + /// Left stick button. static constexpr int kL3 = 11; + /// Right stick button. static constexpr int kR3 = 12; + /// PlayStation button. static constexpr int kPS = 13; + /// Touchpad click button. static constexpr int kTouchpad = 14; }; + /** + * Represents an axis on a PS4Controller. + */ struct Axis { + /// Left X axis. static constexpr int kLeftX = 0; + /// Left Y axis. static constexpr int kLeftY = 1; + /// Right X axis. static constexpr int kRightX = 2; + /// Right Y axis. static constexpr int kRightY = 5; + /// Left Trigger 2. static constexpr int kL2 = 3; + /// Right Trigger 2. static constexpr int kR2 = 4; }; }; diff --git a/wpilibc/src/main/native/include/frc/PS5Controller.h b/wpilibc/src/main/native/include/frc/PS5Controller.h index 15a0a0515e..e9d5235230 100644 --- a/wpilibc/src/main/native/include/frc/PS5Controller.h +++ b/wpilibc/src/main/native/include/frc/PS5Controller.h @@ -503,29 +503,55 @@ class PS5Controller : public GenericHID { */ BooleanEvent Touchpad(EventLoop* loop) const; + /** + * Represents a digital button on a PS5Controller. + */ struct Button { + /// Square button. static constexpr int kSquare = 1; + /// X button. static constexpr int kCross = 2; + /// Circle button. static constexpr int kCircle = 3; + /// Triangle button. static constexpr int kTriangle = 4; + /// Left trigger 1 button. static constexpr int kL1 = 5; + /// Right trigger 1 button. static constexpr int kR1 = 6; + /// Left trigger 2 button. static constexpr int kL2 = 7; + /// Right trigger 2 button. static constexpr int kR2 = 8; + /// Create button. static constexpr int kCreate = 9; + /// Options button. static constexpr int kOptions = 10; + /// Left stick button. static constexpr int kL3 = 11; + /// Right stick button. static constexpr int kR3 = 12; + /// PlayStation button. static constexpr int kPS = 13; + /// Touchpad click button. static constexpr int kTouchpad = 14; }; + /** + * Represents an axis on a PS5Controller. + */ struct Axis { + /// Left X axis. static constexpr int kLeftX = 0; + /// Left Y axis. static constexpr int kLeftY = 1; + /// Right X axis. static constexpr int kRightX = 2; + /// Right Y axis. static constexpr int kRightY = 5; + /// Left Trigger 2. static constexpr int kL2 = 3; + /// Right Trigger 2. static constexpr int kR2 = 4; }; }; diff --git a/wpilibc/src/main/native/include/frc/PowerDistribution.h b/wpilibc/src/main/native/include/frc/PowerDistribution.h index 8f49f71b84..6c2fbe5ef0 100644 --- a/wpilibc/src/main/native/include/frc/PowerDistribution.h +++ b/wpilibc/src/main/native/include/frc/PowerDistribution.h @@ -18,7 +18,16 @@ class PowerDistribution : public wpi::Sendable, public wpi::SendableHelper { public: static constexpr int kDefaultModule = -1; - enum class ModuleType { kCTRE = 1, kRev = 2 }; + + /** + * Power distribution module type. + */ + enum class ModuleType { + /// CTRE (Cross The Road Electronics) CTRE Power Distribution Panel (PDP). + kCTRE = 1, + /// REV Power Distribution Hub (PDH). + kRev = 2 + }; /** * Constructs a PowerDistribution object. diff --git a/wpilibc/src/main/native/include/frc/Relay.h b/wpilibc/src/main/native/include/frc/Relay.h index 4765c64a6a..d08a0007da 100644 --- a/wpilibc/src/main/native/include/frc/Relay.h +++ b/wpilibc/src/main/native/include/frc/Relay.h @@ -31,8 +31,31 @@ class Relay : public MotorSafety, public wpi::Sendable, public wpi::SendableHelper { public: - enum Value { kOff, kOn, kForward, kReverse }; - enum Direction { kBothDirections, kForwardOnly, kReverseOnly }; + /** + * The state to drive a Relay to. + */ + enum Value { + /// Off. + kOff, + /// On. + kOn, + /// Forward. + kForward, + /// Reverse. + kReverse + }; + + /** + * The Direction(s) that a relay is configured to operate in. + */ + enum Direction { + /// Both directions are valid. + kBothDirections, + /// Only forward is valid. + kForwardOnly, + /// Only reverse is valid. + kReverseOnly + }; /** * Relay constructor given a channel. diff --git a/wpilibc/src/main/native/include/frc/SPI.h b/wpilibc/src/main/native/include/frc/SPI.h index 1158cbdea2..7f3ea94e41 100644 --- a/wpilibc/src/main/native/include/frc/SPI.h +++ b/wpilibc/src/main/native/include/frc/SPI.h @@ -25,14 +25,34 @@ class DigitalSource; */ class SPI { public: - enum Port { kOnboardCS0 = 0, kOnboardCS1, kOnboardCS2, kOnboardCS3, kMXP }; + /** + * SPI port. + */ + enum Port { + /// Onboard SPI bus port CS0. + kOnboardCS0 = 0, + /// Onboard SPI bus port CS1. + kOnboardCS1, + /// Onboard SPI bus port CS2. + kOnboardCS2, + /// Onboard SPI bus port CS3. + kOnboardCS3, + /// MXP (roboRIO MXP) SPI bus port. + kMXP + }; + + /** + * SPI mode. + */ enum Mode { - kMode0 = HAL_SPI_kMode0, /*!< Clock idle low, data sampled on rising edge */ - kMode1 = - HAL_SPI_kMode1, /*!< Clock idle low, data sampled on falling edge */ - kMode2 = - HAL_SPI_kMode2, /*!< Clock idle high, data sampled on falling edge */ - kMode3 = HAL_SPI_kMode3 /*!< Clock idle high, data sampled on rising edge */ + /// Clock idle low, data sampled on rising edge. + kMode0 = HAL_SPI_kMode0, + /// Clock idle low, data sampled on falling edge. + kMode1 = HAL_SPI_kMode1, + /// Clock idle high, data sampled on falling edge. + kMode2 = HAL_SPI_kMode2, + /// Clock idle high, data sampled on rising edge. + kMode3 = HAL_SPI_kMode3 }; /** diff --git a/wpilibc/src/main/native/include/frc/SerialPort.h b/wpilibc/src/main/native/include/frc/SerialPort.h index dcc0a2e068..b7784da794 100644 --- a/wpilibc/src/main/native/include/frc/SerialPort.h +++ b/wpilibc/src/main/native/include/frc/SerialPort.h @@ -26,30 +26,73 @@ namespace frc { */ class SerialPort { public: + /** + * Serial port. + */ + 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 + }; + + /** + * Represents the parity to use for serial communications. + */ enum Parity { + /// No parity. kParity_None = 0, + /// Odd parity. kParity_Odd = 1, + /// Even parity. kParity_Even = 2, + /// Parity bit always on. kParity_Mark = 3, + /// Parity bit always off. kParity_Space = 4 }; + /** + * Represents the number of stop bits to use for Serial Communication. + */ enum StopBits { + /// One stop bit. kStopBits_One = 10, + /// One and a half stop bits. kStopBits_OnePointFive = 15, + /// Two stop bits. kStopBits_Two = 20 }; + /** + * Represents what type of flow control to use for serial communication. + */ enum FlowControl { + /// No flow control. kFlowControl_None = 0, + /// XON/XOFF flow control. kFlowControl_XonXoff = 1, + /// RTS/CTS flow control. kFlowControl_RtsCts = 2, + /// DTS/DSR flow control. kFlowControl_DtrDsr = 4 }; - enum WriteBufferMode { kFlushOnAccess = 1, kFlushWhenFull = 2 }; - - enum Port { kOnboard = 0, kMXP = 1, kUSB = 2, kUSB1 = 2, kUSB2 = 3 }; + /** + * Represents which type of buffer mode to use when writing to a serial port. + */ + enum WriteBufferMode { + /// Flush the buffer on each access. + kFlushOnAccess = 1, + /// Flush the buffer when it is full. + kFlushWhenFull = 2 + }; /** * Create an instance of a Serial Port class. diff --git a/wpilibc/src/main/native/include/frc/StadiaController.h b/wpilibc/src/main/native/include/frc/StadiaController.h index 9d978e9e09..cc9dbae981 100644 --- a/wpilibc/src/main/native/include/frc/StadiaController.h +++ b/wpilibc/src/main/native/include/frc/StadiaController.h @@ -514,28 +514,53 @@ class StadiaController : public GenericHID { */ BooleanEvent RightTrigger(EventLoop* loop) const; + /** + * Represents a digital button on a StadiaController. + */ struct Button { + /// A button. static constexpr int kA = 1; + /// B button. static constexpr int kB = 2; + /// X button. static constexpr int kX = 3; + /// Y button. static constexpr int kY = 4; + /// Left bumper button. static constexpr int kLeftBumper = 5; + /// Right bumper button. static constexpr int kRightBumper = 6; + /// Left stick button. static constexpr int kLeftStick = 7; + /// Right stick button. static constexpr int kRightStick = 8; + /// Ellipses button. static constexpr int kEllipses = 9; + /// Hamburger button. static constexpr int kHamburger = 10; + /// Stadia button. static constexpr int kStadia = 11; + /// Right trigger button. static constexpr int kRightTrigger = 12; + /// Left trigger button. static constexpr int kLeftTrigger = 13; + /// Google button. static constexpr int kGoogle = 14; + /// Frame button. static constexpr int kFrame = 15; }; + /** + * Represents an axis on a StadiaController. + */ struct Axis { + /// Left X axis. static constexpr int kLeftX = 0; + /// Right X axis. static constexpr int kRightX = 4; + /// Left Y axis. static constexpr int kLeftY = 1; + /// Right Y axis. static constexpr int kRightY = 5; }; }; diff --git a/wpilibc/src/main/native/include/frc/SynchronousInterrupt.h b/wpilibc/src/main/native/include/frc/SynchronousInterrupt.h index fbe0fca680..3e396e8577 100644 --- a/wpilibc/src/main/native/include/frc/SynchronousInterrupt.h +++ b/wpilibc/src/main/native/include/frc/SynchronousInterrupt.h @@ -25,9 +25,13 @@ class SynchronousInterrupt { * Event trigger combinations for a synchronous interrupt. */ enum WaitResult { + /// Timeout event. kTimeout = 0x0, + /// Rising edge event. kRisingEdge = 0x1, + /// Falling edge event. kFallingEdge = 0x100, + /// Both rising and falling edge events. kBoth = 0x101, }; diff --git a/wpilibc/src/main/native/include/frc/counter/EdgeConfiguration.h b/wpilibc/src/main/native/include/frc/counter/EdgeConfiguration.h index 508117d79f..4f5a039de2 100644 --- a/wpilibc/src/main/native/include/frc/counter/EdgeConfiguration.h +++ b/wpilibc/src/main/native/include/frc/counter/EdgeConfiguration.h @@ -5,10 +5,17 @@ #pragma once namespace frc { +/** + * Edge configuration. + */ enum class EdgeConfiguration { + /// No edge configuration (neither rising nor falling). kNone = 0, + /// Rising edge configuration. kRisingEdge = 0x1, + /// Falling edge configuration. kFallingEdge = 0x2, + /// Both rising and falling edges configuration. kBoth = 0x3 }; } // namespace frc diff --git a/wpilibc/src/main/native/include/frc/drive/RobotDriveBase.h b/wpilibc/src/main/native/include/frc/drive/RobotDriveBase.h index b3fb56be4b..78336103bb 100644 --- a/wpilibc/src/main/native/include/frc/drive/RobotDriveBase.h +++ b/wpilibc/src/main/native/include/frc/drive/RobotDriveBase.h @@ -23,12 +23,19 @@ class RobotDriveBase : public MotorSafety { * The location of a motor on the robot for the purpose of driving. */ enum MotorType { + /// Front-left motor. kFrontLeft = 0, + /// Front-right motor. kFrontRight = 1, + /// Rear-left motor. kRearLeft = 2, + /// Rear-right motor. kRearRight = 3, + /// Left motor. kLeft = 0, + /// Right motor. kRight = 1, + /// Back motor. kBack = 2 }; diff --git a/wpilibc/src/main/native/include/frc/simulation/DifferentialDrivetrainSim.h b/wpilibc/src/main/native/include/frc/simulation/DifferentialDrivetrainSim.h index 78310d78c7..c2598c943f 100644 --- a/wpilibc/src/main/native/include/frc/simulation/DifferentialDrivetrainSim.h +++ b/wpilibc/src/main/native/include/frc/simulation/DifferentialDrivetrainSim.h @@ -210,32 +210,54 @@ class DifferentialDrivetrainSim { */ class KitbotGearing { public: + /// Gear ratio of 12.75:1. static constexpr double k12p75 = 12.75; + /// Gear ratio of 10.71:1. static constexpr double k10p71 = 10.71; + /// Gear ratio of 8.45:1. static constexpr double k8p45 = 8.45; + /// Gear ratio of 7.31:1. static constexpr double k7p31 = 7.31; + /// Gear ratio of 5.95:1. static constexpr double k5p95 = 5.95; }; + /** + * Represents common motor layouts of the kit drivetrain. + */ class KitbotMotor { public: + /// One CIM motor per drive side. static constexpr frc::DCMotor SingleCIMPerSide = frc::DCMotor::CIM(1); + /// Two CIM motors per drive side. static constexpr frc::DCMotor DualCIMPerSide = frc::DCMotor::CIM(2); + /// One Mini CIM motor per drive side. static constexpr frc::DCMotor SingleMiniCIMPerSide = frc::DCMotor::MiniCIM(1); + /// Two Mini CIM motors per drive side. static constexpr frc::DCMotor DualMiniCIMPerSide = frc::DCMotor::MiniCIM(2); + /// One Falcon 500 motor per drive side. static constexpr frc::DCMotor SingleFalcon500PerSide = frc::DCMotor::Falcon500(1); + /// Two Falcon 500 motors per drive side. static constexpr frc::DCMotor DualFalcon500PerSide = frc::DCMotor::Falcon500(2); + /// One NEO motor per drive side. static constexpr frc::DCMotor SingleNEOPerSide = frc::DCMotor::NEO(1); + /// Two NEO motors per drive side. static constexpr frc::DCMotor DualNEOPerSide = frc::DCMotor::NEO(2); }; + /** + * Represents common wheel sizes of the kit drivetrain. + */ class KitbotWheelSize { public: + /// Six inch diameter wheels. static constexpr units::meter_t kSixInch = 6_in; + /// Eight inch diameter wheels. static constexpr units::meter_t kEightInch = 8_in; + /// Ten inch diameter wheels. static constexpr units::meter_t kTenInch = 10_in; }; diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/DMASample.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/DMASample.java index 63a5e7249c..7f833b6f10 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/DMASample.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/DMASample.java @@ -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; diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/DoubleSolenoid.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/DoubleSolenoid.java index 6e037dfcf6..de0697ccde 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/DoubleSolenoid.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/DoubleSolenoid.java @@ -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 } diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/DriverStation.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/DriverStation.java index 1c6e0c8501..9eb60aa32d 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/DriverStation.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/DriverStation.java @@ -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 } diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Encoder.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Encoder.java index b70a5cdfb8..5211e20c06 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Encoder.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Encoder.java @@ -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; diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/GenericHID.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/GenericHID.java index 58e55f0242..d5a3f9cc25 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/GenericHID.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/GenericHID.java @@ -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; diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/I2C.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/I2C.java index 0d54c4239f..5e40b23558 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/I2C.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/I2C.java @@ -23,8 +23,11 @@ import java.nio.ByteBuffer; * WPILib Known Issues 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; diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Joystick.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Joystick.java index 0e112ded0f..ac929ce628 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Joystick.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Joystick.java @@ -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; diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/PS4Controller.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/PS4Controller.java index 3958b695f1..97d1ed13e2 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/PS4Controller.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/PS4Controller.java @@ -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; diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/PS5Controller.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/PS5Controller.java index b95ce022f6..17608c0b24 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/PS5Controller.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/PS5Controller.java @@ -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; diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/PowerDistribution.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/PowerDistribution.java index 3a4c2ab7f2..08beeb7029 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/PowerDistribution.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/PowerDistribution.java @@ -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; diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Relay.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Relay.java index e68bf72108..c1b1c8f1bb 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Relay.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Relay.java @@ -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 } diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/RuntimeType.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/RuntimeType.java index e7af118bfd..bd9e4d795a 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/RuntimeType.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/RuntimeType.java @@ -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; diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/SPI.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/SPI.java index 632770c80d..8f19ec3fe2 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/SPI.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/SPI.java @@ -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), diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/SerialPort.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/SerialPort.java index c2b35cad3a..deafb4f737 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/SerialPort.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/SerialPort.java @@ -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; diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/StadiaController.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/StadiaController.java index 6c95020dad..d7bb16473a 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/StadiaController.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/StadiaController.java @@ -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; diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/SynchronousInterrupt.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/SynchronousInterrupt.java index 705d6b1a7c..45a978fb04 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/SynchronousInterrupt.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/SynchronousInterrupt.java @@ -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; diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/counter/EdgeConfiguration.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/counter/EdgeConfiguration.java index 9d58fbf1db..d8200d082f 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/counter/EdgeConfiguration.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/counter/EdgeConfiguration.java @@ -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") diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/RobotDriveBase.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/RobotDriveBase.java index 933773b4b8..204d89f0d6 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/RobotDriveBase.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/RobotDriveBase.java @@ -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; diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/DifferentialDrivetrainSim.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/DifferentialDrivetrainSim.java index 4798ad34a4..de2e2f271f 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/DifferentialDrivetrainSim.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/DifferentialDrivetrainSim.java @@ -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;