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 007import java.nio.ByteBuffer; 008 009public class I2CJNI extends JNIWrapper { 010 public static native void i2CInitialize(int port); 011 012 public static native int i2CTransaction( 013 int port, 014 byte address, 015 ByteBuffer dataToSend, 016 byte sendSize, 017 ByteBuffer dataReceived, 018 byte receiveSize); 019 020 public static native int i2CTransactionB( 021 int port, 022 byte address, 023 byte[] dataToSend, 024 byte sendSize, 025 byte[] dataReceived, 026 byte receiveSize); 027 028 public static native int i2CWrite(int port, byte address, ByteBuffer dataToSend, byte sendSize); 029 030 public static native int i2CWriteB(int port, byte address, byte[] dataToSend, byte sendSize); 031 032 public static native int i2CRead( 033 int port, byte address, ByteBuffer dataReceived, byte receiveSize); 034 035 public static native int i2CReadB(int port, byte address, byte[] dataReceived, byte receiveSize); 036 037 public static native void i2CClose(int port); 038}