001/*----------------------------------------------------------------------------*/
002/* Copyright (c) 2016-2018 FIRST. 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
010import java.nio.ByteBuffer;
011
012@SuppressWarnings("AbbreviationAsWordInName")
013public class I2CJNI extends JNIWrapper {
014  public static native void i2CInitialize(int port);
015
016  public static native int i2CTransaction(int port, byte address, ByteBuffer dataToSend,
017                                          byte sendSize, ByteBuffer dataReceived, byte receiveSize);
018
019  public static native int i2CTransactionB(int port, byte address, byte[] dataToSend,
020                                           byte sendSize, byte[] dataReceived, byte receiveSize);
021
022  public static native int i2CWrite(int port, byte address, ByteBuffer dataToSend, byte sendSize);
023
024  public static native int i2CWriteB(int port, byte address, byte[] dataToSend, byte sendSize);
025
026  public static native int i2CRead(int port, byte address, ByteBuffer dataReceived,
027                                   byte receiveSize);
028
029  public static native int i2CReadB(int port, byte address, byte[] dataReceived,
030                                    byte receiveSize);
031
032  public static native void i2CClose(int port);
033}