FT_GetBitMode函数的用法

介绍 FT_GetBitMode函数的用法、参数、返回值、注意事项、适用的操作系统环境、调用代码示例等。

null

支持的操作系统

Linux

Mac OS X 10.4 以上版本

Windows 2000 以上版本

Windows CE 4.2 以上版本

概述

FT_GetBitMode函数获取数据总线的当前值。

定义

FT_STATUS FT_GetBitmode (FT_HANDLE ftHandle, PUCHAR pucMode)

参数说明

ftHandle — 设备句柄。

pucMode—指向 unsigned char 的指针,存储数据总线的当前值。

返回值

成功则返回FT_OK,如果失败则根据错误返回特定错误码(FT_*).

备注

关于 FT232R 类型的设备,其可用的位模式的详情,请查阅: the application note “Bit Bang Modes for the
FT232R and FT245R”;

关于 FT2232 类型的设备,其可用的位模式的详情,请查阅: see the application note “Bit Mode Functions for
the FT2232″;

关于 FT232B 和  FT245B 类型的设备,其bit bang模式的详情,请查阅: see the application note
“FT232B/FT245B Bit Bang Mode”;

关于 FT2232 类型的设备,其支持的位模式的详情,请查阅: the IC data sheets;

这些说明手册可以从 FTDI 官方网站下载。

代码示例

FT_HANDLE ftHandle;
UCHAR BitMode;
FT_STATUS ftStatus;
ftStatus = FT_Open(0, &ftHandle);
if(ftStatus != FT_OK) {
// FT_Open failed
return;
}
ftStatus = FT_GetBitMode(ftHandle, &BitMode);
if (ftStatus == FT_OK) {
// BitMode contains current value
}
else {
// FT_GetBitMode FAILED!
}
FT_Close(ftHandle);

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容