001/*----------------------------------------------------------------------------*/ 002/* Copyright (c) FIRST 2016-2017. All Rights Reserved. */ 003/* Open Source Software - may be modified and shared by FRC teams. The code */ 004/* must be accompanied by the FIRST BSD license file in the root directory of */ 005/* the project. */ 006/*----------------------------------------------------------------------------*/ 007 008package edu.wpi.first.wpilibj.hal; 009 010@SuppressWarnings("AbbreviationAsWordInName") 011public class DIOJNI extends JNIWrapper { 012 public static native int initializeDIOPort(int halPortHandle, boolean input); 013 014 public static native boolean checkDIOChannel(int channel); 015 016 public static native void freeDIOPort(int dioPortHandle); 017 018 public static native void setDIO(int dioPortHandle, short value); 019 020 public static native boolean getDIO(int dioPortHandle); 021 022 public static native boolean getDIODirection(int dioPortHandle); 023 024 public static native void pulse(int dioPortHandle, double pulseLength); 025 026 public static native boolean isPulsing(int dioPortHandle); 027 028 public static native boolean isAnyPulsing(); 029 030 public static native short getLoopTiming(); 031 032 public static native int allocateDigitalPWM(); 033 034 public static native void freeDigitalPWM(int pwmGenerator); 035 036 public static native void setDigitalPWMRate(double rate); 037 038 public static native void setDigitalPWMDutyCycle(int pwmGenerator, double dutyCycle); 039 040 public static native void setDigitalPWMOutputChannel(int pwmGenerator, int channel); 041}