3.1.3. SPI¶
ZM65 4G Mini板系统集成了上层直接操作底层SPI硬件接口;
3.1.3.1. SPI硬件接口定义¶
J1的位置如下:

硬件接口如下:
J1 | 丝印名字 | 支持模式 | 默认模式 |
---|---|---|---|
15 | SPI_MI | SPI_MI/GPIO | SPI_MI |
16 | SPI_CS | SPI_CS/GPIO | SPI_CS |
17 | SPI_CLK | SPI_CLK/GPIO | SPI_CLK |
18 | SPI_MO | SPI_MO/GPIO | SPI_MO |
3.1.3.2. SPI native申明方法¶
使用的时候需要申请native方法,注意class路径:
package com.ziver.Native;
public class SPI {
public static native boolean spi_open(int mode ,int speed);
public static native boolean spi_close();
public static native byte[] spi_transfer(byte[] buffer ,int len,int read_len);
}