在好例子网,分享、交流、成长!
您当前所在位置:首页Others 开发实例一般编程问题 → FT232HL编程指导

FT232HL编程指导

一般编程问题

下载此实例
  • 开发语言:Others
  • 实例大小:0.81M
  • 下载次数:2
  • 浏览次数:253
  • 发布时间:2020-10-24
  • 实例类别:一般编程问题
  • 发 布 人:robot666
  • 文件格式:.pdf
  • 所需积分:2
 

实例介绍

【实例简介】
FT232HL芯片的编程指导,官网已经失传,根据此手册可快速掌握USB2.0芯片的上位机编程方案
FTDI Document reference noi ft ooo071 D2XX Programmers Guide Version 1.3 Chip Clearance noi ftdi#f 17o Copyright c 2011 Future Technology Devices International Limited FTDI Document reference noi ft ooo071 D2XX Programmers Guide Version 1.3 Chip Clearance noi ftdi#f 17o Copyright c 2011 Future Technology Devices International Limited FTDI Document reference noi ft ooo071 D2XX Programmers Guide Version 1.3 Chip Clearance noi ftdi#f 17o 1 Preface explanation of the functions available to application developers via the FTD2XX library t provides an The d2XX interface is a proprietary interface specifically for Ftdi devices. This docum Any software code examples given in this document are for information only. the examples are not guaranteed and are not supported by ftDI 1.1 Acronyms and abbreviations Terms Description CDM Combined driver Model. Windows driver package which incorporates both D2XX and vcp drivers D2XX FTDI's proprietary" direct"driver interface via FTD2XXDLL VCP Virtual com port Copyright c 2011 Future Technology Devices International Limited FTDI Document reference noi ft ooo071 D2XX Programmers Guide Version 1.3 Chip Clearance noi ftdi#f 17o 2 Introduction FTDI provides two alternative software interfaces for its range of USB-UART and USB-FIFO ICS. One interface provides a virtual COM Port (vCp)which appears to the system as a legacy CoM port. the second interface, D2XX, is provided via a proprietary DLL (FTD2XX. DLL). The d2XX interface provides special functions that are not available in standard operating system COM port APIs, such as setting the device into a different mode or writing data into the device EEPROM In the case of the ftdi drivers for windows the d2XX driver and vcp driver are distributed in the same driver package, called the Combined Driver Model (CDM) package. Figure 2.1 Windows CDM Driver Architecture illustrates the architecture of the windows cdm driver D2XX Application COM Port Application FTD2XX DLL FTSER2KSYS FTDIBUS SYS USB Host Controller Driver For Linux, Mac os X(10.4 and later)and windows Ce (4.2 and later the d2XX driver and vcp driver are mutually exclusive options as only one driver type may be installed at a given time for a given device ID In the case of a Windows system running the CDm driver, applications may use either the d2XX or VCP interface without installing a different driver but may not use both interfaces at the same time As the vcp driver interface is designed to emulate a legacy COM port ftdi does not provide documentation on how to communicate with the vcp driver from an application; the developer is referred to the large amount of material available on the Internet regarding serial communication The d2XX interface is a proprietary interface specifically for FtDi devices. This document provides an explanation of the functions available to application developers via the fTD2XX library Copyright c 2011 Future Technology Devices International Limited FTDI Document reference noi ft ooo071 D2XX Programmers Guide Version 1.3 Chip Clearance noi ftdi#f 17o 3 D2XX Classic Functions The functions listed in this section are compatible with all FTDI devices 31F SetVIDPID Supported Operating Systems Linux Mac osX(10.4 and later) Summary a command to include a custom vid and pid combination within the internal device list table. This will allow the driver to load for the specified vid and Pid combination Definition FT_STATUS FT_SetVIDPID (dWoRd dwVID, dWORD dWPID) Parameters dIVID Device Vendor ID(VID) dw PID Device product ID (PID) Return value t oK if successful otherwise the return value is an ft error code Remarks By default, the driver will support a limited set of Vid and PId matched devices (vid 0x0403 with PIDs 0×6001,0×6010,0×6006only) In order to use the driver with other vid and pid combinations the ft setvidPid function must be used prior to calling FT ListDevices, FT Open FT OpenEx or FT CreateDeviceInfoList 32 Ft GetID工D Supported operating Systems Li Mac os X(10. 4 and later) Summary a command to retrieve the current vid and pid com bination from within the internal device list table Definition T STATUS FT_GetVIDPID (DWORD* pdwVID, dWoRd* pdWPID) Parameters paVID Pointer to dword that will contain the internal vid pointer to dword that will contain the internal ptd Copyright c 2011 Future Technology Devices International Limited 6 FTDI Document reference noi ft ooo071 D2XX Programmers Guide Version 1.3 Chip Clearance noi ftdi#f 17o Return value FT OK if successful, otherwise the return value is an Ft error code Remarks See ft setVIDPID 3.3 Ft CreateDeviceInfolist Supported Operating Systems Linux Mac Os X(10.4 and later) Windows(2000 and later) Windows CE(4.2 and later) Summary This function builds a device information list and returns the number of d2xx devices connected to the system The list contains information about both unopen and open devices Definition T sTATUS FT Create DeviceInfoList(LPDWORD pdwNum Devs) Parameters IpdwNum Devs Pointer to unsigned long to store the number of devices connected Return value F OK if successful otherwise the return value is an f error code Remarks An application can use this function to get the number of devices attached to the system. It can then allocate space for the device information list and retrieve the list using ft getDevicelnfo list or Ft GetDeviceInfo detaiift getdeviceinfo detail If the devices connected to the system change the device info list will not be updated until T Create DeviceInfolist is called again Example FT STATUS - tstatus DWCRD numloⅴs; // create the device information list ftstatus Ft CreateDeviceInfoList (&numDeys)i if (ftstatus ETOK)「 is sd\ 已⊥se / ET CreateDeviceInfoList failed Copyright c 2011 Future Technology Devices International Limited FTDI Document reference noi ft ooo071 D2XX Programmers Guide Version 1.3 Chip Clearance noi ftdi#f 17o 3, 4 Ft Getdeviceinfolist Supported operating systems Linux Mac os x(10.4 and later) Windows(2000 and later) Windows CE(4.2 and later) Summary This function returns a device information list and the number of d2xx devices in the list Definition T_STATUS FT_GetDeviceInfoList (FT_DEVICE_LIST_INFO_NODE *pDest, LPDWORD pdwNumDevs Parameters pDest Pointer to an array of FT DEVICE LIST INFO NODE structures. pdwNumDevs Pointer to the number of elements in the array Return value T OK if successful, otherwise the return value is an f error code Remarks system change, the device info list will not be updated until FT Create DeviceInfoList is called again. he This function should only be called after calling Ft create DeviceInfoList. If the devices connected to the Location ID information is not returned for devices that are open when FT CreateDeviceInfoList is called Information is not available for devices which are open in other processes. In this case, the flags arameter of the ft dEvIce LIsT INFo Node will indicate that the device is open, but other fields will be unpopulated The flag value is a 4-byte bit map containing miscellaneous data as defined Appendix a-Type Definitions. Bit 0 (least significant bit) of this number indicates if the port is open(1)or closed(o). Bit 1 indicates if the device is enumerated as a high-speed usB device (2)or a full-speed usB device(0). the remaining bits(2-31) are reserved. The array of FT DEVICE LIST INFO NODES contains all available data on each device. The structure of FT DEVICE LIST INFO NODES is given in the Appendix. The storage for the list must be allocated by the application the number of devices returned by ft create deviceinfolist can be used to do this When programming in Visual Basic, LabVieW or similar languages, ft GetDeviceInfoDetail may be required instead of this function Please note that Linux, mac os X and Windows ce do not support location IDs. As such the Location ID parameter in the structure will be empty under these operating systems Copyright c 2011 Future Technology Devices International Limited FTDI Document reference noi ft ooo071 D2XX Programmers Guide Version 1.3 Chip Clearance noi ftdi#f 17o Example FTS冖ATUs"+ Status; FT DEVICE LIST INEO NODE *devirfo DWCRD numtevs / create the device information list ftstatus FT CrcatcDcviccinfolist(&numDcvs)i 1上(土 tstatus==OK){ printf("Number of devices is d\n", numDevs)i f (numDevs >0) I // allocate storage for list based cn numDevs devinfo (FT DEVICE LIST INFO NODE*)mallcc(sizeof(FT DEVICE LIst INFO NODE )Anumdevs)i A cet the device information list ftstatus Fr GetDeviceInfolist(devIn=o, &numDevs) if(ftstatus = FT OK) i for (int i=0; i< numDevsi i++) rinf("Dev d: \n", i printf(" Flags=Oxx\n", devInfo[i]. Flags) printf(" Type=0xx\n", devIn=o[i]Type)i printf(" ID-Oxx\n", dcvInfo[i1ID) print f("Tc:Td=0×3x、n", devinfo[i].ocTd); printf( scrialNumbcr-os\n", dcvInforil scrialNumbcr)i printf(" De scription=&s\r", devInfol1. Description)i printf(" ftHandlc-0x9xn", dcvInforil ftHandlc)i 3.5 Ft GetDevicelnfoDetail Supported Operating Systems Linux Mac os X(10. 4 and later) Windows(2000 and later) Windows CE(4.2 and later Summary This function returns an entry from the device information list. Definition FT_STATUS FT_GetDeviceInfoDetail(DWord dwIndex LPdWORd lpdwFlags LPDWORD ipdwType, LPDWORD ipdwID, LPDWORD IpdwLocId PCHAR pcSerialNumber, PCHAR pcDescription FT_HANDLE * ftHandle) Parameters dwIndex Index of the entry in the device into list gs Pointer to unsigned long to store the flag value pdwType pointer to unsigned long to store device type. Copyright c 2011 Future Technology Devices International Limited 【实例截图】
【核心代码】

标签:

实例下载地址

FT232HL编程指导

不能下载?内容有错? 点击这里报错 + 投诉 + 提问

好例子网口号:伸出你的我的手 — 分享

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。

关于好例子网

本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明

;
报警