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 setPWMConfigMicroseconds(
015      int pwmPortHandle,
016      int maxPwm,
017      int deadbandMaxPwm,
018      int centerPwm,
019      int deadbandMinPwm,
020      int minPwm);
021
022  public static native PWMConfigDataResult getPWMConfigMicroseconds(int pwmPortHandle);
023
024  public static native void setPWMEliminateDeadband(int pwmPortHandle, boolean eliminateDeadband);
025
026  public static native boolean getPWMEliminateDeadband(int pwmPortHandle);
027
028  public static native void setPulseTimeMicroseconds(int pwmPortHandle, int microsecondPulseTime);
029
030  public static native void setPWMSpeed(int pwmPortHandle, double speed);
031
032  public static native void setPWMPosition(int pwmPortHandle, double position);
033
034  public static native int getPulseTimeMicroseconds(int pwmPortHandle);
035
036  public static native double getPWMSpeed(int pwmPortHandle);
037
038  public static native double getPWMPosition(int pwmPortHandle);
039
040  public static native void setPWMDisabled(int pwmPortHandle);
041
042  public static native void latchPWMZero(int pwmPortHandle);
043
044  public static native void setAlwaysHighMode(int pwmPortHandle);
045
046  public static native void setPWMPeriodScale(int pwmPortHandle, int squelchMask);
047}