001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004
005package edu.wpi.first.hal;
006
007public class PWMJNI extends DIOJNI {
008  public static native int initializePWMPort(int halPortHandle);
009
010  public static native boolean checkPWMChannel(int channel);
011
012  public static native void freePWMPort(int pwmPortHandle);
013
014  public static native void setPWMConfigRaw(
015      int pwmPortHandle,
016      int maxPwm,
017      int deadbandMaxPwm,
018      int centerPwm,
019      int deadbandMinPwm,
020      int minPwm);
021
022  public static native void setPWMConfig(
023      int pwmPortHandle,
024      double maxPwm,
025      double deadbandMaxPwm,
026      double centerPwm,
027      double deadbandMinPwm,
028      double minPwm);
029
030  public static native PWMConfigDataResult getPWMConfigRaw(int pwmPortHandle);
031
032  public static native void setPWMEliminateDeadband(int pwmPortHandle, boolean eliminateDeadband);
033
034  public static native boolean getPWMEliminateDeadband(int pwmPortHandle);
035
036  public static native void setPWMRaw(int pwmPortHandle, short value);
037
038  public static native void setPWMSpeed(int pwmPortHandle, double speed);
039
040  public static native void setPWMPosition(int pwmPortHandle, double position);
041
042  public static native short getPWMRaw(int pwmPortHandle);
043
044  public static native double getPWMSpeed(int pwmPortHandle);
045
046  public static native double getPWMPosition(int pwmPortHandle);
047
048  public static native void setPWMDisabled(int pwmPortHandle);
049
050  public static native void latchPWMZero(int pwmPortHandle);
051
052  public static native void setPWMPeriodScale(int pwmPortHandle, int squelchMask);
053}