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.simulation; 006 007import edu.wpi.first.hal.JNIWrapper; 008 009/** JNI for SPI data. */ 010public class SPIDataJNI extends JNIWrapper { 011 public static native int registerInitializedCallback( 012 int index, NotifyCallback callback, boolean initialNotify); 013 014 public static native void cancelInitializedCallback(int index, int uid); 015 016 public static native boolean getInitialized(int index); 017 018 public static native void setInitialized(int index, boolean initialized); 019 020 public static native int registerReadCallback(int index, BufferCallback callback); 021 022 public static native void cancelReadCallback(int index, int uid); 023 024 public static native int registerWriteCallback(int index, ConstBufferCallback callback); 025 026 public static native void cancelWriteCallback(int index, int uid); 027 028 public static native int registerReadAutoReceiveBufferCallback( 029 int index, SpiReadAutoReceiveBufferCallback callback); 030 031 public static native void cancelReadAutoReceiveBufferCallback(int index, int uid); 032 033 public static native void resetData(int index); 034 035 /** Utility class. */ 036 private SPIDataJNI() {} 037}