mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +00:00
[hal, wpilib] PWM Rewrite (#7845)
The HAL will only contain the output period and the raw microseconds. Higher level things such as SimDevice can handle everything else.
This commit is contained in:
@@ -37,10 +37,9 @@ public class DMC60 extends PWMMotorController {
|
||||
public DMC60(final int channel) {
|
||||
super("DMC60", channel);
|
||||
|
||||
m_pwm.setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
|
||||
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
|
||||
m_pwm.setSpeed(0.0);
|
||||
m_pwm.setZeroLatch();
|
||||
setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
|
||||
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
|
||||
setSpeed(0.0);
|
||||
|
||||
HAL.reportUsage("IO", getChannel(), "DigilentDMC60");
|
||||
}
|
||||
|
||||
@@ -37,10 +37,9 @@ public class Jaguar extends PWMMotorController {
|
||||
public Jaguar(final int channel) {
|
||||
super("Jaguar", channel);
|
||||
|
||||
m_pwm.setBoundsMicroseconds(2310, 1550, 1507, 1454, 697);
|
||||
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
|
||||
m_pwm.setSpeed(0.0);
|
||||
m_pwm.setZeroLatch();
|
||||
setBoundsMicroseconds(2310, 1550, 1507, 1454, 697);
|
||||
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
|
||||
setSpeed(0.0);
|
||||
|
||||
HAL.reportUsage("IO", getChannel(), "Jaguar");
|
||||
}
|
||||
|
||||
@@ -37,10 +37,9 @@ public class Koors40 extends PWMMotorController {
|
||||
public Koors40(final int channel) {
|
||||
super("Koors40", channel);
|
||||
|
||||
m_pwm.setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
|
||||
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k4X);
|
||||
m_pwm.setSpeed(0.0);
|
||||
m_pwm.setZeroLatch();
|
||||
setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
|
||||
m_pwm.setOutputPeriod(PWM.OutputPeriod.k20Ms);
|
||||
setSpeed(0.0);
|
||||
|
||||
HAL.reportUsage("IO", getChannel(), "Koors40");
|
||||
}
|
||||
|
||||
@@ -37,10 +37,9 @@ public class PWMSparkFlex extends PWMMotorController {
|
||||
public PWMSparkFlex(final int channel) {
|
||||
super("PWMSparkFlex", channel);
|
||||
|
||||
m_pwm.setBoundsMicroseconds(2003, 1550, 1500, 1460, 999);
|
||||
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
|
||||
m_pwm.setSpeed(0.0);
|
||||
m_pwm.setZeroLatch();
|
||||
setBoundsMicroseconds(2003, 1550, 1500, 1460, 999);
|
||||
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
|
||||
setSpeed(0.0);
|
||||
|
||||
HAL.reportUsage("IO", getChannel(), "RevSparkFlexPWM");
|
||||
}
|
||||
|
||||
@@ -37,10 +37,9 @@ public class PWMSparkMax extends PWMMotorController {
|
||||
public PWMSparkMax(final int channel) {
|
||||
super("PWMSparkMax", channel);
|
||||
|
||||
m_pwm.setBoundsMicroseconds(2003, 1550, 1500, 1460, 999);
|
||||
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
|
||||
m_pwm.setSpeed(0.0);
|
||||
m_pwm.setZeroLatch();
|
||||
setBoundsMicroseconds(2003, 1550, 1500, 1460, 999);
|
||||
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
|
||||
setSpeed(0.0);
|
||||
|
||||
HAL.reportUsage("IO", getChannel(), "RevSparkMaxPWM");
|
||||
}
|
||||
|
||||
@@ -37,10 +37,9 @@ public class PWMTalonFX extends PWMMotorController {
|
||||
public PWMTalonFX(final int channel) {
|
||||
super("PWMTalonFX", channel);
|
||||
|
||||
m_pwm.setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
|
||||
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
|
||||
m_pwm.setSpeed(0.0);
|
||||
m_pwm.setZeroLatch();
|
||||
setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
|
||||
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
|
||||
setSpeed(0.0);
|
||||
|
||||
HAL.reportUsage("IO", getChannel(), "TalonFX");
|
||||
}
|
||||
|
||||
@@ -37,10 +37,9 @@ public class PWMTalonSRX extends PWMMotorController {
|
||||
public PWMTalonSRX(final int channel) {
|
||||
super("PWMTalonSRX", channel);
|
||||
|
||||
m_pwm.setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
|
||||
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
|
||||
m_pwm.setSpeed(0.0);
|
||||
m_pwm.setZeroLatch();
|
||||
setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
|
||||
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
|
||||
setSpeed(0.0);
|
||||
|
||||
HAL.reportUsage("IO", getChannel(), "PWMTalonSRX");
|
||||
}
|
||||
|
||||
@@ -37,10 +37,9 @@ public class PWMVenom extends PWMMotorController {
|
||||
public PWMVenom(final int channel) {
|
||||
super("PWMVenom", channel);
|
||||
|
||||
m_pwm.setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
|
||||
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
|
||||
m_pwm.setSpeed(0.0);
|
||||
m_pwm.setZeroLatch();
|
||||
setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
|
||||
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
|
||||
setSpeed(0.0);
|
||||
|
||||
HAL.reportUsage("IO", getChannel(), "FusionVenom");
|
||||
}
|
||||
|
||||
@@ -37,10 +37,9 @@ public class PWMVictorSPX extends PWMMotorController {
|
||||
public PWMVictorSPX(final int channel) {
|
||||
super("PWMVictorSPX", channel);
|
||||
|
||||
m_pwm.setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
|
||||
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
|
||||
m_pwm.setSpeed(0.0);
|
||||
m_pwm.setZeroLatch();
|
||||
setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
|
||||
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
|
||||
setSpeed(0.0);
|
||||
|
||||
HAL.reportUsage("IO", getChannel(), "PWMVictorSPX");
|
||||
}
|
||||
|
||||
@@ -37,10 +37,9 @@ public class SD540 extends PWMMotorController {
|
||||
public SD540(final int channel) {
|
||||
super("SD540", channel);
|
||||
|
||||
m_pwm.setBoundsMicroseconds(2050, 1550, 1500, 1440, 940);
|
||||
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
|
||||
m_pwm.setSpeed(0.0);
|
||||
m_pwm.setZeroLatch();
|
||||
setBoundsMicroseconds(2050, 1550, 1500, 1440, 940);
|
||||
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
|
||||
setSpeed(0.0);
|
||||
|
||||
HAL.reportUsage("IO", getChannel(), "MindsensorsSD540");
|
||||
}
|
||||
|
||||
@@ -37,10 +37,9 @@ public class Spark extends PWMMotorController {
|
||||
public Spark(final int channel) {
|
||||
super("Spark", channel);
|
||||
|
||||
m_pwm.setBoundsMicroseconds(2003, 1550, 1500, 1460, 999);
|
||||
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
|
||||
m_pwm.setSpeed(0.0);
|
||||
m_pwm.setZeroLatch();
|
||||
setBoundsMicroseconds(2003, 1550, 1500, 1460, 999);
|
||||
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
|
||||
setSpeed(0.0);
|
||||
|
||||
HAL.reportUsage("IO", getChannel(), "RevSPARK");
|
||||
}
|
||||
|
||||
@@ -37,10 +37,9 @@ public class SparkMini extends PWMMotorController {
|
||||
public SparkMini(final int channel) {
|
||||
super("SparkMini", channel);
|
||||
|
||||
m_pwm.setBoundsMicroseconds(2500, 1510, 1500, 1490, 500);
|
||||
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
|
||||
m_pwm.setSpeed(0.0);
|
||||
m_pwm.setZeroLatch();
|
||||
setBoundsMicroseconds(2500, 1510, 1500, 1490, 500);
|
||||
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
|
||||
setSpeed(0.0);
|
||||
|
||||
HAL.reportUsage("IO", getChannel(), "RevSPARK");
|
||||
}
|
||||
|
||||
@@ -37,10 +37,9 @@ public class Talon extends PWMMotorController {
|
||||
public Talon(final int channel) {
|
||||
super("Talon", channel);
|
||||
|
||||
m_pwm.setBoundsMicroseconds(2037, 1539, 1513, 1487, 989);
|
||||
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
|
||||
m_pwm.setSpeed(0.0);
|
||||
m_pwm.setZeroLatch();
|
||||
setBoundsMicroseconds(2037, 1539, 1513, 1487, 989);
|
||||
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
|
||||
setSpeed(0.0);
|
||||
|
||||
HAL.reportUsage("IO", getChannel(), "Talon");
|
||||
}
|
||||
|
||||
@@ -37,10 +37,9 @@ public class Victor extends PWMMotorController {
|
||||
public Victor(final int channel) {
|
||||
super("Victor", channel);
|
||||
|
||||
m_pwm.setBoundsMicroseconds(2027, 1525, 1507, 1490, 1026);
|
||||
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k2X);
|
||||
m_pwm.setSpeed(0.0);
|
||||
m_pwm.setZeroLatch();
|
||||
setBoundsMicroseconds(2027, 1525, 1507, 1490, 1026);
|
||||
m_pwm.setOutputPeriod(PWM.OutputPeriod.k10Ms);
|
||||
setSpeed(0.0);
|
||||
|
||||
HAL.reportUsage("IO", getChannel(), "Victor");
|
||||
}
|
||||
|
||||
@@ -37,10 +37,9 @@ public class VictorSP extends PWMMotorController {
|
||||
public VictorSP(final int channel) {
|
||||
super("VictorSP", channel);
|
||||
|
||||
m_pwm.setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
|
||||
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
|
||||
m_pwm.setSpeed(0.0);
|
||||
m_pwm.setZeroLatch();
|
||||
setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
|
||||
m_pwm.setOutputPeriod(PWM.OutputPeriod.k5Ms);
|
||||
setSpeed(0.0);
|
||||
|
||||
HAL.reportUsage("IO", getChannel(), "VictorSP");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user