[docs] Add missing JavaDocs (#6125)

This commit is contained in:
Tyler Veness
2024-01-01 22:56:23 -08:00
committed by GitHub
parent 5579219716
commit ad0859a8c9
137 changed files with 1202 additions and 204 deletions

View File

@@ -59,4 +59,7 @@ public class AccelerometerJNI extends JNIWrapper {
* @return the Z acceleration
*/
public static native double getAccelerometerZ();
/** Utility class. */
private AccelerometerJNI() {}
}

View File

@@ -13,6 +13,9 @@ public class AccumulatorResult {
/** The number of sample value was accumulated over. */
public long count;
/** Constructs an AccumulatorResult. */
public AccumulatorResult() {}
/**
* Set the value and count.
*

View File

@@ -97,4 +97,7 @@ public class AddressableLEDJNI extends JNIWrapper {
* @see "HAL_StopAddressableLEDOutput"
*/
public static native void stop(int handle);
/** Utility class. */
private AddressableLEDJNI() {}
}

View File

@@ -4,12 +4,20 @@
package edu.wpi.first.hal;
/** Alliance station ID. */
public enum AllianceStationID {
/** Unknown. */
Unknown,
/** Red 1. */
Red1,
/** Red 2. */
Red2,
/** Red 3. */
Red3,
/** Blue 1. */
Blue1,
/** Blue 2. */
Blue2,
/** Blue 3. */
Blue3
}

View File

@@ -126,4 +126,7 @@ public class AnalogGyroJNI extends JNIWrapper {
* @see "HAL_GetAnalogGyroCenter"
*/
public static native int getAnalogGyroCenter(int handle);
/** Utility class. */
private AnalogGyroJNI() {}
}

View File

@@ -497,4 +497,7 @@ public class AnalogJNI extends JNIWrapper {
* @see "HAL_GetAnalogTriggerFPGAIndex"
*/
public static native int getAnalogTriggerFPGAIndex(int analogTriggerHandle);
/** Utility class. */
private AnalogJNI() {}
}

View File

@@ -177,4 +177,7 @@ public class CANAPIJNI extends JNIWrapper {
*/
public static native boolean readCANPacketTimeout(
int handle, int apiId, int timeoutMs, CANData data);
/** Utility class. */
private CANAPIJNI() {}
}

View File

@@ -221,4 +221,7 @@ public class CTREPCMJNI extends JNIWrapper {
* @see "HAL_SetCTREPCMOneShotDuration"
*/
public static native void setOneShotDuration(int handle, int index, int durMs);
/** Utility class. */
private CTREPCMJNI() {}
}

View File

@@ -17,4 +17,7 @@ public class ConstantsJNI extends JNIWrapper {
* @see "HAL_GetSystemClockTicksPerMicrosecond"
*/
public static native int getSystemClockTicksPerMicrosecond();
/** Utility class. */
private ConstantsJNI() {}
}

View File

@@ -279,4 +279,7 @@ public class CounterJNI extends JNIWrapper {
* @see "HAL_SetCounterReverseDirection"
*/
public static native void setCounterReverseDirection(int counterHandle, boolean reverseDirection);
/** Utility class. */
private CounterJNI() {}
}

View File

@@ -178,4 +178,7 @@ public class DIOJNI extends JNIWrapper {
* @see "HAL_SetDigitalPWMOutputChannel"
*/
public static native void setDigitalPWMOutputChannel(int pwmGenerator, int channel);
/** Utility class. */
DIOJNI() {}
}

View File

@@ -245,4 +245,7 @@ public class DMAJNI extends JNIWrapper {
* @return The DMA sample
*/
public static native DMAJNISample.BaseStore getSensorReadData(int handle);
/** Utility class. */
private DMAJNI() {}
}

View File

@@ -59,4 +59,7 @@ public class DigitalGlitchFilterJNI extends JNIWrapper {
* @see "HAL_GetFilterPeriod"
*/
public static native int getFilterPeriod(int filterIndex);
/** Utility class. */
private DigitalGlitchFilterJNI() {}
}

View File

@@ -372,5 +372,6 @@ public class DriverStationJNI extends JNIWrapper {
*/
public static native boolean getOutputsActive();
/** Utility class. */
private DriverStationJNI() {}
}

View File

@@ -78,4 +78,7 @@ public class DutyCycleJNI extends JNIWrapper {
* @see "HAL_GetDutyCycleFPGAIndex"
*/
public static native int getFPGAIndex(int handle);
/** Utility class. */
private DutyCycleJNI() {}
}

View File

@@ -275,4 +275,7 @@ public class EncoderJNI extends JNIWrapper {
* @see "HAL_GetEncoderEncodingType"
*/
public static native int getEncoderEncodingType(int encoderHandle);
/** Utility class. */
private EncoderJNI() {}
}

View File

@@ -135,4 +135,7 @@ public class I2CJNI extends JNIWrapper {
* @see "HAL_CloseI2C"
*/
public static native void i2CClose(int port);
/** Utility class. */
private I2CJNI() {}
}

View File

@@ -113,4 +113,7 @@ public class InterruptJNI extends JNIWrapper {
* @see "HAL_ReleaseWaitingInterrupt"
*/
public static native void releaseWaitingInterrupt(int interruptHandle);
/** Utility class. */
private InterruptJNI() {}
}

View File

@@ -13,16 +13,30 @@ public class JNIWrapper {
static boolean libraryLoaded = false;
static RuntimeLoader<JNIWrapper> loader = null;
/** Sets whether JNI should be loaded in the static block. */
public static class Helper {
private static AtomicBoolean extractOnStaticLoad = new AtomicBoolean(true);
/**
* Returns true if the JNI should be loaded in the static block.
*
* @return True if the JNI should be loaded in the static block.
*/
public static boolean getExtractOnStaticLoad() {
return extractOnStaticLoad.get();
}
/**
* Sets whether the JNI should be loaded in the static block.
*
* @param load Whether the JNI should be loaded in the static block.
*/
public static void setExtractOnStaticLoad(boolean load) {
extractOnStaticLoad.set(load);
}
/** Utility class. */
private Helper() {}
}
static {
@@ -57,4 +71,7 @@ public class JNIWrapper {
}
public static void suppressUnused(Object object) {}
/** Utility class. */
public JNIWrapper() {}
}

View File

@@ -25,4 +25,7 @@ public class LEDJNI extends JNIWrapper {
* @see "HAL_GetRadioLEDState"
*/
public static native int getRadioLEDState();
/** Utility class. */
private LEDJNI() {}
}

View File

@@ -101,4 +101,7 @@ public class NotifierJNI extends JNIWrapper {
* @return the FPGA time the notifier returned
*/
public static native long waitForNotifierAlarm(int notifierHandle);
/** Utility class. */
private NotifierJNI() {}
}

View File

@@ -44,4 +44,7 @@ public class PWMJNI extends DIOJNI {
public static native void setAlwaysHighMode(int pwmPortHandle);
public static native void setPWMPeriodScale(int pwmPortHandle, int squelchMask);
/** Utility class. */
private PWMJNI() {}
}

View File

@@ -185,4 +185,7 @@ public class PortsJNI extends JNIWrapper {
* @see "HAL_GetNumREVPHChannels"
*/
public static native int getNumREVPHChannels();
/** Utility class. */
private PortsJNI() {}
}

View File

@@ -282,4 +282,7 @@ public class PowerDistributionJNI extends JNIWrapper {
* @see "HAL_GetPowerDistributionVersion"
*/
public static native PowerDistributionVersion getVersion(int handle);
/** Utility class. */
private PowerDistributionJNI() {}
}

View File

@@ -167,4 +167,7 @@ public class PowerJNI extends JNIWrapper {
* @return current CPU temperature in degrees Celsius
*/
public static native double getCPUTemp();
/** Utility class. */
private PowerJNI() {}
}

View File

@@ -286,4 +286,7 @@ public class REVPHJNI extends JNIWrapper {
* @see "HAL_GetREVPHVersion"
*/
public static native REVPHVersion getVersion(int handle);
/** Utility class. */
private REVPHJNI() {}
}

View File

@@ -57,4 +57,7 @@ public class RelayJNI extends DIOJNI {
* @see "HAL_GetRelay"
*/
public static native boolean getRelay(int relayPortHandle);
/** Utility class. */
private RelayJNI() {}
}

View File

@@ -302,4 +302,7 @@ public class SPIJNI extends JNIWrapper {
*/
public static native void spiConfigureAutoStall(
int port, int csToSclkTicks, int stallTicks, int pow2BytesPerRead);
/** Utility class. */
private SPIJNI() {}
}

View File

@@ -205,4 +205,7 @@ public class SerialPortJNI extends JNIWrapper {
* @see "HAL_CloseSerial"
*/
public static native void serialClose(int handle);
/** Utility class. */
private SerialPortJNI() {}
}

View File

@@ -286,4 +286,7 @@ public class SimDeviceJNI extends JNIWrapper {
* @param handle simulated value handle
*/
public static native void resetSimValue(int handle);
/** Utility class. */
private SimDeviceJNI() {}
}

View File

@@ -37,4 +37,7 @@ public class ThreadsJNI extends JNIWrapper {
* @see "HAL_SetCurrentThreadPriority"
*/
public static native boolean setCurrentThreadPriority(boolean realTime, int priority);
/** Utility class. */
private ThreadsJNI() {}
}

View File

@@ -8,7 +8,10 @@ import edu.wpi.first.hal.CANStreamMessage;
import java.io.IOException;
public class CANStreamOverflowException extends IOException {
/** The messages. */
private final CANStreamMessage[] m_messages;
/** The length of messages read. */
private final int m_messagesRead;
/**

View File

@@ -6,7 +6,16 @@ package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
/** JNI for accelerometer data. */
public class AccelerometerDataJNI extends JNIWrapper {
/**
* Register a callback to be run when this accelerometer activates.
*
* @param index the index
* @param callback the callback
* @param initialNotify whether to run the callback with the initial state
* @return the CallbackStore object associated with this callback
*/
public static native int registerActiveCallback(
int index, NotifyCallback callback, boolean initialNotify);
@@ -53,4 +62,7 @@ public class AccelerometerDataJNI extends JNIWrapper {
public static native void setZ(int index, double z);
public static native void resetData(int index);
/** Utility class. */
private AccelerometerDataJNI() {}
}

View File

@@ -6,6 +6,7 @@ package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
/** JNI for addressable LED data. */
public class AddressableLEDDataJNI extends JNIWrapper {
public static native int registerInitializedCallback(
int index, NotifyCallback callback, boolean initialNotify);
@@ -54,4 +55,7 @@ public class AddressableLEDDataJNI extends JNIWrapper {
public static native void resetData(int index);
public static native int findForChannel(int channel);
/** Utility class. */
private AddressableLEDDataJNI() {}
}

View File

@@ -6,6 +6,7 @@ package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
/** JNI for analog gyro data. */
public class AnalogGyroDataJNI extends JNIWrapper {
public static native int registerAngleCallback(
int index, NotifyCallback callback, boolean initialNotify);
@@ -35,4 +36,7 @@ public class AnalogGyroDataJNI extends JNIWrapper {
public static native void setInitialized(int index, boolean initialized);
public static native void resetData(int index);
/** Utility class. */
private AnalogGyroDataJNI() {}
}

View File

@@ -6,6 +6,7 @@ package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
/** JNI for analog input data. */
public class AnalogInDataJNI extends JNIWrapper {
public static native int registerInitializedCallback(
int index, NotifyCallback callback, boolean initialNotify);
@@ -89,4 +90,7 @@ public class AnalogInDataJNI extends JNIWrapper {
public static native void setAccumulatorDeadband(int index, int AccumulatorDeadband);
public static native void resetData(int index);
/** Utility class. */
private AnalogInDataJNI() {}
}

View File

@@ -6,6 +6,7 @@ package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
/** JNI for analog output data. */
public class AnalogOutDataJNI extends JNIWrapper {
public static native int registerVoltageCallback(
int index, NotifyCallback callback, boolean initialNotify);
@@ -26,4 +27,7 @@ public class AnalogOutDataJNI extends JNIWrapper {
public static native void setInitialized(int index, boolean initialized);
public static native void resetData(int index);
/** Utility class. */
private AnalogOutDataJNI() {}
}

View File

@@ -6,6 +6,7 @@ package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
/** JNI for analog trigger data. */
public class AnalogTriggerDataJNI extends JNIWrapper {
public static native int registerInitializedCallback(
int index, NotifyCallback callback, boolean initialNotify);
@@ -37,4 +38,7 @@ public class AnalogTriggerDataJNI extends JNIWrapper {
public static native void resetData(int index);
public static native int findForChannel(int channel);
/** Utility class. */
private AnalogTriggerDataJNI() {}
}

View File

@@ -6,6 +6,7 @@ package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
/** JNI for CTRE PCM data. */
public class CTREPCMDataJNI extends JNIWrapper {
public static native int registerInitializedCallback(
int index, NotifyCallback callback, boolean initialNotify);
@@ -68,4 +69,7 @@ public class CTREPCMDataJNI extends JNIWrapper {
int index, int channel, NotifyCallback callback, boolean initialNotify);
public static native void resetData(int index);
/** Utility class. */
private CTREPCMDataJNI() {}
}

View File

@@ -6,6 +6,7 @@ package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
/** JNI for DIO data. */
public class DIODataJNI extends JNIWrapper {
public static native int registerInitializedCallback(
int index, NotifyCallback callback, boolean initialNotify);
@@ -53,4 +54,7 @@ public class DIODataJNI extends JNIWrapper {
public static native void setFilterIndex(int index, int filterIndex);
public static native void resetData(int index);
/** Utility class. */
private DIODataJNI() {}
}

View File

@@ -6,6 +6,7 @@ package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
/** JNI for digital PWM data. */
public class DigitalPWMDataJNI extends JNIWrapper {
public static native int registerInitializedCallback(
int index, NotifyCallback callback, boolean initialNotify);
@@ -37,4 +38,7 @@ public class DigitalPWMDataJNI extends JNIWrapper {
public static native void resetData(int index);
public static native int findForChannel(int channel);
/** Utility class. */
private DigitalPWMDataJNI() {}
}

View File

@@ -6,6 +6,7 @@ package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
/** JNI for Driver Station data. */
public class DriverStationDataJNI extends JNIWrapper {
public static native int registerEnabledCallback(NotifyCallback callback, boolean initialNotify);
@@ -134,4 +135,7 @@ public class DriverStationDataJNI extends JNIWrapper {
public static native void setReplayNumber(int replayNumber);
public static native void resetData();
/** Utility class. */
private DriverStationDataJNI() {}
}

View File

@@ -6,6 +6,7 @@ package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
/** JNI for duty cycle data. */
public class DutyCycleDataJNI extends JNIWrapper {
public static native int registerInitializedCallback(
int index, NotifyCallback callback, boolean initialNotify);
@@ -37,4 +38,7 @@ public class DutyCycleDataJNI extends JNIWrapper {
public static native void resetData(int index);
public static native int findForChannel(int channel);
/** Utility class. */
private DutyCycleDataJNI() {}
}

View File

@@ -6,6 +6,7 @@ package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
/** JNI for encoder data. */
public class EncoderDataJNI extends JNIWrapper {
public static native int registerInitializedCallback(
int index, NotifyCallback callback, boolean initialNotify);
@@ -99,4 +100,7 @@ public class EncoderDataJNI extends JNIWrapper {
public static native void resetData(int index);
public static native int findForChannel(int channel);
/** Utility class. */
private EncoderDataJNI() {}
}

View File

@@ -6,6 +6,7 @@ package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
/** JNI for I2C data. */
public class I2CDataJNI extends JNIWrapper {
public static native int registerInitializedCallback(
int index, NotifyCallback callback, boolean initialNotify);
@@ -25,4 +26,7 @@ public class I2CDataJNI extends JNIWrapper {
public static native void cancelWriteCallback(int index, int uid);
public static native void resetData(int index);
/** Utility class. */
private I2CDataJNI() {}
}

View File

@@ -6,8 +6,12 @@ package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
/** JNI for notifier data. */
public class NotifierDataJNI extends JNIWrapper {
public static native long getNextTimeout();
public static native int getNumNotifiers();
/** Utility class. */
private NotifierDataJNI() {}
}

View File

@@ -6,6 +6,7 @@ package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
/** JNI for PWM data. */
public class PWMDataJNI extends JNIWrapper {
public static native int registerInitializedCallback(
int index, NotifyCallback callback, boolean initialNotify);
@@ -62,4 +63,7 @@ public class PWMDataJNI extends JNIWrapper {
public static native void setZeroLatch(int index, boolean zeroLatch);
public static native void resetData(int index);
/** Utility class. */
private PWMDataJNI() {}
}

View File

@@ -6,6 +6,7 @@ package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
/** JNI for power distribution data. */
public class PowerDistributionDataJNI extends JNIWrapper {
public static native int registerInitializedCallback(
int index, NotifyCallback callback, boolean initialNotify);
@@ -44,4 +45,7 @@ public class PowerDistributionDataJNI extends JNIWrapper {
public static native void setCurrent(int index, int channel, double current);
public static native void resetData(int index);
/** Utility class. */
private PowerDistributionDataJNI() {}
}

View File

@@ -6,6 +6,7 @@ package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
/** JNI for REV PH data. */
public class REVPHDataJNI extends JNIWrapper {
public static native int registerInitializedCallback(
int index, NotifyCallback callback, boolean initialNotify);
@@ -68,4 +69,7 @@ public class REVPHDataJNI extends JNIWrapper {
int index, int channel, NotifyCallback callback, boolean initialNotify);
public static native void resetData(int index);
/** Utility class. */
private REVPHDataJNI() {}
}

View File

@@ -6,6 +6,7 @@ package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
/** JNI for relay data. */
public class RelayDataJNI extends JNIWrapper {
public static native int registerInitializedForwardCallback(
int index, NotifyCallback callback, boolean initialNotify);
@@ -44,4 +45,7 @@ public class RelayDataJNI extends JNIWrapper {
public static native void setReverse(int index, boolean reverse);
public static native void resetData(int index);
/** Utility class. */
private RelayDataJNI() {}
}

View File

@@ -6,6 +6,7 @@ package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
/** JNI for roboRIO data. */
public class RoboRioDataJNI extends JNIWrapper {
public static native int registerFPGAButtonCallback(
NotifyCallback callback, boolean initialNotify);
@@ -186,4 +187,7 @@ public class RoboRioDataJNI extends JNIWrapper {
public static native void setRadioLEDState(int state);
public static native void resetData();
/** Utility class. */
private RoboRioDataJNI() {}
}

View File

@@ -6,6 +6,7 @@ package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
/** JNI for SPI accelerometer data. */
public class SPIAccelerometerDataJNI extends JNIWrapper {
public static native int registerActiveCallback(
int index, NotifyCallback callback, boolean initialNotify);
@@ -53,4 +54,7 @@ public class SPIAccelerometerDataJNI extends JNIWrapper {
public static native void setZ(int index, double z);
public static native void resetData(int index);
/** Utility class. */
private SPIAccelerometerDataJNI() {}
}

View File

@@ -6,6 +6,7 @@ package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
/** JNI for SPI data. */
public class SPIDataJNI extends JNIWrapper {
public static native int registerInitializedCallback(
int index, NotifyCallback callback, boolean initialNotify);
@@ -30,4 +31,7 @@ public class SPIDataJNI extends JNIWrapper {
public static native void cancelReadAutoReceiveBufferCallback(int index, int uid);
public static native void resetData(int index);
/** Utility class. */
private SPIDataJNI() {}
}

View File

@@ -7,6 +7,7 @@ package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.HALValue;
import edu.wpi.first.hal.JNIWrapper;
/** JNI for sim device data. */
public class SimDeviceDataJNI extends JNIWrapper {
public static native void setSimDeviceEnabled(String prefix, boolean enabled);
@@ -106,4 +107,7 @@ public class SimDeviceDataJNI extends JNIWrapper {
public static native double[] getSimValueEnumDoubleValues(int handle);
public static native void resetSimDeviceData();
/** Utility class. */
private SimDeviceDataJNI() {}
}

View File

@@ -6,6 +6,7 @@ package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
/** JNI for simulator. */
public class SimulatorJNI extends JNIWrapper {
public static native void setRuntimeType(int type);
@@ -28,4 +29,7 @@ public class SimulatorJNI extends JNIWrapper {
public static native void stepTimingAsync(long delta);
public static native void resetHandles();
/** Utility class. */
private SimulatorJNI() {}
}

View File

@@ -6,6 +6,7 @@ package edu.wpi.first.hal.util;
/** Exception for bad status codes from the chip object. */
public final class UncleanStatusException extends IllegalStateException {
/** The status code from the chip object. */
private final int m_statusCode;
/**