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
007@SuppressWarnings("AbbreviationAsWordInName")
008public class PWMJNI extends DIOJNI {
009  public static native int initializePWMPort(int halPortHandle);
010
011  public static native boolean checkPWMChannel(int channel);
012
013  public static native void freePWMPort(int pwmPortHandle);
014
015  public static native void setPWMConfigRaw(
016      int pwmPortHandle,
017      int maxPwm,
018      int deadbandMaxPwm,
019      int centerPwm,
020      int deadbandMinPwm,
021      int minPwm);
022
023  public static native void setPWMConfig(
024      int pwmPortHandle,
025      double maxPwm,
026      double deadbandMaxPwm,
027      double centerPwm,
028      double deadbandMinPwm,
029      double minPwm);
030
031  public static native PWMConfigDataResult getPWMConfigRaw(int pwmPortHandle);
032
033  public static native void setPWMEliminateDeadband(int pwmPortHandle, boolean eliminateDeadband);
034
035  public static native boolean getPWMEliminateDeadband(int pwmPortHandle);
036
037  public static native void setPWMRaw(int pwmPortHandle, short value);
038
039  public static native void setPWMSpeed(int pwmPortHandle, double speed);
040
041  public static native void setPWMPosition(int pwmPortHandle, double position);
042
043  public static native short getPWMRaw(int pwmPortHandle);
044
045  public static native double getPWMSpeed(int pwmPortHandle);
046
047  public static native double getPWMPosition(int pwmPortHandle);
048
049  public static native void setPWMDisabled(int pwmPortHandle);
050
051  public static native void latchPWMZero(int pwmPortHandle);
052
053  public static native void setPWMPeriodScale(int pwmPortHandle, int squelchMask);
054}