下载此文档

Android串口操作说明文档.docx


文档分类:IT计算机 | 页数:约5页 举报非法文档有奖
1/5
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/5 下载此文档
文档列表 文档介绍
Android串口操作说明
底层接口
使用底层接口
.,在该包中建立HardwareControler类。类的具体内容如下,该类中的方法用于操作底层接口。
public class HardwareControler {
/* Serial Port */
static public native int openSerialPort(String devName,
long baud, int dataBits, int stopBits);

/* LED */
static public native int setLedState(int ledID, int ledState);

/* PWM */
static public native int PWMPlay(int frequency);
static public native int PWMStop();

/* ADC */
static public native int readADC();
static public native int readADCWithChannel(int channel);
static public native int[] readADCWithChannels(int[] channels);

/* I2C */
static public native int openI2CDevice();
static public native int writeByteDataToI2C(int fd, int pos, byte byteData);
static public native int readByteDataFromI2C(int fd, int pos);

/* IO */
static public native int write(int fd, byte[] data);
static public native int read(int fd, byte[] buf, int len);
static public native int select(int fd, int sec, int usec);
static public native void close(int fd);

/* return 6410 or 210 */
static public native int getBoardType();
static {
try {
("friendlyarm-hardware");
} catch (UnsatisfiedLinkError e) {
("HardwareControler",
"libfriendlyarm-hardware library not found!");
}
}
}
串口API说明
接口名称
参数与返回值说明
功能说明
int openSerialPort(
String devName,

Android串口操作说明文档 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数5
  • 收藏数0 收藏
  • 顶次数0
  • 上传人xunlai783
  • 文件大小24 KB
  • 时间2017-12-22