mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[wpilib][hal] PWM Raw using microseconds (#5283)
Co-authored-by: Joe <sciencewhiz@users.noreply.github.com>
This commit is contained in:
@@ -15,18 +15,18 @@ public class PWMConfigDataResult {
|
||||
this.min = min;
|
||||
}
|
||||
|
||||
/** The maximum PWM value. */
|
||||
/** The maximum PWM value in microseconds. */
|
||||
public int max;
|
||||
|
||||
/** The deadband maximum PWM value. */
|
||||
/** The deadband maximum PWM value in microseconds. */
|
||||
public int deadbandMax;
|
||||
|
||||
/** The center PWM value. */
|
||||
/** The center PWM value in microseconds. */
|
||||
public int center;
|
||||
|
||||
/** The deadband minimum PWM value. */
|
||||
/** The deadband minimum PWM value in microseconds. */
|
||||
public int deadbandMin;
|
||||
|
||||
/** The minimum PWM value. */
|
||||
/** The minimum PWM value in microseconds. */
|
||||
public int min;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ public class PWMJNI extends DIOJNI {
|
||||
|
||||
public static native void freePWMPort(int pwmPortHandle);
|
||||
|
||||
public static native void setPWMConfigRaw(
|
||||
public static native void setPWMConfigMicroseconds(
|
||||
int pwmPortHandle,
|
||||
int maxPwm,
|
||||
int deadbandMaxPwm,
|
||||
@@ -19,27 +19,19 @@ public class PWMJNI extends DIOJNI {
|
||||
int deadbandMinPwm,
|
||||
int minPwm);
|
||||
|
||||
public static native void setPWMConfig(
|
||||
int pwmPortHandle,
|
||||
double maxPwm,
|
||||
double deadbandMaxPwm,
|
||||
double centerPwm,
|
||||
double deadbandMinPwm,
|
||||
double minPwm);
|
||||
|
||||
public static native PWMConfigDataResult getPWMConfigRaw(int pwmPortHandle);
|
||||
public static native PWMConfigDataResult getPWMConfigMicroseconds(int pwmPortHandle);
|
||||
|
||||
public static native void setPWMEliminateDeadband(int pwmPortHandle, boolean eliminateDeadband);
|
||||
|
||||
public static native boolean getPWMEliminateDeadband(int pwmPortHandle);
|
||||
|
||||
public static native void setPWMRaw(int pwmPortHandle, short value);
|
||||
public static native void setPulseTimeMicroseconds(int pwmPortHandle, int microsecondPulseTime);
|
||||
|
||||
public static native void setPWMSpeed(int pwmPortHandle, double speed);
|
||||
|
||||
public static native void setPWMPosition(int pwmPortHandle, double position);
|
||||
|
||||
public static native short getPWMRaw(int pwmPortHandle);
|
||||
public static native int getPulseTimeMicroseconds(int pwmPortHandle);
|
||||
|
||||
public static native double getPWMSpeed(int pwmPortHandle);
|
||||
|
||||
@@ -49,5 +41,7 @@ public class PWMJNI extends DIOJNI {
|
||||
|
||||
public static native void latchPWMZero(int pwmPortHandle);
|
||||
|
||||
public static native void setAlwaysHighMode(int pwmPortHandle);
|
||||
|
||||
public static native void setPWMPeriodScale(int pwmPortHandle, int squelchMask);
|
||||
}
|
||||
|
||||
@@ -16,14 +16,14 @@ public class PWMDataJNI extends JNIWrapper {
|
||||
|
||||
public static native void setInitialized(int index, boolean initialized);
|
||||
|
||||
public static native int registerRawValueCallback(
|
||||
public static native int registerPulseMicrosecondCallback(
|
||||
int index, NotifyCallback callback, boolean initialNotify);
|
||||
|
||||
public static native void cancelRawValueCallback(int index, int uid);
|
||||
public static native void cancelPulseMicrosecondCallback(int index, int uid);
|
||||
|
||||
public static native int getRawValue(int index);
|
||||
public static native int getPulseMicrosecond(int index);
|
||||
|
||||
public static native void setRawValue(int index, int rawValue);
|
||||
public static native void setPulseMicrosecond(int index, int microsecondPulseTime);
|
||||
|
||||
public static native int registerSpeedCallback(
|
||||
int index, NotifyCallback callback, boolean initialNotify);
|
||||
|
||||
Reference in New Issue
Block a user