3.1.4. I2C¶
3.1.4.1. I2C硬件接口定义¶
ZM65 4G Mini板系统集成了上层直接操作底层I2C硬件接口,预留的为I2C6,可以外设I2C设备对其进行操作。 相关的硬件在J20上,转换为3.3V的电压的。硬件使用请注意; J1的位置如下:

定义如下:
10 | SCL6_3V3 | SCL6 | +——+————+——–+ |11 | SDA6_3V3 | SDA6 | +——+————+——–+
3.1.4.2. I2C接口的Native申明方法¶
I2C的native申明如下:
package com.ziver.Native; public class I2C {
public static native boolean i2cSetAddress(int i2c_addr); public static native boolean i2cOpen(int id);//String dev public static native void close(); public static native byte[] read8( int reg_addr, int len); public static native byte[] read16( int reg_addr,int len); public static native void write8(int reg_addr, byte[] data,int len); public static native void write16(int reg_addr,byte[] data,int len);
}