Notes on INF files
Introduction
INF files are in general not a feature in Windows CE, however to configure a USB device to load the appropriate device driver corresponding
to a particular VID and PID requires access to a registry editor which (unlike windows) is not always available on a Windows CE platform.
Using INF files to configure the driver to load properly and initialize some device settings helps users from a windows background
to use the drivers without the need for a registry editor or a complete recompile of the driver with each new VID and PID.
Alternatively to have a device install automatically (without the need for an INF file) when building your own platform you can either use
the suggested registry settings in the registry settings.txt file or include the FTDI.reg and FTDI.bib files in the Windows CE solution.
On loading the driver parses the INF file (which must be located in the Windows directory) to extract settings such as VID/PID and Latency timer.
It then populates the registry with the appropriate values to enable all future removal and insertion of the device to load the FTDI driver.
Please note: INF files are for INSTALLATION ONLY. After a particular device has been installed the inf file becomes redundant and
changes to the inf file will not affect the device.
Altering the INF file
The following sections guide you through the steps to alter the FTDIPORT INF file. Please do not alter the name of this file as the driver
will not recognize any other file name.
WARNING: YOU MUST NOT CHANGE THE GENERAL FORMAT OF THE INF FILE - DOING THIS COULD CAUSE YOUR INSTALLATION TO HALT THE DEVICE AND THEREFORE
REQUIRE A REBOOT. BEFORE PERFORMING THE FOLLOWING PROCEDURE IT IS RECOMMENDED YOU BACK UP ALL ESSENTIAL DATA.
If you have any doubt on how to alter the INF file then contact support who can help with this process.
Alternative VID/PID
By default the VCP driver for Windows CE (ftdi_ser.dll) will work with all devices with a VID of 0x0403.
Therefore if you do not copy the INF file to the Windows directory the driver will create registry settings for
USB devices with a VID of 0x0403.
The INF files provided in this distribution package correspond to a VID of 0x0403 and PIDs of 0x6001, 0x6010, 0x6011, 0x6014 and 0x6015.
If you have a device with an alternative VID and PID (use USBView on a desktop Windows PC to find out device VID and PID)
you will need to edit the INF file to correspond to your device.
The INF file format is a cut down version of the Windows equivalent.
On loading (after you type in the driver name in the install driver dialog box) the driver will read the INF file (if it is present
in the \Windows\ directory) and use the settings you provide.
The section [FtdiHw] must be altered to correspond to your device VID and PID (you can obtain this using USBView on a desktop PC).
For example for a device with VID 0x1234 and PID 0x4321:
Original (0x0403/0x6001) INF entry
[FtdiHw]
%VID_0403&PID_6001.DeviceDesc%=FtdiPort232,FTDIBUS\COMPORT&VID_0403&PID_6001
New entry with a VID of 0x1234 and PID of 0x4321
[FtdiHw]
%VID_1234&PID_4321.DeviceDesc%=FtdiPort232,FTDIBUS\COMPORT&VID_1234&PID_4321
Multiple VIDs and PIDs
The INF file now supports multiple VID and PIDs - if you want to install 2 devices with different VIDs and PIDs you can have
the following entry in the INF file:
[FtdiHw]
%VID_0403&PID_6001.DeviceDesc%=FtdiPort232,FTDIBUS\COMPORT&VID_0403&PID_6001
%VID_0403&PID_6010.DeviceDesc%=FtdiPort232,FTDIBUS\COMPORT&VID_0403&PID_6010
%VID_0403&PID_6011.DeviceDesc%=FtdiPort232,FTDIBUS\COMPORT&VID_0403&PID_6011
%VID_0403&PID_6012.DeviceDesc%=FtdiPort232,FTDIBUS\COMPORT&VID_0403&PID_6014
%VID_0403&PID_6015.DeviceDesc%=FtdiPort232,FTDIBUS\COMPORT&VID_0403&PID_6015
Additional INF Settings
Additional settings are under the [FtdiPort232.NT.HW.AddReg] section of the INF file.
All settings are added to the registry and take effect when the port is opened.
LatencyTimer
This sets the latency on an open (CreateFile) to a device - 1..255
HKR,,"LatencyTimer",0x00010001,25 - this will set the latency timer to 25
InitialIndex
This is the initial index that will be used for this COM device. Currently the driver will assign COM ports 0 to 9 on WinCE 4.2
and 0 to 255 on WinCE 5.0 onwards but if you require the COM port to start at 2 you could have the following setting in the INF file:
HKR,,"InitialIndex",0x00010001,2
ConfigDataFlags
Various settings for control lines
HKR,,"ConfigDataFlags",0x00010001,33
ConfigDataFlags:
bit 0: Ignore all set/clear DTR requests
bit 1: Ignore all set/clear RTS requests
bit 2: DTR initial state high (on open device)
bit 3: RTS initial state high (on open device)
bit 4: Ignore set DTR low on close device
bit 5: Ignore set RTS low on close device
So for example if you want all requests to DTR set or clear to be ignored and the initial state of DTR on open to be high use
a ConfigDataFlags value of 5 decimal.
ConfigData
Aliasing of baud rate can be used to set a particular baud rate not supported by a legacy application.
You in effect replace a standard baud rate for the one you require so the application calls set baud rate for say 9600 but your
alias table has set this to 10000 therefore your COM port will communicate at 10000 baud.
For more info please see app note "Configuring FT232BM Baud Rates"
Use the following setting in the INF file to allow for aliasing of baud rates.
HKR,,"ConfigData",1,01,00,3F,3F,10,27,88,13,C4,09,E2,04,71,02,38,41,9c,80,4E,C0,34,00,1A,00,0D,00,06,40,03,80,00,00,d0,80
Persistent unplug/replug.
A feature to allow the COM port to still be available on an unplug/replug or suspend resume has been added.
To enable this feature you must set bit 2 of the second byte of the ConfigData flags as follows:
HKR,,"ConfigData",1,01,04,00,00,10,27,88,13,C4,09,E2,04,71,02,38,41,9c,80,4E,C0,34,00,1A,00,0D,00,06,40,03,80,00,00,d0,80
PLEASE NOTE: in addition to the above setting you must have unique serial numbers programmed into the devices.
This is required to determine which data to attach to which device on an unplug/replug.
CAUTION must be taken when using this feature. If a COM_Close is not performed on an opened and connected VCP device before the system is
shutdown then there is a risk of a data abort occurring either during the next system power up with the previously opened
VCP device connected or the next time the VCP device is plugged in. Mobile devices where the battery / power can either be removed instantly or drain over a period of time are particularly susceptible to this type of failure and care should be taken to ensure a COM_Close is performed during the shutdown procedure of such devices. It is not advised to use this functionality on a
system with a persistent registry and where an uncontrolled shutdown may occur. COM_Close should also not be called on a VCP where the
hardware has been removed, this may cause a data abort.
Support for CF USB Host
A registry setting may be required to support CF host cards (for example the Ratoc REX-CFU1) the following registry setting
should be used in this case.
HKR,,"ConfigData",1,01,02,00,00,10,27,88,13,C4,09,E2,04,71,02,38,41,9c,80,4E,C0,34,00,1A,00,0D,00,06,40,03,80,00,00,d0,80
(bit 1 of the second byte of the configuration flag data).
In/Out Transfer Sizes
These 2 settings adjust the bulk transfer size. If you are having problems getting the driver to work (such as unable to read from the port)
- try setting the InTransfer size to 64 and working upwards in multiples of 64 to find a suitable value.
HKR,,"InTransferSize",0x00010001,64
HKR,,"OutTransferSize",0x00010001,4096
BulkPriority/Ex
HKR,,"BulkPriority",0x00010001,2 - sets the priority of the reading thread of the driver Valid range 0(High priority) to 7(Low priority).
Setting this value may
RS485转USB 驱动 支持WINCE Android
需积分: 10 174 浏览量
2018-04-16
16:43:56
上传
评论
收藏 47.22MB 7Z 举报
飛越無限
- 粉丝: 242
- 资源: 35
最新资源
- STM32单片机FPGA毕设电路原理论文报告一种基于st62单片机的称重显示控制器
- STM32单片机FPGA毕设电路原理论文报告一种基于SPCE061A单片机的信号发生器
- Ruby菜鸟入门指南.md
- STM32单片机FPGA毕设电路原理论文报告一种基于PIC系列单片机的SPWM逆变电源
- exp01A.cpp
- Rust语言学习万字指南!.md
- STM32单片机FPGA毕设电路原理论文报告一种基于msp430单片机的心电模块设计
- STM32单片机FPGA毕设电路原理论文报告一种基于MSP430单片机的日程管理系统
- web-screen-capture.jar
- 2024最新计算机二级真题练习题库含答案.md
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈