adding doc on how to wire EEPROM to the other type oc CH341A programmer

main
Holguer Andres Becerra Daza 2023-09-18 16:33:01 -07:00
parent 2b57b6dc72
commit 480bfe1519
39 changed files with 5689 additions and 2 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,288 @@
; CH341WDM.INF
; Driver for CH341/7 (USB2.0=>EPP/I2C/SPI/JTAG/UART... chip) V2.3
; DRIVER for Windows 2000/XP/Vista/7/8/8.1/10/11/SERVER 2003/2008/2012/2016/2019/2022
; Copyright (C) WCH 2001-2022
;
[Version]
Signature = "$Chicago$"
Class = WCH
ClassGuid = {77989ADF-06DB-4025-92E8-40D902C03B0A}
Provider = %WinChipHead%
DriverVer = 05/06/2022, 2.3.2022.05
CatalogFile.NT = CH341WDM.CAT
[ControlFlags]
ExcludeFromSelect = USB\VID_1A86&PID_5512
ExcludeFromSelect = USB\VID_4348&PID_5512
ExcludeFromSelect = USB\VID_1A86&PID_55DB&MI_02
ExcludeFromSelect = USB\VID_1A86&PID_55DD&MI_02
;ExcludeFromSelect = USB\VID_1A86&PID_7523
;ExcludeFromSelect = USB\VID_1A86&PID_5523
;ExcludeFromSelect = USB\VID_4348&PID_5523
;ExcludeFromSelect = USB\VID_4348&PID_5523&REV_0250
[ClassInstall32]
Addreg = WCHReg
[ClassInstall]
Addreg = WCHReg
[WCHReg]
HKR, , , 0, %ClassName%
HKR, , Icon, , -5
HKR, , NoInstallClass, , 1
[Manufacturer]
%WinChipHead% = WinChipHead,NT,NTamd64,NTia64,NTARM64
[WinChipHead]
%CH341A.DeviceDesc% = CH341.Install, USB\VID_1A86&PID_5512
%CH341.DeviceDesc% = CH341.Install, USB\VID_4348&PID_5512
%CH347M1A.DeviceDesc% = CH347.Install, USB\VID_1A86&PID_55DB&MI_02
%CH347M1B.DeviceDesc% = CH347.Install, USB\VID_1A86&PID_55DD&MI_02
;%CH340SER.DeviceDesc% = CH341.Install, USB\VID_1A86&PID_7523
;%CH341ASER.DeviceDesc% = CH341.Install, USB\VID_1A86&PID_5523
;%CH341SER.DeviceDesc% = CH341.Install, USB\VID_4348&PID_5523
;%CH340SER.DeviceDesc% = CH341.Install, USB\VID_4348&PID_5523&REV_0250
[WinChipHead.NT]
%CH341A.DeviceDesc% = CH341.Install.NT, USB\VID_1A86&PID_5512
%CH341.DeviceDesc% = CH341.Install.NT, USB\VID_4348&PID_5512
%CH347M1A.DeviceDesc% = CH347.Install.NT, USB\VID_1A86&PID_55DB&MI_02
%CH347M1B.DeviceDesc% = CH347.Install.NT, USB\VID_1A86&PID_55DD&MI_02
;%CH340SER.DeviceDesc% = CH341.Install.NT.NTamd64, USB\VID_1A86&PID_7523
;%CH341ASER.DeviceDesc% = CH341.Install.NT, USB\VID_1A86&PID_5523
;%CH341SER.DeviceDesc% = CH341.Install.NT, USB\VID_4348&PID_5523
;%CH340SER.DeviceDesc% = CH341.Install.NT, USB\VID_4348&PID_5523&REV_0250
[WinChipHead.NTamd64]
%CH341A.DeviceDesc% = CH341.Install.NTamd64, USB\VID_1A86&PID_5512
%CH341.DeviceDesc% = CH341.Install.NTamd64, USB\VID_4348&PID_5512
%CH347M1A.DeviceDesc% = CH347.Install.NTamd64, USB\VID_1A86&PID_55DB&MI_02
%CH347M1B.DeviceDesc% = CH347.Install.NTamd64, USB\VID_1A86&PID_55DD&MI_02
;%CH340SER.DeviceDesc% = CH341.Install.NTamd64, USB\VID_1A86&PID_7523
;%CH341ASER.DeviceDesc% = CH341.Install.NTamd64, USB\VID_1A86&PID_5523
;%CH341SER.DeviceDesc% = CH341.Install.NTamd64, USB\VID_4348&PID_5523
;%CH340SER.DeviceDesc% = CH341.Install.NTamd64, USB\VID_4348&PID_5523&REV_0250
[WinChipHead.NTia64]
%CH341A.DeviceDesc% = CH341.Install.NTia64, USB\VID_1A86&PID_5512
%CH341.DeviceDesc% = CH341.Install.NTia64, USB\VID_4348&PID_5512
%CH347M1A.DeviceDesc% = CH347.Install.NTia64, USB\VID_1A86&PID_55DB&MI_02
%CH347M1B.DeviceDesc% = CH347.Install.NTia64, USB\VID_1A86&PID_55DD&MI_02
;%CH340SER.DeviceDesc% = CH341.Install.NTia64, USB\VID_1A86&PID_7523
;%CH341ASER.DeviceDesc% = CH341.Install.NTia64, USB\VID_1A86&PID_5523
;%CH341SER.DeviceDesc% = CH341.Install.NTia64, USB\VID_4348&PID_5523
;%CH340SER.DeviceDesc% = CH341.Install.NTia64, USB\VID_4348&PID_5523&REV_0250
[WinChipHead.NTARM64]
%CH341A.DeviceDesc% = CH341.Install.NTARM64, USB\VID_1A86&PID_5512
%CH341.DeviceDesc% = CH341.Install.NTARM64, USB\VID_4348&PID_5512
%CH347M1A.DeviceDesc% = CH347.Install.NTARM64, USB\VID_1A86&PID_55DB&MI_02
%CH347M1B.DeviceDesc% = CH347.Install.NTARM64, USB\VID_1A86&PID_55DD&MI_02
;%CH340SER.DeviceDesc% = CH341.Install.NTARM64, USB\VID_1A86&PID_7523
;%CH341ASER.DeviceDesc% = CH341.Install.NTARM64, USB\VID_1A86&PID_5523
;%CH341SER.DeviceDesc% = CH341.Install.NTARM64, USB\VID_4348&PID_5523
;%CH340SER.DeviceDesc% = CH341.Install.NTARM64, USB\VID_4348&PID_5523&REV_0250
[CH341.Install]
CopyFiles = CH341.CopyFiles.SYS, CH341.CopyFiles.DLL
AddReg = CH341.9X.AddReg, CH341.AddReg
[CH341.Install.NT]
CopyFiles = CH341.CopyFiles.SYS, CH341.CopyFiles.DLL
AddReg = CH341.NT.AddReg, CH341.AddReg
[CH341.Install.NTamd64]
CopyFiles = CH341.CopyFiles.SYSA64, CH341.CopyFiles.DLLA64,CH341.CopyFiles.WOWDLL
AddReg = CH341.NT.AddReg, CH341.AddReg
[CH341.Install.NTarm64]
CopyFiles = CH341.CopyFiles.SYSM64, CH341.CopyFiles.DLLA64,CH341.CopyFiles.WOWDLL
AddReg = CH341.NT.AddReg, CH341.AddReg
[CH341.Install.NTia64]
CopyFiles = CH341.CopyFiles.SYSI64, CH341.CopyFiles.DLLA64,CH341.CopyFiles.WOWDLL
AddReg = CH341.NT.AddReg, CH341.AddReg
[CH347.Install]
CopyFiles = CH341.CopyFiles.SYS, CH347.CopyFiles.DLL, CH341.CopyFiles.DLL
AddReg = CH341.9X.AddReg, CH347.AddReg
[CH347.Install.NT]
CopyFiles = CH341.CopyFiles.SYS, CH347.CopyFiles.DLL, CH341.CopyFiles.DLL
AddReg = CH341.NT.AddReg, CH347.AddReg
[CH347.Install.NTamd64]
CopyFiles = CH341.CopyFiles.SYSA64, CH347.CopyFiles.DLLA64, CH347.CopyFiles.WOWDLL,CH341.CopyFiles.WOWDLL
AddReg = CH341.NT.AddReg, CH347.AddReg
[CH347.Install.NTia64]
CopyFiles = CH341.CopyFiles.SYSI64, CH347.CopyFiles.DLLA64, CH347.CopyFiles.WOWDLL,CH341.CopyFiles.WOWDLL
AddReg = CH341.NT.AddReg, CH347.AddReg
[CH347.Install.NTarm64]
CopyFiles = CH341.CopyFiles.SYSM64, CH347.CopyFiles.DLLA64, CH347.CopyFiles.WOWDLL,CH341.CopyFiles.WOWDLL
AddReg = CH341.NT.AddReg, CH347.AddReg
[CH341.CopyFiles.SYS]
CH341WDM.SYS, , , 2
[CH341.CopyFiles.SYSA64]
CH341W64.SYS, , , 2
[CH341.CopyFiles.SYSM64]
CH341M64.SYS, , , 2
[CH341.CopyFiles.SYSI64]
;CH341I64.SYS, , , 2
[CH341.CopyFiles.DLL]
CH341DLL.DLL, , , 2
[CH341.CopyFiles.DLLA64]
CH341DLLA64.DLL, , , 2
[CH341.CopyFiles.WOWDLL]
CH341DLL.DLL, , , 2
[CH347.CopyFiles.DLL]
CH347DLL.DLL, , , 2
[CH347.CopyFiles.DLLA64]
CH347DLLA64.DLL, , , 2
[CH347.CopyFiles.WOWDLL]
CH347DLL.DLL, , , 2
[CH341.9X.AddReg]
HKR, , DevLoader, , *NTKERN
HKR, , NTMPDriver, , CH341WDM.SYS
[CH341.NT.AddReg]
[CH341.AddReg]
HKLM, SOFTWARE\WinChipHead\IC\CH341, WDM, 0x00010001, 0x00000022
HKLM, SOFTWARE\WinChipHead\IC\CH341, DLL, 0x00010001, 0x00000021
HKLM, SOFTWARE\WinChipHead\IC\CH341, Function, , "USB=>Parallel"
[CH347.AddReg]
HKLM, SOFTWARE\WinChipHead\IC\CH347, WDM, 0x00010001, 0x00000022
HKLM, SOFTWARE\WinChipHead\IC\CH347, DLL, 0x00010001, 0x00000021
HKLM, SOFTWARE\WinChipHead\IC\CH347, Function, , "USB20=>SPI&I2C&JTAG&UART"
[CH341.Install.NT.Services]
AddService = CH341, 2, CH341.Service
[CH341.Install.NTamd64.Services]
AddService = CH341_A64, 2, CH341.ServiceA64
[CH341.Install.NTia64.Services]
AddService = CH341_I64, 2, CH341.ServiceI64
[CH341.Install.NTarm64.Services]
AddService = CH341_M64, 2, CH341.ServiceM64
[CH347.Install.NT.Services]
AddService = CH341, 2, CH341.Service
[CH347.Install.NTamd64.Services]
AddService = CH341_A64, 2, CH341.ServiceA64
[CH347.Install.NTia64.Services]
AddService = CH341_I64, 2, CH341.ServiceI64
[CH347.Install.NTarm64.Services]
AddService = CH341_M64, 2, CH341.ServiceM64
[CH341.Service]
DisplayName = "CH341WDM"
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %10%\System32\Drivers\CH341WDM.SYS
[CH341.ServiceA64]
DisplayName = "CH341WDM_A64"
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %10%\System32\Drivers\CH341W64.SYS
[CH341.ServiceI64]
DisplayName = "CH341WDM_I64"
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %10%\System32\Drivers\CH341I64.SYS
[CH341.ServiceM64]
DisplayName = "CH341WDM_M64"
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %10%\System32\Drivers\CH341M64.SYS
[DestinationDirs]
DefaultDestDir = 10, System32\Drivers
CH347.CopyFiles.DLL = 11
CH347.CopyFiles.DLLA64 = 11
CH347.CopyFiles.WOWDLL = 10,SysWOW64
CH341.CopyFiles.DLL = 11
CH341.CopyFiles.DLLA64 = 11
CH341.CopyFiles.WOWDLL = 10,SysWOW64
CH341.CopyFiles.SYS = 10, System32\Drivers
CH341.CopyFiles.SYSA64 = 10, System32\Drivers
CH341.CopyFiles.SYSM64 = 10, System32\Drivers
;CH347.CopyFiles.SYSI64 = 10, System32\Drivers
;CH341.CopyFiles.SYSI64 = 10, System32\Drivers
[SourceDisksFiles]
CH341WDM.SYS = 1
CH341W64.SYS = 1
CH341M64.SYS = 1
CH341DLL.DLL = 1
CH341DLLA64.DLL = 1
CH347DLL.DLL = 1
CH347DLLA64.DLL = 1
;CH341I64.SYS = 1
;CH347I64.SYS = 1
[SourceDisksNames]
1 = %DISK_NAME%, CH341WDM.SYS, ,
[SourceDisksNames.amd64]
1 = %DISK_NAME%, CH341W64.SYS, ,
[SourceDisksNames.ia64]
1 = %DISK_NAME%, CH341I64.SYS, ,
[SourceDisksNames.arm64]
1 = %DISK_NAME%, CH341M64.SYS, ,
[Strings]
ClassName = "Interface"
WinChipHead = "wch.cn"
CH341.DeviceDesc = "USB-EPP/I2C... CH341"
CH341A.DeviceDesc = "USB-EPP/I2C... CH341A"
CH347M1A.DeviceDesc = "USB HighSpeed-SPI/I2C... CH347"
CH347M1B.DeviceDesc = "USB HighSpeed-JTAG/I2C... CH347"
CH341SER.DeviceDesc = "USB-SERIAL CH341"
CH340SER.DeviceDesc = "USB-SERIAL CH340"
CH341ASER.DeviceDesc = "USB-SERIAL CH341A"
DISK_NAME = "CH341 Parallel Installation Disk"
[Strings.0804]
ClassName = "Íⲿ½Ó¿Ú"
WinChipHead = "wch.cn"
CH341.DeviceDesc = "USB-EPP/I2C... CH341"
CH341A.DeviceDesc = "USB-EPP/I2C... CH341A"
CH347M1A.DeviceDesc = "USB HighSpeed-SPI/I2C... CH347"
CH347M1B.DeviceDesc = "USB HighSpeed-JTAG/I2C... CH347"
CH341SER.DeviceDesc = "USB-SERIAL CH341"
CH340SER.DeviceDesc = "USB-SERIAL CH340"
CH341ASER.DeviceDesc = "USB-SERIAL CH341A"
DISK_NAME = "CH341 Parallel Installation Disk"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,288 @@
; CH341WDM.INF
; Driver for CH341/7 (USB2.0=>EPP/I2C/SPI/JTAG/UART... chip) V2.3
; DRIVER for Windows 2000/XP/Vista/7/8/8.1/10/11/SERVER 2003/2008/2012/2016/2019/2022
; Copyright (C) WCH 2001-2022
;
[Version]
Signature = "$Chicago$"
Class = WCH
ClassGuid = {77989ADF-06DB-4025-92E8-40D902C03B0A}
Provider = %WinChipHead%
DriverVer = 05/06/2022, 2.3.2022.05
CatalogFile.NT = CH341WDM.CAT
[ControlFlags]
ExcludeFromSelect = USB\VID_1A86&PID_5512
ExcludeFromSelect = USB\VID_4348&PID_5512
ExcludeFromSelect = USB\VID_1A86&PID_55DB&MI_02
ExcludeFromSelect = USB\VID_1A86&PID_55DD&MI_02
;ExcludeFromSelect = USB\VID_1A86&PID_7523
;ExcludeFromSelect = USB\VID_1A86&PID_5523
;ExcludeFromSelect = USB\VID_4348&PID_5523
;ExcludeFromSelect = USB\VID_4348&PID_5523&REV_0250
[ClassInstall32]
Addreg = WCHReg
[ClassInstall]
Addreg = WCHReg
[WCHReg]
HKR, , , 0, %ClassName%
HKR, , Icon, , -5
HKR, , NoInstallClass, , 1
[Manufacturer]
%WinChipHead% = WinChipHead,NT,NTamd64,NTia64,NTARM64
[WinChipHead]
%CH341A.DeviceDesc% = CH341.Install, USB\VID_1A86&PID_5512
%CH341.DeviceDesc% = CH341.Install, USB\VID_4348&PID_5512
%CH347M1A.DeviceDesc% = CH347.Install, USB\VID_1A86&PID_55DB&MI_02
%CH347M1B.DeviceDesc% = CH347.Install, USB\VID_1A86&PID_55DD&MI_02
;%CH340SER.DeviceDesc% = CH341.Install, USB\VID_1A86&PID_7523
;%CH341ASER.DeviceDesc% = CH341.Install, USB\VID_1A86&PID_5523
;%CH341SER.DeviceDesc% = CH341.Install, USB\VID_4348&PID_5523
;%CH340SER.DeviceDesc% = CH341.Install, USB\VID_4348&PID_5523&REV_0250
[WinChipHead.NT]
%CH341A.DeviceDesc% = CH341.Install.NT, USB\VID_1A86&PID_5512
%CH341.DeviceDesc% = CH341.Install.NT, USB\VID_4348&PID_5512
%CH347M1A.DeviceDesc% = CH347.Install.NT, USB\VID_1A86&PID_55DB&MI_02
%CH347M1B.DeviceDesc% = CH347.Install.NT, USB\VID_1A86&PID_55DD&MI_02
;%CH340SER.DeviceDesc% = CH341.Install.NT.NTamd64, USB\VID_1A86&PID_7523
;%CH341ASER.DeviceDesc% = CH341.Install.NT, USB\VID_1A86&PID_5523
;%CH341SER.DeviceDesc% = CH341.Install.NT, USB\VID_4348&PID_5523
;%CH340SER.DeviceDesc% = CH341.Install.NT, USB\VID_4348&PID_5523&REV_0250
[WinChipHead.NTamd64]
%CH341A.DeviceDesc% = CH341.Install.NTamd64, USB\VID_1A86&PID_5512
%CH341.DeviceDesc% = CH341.Install.NTamd64, USB\VID_4348&PID_5512
%CH347M1A.DeviceDesc% = CH347.Install.NTamd64, USB\VID_1A86&PID_55DB&MI_02
%CH347M1B.DeviceDesc% = CH347.Install.NTamd64, USB\VID_1A86&PID_55DD&MI_02
;%CH340SER.DeviceDesc% = CH341.Install.NTamd64, USB\VID_1A86&PID_7523
;%CH341ASER.DeviceDesc% = CH341.Install.NTamd64, USB\VID_1A86&PID_5523
;%CH341SER.DeviceDesc% = CH341.Install.NTamd64, USB\VID_4348&PID_5523
;%CH340SER.DeviceDesc% = CH341.Install.NTamd64, USB\VID_4348&PID_5523&REV_0250
[WinChipHead.NTia64]
%CH341A.DeviceDesc% = CH341.Install.NTia64, USB\VID_1A86&PID_5512
%CH341.DeviceDesc% = CH341.Install.NTia64, USB\VID_4348&PID_5512
%CH347M1A.DeviceDesc% = CH347.Install.NTia64, USB\VID_1A86&PID_55DB&MI_02
%CH347M1B.DeviceDesc% = CH347.Install.NTia64, USB\VID_1A86&PID_55DD&MI_02
;%CH340SER.DeviceDesc% = CH341.Install.NTia64, USB\VID_1A86&PID_7523
;%CH341ASER.DeviceDesc% = CH341.Install.NTia64, USB\VID_1A86&PID_5523
;%CH341SER.DeviceDesc% = CH341.Install.NTia64, USB\VID_4348&PID_5523
;%CH340SER.DeviceDesc% = CH341.Install.NTia64, USB\VID_4348&PID_5523&REV_0250
[WinChipHead.NTARM64]
%CH341A.DeviceDesc% = CH341.Install.NTARM64, USB\VID_1A86&PID_5512
%CH341.DeviceDesc% = CH341.Install.NTARM64, USB\VID_4348&PID_5512
%CH347M1A.DeviceDesc% = CH347.Install.NTARM64, USB\VID_1A86&PID_55DB&MI_02
%CH347M1B.DeviceDesc% = CH347.Install.NTARM64, USB\VID_1A86&PID_55DD&MI_02
;%CH340SER.DeviceDesc% = CH341.Install.NTARM64, USB\VID_1A86&PID_7523
;%CH341ASER.DeviceDesc% = CH341.Install.NTARM64, USB\VID_1A86&PID_5523
;%CH341SER.DeviceDesc% = CH341.Install.NTARM64, USB\VID_4348&PID_5523
;%CH340SER.DeviceDesc% = CH341.Install.NTARM64, USB\VID_4348&PID_5523&REV_0250
[CH341.Install]
CopyFiles = CH341.CopyFiles.SYS, CH341.CopyFiles.DLL
AddReg = CH341.9X.AddReg, CH341.AddReg
[CH341.Install.NT]
CopyFiles = CH341.CopyFiles.SYS, CH341.CopyFiles.DLL
AddReg = CH341.NT.AddReg, CH341.AddReg
[CH341.Install.NTamd64]
CopyFiles = CH341.CopyFiles.SYSA64, CH341.CopyFiles.DLLA64,CH341.CopyFiles.WOWDLL
AddReg = CH341.NT.AddReg, CH341.AddReg
[CH341.Install.NTarm64]
CopyFiles = CH341.CopyFiles.SYSM64, CH341.CopyFiles.DLLA64,CH341.CopyFiles.WOWDLL
AddReg = CH341.NT.AddReg, CH341.AddReg
[CH341.Install.NTia64]
CopyFiles = CH341.CopyFiles.SYSI64, CH341.CopyFiles.DLLA64,CH341.CopyFiles.WOWDLL
AddReg = CH341.NT.AddReg, CH341.AddReg
[CH347.Install]
CopyFiles = CH341.CopyFiles.SYS, CH347.CopyFiles.DLL, CH341.CopyFiles.DLL
AddReg = CH341.9X.AddReg, CH347.AddReg
[CH347.Install.NT]
CopyFiles = CH341.CopyFiles.SYS, CH347.CopyFiles.DLL, CH341.CopyFiles.DLL
AddReg = CH341.NT.AddReg, CH347.AddReg
[CH347.Install.NTamd64]
CopyFiles = CH341.CopyFiles.SYSA64, CH347.CopyFiles.DLLA64, CH347.CopyFiles.WOWDLL,CH341.CopyFiles.WOWDLL
AddReg = CH341.NT.AddReg, CH347.AddReg
[CH347.Install.NTia64]
CopyFiles = CH341.CopyFiles.SYSI64, CH347.CopyFiles.DLLA64, CH347.CopyFiles.WOWDLL,CH341.CopyFiles.WOWDLL
AddReg = CH341.NT.AddReg, CH347.AddReg
[CH347.Install.NTarm64]
CopyFiles = CH341.CopyFiles.SYSM64, CH347.CopyFiles.DLLA64, CH347.CopyFiles.WOWDLL,CH341.CopyFiles.WOWDLL
AddReg = CH341.NT.AddReg, CH347.AddReg
[CH341.CopyFiles.SYS]
CH341WDM.SYS, , , 2
[CH341.CopyFiles.SYSA64]
CH341W64.SYS, , , 2
[CH341.CopyFiles.SYSM64]
CH341M64.SYS, , , 2
[CH341.CopyFiles.SYSI64]
;CH341I64.SYS, , , 2
[CH341.CopyFiles.DLL]
CH341DLL.DLL, , , 2
[CH341.CopyFiles.DLLA64]
CH341DLLA64.DLL, , , 2
[CH341.CopyFiles.WOWDLL]
CH341DLL.DLL, , , 2
[CH347.CopyFiles.DLL]
CH347DLL.DLL, , , 2
[CH347.CopyFiles.DLLA64]
CH347DLLA64.DLL, , , 2
[CH347.CopyFiles.WOWDLL]
CH347DLL.DLL, , , 2
[CH341.9X.AddReg]
HKR, , DevLoader, , *NTKERN
HKR, , NTMPDriver, , CH341WDM.SYS
[CH341.NT.AddReg]
[CH341.AddReg]
HKLM, SOFTWARE\WinChipHead\IC\CH341, WDM, 0x00010001, 0x00000022
HKLM, SOFTWARE\WinChipHead\IC\CH341, DLL, 0x00010001, 0x00000021
HKLM, SOFTWARE\WinChipHead\IC\CH341, Function, , "USB=>Parallel"
[CH347.AddReg]
HKLM, SOFTWARE\WinChipHead\IC\CH347, WDM, 0x00010001, 0x00000022
HKLM, SOFTWARE\WinChipHead\IC\CH347, DLL, 0x00010001, 0x00000021
HKLM, SOFTWARE\WinChipHead\IC\CH347, Function, , "USB20=>SPI&I2C&JTAG&UART"
[CH341.Install.NT.Services]
AddService = CH341, 2, CH341.Service
[CH341.Install.NTamd64.Services]
AddService = CH341_A64, 2, CH341.ServiceA64
[CH341.Install.NTia64.Services]
AddService = CH341_I64, 2, CH341.ServiceI64
[CH341.Install.NTarm64.Services]
AddService = CH341_M64, 2, CH341.ServiceM64
[CH347.Install.NT.Services]
AddService = CH341, 2, CH341.Service
[CH347.Install.NTamd64.Services]
AddService = CH341_A64, 2, CH341.ServiceA64
[CH347.Install.NTia64.Services]
AddService = CH341_I64, 2, CH341.ServiceI64
[CH347.Install.NTarm64.Services]
AddService = CH341_M64, 2, CH341.ServiceM64
[CH341.Service]
DisplayName = "CH341WDM"
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %10%\System32\Drivers\CH341WDM.SYS
[CH341.ServiceA64]
DisplayName = "CH341WDM_A64"
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %10%\System32\Drivers\CH341W64.SYS
[CH341.ServiceI64]
DisplayName = "CH341WDM_I64"
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %10%\System32\Drivers\CH341I64.SYS
[CH341.ServiceM64]
DisplayName = "CH341WDM_M64"
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %10%\System32\Drivers\CH341M64.SYS
[DestinationDirs]
DefaultDestDir = 10, System32\Drivers
CH347.CopyFiles.DLL = 11
CH347.CopyFiles.DLLA64 = 11
CH347.CopyFiles.WOWDLL = 10,SysWOW64
CH341.CopyFiles.DLL = 11
CH341.CopyFiles.DLLA64 = 11
CH341.CopyFiles.WOWDLL = 10,SysWOW64
CH341.CopyFiles.SYS = 10, System32\Drivers
CH341.CopyFiles.SYSA64 = 10, System32\Drivers
CH341.CopyFiles.SYSM64 = 10, System32\Drivers
;CH347.CopyFiles.SYSI64 = 10, System32\Drivers
;CH341.CopyFiles.SYSI64 = 10, System32\Drivers
[SourceDisksFiles]
CH341WDM.SYS = 1
CH341W64.SYS = 1
CH341M64.SYS = 1
CH341DLL.DLL = 1
CH341DLLA64.DLL = 1
CH347DLL.DLL = 1
CH347DLLA64.DLL = 1
;CH341I64.SYS = 1
;CH347I64.SYS = 1
[SourceDisksNames]
1 = %DISK_NAME%, CH341WDM.SYS, ,
[SourceDisksNames.amd64]
1 = %DISK_NAME%, CH341W64.SYS, ,
[SourceDisksNames.ia64]
1 = %DISK_NAME%, CH341I64.SYS, ,
[SourceDisksNames.arm64]
1 = %DISK_NAME%, CH341M64.SYS, ,
[Strings]
ClassName = "Interface"
WinChipHead = "wch.cn"
CH341.DeviceDesc = "USB-EPP/I2C... CH341"
CH341A.DeviceDesc = "USB-EPP/I2C... CH341A"
CH347M1A.DeviceDesc = "USB HighSpeed-SPI/I2C... CH347"
CH347M1B.DeviceDesc = "USB HighSpeed-JTAG/I2C... CH347"
CH341SER.DeviceDesc = "USB-SERIAL CH341"
CH340SER.DeviceDesc = "USB-SERIAL CH340"
CH341ASER.DeviceDesc = "USB-SERIAL CH341A"
DISK_NAME = "CH341 Parallel Installation Disk"
[Strings.0804]
ClassName = "Íⲿ½Ó¿Ú"
WinChipHead = "wch.cn"
CH341.DeviceDesc = "USB-EPP/I2C... CH341"
CH341A.DeviceDesc = "USB-EPP/I2C... CH341A"
CH347M1A.DeviceDesc = "USB HighSpeed-SPI/I2C... CH347"
CH347M1B.DeviceDesc = "USB HighSpeed-JTAG/I2C... CH347"
CH341SER.DeviceDesc = "USB-SERIAL CH341"
CH340SER.DeviceDesc = "USB-SERIAL CH340"
CH341ASER.DeviceDesc = "USB-SERIAL CH341A"
DISK_NAME = "CH341 Parallel Installation Disk"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,688 @@
// 2004.05.28, 2004.10.20, 2005.01.08, 2005.03.25, 2005.04.28, 2005.07.18, 2005.07.28, 2005.09.19, 2007.12.19, 2008.10.15,2022.5
//****************************************
//** Copyright (C) WCH 1999-2022 **
//** Web: http://www.winchiphead.com **
//****************************************
//** DLL for USB interface chip CH341 **
//** C, VC5.0 **
//****************************************
//
// USB总线接口芯片CH341并口应用层接口库 V2.2
// 南京沁恒电子有限公司 作者: W.ch 2008.10
// CH341-DLL V2.2
// 运行环境: Windows 98/ME, Windows 2000/XP/7/10/11
// support USB chip: CH341, CH341A CH347 SPI/I2C
// USB => Parallel, I2C, SPI, ...
//
#ifndef _CH341_DLL_H
#define _CH341_DLL_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _WIN64
#define mOFFSET( s, m ) ( (ULONG_PTR) & ( ( ( s * ) 0 ) -> m ) ) // 定义获取结构成员相对偏移地址的宏
#else
#define mOFFSET( s, m ) ( (ULONG) & ( ( ( s * ) 0 ) -> m ) ) // 定义获取结构成员相对偏移地址的宏
#endif
#ifndef max
#define max( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) ) // 较大值
#endif
#ifndef min
#define min( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) ) // 较小值
#endif
#ifdef ExAllocatePool
#undef ExAllocatePool // 删除带TAG的内存分配
#endif
#ifndef NTSTATUS
typedef LONG NTSTATUS; // 返回状态
#endif
typedef struct _USB_SETUP_PKT { // USB控制传输的建立阶段的数据请求包结构
UCHAR mUspReqType; // 00H 请求类型
UCHAR mUspRequest; // 01H 请求代码
union {
struct {
UCHAR mUspValueLow; // 02H 值参数低字节
UCHAR mUspValueHigh; // 03H 值参数高字节
};
USHORT mUspValue; // 02H-03H 值参数
};
union {
struct {
UCHAR mUspIndexLow; // 04H 索引参数低字节
UCHAR mUspIndexHigh; // 05H 索引参数高字节
};
USHORT mUspIndex; // 04H-05H 索引参数
};
USHORT mLength; // 06H-07H 数据阶段的数据长度
} mUSB_SETUP_PKT, *mPUSB_SETUP_PKT;
#define mCH341_PACKET_LENGTH 32 // CH341支持的数据包的长度
#define mCH341_PKT_LEN_SHORT 8 // CH341支持的短数据包的长度
typedef struct _WIN32_COMMAND { // 定义WIN32命令接口结构
union {
ULONG mFunction; // 输入时指定功能代码或者管道号
NTSTATUS mStatus; // 输出时返回操作状态
};
ULONG mLength; // 存取长度,返回后续数据的长度
union {
mUSB_SETUP_PKT mSetupPkt; // USB控制传输的建立阶段的数据请求
UCHAR mBuffer[ 512]; // 数据缓冲区,长度为0至255B
};
} mWIN32_COMMAND, *mPWIN32_COMMAND;
// WIN32应用层接口命令
#define IOCTL_CH341_COMMAND ( FILE_DEVICE_UNKNOWN << 16 | FILE_ANY_ACCESS << 14 | 0x0f34 << 2 | METHOD_BUFFERED ) // 专用接口
#define mWIN32_COMMAND_HEAD mOFFSET( mWIN32_COMMAND, mBuffer ) // WIN32命令接口的头长度
#define mCH341_MAX_NUMBER 16 // 最多同时连接的CH341数
#define mMAX_BUFFER_LENGTH 0x1000 // 数据缓冲区最大长度4096
#define mMAX_COMMAND_LENGTH ( mWIN32_COMMAND_HEAD + mMAX_BUFFER_LENGTH ) // 最大数据长度加上命令结构头的长度
#define mDEFAULT_BUFFER_LEN 0x0400 // 数据缓冲区默认长度1024
#define mDEFAULT_COMMAND_LEN ( mWIN32_COMMAND_HEAD + mDEFAULT_BUFFER_LEN ) // 默认数据长度加上命令结构头的长度
// CH341端点地址
#define mCH341_ENDP_INTER_UP 0x81 // CH341的中断数据上传端点的地址
#define mCH341_ENDP_INTER_DOWN 0x01 // CH341的中断数据下传端点的地址
#define mCH341_ENDP_DATA_UP 0x82 // CH341的数据块上传端点的地址
#define mCH341_ENDP_DATA_DOWN 0x02 // CH341的数据块下传端点的地址
// 设备层接口提供的管道操作命令
#define mPipeDeviceCtrl 0x00000004 // CH341的综合控制管道
#define mPipeInterUp 0x00000005 // CH341的中断数据上传管道
#define mPipeDataUp 0x00000006 // CH341的数据块上传管道
#define mPipeDataDown 0x00000007 // CH341的数据块下传管道
// 应用层接口的功能代码
#define mFuncNoOperation 0x00000000 // 无操作
#define mFuncGetVersion 0x00000001 // 获取驱动程序版本号
#define mFuncGetConfig 0x00000002 // 获取USB设备配置描述符
#define mFuncSetTimeout 0x00000009 // 设置USB通讯超时
#define mFuncSetExclusive 0x0000000b // 设置独占使用
#define mFuncResetDevice 0x0000000c // 复位USB设备
#define mFuncResetPipe 0x0000000d // 复位USB管道
#define mFuncAbortPipe 0x0000000e // 取消USB管道的数据请求
// CH341并口专用的功能代码
#define mFuncSetParaMode 0x0000000f // 设置并口模式
#define mFuncReadData0 0x00000010 // 从并口读取数据块0
#define mFuncReadData1 0x00000011 // 从并口读取数据块1
#define mFuncWriteData0 0x00000012 // 向并口写入数据块0
#define mFuncWriteData1 0x00000013 // 向并口写入数据块1
#define mFuncWriteRead 0x00000014 // 先输出再输入
#define mFuncBufferMode 0x00000020 // 设定缓冲上传模式及查询缓冲区中的数据长度
#define mFuncBufferModeDn 0x00000021 // 设定缓冲下传模式及查询缓冲区中的数据长度
#define mFuncGetVersionEx 0x00000022 // 获取驱动程序版本号及芯片型号
// USB设备标准请求代码
#define mUSB_CLR_FEATURE 0x01
#define mUSB_SET_FEATURE 0x03
#define mUSB_GET_STATUS 0x00
#define mUSB_SET_ADDRESS 0x05
#define mUSB_GET_DESCR 0x06
#define mUSB_SET_DESCR 0x07
#define mUSB_GET_CONFIG 0x08
#define mUSB_SET_CONFIG 0x09
#define mUSB_GET_INTERF 0x0a
#define mUSB_SET_INTERF 0x0b
#define mUSB_SYNC_FRAME 0x0c
// CH341控制传输的厂商专用请求类型
#define mCH341_VENDOR_READ 0xC0 // 通过控制传输实现的CH341厂商专用读操作
#define mCH341_VENDOR_WRITE 0x40 // 通过控制传输实现的CH341厂商专用写操作
// CH341控制传输的厂商专用请求代码
#define mCH341_PARA_INIT 0xB1 // 初始化并口
#define mCH341_I2C_STATUS 0x52 // 获取I2C接口的状态
#define mCH341_I2C_COMMAND 0x53 // 发出I2C接口的命令
// CH341并口操作命令代码
#define mCH341_PARA_CMD_R0 0xAC // 从并口读数据0,次字节为长度
#define mCH341_PARA_CMD_R1 0xAD // 从并口读数据1,次字节为长度
#define mCH341_PARA_CMD_W0 0xA6 // 向并口写数据0,从次字节开始为数据流
#define mCH341_PARA_CMD_W1 0xA7 // 向并口写数据1,从次字节开始为数据流
#define mCH341_PARA_CMD_STS 0xA0 // 获取并口状态
// CH341A并口操作命令代码
#define mCH341A_CMD_SET_OUTPUT 0xA1 // 设置并口输出
#define mCH341A_CMD_IO_ADDR 0xA2 // MEM带地址读写/输入输出,从次字节开始为命令流
#define mCH341A_CMD_PRINT_OUT 0xA3 // PRINT兼容打印方式输出,从次字节开始为数据流
#define mCH341A_CMD_PWM_OUT 0xA4 // PWM数据输出的命令包,从次字节开始为数据流
#define mCH341A_CMD_SHORT_PKT 0xA5 // 短包,次字节是该命令包的真正长度,再次字节及之后的字节是原命令包
#define mCH341A_CMD_SPI_STREAM 0xA8 // SPI接口的命令包,从次字节开始为数据流
//#define mCH341A_CMD_SIO_STREAM 0xA9 // SIO接口的命令包,从次字节开始为数据流
#define mCH341A_CMD_I2C_STREAM 0xAA // I2C接口的命令包,从次字节开始为I2C命令流
#define mCH341A_CMD_UIO_STREAM 0xAB // UIO接口的命令包,从次字节开始为命令流
#define mCH341A_CMD_PIO_STREAM 0xAE // PIO接口的命令包,从次字节开始为数据流
// CH341A控制传输的厂商专用请求代码
#define mCH341A_BUF_CLEAR 0xB2 // 清除未完成的数据
#define mCH341A_I2C_CMD_X 0x54 // 发出I2C接口的命令,立即执行
#define mCH341A_DELAY_MS 0x5E // 以亳秒为单位延时指定时间
#define mCH341A_GET_VER 0x5F // 获取芯片版本
#define mCH341_EPP_IO_MAX ( mCH341_PACKET_LENGTH - 1 ) // CH341在EPP/MEM方式下单次读写数据块的最大长度
#define mCH341A_EPP_IO_MAX 0xFF // CH341A在EPP/MEM方式下单次读写数据块的最大长度
#define mCH341A_CMD_IO_ADDR_W 0x00 // MEM带地址读写/输入输出的命令流:写数据,位6-位0为地址,下一个字节为待写数据
#define mCH341A_CMD_IO_ADDR_R 0x80 // MEM带地址读写/输入输出的命令流:读数据,位6-位0为地址,读出数据一起返回
#define mCH341A_CMD_I2C_STM_STA 0x74 // I2C接口的命令流:产生起始位
#define mCH341A_CMD_I2C_STM_STO 0x75 // I2C接口的命令流:产生停止位
#define mCH341A_CMD_I2C_STM_OUT 0x80 // I2C接口的命令流:输出数据,位5-位0为长度,后续字节为数据,0长度则只发送一个字节并返回应答
#define mCH341A_CMD_I2C_STM_IN 0xC0 // I2C接口的命令流:输入数据,位5-位0为长度,0长度则只接收一个字节并发送无应答
#define mCH341A_CMD_I2C_STM_MAX ( min( 0x3F, mCH341_PACKET_LENGTH ) ) // I2C接口的命令流单个命令输入输出数据的最大长度
#define mCH341A_CMD_I2C_STM_SET 0x60 // I2C接口的命令流:设置参数,位2=SPI的I/O数(0=单入单出,1=双入双出),位1位0=I2C速度(00=低速,01=标准,10=快速,11=高速)
#define mCH341A_CMD_I2C_STM_US 0x40 // I2C接口的命令流:以微秒为单位延时,位3-位0为延时值
#define mCH341A_CMD_I2C_STM_MS 0x50 // I2C接口的命令流:以亳秒为单位延时,位3-位0为延时值
#define mCH341A_CMD_I2C_STM_DLY 0x0F // I2C接口的命令流单个命令延时的最大值
#define mCH341A_CMD_I2C_STM_END 0x00 // I2C接口的命令流:命令包提前结束
#define mCH341A_CMD_UIO_STM_IN 0x00 // UIO接口的命令流:输入数据D7-D0
#define mCH341A_CMD_UIO_STM_DIR 0x40 // UIO接口的命令流:设定I/O方向D5-D0,位5-位0为方向数据
#define mCH341A_CMD_UIO_STM_OUT 0x80 // UIO接口的命令流:输出数据D5-D0,位5-位0为数据
#define mCH341A_CMD_UIO_STM_US 0xC0 // UIO接口的命令流:以微秒为单位延时,位5-位0为延时值
#define mCH341A_CMD_UIO_STM_END 0x20 // UIO接口的命令流:命令包提前结束
// CH341并口工作模式
#define mCH341_PARA_MODE_EPP 0x00 // CH341并口工作模式为EPP方式
#define mCH341_PARA_MODE_EPP17 0x00 // CH341A并口工作模式为EPP方式V1.7
#define mCH341_PARA_MODE_EPP19 0x01 // CH341A并口工作模式为EPP方式V1.9
#define mCH341_PARA_MODE_MEM 0x02 // CH341并口工作模式为MEM方式
#define mCH341_PARA_MODE_ECP 0x03 // CH341A并口工作模式为ECP方式
// I/O方向设置位定义,直接输入的状态信号的位定义,直接输出的位数据定义
#define mStateBitERR 0x00000100 // 只读可写,ERR#引脚输入状态,1:高电平,0:低电平
#define mStateBitPEMP 0x00000200 // 只读可写,PEMP引脚输入状态,1:高电平,0:低电平
#define mStateBitINT 0x00000400 // 只读可写,INT#引脚输入状态,1:高电平,0:低电平
#define mStateBitSLCT 0x00000800 // 只读可写,SLCT引脚输入状态,1:高电平,0:低电平
#define mStateBitWAIT 0x00002000 // 只读可写,WAIT#引脚输入状态,1:高电平,0:低电平
#define mStateBitDATAS 0x00004000 // 只写可读,DATAS#/READ#引脚输入状态,1:高电平,0:低电平
#define mStateBitADDRS 0x00008000 // 只写可读,ADDRS#/ADDR/ALE引脚输入状态,1:高电平,0:低电平
#define mStateBitRESET 0x00010000 // 只写,RESET#引脚输入状态,1:高电平,0:低电平
#define mStateBitWRITE 0x00020000 // 只写,WRITE#引脚输入状态,1:高电平,0:低电平
#define mStateBitSCL 0x00400000 // 只读,SCL引脚输入状态,1:高电平,0:低电平
#define mStateBitSDA 0x00800000 // 只读,SDA引脚输入状态,1:高电平,0:低电平
#define MAX_DEVICE_PATH_SIZE 128 // 设备名称的最大字符数
#define MAX_DEVICE_ID_SIZE 64 // 设备ID的最大字符数
typedef VOID ( CALLBACK * mPCH341_INT_ROUTINE ) ( // 中断服务程序
ULONG iStatus ); // 中断状态数据,参考下面的位说明
// 位7-位0对应CH341的D7-D0引脚
// 位8对应CH341的ERR#引脚, 位9对应CH341的PEMP引脚, 位10对应CH341的INT#引脚, 位11对应CH341的SLCT引脚
HANDLE WINAPI CH341OpenDevice( // 打开CH341设备,返回句柄,出错则无效
ULONG iIndex ); // 指定CH341设备序号,0对应第一个设备
VOID WINAPI CH341CloseDevice( // 关闭CH341设备
ULONG iIndex ); // 指定CH341设备序号
ULONG WINAPI CH341GetVersion( ); // 获得DLL版本号,返回版本号
ULONG WINAPI CH341DriverCommand( // 直接传递命令给驱动程序,出错则返回0,否则返回数据长度
ULONG iIndex, // 指定CH341设备序号,V1.6以上DLL也可以是设备打开后的句柄
mPWIN32_COMMAND ioCommand ); // 命令结构的指针
// 该程序在调用后返回数据长度,并且仍然返回命令结构,如果是读操作,则数据返回在命令结构中,
// 返回的数据长度在操作失败时为0,操作成功时为整个命令结构的长度,例如读一个字节,则返回mWIN32_COMMAND_HEAD+1,
// 命令结构在调用前,分别提供:管道号或者命令功能代码,存取数据的长度(可选),数据(可选)
// 命令结构在调用后,分别返回:操作状态代码,后续数据的长度(可选),
// 操作状态代码是由WINDOWS定义的代码,可以参考NTSTATUS.H,
// 后续数据的长度是指读操作返回的数据长度,数据存放在随后的缓冲区中,对于写操作一般为0
ULONG WINAPI CH341GetDrvVersion( ); // 获得驱动程序版本号,返回版本号,出错则返回0
BOOL WINAPI CH341ResetDevice( // 复位USB设备
ULONG iIndex ); // 指定CH341设备序号
BOOL WINAPI CH341GetDeviceDescr( // 读取设备描述符
ULONG iIndex, // 指定CH341设备序号
PVOID oBuffer, // 指向一个足够大的缓冲区,用于保存描述符
PULONG ioLength ); // 指向长度单元,输入时为准备读取的长度,返回后为实际读取的长度
BOOL WINAPI CH341GetConfigDescr( // 读取配置描述符
ULONG iIndex, // 指定CH341设备序号
PVOID oBuffer, // 指向一个足够大的缓冲区,用于保存描述符
PULONG ioLength ); // 指向长度单元,输入时为准备读取的长度,返回后为实际读取的长度
BOOL WINAPI CH341SetIntRoutine( // 设定中断服务程序
ULONG iIndex, // 指定CH341设备序号
mPCH341_INT_ROUTINE iIntRoutine ); // 指定中断服务程序,为NULL则取消中断服务,否则在中断时调用该程序
BOOL WINAPI CH341ReadInter( // 读取中断数据
ULONG iIndex, // 指定CH341设备序号
PULONG iStatus ); // 指向一个双字单元,用于保存读取的中断状态数据,见下行
// 位7-位0对应CH341的D7-D0引脚
// 位8对应CH341的ERR#引脚, 位9对应CH341的PEMP引脚, 位10对应CH341的INT#引脚, 位11对应CH341的SLCT引脚
BOOL WINAPI CH341AbortInter( // 放弃中断数据读操作
ULONG iIndex ); // 指定CH341设备序号
BOOL WINAPI CH341SetParaMode( // 设置并口模式
ULONG iIndex, // 指定CH341设备序号
ULONG iMode ); // 指定并口模式: 0为EPP模式/EPP模式V1.7, 1为EPP模式V1.9, 2为MEM模式
BOOL WINAPI CH341InitParallel( // 复位并初始化并口,RST#输出低电平脉冲
ULONG iIndex, // 指定CH341设备序号
ULONG iMode ); // 指定并口模式: 0为EPP模式/EPP模式V1.7, 1为EPP模式V1.9, 2为MEM模式, >= 0x00000100 保持当前模式
BOOL WINAPI CH341ReadData0( // 从0#端口读取数据块
ULONG iIndex, // 指定CH341设备序号
PVOID oBuffer, // 指向一个足够大的缓冲区,用于保存读取的数据
PULONG ioLength ); // 指向长度单元,输入时为准备读取的长度,返回后为实际读取的长度
BOOL WINAPI CH341ReadData1( // 从1#端口读取数据块
ULONG iIndex, // 指定CH341设备序号
PVOID oBuffer, // 指向一个足够大的缓冲区,用于保存读取的数据
PULONG ioLength ); // 指向长度单元,输入时为准备读取的长度,返回后为实际读取的长度
BOOL WINAPI CH341AbortRead( // 放弃数据块读操作
ULONG iIndex ); // 指定CH341设备序号
BOOL WINAPI CH341WriteData0( // 向0#端口写出数据块
ULONG iIndex, // 指定CH341设备序号
PVOID iBuffer, // 指向一个缓冲区,放置准备写出的数据
PULONG ioLength ); // 指向长度单元,输入时为准备写出的长度,返回后为实际写出的长度
BOOL WINAPI CH341WriteData1( // 向1#端口写出数据块
ULONG iIndex, // 指定CH341设备序号
PVOID iBuffer, // 指向一个缓冲区,放置准备写出的数据
PULONG ioLength ); // 指向长度单元,输入时为准备写出的长度,返回后为实际写出的长度
BOOL WINAPI CH341AbortWrite( // 放弃数据块写操作
ULONG iIndex ); // 指定CH341设备序号
BOOL WINAPI CH341GetStatus( // 通过CH341直接输入数据和状态
ULONG iIndex, // 指定CH341设备序号
PULONG iStatus ); // 指向一个双字单元,用于保存状态数据,参考下面的位说明
// 位7-位0对应CH341的D7-D0引脚
// 位8对应CH341的ERR#引脚, 位9对应CH341的PEMP引脚, 位10对应CH341的INT#引脚, 位11对应CH341的SLCT引脚, 位23对应CH341的SDA引脚
// 位13对应CH341的BUSY/WAIT#引脚, 位14对应CH341的AUTOFD#/DATAS#引脚,位15对应CH341的SLCTIN#/ADDRS#引脚
BOOL WINAPI CH341ReadI2C( // 从I2C接口读取一个字节数据
ULONG iIndex, // 指定CH341设备序号
UCHAR iDevice, // 低7位指定I2C设备地址
UCHAR iAddr, // 指定数据单元的地址
PUCHAR oByte ); // 指向一个字节单元,用于保存读取的字节数据
BOOL WINAPI CH341WriteI2C( // 向I2C接口写入一个字节数据
ULONG iIndex, // 指定CH341设备序号
UCHAR iDevice, // 低7位指定I2C设备地址
UCHAR iAddr, // 指定数据单元的地址
UCHAR iByte ); // 待写入的字节数据
BOOL WINAPI CH341EppReadData( // EPP方式读数据: WR#=1, DS#=0, AS#=1, D0-D7=input
ULONG iIndex, // 指定CH341设备序号
PVOID oBuffer, // 指向一个足够大的缓冲区,用于保存读取的数据
PULONG ioLength ); // 指向长度单元,输入时为准备读取的长度,返回后为实际读取的长度
BOOL WINAPI CH341EppReadAddr( // EPP方式读地址: WR#=1, DS#=1, AS#=0, D0-D7=input
ULONG iIndex, // 指定CH341设备序号
PVOID oBuffer, // 指向一个足够大的缓冲区,用于保存读取的地址数据
PULONG ioLength ); // 指向长度单元,输入时为准备读取的长度,返回后为实际读取的长度
BOOL WINAPI CH341EppWriteData( // EPP方式写数据: WR#=0, DS#=0, AS#=1, D0-D7=output
ULONG iIndex, // 指定CH341设备序号
PVOID iBuffer, // 指向一个缓冲区,放置准备写出的数据
PULONG ioLength ); // 指向长度单元,输入时为准备写出的长度,返回后为实际写出的长度
BOOL WINAPI CH341EppWriteAddr( // EPP方式写地址: WR#=0, DS#=1, AS#=0, D0-D7=output
ULONG iIndex, // 指定CH341设备序号
PVOID iBuffer, // 指向一个缓冲区,放置准备写出的地址数据
PULONG ioLength ); // 指向长度单元,输入时为准备写出的长度,返回后为实际写出的长度
BOOL WINAPI CH341EppSetAddr( // EPP方式设置地址: WR#=0, DS#=1, AS#=0, D0-D7=output
ULONG iIndex, // 指定CH341设备序号
UCHAR iAddr ); // 指定EPP地址
BOOL WINAPI CH341MemReadAddr0( // MEM方式读地址0: WR#=1, DS#/RD#=0, AS#/ADDR=0, D0-D7=input
ULONG iIndex, // 指定CH341设备序号
PVOID oBuffer, // 指向一个足够大的缓冲区,用于保存从地址0读取的数据
PULONG ioLength ); // 指向长度单元,输入时为准备读取的长度,返回后为实际读取的长度
BOOL WINAPI CH341MemReadAddr1( // MEM方式读地址1: WR#=1, DS#/RD#=0, AS#/ADDR=1, D0-D7=input
ULONG iIndex, // 指定CH341设备序号
PVOID oBuffer, // 指向一个足够大的缓冲区,用于保存从地址1读取的数据
PULONG ioLength ); // 指向长度单元,输入时为准备读取的长度,返回后为实际读取的长度
BOOL WINAPI CH341MemWriteAddr0( // MEM方式写地址0: WR#=0, DS#/RD#=1, AS#/ADDR=0, D0-D7=output
ULONG iIndex, // 指定CH341设备序号
PVOID iBuffer, // 指向一个缓冲区,放置准备向地址0写出的数据
PULONG ioLength ); // 指向长度单元,输入时为准备写出的长度,返回后为实际写出的长度
BOOL WINAPI CH341MemWriteAddr1( // MEM方式写地址1: WR#=0, DS#/RD#=1, AS#/ADDR=1, D0-D7=output
ULONG iIndex, // 指定CH341设备序号
PVOID iBuffer, // 指向一个缓冲区,放置准备向地址1写出的数据
PULONG ioLength ); // 指向长度单元,输入时为准备写出的长度,返回后为实际写出的长度
BOOL WINAPI CH341SetExclusive( // 设置独占使用当前CH341设备
ULONG iIndex, // 指定CH341设备序号
ULONG iExclusive ); // 为0则设备可以共享使用,非0则独占使用
BOOL WINAPI CH341SetTimeout( // 设置USB数据读写的超时
ULONG iIndex, // 指定CH341设备序号
ULONG iWriteTimeout, // 指定USB写出数据块的超时时间,以毫秒mS为单位,0xFFFFFFFF指定不超时(默认值)
ULONG iReadTimeout ); // 指定USB读取数据块的超时时间,以毫秒mS为单位,0xFFFFFFFF指定不超时(默认值)
BOOL WINAPI CH341ReadData( // 读取数据块
ULONG iIndex, // 指定CH341设备序号
PVOID oBuffer, // 指向一个足够大的缓冲区,用于保存读取的数据
PULONG ioLength ); // 指向长度单元,输入时为准备读取的长度,返回后为实际读取的长度
BOOL WINAPI CH341WriteData( // 写出数据块
ULONG iIndex, // 指定CH341设备序号
PVOID iBuffer, // 指向一个缓冲区,放置准备写出的数据
PULONG ioLength ); // 指向长度单元,输入时为准备写出的长度,返回后为实际写出的长度
PVOID WINAPI CH341GetDeviceName( // 返回指向CH341设备名称的缓冲区,出错则返回NULL
ULONG iIndex ); // 指定CH341设备序号,0对应第一个设备
ULONG WINAPI CH341GetVerIC( // 获取CH341芯片的版本,返回:0=设备无效,0x10=CH341,0x20=CH341A
ULONG iIndex ); // 指定CH341设备序号
#define IC_VER_CH341A 0x20
#define IC_VER_CH341A3 0x30
BOOL WINAPI CH341FlushBuffer( // 清空CH341的缓冲区
ULONG iIndex ); // 指定CH341设备序号
BOOL WINAPI CH341WriteRead( // 执行数据流命令,先输出再输入
ULONG iIndex, // 指定CH341设备序号
ULONG iWriteLength, // 写长度,准备写出的长度
PVOID iWriteBuffer, // 指向一个缓冲区,放置准备写出的数据
ULONG iReadStep, // 准备读取的单个块的长度, 准备读取的总长度为(iReadStep*iReadTimes)
ULONG iReadTimes, // 准备读取的次数
PULONG oReadLength, // 指向长度单元,返回后为实际读取的长度
PVOID oReadBuffer ); // 指向一个足够大的缓冲区,用于保存读取的数据
BOOL WINAPI CH341SetStream( // 设置串口流模式
ULONG iIndex, // 指定CH341设备序号
ULONG iMode ); // 指定模式,见下行
// 位1-位0: I2C接口速度/SCL频率, 00=低速/20KHz,01=标准/100KHz(默认值),10=快速/400KHz,11=高速/750KHz
// 位2: SPI的I/O数/IO引脚, 0=单入单出(D3时钟/D5出/D7入)(默认值),1=双入双出(D3时钟/D5出D4出/D7入D6入)
// 位7: SPI字节中的位顺序, 0=低位在前, 1=高位在前
// 其它保留,必须为0
BOOL WINAPI CH341SetDelaymS( // 设置硬件异步延时,调用后很快返回,而在下一个流操作之前延时指定毫秒数
ULONG iIndex, // 指定CH341设备序号
ULONG iDelay ); // 指定延时的毫秒数
BOOL WINAPI CH341StreamI2C( // 处理I2C数据流,2线接口,时钟线为SCL引脚,数据线为SDA引脚(准双向I/O),速度约56K字节
ULONG iIndex, // 指定CH341设备序号
ULONG iWriteLength, // 准备写出的数据字节数
PVOID iWriteBuffer, // 指向一个缓冲区,放置准备写出的数据,首字节通常是I2C设备地址及读写方向位
ULONG iReadLength, // 准备读取的数据字节数
PVOID oReadBuffer ); // 指向一个缓冲区,返回后是读入的数据
typedef enum _EEPROM_TYPE { // EEPROM型号
ID_24C01,
ID_24C02,
ID_24C04,
ID_24C08,
ID_24C16,
ID_24C32,
ID_24C64,
ID_24C128,
ID_24C256,
ID_24C512,
ID_24C1024,
ID_24C2048,
ID_24C4096
} EEPROM_TYPE;
BOOL WINAPI CH341ReadEEPROM( // 从EEPROM中读取数据块,速度约56K字节
ULONG iIndex, // 指定CH341设备序号
EEPROM_TYPE iEepromID, // 指定EEPROM型号
ULONG iAddr, // 指定数据单元的地址
ULONG iLength, // 准备读取的数据字节数
PUCHAR oBuffer ); // 指向一个缓冲区,返回后是读入的数据
BOOL WINAPI CH341WriteEEPROM( // 向EEPROM中写入数据块
ULONG iIndex, // 指定CH341设备序号
EEPROM_TYPE iEepromID, // 指定EEPROM型号
ULONG iAddr, // 指定数据单元的地址
ULONG iLength, // 准备写出的数据字节数
PUCHAR iBuffer ); // 指向一个缓冲区,放置准备写出的数据
BOOL WINAPI CH341GetInput( // 通过CH341直接输入数据和状态,效率比CH341GetStatus更高
ULONG iIndex, // 指定CH341设备序号
PULONG iStatus ); // 指向一个双字单元,用于保存状态数据,参考下面的位说明
// 位7-位0对应CH341的D7-D0引脚
// 位8对应CH341的ERR#引脚, 位9对应CH341的PEMP引脚, 位10对应CH341的INT#引脚, 位11对应CH341的SLCT引脚, 位23对应CH341的SDA引脚
// 位13对应CH341的BUSY/WAIT#引脚, 位14对应CH341的AUTOFD#/DATAS#引脚,位15对应CH341的SLCTIN#/ADDRS#引脚
BOOL WINAPI CH341SetOutput( // 设置CH341的I/O方向,并通过CH341直接输出数据
/* ***** 谨慎使用该API, 防止修改I/O方向使输入引脚变为输出引脚导致与其它输出引脚之间短路而损坏芯片 ***** */
ULONG iIndex, // 指定CH341设备序号
ULONG iEnable, // 数据有效标志,参考下面的位说明
// 位0为1说明iSetDataOut的位15-位8有效,否则忽略
// 位1为1说明iSetDirOut的位15-位8有效,否则忽略
// 位2为1说明iSetDataOut的7-位0有效,否则忽略
// 位3为1说明iSetDirOut的位7-位0有效,否则忽略
// 位4为1说明iSetDataOut的位23-位16有效,否则忽略
ULONG iSetDirOut, // 设置I/O方向,某位清0则对应引脚为输入,某位置1则对应引脚为输出,并口方式下默认值为0x000FC000,参考下面的位说明
ULONG iSetDataOut ); // 输出数据,如果I/O方向为输出,那么某位清0时对应引脚输出低电平,某位置1时对应引脚输出高电平,参考下面的位说明
// 位7-位0对应CH341的D7-D0引脚
// 位8对应CH341的ERR#引脚, 位9对应CH341的PEMP引脚, 位10对应CH341的INT#引脚, 位11对应CH341的SLCT引脚
// 位13对应CH341的WAIT#引脚, 位14对应CH341的DATAS#/READ#引脚,位15对应CH341的ADDRS#/ADDR/ALE引脚
// 以下引脚只能输出,不考虑I/O方向: 位16对应CH341的RESET#引脚, 位17对应CH341的WRITE#引脚, 位18对应CH341的SCL引脚, 位29对应CH341的SDA引脚
BOOL WINAPI CH341Set_D5_D0( // 设置CH341的D5-D0引脚的I/O方向,并通过CH341的D5-D0引脚直接输出数据,效率比CH341SetOutput更高
/* ***** 谨慎使用该API, 防止修改I/O方向使输入引脚变为输出引脚导致与其它输出引脚之间短路而损坏芯片 ***** */
ULONG iIndex, // 指定CH341设备序号
ULONG iSetDirOut, // 设置D5-D0各引脚的I/O方向,某位清0则对应引脚为输入,某位置1则对应引脚为输出,并口方式下默认值为0x00全部输入
ULONG iSetDataOut ); // 设置D5-D0各引脚的输出数据,如果I/O方向为输出,那么某位清0时对应引脚输出低电平,某位置1时对应引脚输出高电平
// 以上数据的位5-位0分别对应CH341的D5-D0引脚
BOOL WINAPI CH341StreamSPI3( // 该API已失效,请勿使用
ULONG iIndex,
ULONG iChipSelect,
ULONG iLength,
PVOID ioBuffer );
BOOL WINAPI CH341StreamSPI4( // 处理SPI数据流,4线接口,时钟线为DCK/D3引脚,输出数据线为DOUT/D5引脚,输入数据线为DIN/D7引脚,片选线为D0/D1/D2,速度约68K字节
/* SPI时序: DCK/D3引脚为时钟输出, 默认为低电平, DOUT/D5引脚在时钟上升沿之前的低电平期间输出, DIN/D7引脚在时钟下降沿之前的高电平期间输入 */
ULONG iIndex, // 指定CH341设备序号
ULONG iChipSelect, // 片选控制, 位7为0则忽略片选控制, 位7为1则参数有效: 位1位0为00/01/10分别选择D0/D1/D2引脚作为低电平有效片选
ULONG iLength, // 准备传输的数据字节数
PVOID ioBuffer ); // 指向一个缓冲区,放置准备从DOUT写出的数据,返回后是从DIN读入的数据
BOOL WINAPI CH341StreamSPI5( // 处理SPI数据流,5线接口,时钟线为DCK/D3引脚,输出数据线为DOUT/D5和DOUT2/D4引脚,输入数据线为DIN/D7和DIN2/D6引脚,片选线为D0/D1/D2,速度约30K字节*2
/* SPI时序: DCK/D3引脚为时钟输出, 默认为低电平, DOUT/D5和DOUT2/D4引脚在时钟上升沿之前的低电平期间输出, DIN/D7和DIN2/D6引脚在时钟下降沿之前的高电平期间输入 */
ULONG iIndex, // 指定CH341设备序号
ULONG iChipSelect, // 片选控制, 位7为0则忽略片选控制, 位7为1则参数有效: 位1位0为00/01/10分别选择D0/D1/D2引脚作为低电平有效片选
ULONG iLength, // 准备传输的数据字节数
PVOID ioBuffer, // 指向一个缓冲区,放置准备从DOUT写出的数据,返回后是从DIN读入的数据
PVOID ioBuffer2 ); // 指向第二个缓冲区,放置准备从DOUT2写出的数据,返回后是从DIN2读入的数据
BOOL WINAPI CH341BitStreamSPI( // 处理SPI位数据流,4线/5线接口,时钟线为DCK/D3引脚,输出数据线为DOUT/DOUT2引脚,输入数据线为DIN/DIN2引脚,片选线为D0/D1/D2,速度约8K位*2
ULONG iIndex, // 指定CH341设备序号
ULONG iLength, // 准备传输的数据位数,一次最多896,建议不超过256
PVOID ioBuffer ); // 指向一个缓冲区,放置准备从DOUT/DOUT2/D2-D0写出的数据,返回后是从DIN/DIN2读入的数据
/* SPI时序: DCK/D3引脚为时钟输出, 默认为低电平, DOUT/D5和DOUT2/D4引脚在时钟上升沿之前的低电平期间输出, DIN/D7和DIN2/D6引脚在时钟下降沿之前的高电平期间输入 */
/* ioBuffer中的一个字节共8位分别对应D7-D0引脚, 位5输出到DOUT, 位4输出到DOUT2, 位2-位0输出到D2-D0, 位7从DIN输入, 位6从DIN2输入, 位3数据忽略 */
/* 在调用该API之前,应该先调用CH341Set_D5_D0设置CH341的D5-D0引脚的I/O方向,并设置引脚的默认电平 */
BOOL WINAPI CH341SetBufUpload( // 设定内部缓冲上传模式
ULONG iIndex, // 指定CH341设备序号,0对应第一个设备
ULONG iEnableOrClear ); // 为0则禁止内部缓冲上传模式,使用直接上传,非0则启用内部缓冲上传模式并清除缓冲区中的已有数据
// 如果启用内部缓冲上传模式,那么CH341驱动程序创建线程自动接收USB上传数据到内部缓冲区,同时清除缓冲区中的已有数据,当应用程序调用CH341ReadData后将立即返回缓冲区中的已有数据
LONG WINAPI CH341QueryBufUpload( // 查询内部上传缓冲区中的已有数据包个数,成功返回数据包个数,出错返回-1
ULONG iIndex ); // 指定CH341设备序号,0对应第一个设备
BOOL WINAPI CH341SetBufDownload( // 设定内部缓冲下传模式
ULONG iIndex, // 指定CH341设备序号,0对应第一个设备
ULONG iEnableOrClear ); // 为0则禁止内部缓冲下传模式,使用直接下传,非0则启用内部缓冲下传模式并清除缓冲区中的已有数据
// 如果启用内部缓冲下传模式,那么当应用程序调用CH341WriteData后将仅仅是将USB下传数据放到内部缓冲区并立即返回,而由CH341驱动程序创建的线程自动发送直到完毕
LONG WINAPI CH341QueryBufDownload( // 查询内部下传缓冲区中的剩余数据包个数(尚未发送),成功返回数据包个数,出错返回-1
ULONG iIndex ); // 指定CH341设备序号,0对应第一个设备
BOOL WINAPI CH341ResetInter( // 复位中断数据读操作
ULONG iIndex ); // 指定CH341设备序号
BOOL WINAPI CH341ResetRead( // 复位数据块读操作
ULONG iIndex ); // 指定CH341设备序号
BOOL WINAPI CH341ResetWrite( // 复位数据块写操作
ULONG iIndex ); // 指定CH341设备序号
typedef VOID ( CALLBACK * mPCH341_NOTIFY_ROUTINE ) ( // 设备事件通知回调程序
ULONG iEventStatus ); // 设备事件和当前状态(在下行定义): 0=设备拔出事件, 3=设备插入事件
#define CH341_DEVICE_ARRIVAL 3 // 设备插入事件,已经插入
#define CH341_DEVICE_REMOVE_PEND 1 // 设备将要拔出
#define CH341_DEVICE_REMOVE 0 // 设备拔出事件,已经拔出
BOOL WINAPI CH341SetDeviceNotify( // 设定设备事件通知程序
ULONG iIndex, // 指定CH341设备序号,0对应第一个设备
PCHAR iDeviceID, // 可选参数,指向字符串,指定被监控的设备的ID,字符串以\0终止
mPCH341_NOTIFY_ROUTINE iNotifyRoutine ); // 指定设备事件回调程序,为NULL则取消事件通知,否则在检测到事件时调用该程序
BOOL WINAPI CH341SetupSerial( // 设定CH341的串口特性,该API只能用于工作于串口方式的CH341芯片
ULONG iIndex, // 指定CH341设备序号,0对应第一个设备
ULONG iParityMode, // 指定CH341串口的数据校验模式: NOPARITY/ODDPARITY/EVENPARITY/MARKPARITY/SPACEPARITY
ULONG iBaudRate ); // 指定CH341串口的通讯波特率值,可以是50至3000000之间的任意值
/* 以下API可以用于工作于串口方式的CH341芯片,除此之外的API一般只能用于并口方式的CH341芯片
CH341OpenDevice
CH341CloseDevice
CH341SetupSerial
CH341ReadData
CH341WriteData
CH341SetBufUpload
CH341QueryBufUpload
CH341SetBufDownload
CH341QueryBufDownload
CH341SetDeviceNotify
CH341GetStatus
// 以上是主要API,以下是次要API
CH341GetVersion
CH341DriverCommand
CH341GetDrvVersion
CH341ResetDevice
CH341GetDeviceDescr
CH341GetConfigDescr
CH341SetIntRoutine
CH341ReadInter
CH341AbortInter
CH341AbortRead
CH341AbortWrite
CH341ReadI2C
CH341WriteI2C
CH341SetExclusive
CH341SetTimeout
CH341GetDeviceName
CH341GetVerIC
CH341FlushBuffer
CH341WriteRead
CH341ResetInter
CH341ResetRead
CH341ResetWrite
*/
HANDLE WINAPI CH341OpenDeviceEx( // 打开CH341设备,返回句柄,出错则无效
ULONG iIndex ); // 指定CH341设备序号,0对应插入的第一个设备,1对应插入的第二个设备,为节约设备设备序号资源,用完后要关闭设备
VOID WINAPI CH341CloseDeviceEx( // 关闭CH341设备
ULONG iIndex ); // 指定CH341设备序号
PCHAR WINAPI CH341GetDeviceNameEx( // 返回指向CH341设备名称的缓冲区,出错则返回NULL
ULONG iIndex ); // 指定CH341设备序号,0对应第一个设备
BOOL WINAPI CH341SetDeviceNotifyEx( // 设定设备事件通知程序
ULONG iIndex, // 指定CH341设备序号,0对应第一个设备
PCHAR iDeviceID, // 可选参数,指向字符串,指定被监控的设备的ID,字符串以\0终止
mPCH341_NOTIFY_ROUTINE iNotifyRoutine ); // 指定设备事件回调程序,为NULL则取消事件通知,否则在检测到事件时调用该程序
#ifdef __cplusplus
}
#endif
#endif // _CH341_DLL_H

View File

@ -0,0 +1,680 @@
// 2004.05.28, 2004.10.20, 2005.01.08, 2005.03.25, 2005.04.28, 2005.07.18, 2005.07.28, 2005.09.19, 2007.12.19, 2008.10.15, 2022.5
//****************************************
//** Copyright (C) WCH 1999-2022 **
//** Web: http://www.winchiphead.com **
//****************************************
//** DLL for USB interface chip CH341 **
//** C, VC5.0 **
//****************************************
//
// USB interface chip CH341 parallel application interface lib V2.2
// Nanjing Qinheng Microelectronics Co., Ltd. Author: W.ch 2008.10
// CH341-DLL V2.2
// Runtime environment: Windows 98/ME, Windows 2000/XP/7/10/11
// support USB chip: CH341, CH341A, CH347 SPI/I2C
// USB => Parallel, I2C, SPI, ...
//
#ifndef _CH341_DLL_H
#define _CH341_DLL_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _WIN64
#define mOFFSET( s, m ) ( (ULONG_PTR) & ( ( ( s * ) 0 ) -> m ) ) // Defines a macro that gets the relative offset address of a structure member
#else
#define mOFFSET( s, m ) ( (ULONG) & ( ( ( s * ) 0 ) -> m ) ) // Defines a macro that gets the relative offset address of a structure member
#endif
#ifndef max
#define max( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) ) // Larger value
#endif
#ifndef min
#define min( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) ) // Smaller values
#endif
#ifdef ExAllocatePool
#undef ExAllocatePool // Delete a memory allocation with TAG
#endif
#ifndef NTSTATUS
typedef LONG NTSTATUS; // Return status
#endif
typedef struct _USB_SETUP_PKT { // USB control transmission of the establishment phase of the data request packet structure
UCHAR mUspReqType; // 00H Request type
UCHAR mUspRequest; // 01H Request code
union {
struct {
UCHAR mUspValueLow; // 02H Value parameter low bytes
UCHAR mUspValueHigh; // 03H Value parameter high bytes
};
USHORT mUspValue; // 02H-03H Value parameter
};
union {
struct {
UCHAR mUspIndexLow; // 04H Index parameter low bytes
UCHAR mUspIndexHigh; // 05H Index parameter high bytes
};
USHORT mUspIndex; // 04H-05H Index parameter
};
USHORT mLength; // 06H-07H Data length of the data phase
} mUSB_SETUP_PKT, *mPUSB_SETUP_PKT;
#define mCH341_PACKET_LENGTH 32 // Length of data packets supported by CH341
#define mCH341_PKT_LEN_SHORT 8 // Length of short packets supported by CH341
typedef struct _WIN32_COMMAND { // Define WIN32 command interface structure
union {
ULONG mFunction; // Specify the function code or pipe number when entering
NTSTATUS mStatus; // Returns operation status on output
};
ULONG mLength; // Access length, returns the length of subsequent data
union {
mUSB_SETUP_PKT mSetupPkt; // USB controls the transmission of data requests during the setup phase
UCHAR mBuffer[ 512]; // Data buffer, 0 to 255B in length
};
} mWIN32_COMMAND, *mPWIN32_COMMAND;
// WIN32 application layer interface command
#define IOCTL_CH341_COMMAND ( FILE_DEVICE_UNKNOWN << 16 | FILE_ANY_ACCESS << 14 | 0x0f34 << 2 | METHOD_BUFFERED ) // Special interface
#define mWIN32_COMMAND_HEAD mOFFSET( mWIN32_COMMAND, mBuffer ) // WIN32 command interface header length
#define mCH341_MAX_NUMBER 16 // Maximum number of CH341 connected at the same time
#define mMAX_BUFFER_LENGTH 0x1000 // Maximum length of the data buffer is 4096
#define mMAX_COMMAND_LENGTH ( mWIN32_COMMAND_HEAD + mMAX_BUFFER_LENGTH ) // Maximum data length plus the length of the command structure header
#define mDEFAULT_BUFFER_LEN 0x0400 // Default length of the data buffer is 1024
#define mDEFAULT_COMMAND_LEN ( mWIN32_COMMAND_HEAD + mDEFAULT_BUFFER_LEN ) // Default data length plus the length of the command structure header
// CH341 endpoint address
#define mCH341_ENDP_INTER_UP 0x81 // Address of the interrupt data upload endpoint of CH341
#define mCH341_ENDP_INTER_DOWN 0x01 // Address of the interrupt data download endpoint of CH341
#define mCH341_ENDP_DATA_UP 0x82 // Address of the data block upload endpoint of CH341
#define mCH341_ENDP_DATA_DOWN 0x02 // IP address of the data block download endpoint of the CH341
// Operation command of pipes provided by device layer interfaces
#define mPipeDeviceCtrl 0x00000004 // Integrated control piping for CH341
#define mPipeInterUp 0x00000005 // Interrupt data upload pipeline for CH341
#define mPipeDataUp 0x00000006 // CH341 data block upload pipeline
#define mPipeDataDown 0x00000007 // CH341 data block dowload pipeline
// Function code of the application interface
#define mFuncNoOperation 0x00000000 // No operation
#define mFuncGetVersion 0x00000001 // Gets the driver version number
#define mFuncGetConfig 0x00000002 // Gets the USB device configuration descriptor
#define mFuncSetTimeout 0x00000009 // Set USB communication timeout
#define mFuncSetExclusive 0x0000000b // Set exclusive use
#define mFuncResetDevice 0x0000000c // Reset USB device
#define mFuncResetPipe 0x0000000d // Reset USB pipe
#define mFuncAbortPipe 0x0000000e // Cancels data requests for USB pipes
//Function code of CH341 parallel port dedicated
#define mFuncSetParaMode 0x0000000f // Set parallel port mode
#define mFuncReadData0 0x00000010 // Read block 0 from parallel port
#define mFuncReadData1 0x00000011 // Read block 1 from parallel port
#define mFuncWriteData0 0x00000012 // Write data block 0 to parallel port
#define mFuncWriteData1 0x00000013 // Write data block 1 to parallel port
#define mFuncWriteRead 0x00000014 // Output before input
#define mFuncBufferMode 0x00000020 // Set buffered upload mode and query the length of data in the buffer
#define mFuncBufferModeDn 0x00000021 // Set buffered download mode and query the length of data in the buffer
#define mFuncGetVersionEx 0x00000022 // Get driver version number and chip model
// USB device standard request code
#define mUSB_CLR_FEATURE 0x01
#define mUSB_SET_FEATURE 0x03
#define mUSB_GET_STATUS 0x00
#define mUSB_SET_ADDRESS 0x05
#define mUSB_GET_DESCR 0x06
#define mUSB_SET_DESCR 0x07
#define mUSB_GET_CONFIG 0x08
#define mUSB_SET_CONFIG 0x09
#define mUSB_GET_INTERF 0x0a
#define mUSB_SET_INTERF 0x0b
#define mUSB_SYNC_FRAME 0x0c
// Vendor-specific request type of CH341 control transmission
#define mCH341_VENDOR_READ 0xC0 // CH341 Vendor-specific read operations which achieved by control transmission
#define mCH341_VENDOR_WRITE 0x40 // CH341 Vendor-specific write operations which achieved by control transmission
// Vendor-specific request code of CH341 control transmission
#define mCH341_PARA_INIT 0xB1 // Initialize parallel port
#define mCH341_I2C_STATUS 0x52 // Get status of the I2C interface
#define mCH341_I2C_COMMAND 0x53 // Sends I2C interface command
// CH341 Parallel port operation command code
#define mCH341_PARA_CMD_R0 0xAC // Read data 0 from parallel port, subbyte length
#define mCH341_PARA_CMD_R1 0xAD // Read data from parallel port 1, subbyte length
#define mCH341_PARA_CMD_W0 0xA6 // Writes data 0 to parallel port, starting with the next byte as a data stream
#define mCH341_PARA_CMD_W1 0xA7 // Writes data 1 to parallel port, starting with the next byte as a data stream
#define mCH341_PARA_CMD_STS 0xA0 // Gets parallel port status
// CH341A Parallel port operation command code
#define mCH341A_CMD_SET_OUTPUT 0xA1 // Set parallel output
#define mCH341A_CMD_IO_ADDR 0xA2 // MEM address read&write/ input&output, starting with the next byte as a command stream
#define mCH341A_CMD_PRINT_OUT 0xA3 // Compatible PRINT print output, starting with the next byte as a code stream
#define mCH341A_CMD_PWM_OUT 0xA4 // PWM command package for data output, starting with the next byte as a code stream
#define mCH341A_CMD_SHORT_PKT 0xA5 // Short packet, the next byte is the actual length of the command packet, the next after next byte and the bytes after that are the original command packet
#define mCH341A_CMD_SPI_STREAM 0xA8 // SPI interface command package, starting with the next byte as data stream
//#define mCH341A_CMD_SIO_STREAM 0xA9 // SIO interface command package, starting with the next byte as data stream
#define mCH341A_CMD_I2C_STREAM 0xAA // I2C interface command package ,I2C command stream starting from subbyte
#define mCH341A_CMD_UIO_STREAM 0xAB // The command packet of the UIO interface, starting from the next byte is the command stream
#define mCH341A_CMD_PIO_STREAM 0xAE // The command packet of the PIO interface, starting from the second byte is the data stream
// Vendor-specific request code of CH341 control transmission
#define mCH341A_BUF_CLEAR 0xB2 // Clear unfinished data
#define mCH341A_I2C_CMD_X 0x54 // Issue the command of the I2C interface and execute it immediately
#define mCH341A_DELAY_MS 0x5E // Delay the specified time in milliseconds
#define mCH341A_GET_VER 0x5F // Get the chip version
#define mCH341_EPP_IO_MAX ( mCH341_PACKET_LENGTH - 1 ) // The maximum length of a single read and write data block of CH341 in EPP/MEM mode
#define mCH341A_EPP_IO_MAX 0xFF // The maximum length of a single read and write data block for CH341A in EPP/MEM mode
#define mCH341A_CMD_IO_ADDR_W 0x00 // MEM command stream with address read/write/input and output: write data, bit 6-bit 0 is the address, and the next byte is the data to be written
#define mCH341A_CMD_IO_ADDR_R 0x80 // MEM command stream with address read/write/input and output: read data, bit 6-bit 0 is the address, read data and return together
#define mCH341A_CMD_I2C_STM_STA 0x74 // Command flow of I2C interface: generate start bit
#define mCH341A_CMD_I2C_STM_STO 0x75 // Command flow of I2C interface: generate stop bit
#define mCH341A_CMD_I2C_STM_OUT 0x80 // Command flow of I2C interface: output data, bit 5-bit 0 is the length, the subsequent bytes are data, and only one byte is sent with a length of 0 and a response is returned
#define mCH341A_CMD_I2C_STM_IN 0xC0 // Command flow of I2C interface: input data, bit 5-bit 0 is the length, 0 length means only one byte is received and no response is sent
#define mCH341A_CMD_I2C_STM_MAX ( min( 0x3F, mCH341_PACKET_LENGTH ) ) // The maximum length of the input and output data of a single command in the command stream of the I2C interface
#define mCH341A_CMD_I2C_STM_SET 0x60 // Command flow of I2C interface: set parameters, bit 2=SPI I/O number (0=single input and single output, 1=double input and double output), bit 1 bit 0=I2C speed (00=low speed, 01=standard, 10=fast, 11=high speed)
#define mCH341A_CMD_I2C_STM_US 0x40 // Command flow of I2C interface: delay in microseconds, bit 3-bit 0 is the delay value
#define mCH341A_CMD_I2C_STM_MS 0x50 // Command flow of I2C interface: delay in milliseconds, bit 3-bit 0 is the delay value
#define mCH341A_CMD_I2C_STM_DLY 0x0F // The maximum value of the single command delay of the command stream of the I2C interface
#define mCH341A_CMD_I2C_STM_END 0x00 // Command flow of I2C interface: command packet ends prematurely
#define mCH341A_CMD_UIO_STM_IN 0x00 // Command flow of UIO interface: input data D7-D0
#define mCH341A_CMD_UIO_STM_DIR 0x40 // Command flow of UIO interface: set I/O direction D5-D0, bit 5-bit 0 is the direction data
#define mCH341A_CMD_UIO_STM_OUT 0x80 // Command flow of UIO interface: output data D5-D0, bit 5-bit 0 is data
#define mCH341A_CMD_UIO_STM_US 0xC0 // Command flow of UIO interface: delay in microseconds, bit 5-bit 0 is the delay value
#define mCH341A_CMD_UIO_STM_END 0x20 // Command flow of UIO interface: command packet ends prematurely
// CH341 parallen port work model
#define mCH341_PARA_MODE_EPP 0x00 // CH341 parallel port working mode is EPP mode
#define mCH341_PARA_MODE_EPP17 0x00 // CH341A parallel port working mode is EPP mode V1.7
#define mCH341_PARA_MODE_EPP19 0x01 // CH341A parallel port working mode is EPP mode V1.9
#define mCH341_PARA_MODE_MEM 0x02 // CH341 parallel port working mode is MEM mode
#define mCH341_PARA_MODE_ECP 0x03 // CH341A parallel port working mode is ECP mode
// I/O direction setting bit definition, direct input status signal bit definition, direct output bit data definition
#define mStateBitERR 0x00000100 // Read-only and writable, ERR# pin input status, 1: high level, 0: low level
#define mStateBitPEMP 0x00000200 // Read-only and writable, PEMP pin input state, 1: high level, 0: low level
#define mStateBitINT 0x00000400 // Read-only and writable, INT# pin input status, 1: high level, 0: low level
#define mStateBitSLCT 0x00000800 // Read-only and writable, SLCT pin input status, 1: high level, 0: low level
#define mStateBitWAIT 0x00002000 // Read-only and writable, WAIT# pin input status, 1: high level, 0: low level
#define mStateBitDATAS 0x00004000 // Only write and read, DATAS#/READ# pin input status, 1: high level, 0: low level
#define mStateBitADDRS 0x00008000 // Write only read, ADDRS#/ADDR/ALE pin input status, 1: high level, 0: low level
#define mStateBitRESET 0x00010000 // Write only, RESET# pin input status, 1: high level, 0: low level
#define mStateBitWRITE 0x00020000 // Write only, WRITE# pin input status, 1: high level, 0: low level
#define mStateBitSCL 0x00400000 // Read only, SCL pin input status, 1: high level, 0: low level
#define mStateBitSDA 0x00800000 // Read only, SDA pin input status, 1: high level, 0: low level
#define MAX_DEVICE_PATH_SIZE 128 // Maximum number of characters for device name
#define MAX_DEVICE_ID_SIZE 64 // Maximum number of characters for device ID
typedef VOID ( CALLBACK * mPCH341_INT_ROUTINE ) ( // interrupt service routine
ULONG iStatus ); // Interrupt status data, refer to the following bit description
// Bit 7-bit 0 correspond to D7-D0 pins of CH341
// Bit 8 corresponds to ERR# pin of CH341, Bit 9 corresponds to PEMP pin of CH341, Bit 10 corresponds to INT# pin of CH341, Bit 11 corresponds to SLCT pin of CH341
HANDLE WINAPI CH341OpenDevice( // Open the CH341 device, return the handle, if an error occurs, it will be invalid
ULONG iIndex ); // Specify the device serial number of CH341, 0 corresponds to the first device
VOID WINAPI CH341CloseDevice( // Close the CH341 device
ULONG iIndex ); // Specify the serial number of the CH341 device
ULONG WINAPI CH341GetVersion( ); // Get the DLL version number, return the version number
ULONG WINAPI CH341DriverCommand( // Directly pass the command to the driver, return 0 if there is an error, otherwise return the data length
ULONG iIndex, // Specify the serial number of the CH341 device, the DLL above V1.6 can also be the handle after the device is opened
mPWIN32_COMMAND ioCommand ); // pointer to command structure
// The program returns the data length after the call, and still returns the command structure, if it is a read operation, the data is returned in the command structure,
// The returned data length is 0 when the operation fails, and the length of the entire command structure when the operation is successful. For example, if one byte is read, mWIN32_COMMAND_HEAD+1 is returned.
// Before the command structure is called, provide: pipe number or command function code, length of access data (optional), data (optional)
// After the command structure is called, it returns: the operation status code, the length of the subsequent data (optional),
// The operation status code is the code defined by WINDOWS, you can refer to NTSTATUS.H,
// The length of the subsequent data refers to the length of the data returned by the read operation. The data is stored in the subsequent buffer, and is generally 0 for the write operation.
ULONG WINAPI CH341GetDrvVersion( ); // Get the driver version number, return the version number, or return 0 if there is an error
BOOL WINAPI CH341ResetDevice( // Reset USB device
ULONG iIndex ); // Specify the serial number of the CH341 device
BOOL WINAPI CH341GetDeviceDescr( // Read device descriptor
ULONG iIndex, // Specify the serial number of the CH341 device
PVOID oBuffer, // Points to a buffer large enough to hold the descriptor
PULONG ioLength ); // Points to the length unit, the length to be read when input is the length to be read, and the actual read length after return
BOOL WINAPI CH341GetConfigDescr( // Read configuration descriptor
ULONG iIndex, // Specify the serial number of the CH341 device
PVOID oBuffer, // Points to a buffer large enough to hold the descriptor
PULONG ioLength ); // Points to the length unit, the length to be read when input is the length to be read, and the actual read length after return
BOOL WINAPI CH341SetIntRoutine( // Set interrupt service routine
ULONG iIndex, // Specify the serial number of the CH341 device
mPCH341_INT_ROUTINE iIntRoutine ); // Specify the interrupt service routine, if it is NULL, the interrupt service will be cancelled, otherwise the routine will be called when interrupted
BOOL WINAPI CH341ReadInter( // Read interrupt data
ULONG iIndex, // Specify the serial number of the CH341 device
PULONG iStatus ); // Points to a double word location used to store the read interrupt status data, see below
// Bit 7-bit 0 correspond to D7-D0 pins of CH341
// Bit 8 corresponds to err# pin of CH341, bit 9 corresponds to PEMP pin of CH341, bit 10 corresponds to int# pin of CH341, and bit 11 corresponds to SLCT pin of CH341
BOOL WINAPI CH341AbortInter( // Abort interrupt data read operation
ULONG iIndex ); // Specify the serial number of the CH341 device
BOOL WINAPI CH341SetParaMode( // Set parallel port mode
ULONG iIndex, // Specify the serial number of the CH341 device
ULONG iMode ); // Specify parallel port mode: 0 is EPP mode/EPP mode V1.7, 1 is EPP mode V1.9, 2 is MEM mode
BOOL WINAPI CH341InitParallel( // Reset and initialize the parallel port, RST# outputs a low-level pulse
ULONG iIndex, // Specify the serial number of the CH341 device
ULONG iMode ); // Specify parallel port mode: 0 is EPP mode/EPP mode V1.7, 1 is EPP mode V1.9, 2 is MEM mode, >= 0x00000100 keep current mode
BOOL WINAPI CH341ReadData0( // Read data block from 0# port
ULONG iIndex, // Specify the serial number of the CH341 device
PVOID oBuffer, // Points to a buffer large enough to hold the read data
PULONG ioLength ); // Points to the length unit, the length to be read when input is the length to be read, and the actual read length after return
BOOL WINAPI CH341ReadData1( // Read data block from port 1#
ULONG iIndex, // Specify the serial number of the CH341 device
PVOID oBuffer, // Points to a buffer large enough to hold the read data
PULONG ioLength ); // Points to the length unit, the length to be read when input is the length to be read, and the actual read length after return
BOOL WINAPI CH341AbortRead( // Abort data block read operation
ULONG iIndex ); // Specify the serial number of the CH341 device
BOOL WINAPI CH341WriteData0( // Write data block to port 0#
ULONG iIndex, // Specify the serial number of the CH341 device
PVOID iBuffer, // Pointer to a buffer where the data to be written is placed
PULONG ioLength ); // Points to the length unit, the length to be written out when input is the length to be written out, and the length actually written out after return
BOOL WINAPI CH341WriteData1( // Write data block to port 1#
ULONG iIndex, // Specify the serial number of the CH341 device
PVOID iBuffer, // Pointer to a buffer where the data to be written is placed
PULONG ioLength ); // Points to the length unit, the length to be written out when input is the length to be written out, and the length actually written out after return
BOOL WINAPI CH341AbortWrite( // Abort block write operation
ULONG iIndex ); // Specify the serial number of the CH341 device
BOOL WINAPI CH341GetStatus( // Input data and status directly through CH341
ULONG iIndex, // Specify the serial number of the CH341 device
PULONG iStatus ); // Points to a double word unit, used to save status data, refer to the following bit description
// Bit 7-bit 0 correspond to D7-D0 pins of CH341
// Bit 8 corresponds to ERR# pin of CH341, Bit 9 corresponds to PEMP pin of CH341, Bit 10 corresponds to INT# pin of CH341, Bit 11 corresponds to SLCT pin of CH341, Bit 23 corresponds to SDA pin of CH341
// Bit 13 corresponds to BUSY/WAIT# pin of CH341, Bit 14 corresponds to AUTOFD#/DATAS# pin of CH341, Bit 15 corresponds to SLCTIN#/ADDRS# pin of CH341
BOOL WINAPI CH341ReadI2C( // Read one byte of data from the I2C interface
ULONG iIndex, // Specify the serial number of the CH341 device
UCHAR iDevice, // The lower 7 bits specify the I2C device address
UCHAR iAddr, // Address of specified data unit
PUCHAR oByte ); // Address of specified data unit
BOOL WINAPI CH341WriteI2C( // Write a byte of data to the I2C interface
ULONG iIndex, // Specify the serial number of the CH341 device
UCHAR iDevice, // The lower 7 bits specify the I2C device address
UCHAR iAddr, // Address of specified data unit
UCHAR iByte ); // Byte data to be written
BOOL WINAPI CH341EppReadData( // Byte data to be written
ULONG iIndex, // Specify the serial number of the CH341 device
PVOID oBuffer, // Points to a buffer large enough to hold the read data
PULONG ioLength ); // Points to a buffer large enough to hold the read data
BOOL WINAPI CH341EppReadAddr( // Read address in EPP mode: WR#=1, DS#=1, AS#=0, D0-D7=input
ULONG iIndex, // Specify the serial number of the CH341 device
PVOID oBuffer, // Point to a buffer large enough to hold the read address data
PULONG ioLength ); // Points to the length unit, the length to be read when input is the length to be read, and the actual read length after return
BOOL WINAPI CH341EppWriteData( // Write data in EPP mode: WR#=0, DS#=0, AS#=1, D0-D7=output
ULONG iIndex, // Specify the serial number of the CH341 device
PVOID iBuffer, // Pointer to a buffer where the data to be written is placed
PULONG ioLength ); // Points to the length unit, the length to be written out when input is the length to be written out, and the length actually written out after return
BOOL WINAPI CH341EppWriteAddr( // Write address in EPP mode: WR#=0, DS#=1, AS#=0, D0-D7=output
ULONG iIndex, // Specify the serial number of the CH341 device
PVOID iBuffer, // Point to a buffer to place the address data to be written out
PULONG ioLength ); // Points to the length unit, the length to be written out when input is the length to be written out, and the length actually written out after return
BOOL WINAPI CH341EppSetAddr( // EPP mode setting address: WR#=0, DS#=1, AS#=0, D0-D7=output
ULONG iIndex, // Specify the serial number of the CH341 device
UCHAR iAddr ); // Specify the EPP address
BOOL WINAPI CH341MemReadAddr0( // Read the address in MEM mode 0: WR#=1, DS#/RD#=0, AS#/ADDR=0, D0-D7=input
ULONG iIndex, // Specify the CH341 device number
PVOID oBuffer, // Points to a buffer large enough to hold the data read from address 0
PULONG ioLength ); // Refers to the length unit, input is the length to read, return is the actual length to read
BOOL WINAPI CH341MemReadAddr1( // Read the address in MEM mode 1: WR#=1, DS#/RD#=0, AS#/ADDR=1, D0-D7=input
ULONG iIndex, // Specify the CH341 device number
PVOID oBuffer, // Points to a buffer large enough to hold the data read from address 1
PULONG ioLength ); // Refers to the length unit, input is the length to read, return is the actual length to read
BOOL WINAPI CH341MemWriteAddr0( // Write the address in MEM mode 0: WR#=0, DS#/RD#=1, AS#/ADDR=0, D0-D7=output
ULONG iIndex, // Specify the CH341 device number
PVOID iBuffer, // Points to a buffer to place the data to be written to address 0
PULONG ioLength ); // Refers to the length unit. The input is the intended length and the return is the actual length
BOOL WINAPI CH341MemWriteAddr1( // Write the address in MEM mode 1: WR#=0, DS#/RD#=1, AS#/ADDR=1, D0-D7=output
ULONG iIndex, // Specify the CH341 device number
PVOID iBuffer, // Points to a buffer to place the data to be written to address 1
PULONG ioLength ); // Refers to the length unit. The input is the intended length and the return is the actual length
BOOL WINAPI CH341SetExclusive( // Set exclusive use of the current CH341 device
ULONG iIndex, // Specify the CH341 device number
ULONG iExclusive ); // If the value is 0, the device can be shared. If the value is not 0, the device can be exclusively used
BOOL WINAPI CH341SetTimeout( // Set the timeout of USB data read and write
ULONG iIndex, // Specify the CH341 device number
ULONG iWriteTimeout, // Specifies the timeout for USB to write data blocks, in milliseconds mS, 0xFFFFFFFF specifies no timeout (default)
ULONG iReadTimeout ); // Specifies the timeout for USB to read data blocks, in milliseconds mS, 0xFFFFFFFF specifies no timeout (default)
BOOL WINAPI CH341ReadData( // Read data block
ULONG iIndex, // Specify the CH341 device number
PVOID oBuffer, // Points to a buffer large enough to hold the read data
PULONG ioLength ); // Refers to the length unit, input is the length to read, return is the actual length to read
BOOL WINAPI CH341WriteData( // Write out blocks of data
ULONG iIndex, // Specify the CH341 device number
PVOID iBuffer, // Points to a buffer to place data ready to be written out
PULONG ioLength ); // Refers to the length unit. The input is the intended length and the return is the actual length
PVOID WINAPI CH341GetDeviceName( // Returns a buffer pointing to the CH341 device name, or NULL on error
ULONG iIndex ); // Specify the CH341 device number,0 corresponds to the first device
ULONG WINAPI CH341GetVerIC( // 0= device invalid,0x10=CH341,0x20=CH341A
ULONG iIndex ); // Specify the CH341 device number
#define IC_VER_CH341A 0x20
#define IC_VER_CH341A3 0x30
BOOL WINAPI CH341FlushBuffer( // Clear the buffer of CH341
ULONG iIndex ); // Specify the CH341 device number
BOOL WINAPI CH341WriteRead( // Execute the data flow command, output before input
ULONG iIndex, // Specify the CH341 device number
ULONG iWriteLength, // Write the length, the length you're going to write
PVOID iWriteBuffer, // Points to a buffer to place data ready to be written out
ULONG iReadStep, // The length of a single block to be read. The total length to be read is(iReadStep*iReadTimes)
ULONG iReadTimes, // Number of times you are ready to read
PULONG oReadLength, // Points to the length unit and returns the length actually read
PVOID oReadBuffer ); // Points to a buffer large enough to hold the read data
BOOL WINAPI CH341SetStream( // Set the serial port flow mode
ULONG iIndex, // Specify the CH341 device number
ULONG iMode ); // To specify the mode, see Downlink
// Bit 1-bit 0: I2C interface speed /SCL frequency, 00= low speed /20KHz,01= standard /100KHz(default),10= fast /400KHz,11= high speed /750KHz
// Bit 2: SPI I/O number /IO pins, 0= single in/single out (D3 clock /D5 out /D7 in)(default),1= double in/double out (D3 clock /D5 out D4 out /D7 in D6 in)
// Bit 7: Bit order in SPI bytes, 0= low first, 1= high first
// All other reservations must be 0
BOOL WINAPI CH341SetDelaymS( // Set the hardware asynchronous delay to a specified number of milliseconds before the next stream operation
ULONG iIndex, // Specify the CH341 device number
ULONG iDelay ); // Specifies the number of milliseconds to delay
BOOL WINAPI CH341StreamI2C( // Process I2C data stream, 2-wire interface, clock line for SCL pin, data line for SDA pin (quasi-bidirectional I/O), speed of about 56K bytes
ULONG iIndex, // Specify the CH341 device number
ULONG iWriteLength, // Number of bytes of data to write out
PVOID iWriteBuffer, // Points to a buffer to place data to be written, usually with the I2C device address and read/write direction bits as the first byte
ULONG iReadLength, // Number of bytes of data to be read
PVOID oReadBuffer ); // Points to a buffer and returns the data read in
typedef enum _EEPROM_TYPE { // EEPROM type
ID_24C01,
ID_24C02,
ID_24C04,
ID_24C08,
ID_24C16,
ID_24C32,
ID_24C64,
ID_24C128,
ID_24C256,
ID_24C512,
ID_24C1024,
ID_24C2048,
ID_24C4096
} EEPROM_TYPE;
BOOL WINAPI CH341ReadEEPROM( // Reads data blocks from EEPROM at a speed of about 56 KB
ULONG iIndex, // Specify the CH341 device number
EEPROM_TYPE iEepromID, // Specifies the EEPROM model
ULONG iAddr, // Specifies the address of the data unit
ULONG iLength, // Number of bytes of data to be read
PUCHAR oBuffer ); // Points to a buffer and returns the data read in
BOOL WINAPI CH341WriteEEPROM( // Writes a data block to the EEPROM
ULONG iIndex, // Specify the CH341 device number
EEPROM_TYPE iEepromID, // Specifies the EEPROM model
ULONG iAddr, // Specifies the address of the data unit
ULONG iLength, // Number of bytes of data to write out
PUCHAR iBuffer ); // Points to a buffer to place data ready to be written out
BOOL WINAPI CH341GetInput( // Using the CH341 to directly enter data and status is more efficient than using the CH341GetStatus function
ULONG iIndex, // Specify the CH341 device number
PULONG iStatus ); // Points to a two-word unit that holds state data, as described in the bit description below
// Bits 7-0 correspond to the D7-D0 pins of CH341
// Bit 8 corresponds to the ERR# pin of CH341, bit 9 to the PEMP pin of CH341, bit 10 to the INT# pin of CH341, bit 11 to the SLCT pin of CH341, and bit 23 to the SDA pin of CH341
// Bit 13 corresponds to the BUSY/WAIT# pin of CH341, bit 14 corresponds to the AUTOFD#/ data # pin of CH341, and bit 15 corresponds to the SLCTIN#/ADDRS# pin of CH341
BOOL WINAPI CH341SetOutput( // Set the I/O direction for the CH341 and output data over the CH341
/* ***** Use this API with care to prevent damage to the chip by changing the I/O direction to change the input pin to the output pin, resulting in short circuits with other output pins ***** */
ULONG iIndex, // Specify the CH341 device number
ULONG iEnable, // Data valid flag, refer to the bit description below
// If bit 0 is 1, bits 15 to 8 of iSetDataOut are valid. Otherwise, it is ignored
// If bit 1 is 1, bits 15 to 8 of iSetDirOut are valid. Otherwise, the value is ignored
// If bit 2 is 1, the 7-bit 0 of iSetDataOut is valid. Otherwise, it is ignored
// If bit 3 is 1, the iSetDirOut bit 7 to bit 0 is valid. Otherwise, the iSetDirOut bit is ignored
// If bit 4 is 1, bits 23 to 16 of iSetDataOut are valid. Otherwise, it is ignored
ULONG iSetDirOut, // To set the I/O direction, pin 0 corresponds to input and pin 1 corresponds to output. In parallel port mode, the default value is 0x000FC000. Refer to the bit description below
ULONG iSetDataOut ); // Output data. If the I/O direction is output, then a clear 0 corresponds to pin output low level, and a position 1 corresponds to pin output high level, refer to the bit description below
// Bits 7-0 correspond to the D7-D0 pins of CH341
// Bit 8 corresponds to the ERR# pin of CH341, bit 9 to the PEMP pin of CH341, bit 10 to the INT# pin of CH341, and bit 11 to the SLCT pin of CH341
// Bit 13 corresponds to the WAIT# pin of CH341, bit 14 to the DATAS#/READ# pin of CH341, and bit 15 to the ADDRS#/ADDR/ALE pin of CH341
// The following pins can only be output, irrespective of the I/O direction: bit 16 corresponds to set # for CH341, bit 17 corresponds to WRITE# for CH341, bit 18 corresponds to SCL for CH341, and bit 29 corresponds to SDA for CH341
BOOL WINAPI CH341Set_D5_D0( // Set the I/O direction of D5-D0 pins of CH341, and directly output data through THE D5-D0 pins of CH341. The efficiency is higher than that of CH341SetOutput
/* ***** Use this API with care to prevent damage to the chip by changing the I/O direction to change the input pin to the output pin, resulting in short circuits with other output pins ***** */
ULONG iIndex, // Specify the CH341 device number
ULONG iSetDirOut, // Set the I/O direction of each pin d5-D0. Pin 0 corresponds to input, pin 1 corresponds to output. In parallel port mode, the default value is 0x00 for all input
ULONG iSetDataOut ); // Set the output data of each pin of D5-D0. If the I/O direction is output, then a clear 0 corresponds to pin output low level, and a position 1 corresponds to pin output high level
// Bits 5-0 of the above data correspond to the D5-D0 pins of CH341 respectively
BOOL WINAPI CH341StreamSPI3( // This API is invalid. Do not use it
ULONG iIndex,
ULONG iChipSelect,
ULONG iLength,
PVOID ioBuffer );
BOOL WINAPI CH341StreamSPI4( // SPI data stream processing, 4-line interface, clock line is DCK/D3 pin, output data line is DOUT/D5 pin, input data line is DIN/D7 pin, chip line is D0/D1/D2, speed is about 68K bytes
/* SPI timing: DCK/D3 pin is clock output, default low level, DOUT/D5 pin is output during low level before clock rising edge, DIN/D7 pin is input during high level before clock falling edge */
ULONG iIndex, // Specify the CH341 device number
ULONG iChipSelect, // Chip selection control. If bit 7 is 0, chip selection control is ignored. If bit 7 is 1, the parameter is effective: if bit 1 is 00/01/10, D0/D1/D2 pins are selected as low level effective chip selection respectively
ULONG iLength, // Number of bytes of data to be transferred
PVOID ioBuffer ); // Points to a buffer, places data to be written out from DOUT, and returns data to be read in from DIN
BOOL WINAPI CH341StreamSPI5( // SPI data stream processing, 5-line interface, clock line is DCK/D3 pin, output data line is DOUT/D5 and DOUT2/D4 pin, input data line is DIN/D7 and DIN2/D6 pin, chip line is D0/D1/D2, speed is about 30K bytes *2
/* SPI timing: DCK/D3 pins are clock outputs and are low by default, DOUT/D5 and DOUT2/D4 pins are output during the low period before the rising edge of the clock, and DIN/D7 and DIN2/D6 pins are input during the high period before the falling edge of the clock */
ULONG iIndex, // Specify the CH341 device number
ULONG iChipSelect, // Chip selection control. If bit 7 is 0, chip selection control is ignored. If bit 7 is 1, the parameter is effective: if bit 1 is 00/01/10, D0/D1/D2 pins are selected as low level effective chip selection respectively
ULONG iLength, // Number of bytes of data to be transferred
PVOID ioBuffer, // Points to a buffer, places data to be written out from DOUT, and returns data to be read in from DIN
PVOID ioBuffer2 ); // Point to the second buffer, place the data to be written from DOUT2, and return the data to be read from DIN2
BOOL WINAPI CH341BitStreamSPI( // SPI bit data flow processing,4 line /5 line interface, clock line for DCK/D3 pin, output data line for DOUT/DOUT2 pin, input data line for DIN/DIN2 pin, chip line for D0/D1/D2, speed about 8K bit *2
ULONG iIndex, // Specify the CH341 device number
ULONG iLength, // The number of bits to be transmitted at a time is a maximum of 896. It is recommended that the number not exceed 256
PVOID ioBuffer ); // Point to a buffer, place data to be written from DOUT/DOUT2/ d2-d0, and return data to be read from DIN/DIN2
/* SPI timing: DCK/D3 pins are clock outputs and are low by default, DOUT/D5 and DOUT2/D4 pins are output during the low period before the rising edge of the clock, and DIN/D7 and DIN2/D6 pins are input during the high period before the falling edge of the clock*/
/* One byte of the ioBuffer has 8 bits corresponding to d7-D0 pins. Bit 5 is output to DOUT, bit 4 to DOUT2, bit 2-0 to D2-d0, bit 7 is input from DIN, bit 6 is input from DIN2, bit 3 is ignored */
/* Before calling this API, CH341Set_D5_D0 should be called to set the I/O direction of the D5-D0 pins of CH341 and set the default level of the pins */
BOOL WINAPI CH341SetBufUpload( // Set internal buffered upload mode
ULONG iIndex, // Specify the CH341 device number,0 corresponds to the first device
ULONG iEnableOrClear ); // If the value is 0, the internal buffered upload mode is disabled and direct upload is used. If the value is not 0, the internal buffered upload mode is enabled and the existing data in the buffer is cleared
// If internal buffered-upload mode is enabled, the CH341 driver creation thread automatically receives USB upload data to the internal buffer and clears the existing data in the buffer. The existing data in the buffer will be returned immediately when the application calls CH341ReadData
LONG WINAPI CH341QueryBufUpload( // Query the number of existing data packets in the internal upload buffer. The number of data packets is returned successfully, or -1 is returned if an error occurs
ULONG iIndex ); // Specify the CH341 device number,0 corresponds to the first device
BOOL WINAPI CH341SetBufDownload( // Set the internal buffer down mode
ULONG iIndex, // Specify the CH341 device number,0 corresponds to the first device
ULONG iEnableOrClear ); // If the value is 0, the internal buffered downtransmission mode is disabled and direct downtransmission is used. If the value is not 0, the internal buffered downtransmission mode is enabled and the existing data in the buffer is cleared
// If internal buffer-down mode is enabled, when an application calls CH341WriteData, it simply puts USB downpass data into an internal buffer and returns it immediately, while threads created by the CH341 driver automatically send it to completion
LONG WINAPI CH341QueryBufDownload( // Query the number of remaining packets in the internal downtransmission buffer (that have not been sent). The number of successful packets is returned, and -1 is returned if an error occurs
ULONG iIndex ); // Specify the CH341 device number,0 corresponds to the first device
BOOL WINAPI CH341ResetInter( // Reset an interrupted data read operation
ULONG iIndex ); // Specify the CH341 device number
BOOL WINAPI CH341ResetRead( // Reset the data block read operation
ULONG iIndex ); // Specify the CH341 device number
BOOL WINAPI CH341ResetWrite( // Reset a block write operation
ULONG iIndex ); // Specify the CH341 device number
typedef VOID ( CALLBACK * mPCH341_NOTIFY_ROUTINE ) ( // Device event notification callback program
ULONG iEventStatus ); // Device event and current status (defined downstream): 0= device removal event, 3= device insertion event
#define CH341_DEVICE_ARRIVAL 3 // Device insertion event, already inserted
#define CH341_DEVICE_REMOVE_PEND 1 // Device to be pulled out
#define CH341_DEVICE_REMOVE 0 // The device is removed
BOOL WINAPI CH341SetDeviceNotify( // Set up the device event notification procedure
ULONG iIndex, // Specify the CH341 device number,0 corresponds to the first device
PCHAR iDeviceID, // Optional argument pointing to a string specifying the ID of the device to be monitored, terminated with \0
mPCH341_NOTIFY_ROUTINE iNotifyRoutine ); // Specifies a device event callback that cancels event notification if NULL, or is called when an event is detected
BOOL WINAPI CH341SetupSerial( // Set the serial port feature of the CH341. This API can only be used for CH341 chips that work in serial port mode
ULONG iIndex, // Specify the CH341 device number,0 corresponds to the first device
ULONG iParityMode, // Specifies the data verification mode of the CH341 serial port: NOPARITY/ODDPARITY/EVENPARITY/MARKPARITY/SPACEPARITY
ULONG iBaudRate ); // Set the baud rate of the CH341 serial port. The value ranges from 50 to 3000000
/* The following apis can be used for CH341 chips that work in serial port mode. Other apis can only be used for CH341 chips that work in parallel port mode
CH341OpenDevice
CH341CloseDevice
CH341SetupSerial
CH341ReadData
CH341WriteData
CH341SetBufUpload
CH341QueryBufUpload
CH341SetBufDownload
CH341QueryBufDownload
CH341SetDeviceNotify
CH341GetStatus
// The above API is the primary API and the following API is the secondary API
CH341GetVersion
CH341DriverCommand
CH341GetDrvVersion
CH341ResetDevice
CH341GetDeviceDescr
CH341GetConfigDescr
CH341SetIntRoutine
CH341ReadInter
CH341AbortInter
CH341AbortRead
CH341AbortWrite
CH341ReadI2C
CH341WriteI2C
CH341SetExclusive
CH341SetTimeout
CH341GetDeviceName
CH341GetVerIC
CH341FlushBuffer
CH341WriteRead
CH341ResetInter
CH341ResetRead
CH341ResetWrite
*/
HANDLE WINAPI CH341OpenDeviceEx( // Turn on the CH341 device and return the handle
ULONG iIndex ); // Specify the CH341 device number,0 corresponds to the first device to be inserted, and 1 corresponds to the second device to be inserted. To save device serial number resources, shut down the device after it is used up
VOID WINAPI CH341CloseDeviceEx( // Close the CH341
ULONG iIndex ); // Specify the CH341 device number
PCHAR WINAPI CH341GetDeviceNameEx( // Returns a buffer pointing to the CH341 device name, or NULL on error
ULONG iIndex ); // Specify the CH341 device number,0 corresponds to the first device
BOOL WINAPI CH341SetDeviceNotifyEx( // Set up the device event notification procedure
ULONG iIndex, // Specify the CH341 device number,0 corresponds to the first device
PCHAR iDeviceID, // Optional argument pointing to a string specifying the ID of the device to be monitored, terminated with \0
mPCH341_NOTIFY_ROUTINE iNotifyRoutine ); // Specifies a device event callback that cancels event notification if NULL, or is called when an event is detected
#ifdef __cplusplus
}
#endif
#endif // _CH341_DLL_H

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,504 @@
/*****************************************************************************
** Copyright (C) WCH 2001-2022 **
** Web: http://wch.cn **
******************************************************************************
Abstract:
USB2.0CH347,480MbpsUSB线UARTSPII2CJTAG
Environment:
user mode only,VC6.0 and later
Notes:
Copyright (c) 2022 Nanjing Qinheng Microelectronics Co., Ltd.
--*/
#ifndef _CH347_DLL_H
#define _CH347_DLL_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _WIN64
#define mOFFSET( s, m ) ( (ULONG_PTR) & ( ( ( s * ) 0 ) -> m ) ) // 定义获取结构成员相对偏移地址的宏
#else
#define mOFFSET( s, m ) ( (ULONG) & ( ( ( s * ) 0 ) -> m ) ) // 定义获取结构成员相对偏移地址的宏
#endif
#ifndef max
#define max( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) ) // 较大值
#endif
#ifndef min
#define min( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) ) // 较小值
#endif
#ifdef ExAllocatePool
#undef ExAllocatePool // 删除带TAG的内存分配
#endif
#ifndef NTSTATUS
typedef LONG NTSTATUS; // 返回状态
#endif
//与CH31DLL合用CH341WDM驱动
#ifndef _CH341_DLL_H
typedef struct _USB_SETUP_PKT { // USB控制传输的建立阶段的数据请求包结构
UCHAR mUspReqType; // 00H 请求类型
UCHAR mUspRequest; // 01H 请求代码
union {
struct {
UCHAR mUspValueLow; // 02H 值参数低字节
UCHAR mUspValueHigh; // 03H 值参数高字节
};
USHORT mUspValue; // 02H-03H 值参数
};
union {
struct {
UCHAR mUspIndexLow; // 04H 索引参数低字节
UCHAR mUspIndexHigh; // 05H 索引参数高字节
};
USHORT mUspIndex; // 04H-05H 索引参数
};
USHORT mLength; // 06H-07H 数据阶段的数据长度
} mUSB_SETUP_PKT, *mPUSB_SETUP_PKT;
typedef struct _WIN32_COMMAND { // 定义WIN32命令接口结构
union {
ULONG mFunction; // 输入时指定功能代码或者管道号
NTSTATUS mStatus; // 输出时返回操作状态
};
ULONG mLength; // 存取长度,返回后续数据的长度
union {
mUSB_SETUP_PKT mSetupPkt; // USB控制传输的建立阶段的数据请求
UCHAR mBuffer[ 512]; // 数据缓冲区,长度为0至255B
};
} mWIN32_COMMAND, *mPWIN32_COMMAND;
// WIN32应用层接口命令
#define IOCTL_CH341_COMMAND ( FILE_DEVICE_UNKNOWN << 16 | FILE_ANY_ACCESS << 14 | 0x0f34 << 2 | METHOD_BUFFERED ) // 专用接口
#define mWIN32_COMMAND_HEAD mOFFSET( mWIN32_COMMAND, mBuffer ) // WIN32命令接口的头长度
#define mCH341_MAX_NUMBER 16 // 最多同时连接的CH341数
#define mMAX_BUFFER_LENGTH 0x1000 // 数据缓冲区最大长度4096
#define mMAX_COMMAND_LENGTH ( mWIN32_COMMAND_HEAD + mMAX_BUFFER_LENGTH ) // 最大数据长度加上命令结构头的长度
#define mDEFAULT_BUFFER_LEN 0x0400 // 数据缓冲区默认长度1024
#define mDEFAULT_COMMAND_LEN ( mWIN32_COMMAND_HEAD + mDEFAULT_BUFFER_LEN ) // 默认数据长度加上命令结构头的长度
// CH341端点地址
#define mCH347_ENDP_DATA_UP 0x86 // CH347的数据块上传端点的地址
#define mCH347_ENDP_DATA_DOWN 0x06 // CH347的数据块下传端点的地址
// 设备层接口提供的管道操作命令
#define mPipeDeviceCtrl 0x00000004 // CH347的综合控制管道
#define mPipeDataUp 0x00000006 // CH347的数据块上传管道
#define mPipeDataDown 0x00000007 // CH347的数据块下传管道
// 应用层接口的功能代码
#define mFuncNoOperation 0x00000000 // 无操作
#define mFuncGetVersion 0x00000001 // 获取驱动程序版本号
#define mFuncGetConfig 0x00000002 // 获取USB设备配置描述符
#define mFuncSetTimeout 0x00000009 // 设置USB通讯超时
#define mFuncSetExclusive 0x0000000b // 设置独占使用
#define mFuncResetDevice 0x0000000c // 复位USB设备
#define mFuncResetPipe 0x0000000d // 复位USB管道
#define mFuncAbortPipe 0x0000000e // 取消USB管道的数据请求
#define mFuncBufferMode 0x00000020 // 设定缓冲上传模式及查询缓冲区中的数据长度
#define mFuncBufferModeDn 0x00000021 // 设定缓冲下传模式及查询缓冲区中的数据长度
#define mFuncGetVersionEx 0x00000022 // 获取驱动程序版本号及芯片型号
// USB设备标准请求代码
#define mUSB_CLR_FEATURE 0x01
#define mUSB_SET_FEATURE 0x03
#define mUSB_GET_STATUS 0x00
#define mUSB_SET_ADDRESS 0x05
#define mUSB_GET_DESCR 0x06
#define mUSB_SET_DESCR 0x07
#define mUSB_GET_CONFIG 0x08
#define mUSB_SET_CONFIG 0x09
#define mUSB_GET_INTERF 0x0a
#define mUSB_SET_INTERF 0x0b
#define mUSB_SYNC_FRAME 0x0c
// CH341控制传输的厂商专用请求类型
#define mCH341_VENDOR_READ 0xC0 // 通过控制传输实现的CH341厂商专用读操作
#define mCH341_VENDOR_WRITE 0x40 // 通过控制传输实现的CH341厂商专用写操作
#define mCH341A_CMD_I2C_STREAM 0xAA // I2C接口的命令包,从次字节开始为I2C命令流
#define mCH341A_CMD_UIO_STREAM 0xAB // UIO接口的命令包,从次字节开始为命令流
#define mCH341A_CMD_PIO_STREAM 0xAE // PIO接口的命令包,从次字节开始为数据流
// CH341A控制传输的厂商专用请求代码
#define mCH341A_BUF_CLEAR 0xB2 // 清除未完成的数据
#define mCH341A_I2C_CMD_X 0x54 // 发出I2C接口的命令,立即执行
#define mCH341A_DELAY_MS 0x5E // 以亳秒为单位延时指定时间
#define mCH341A_GET_VER 0x5F // 获取芯片版本
#define mCH341A_CMD_I2C_STM_STA 0x74 // I2C接口的命令流:产生起始位
#define mCH341A_CMD_I2C_STM_STO 0x75 // I2C接口的命令流:产生停止位
#define mCH341A_CMD_I2C_STM_OUT 0x80 // I2C接口的命令流:输出数据,位5-位0为长度,后续字节为数据,0长度则只发送一个字节并返回应答
#define mCH341A_CMD_I2C_STM_IN 0xC0 // I2C接口的命令流:输入数据,位5-位0为长度,0长度则只接收一个字节并发送无应答
#define mCH341A_CMD_I2C_STM_MAX ( min( 0x3F, mCH341_PACKET_LENGTH ) ) // I2C接口的命令流单个命令输入输出数据的最大长度
#define mCH341A_CMD_I2C_STM_SET 0x60 // I2C接口的命令流:设置参数,位2=SPI的I/O数(0=单入单出,1=双入双出),位1位0=I2C速度(00=低速,01=标准,10=快速,11=高速)
#define mCH341A_CMD_I2C_STM_US 0x40 // I2C接口的命令流:以微秒为单位延时,位3-位0为延时值
#define mCH341A_CMD_I2C_STM_MS 0x50 // I2C接口的命令流:以亳秒为单位延时,位3-位0为延时值
#define mCH341A_CMD_I2C_STM_DLY 0x0F // I2C接口的命令流单个命令延时的最大值
#define mCH341A_CMD_I2C_STM_END 0x00 // I2C接口的命令流:命令包提前结束
#define mCH341A_CMD_UIO_STM_IN 0x00 // UIO接口的命令流:输入数据D7-D0
#define mCH341A_CMD_UIO_STM_DIR 0x40 // UIO接口的命令流:设定I/O方向D5-D0,位5-位0为方向数据
#define mCH341A_CMD_UIO_STM_OUT 0x80 // UIO接口的命令流:输出数据D5-D0,位5-位0为数据
#define mCH341A_CMD_UIO_STM_US 0xC0 // UIO接口的命令流:以微秒为单位延时,位5-位0为延时值
#define mCH341A_CMD_UIO_STM_END 0x20 // UIO接口的命令流:命令包提前结束
#define MAX_DEVICE_PATH_SIZE 128 // 设备名称的最大字符数
#define MAX_DEVICE_ID_SIZE 64 // 设备ID的最大字符数
#endif _CH341_DLL_H
//驱动接口
#define CH347_USB_VENDOR 0
#define CH347_USB_HID 2
#define CH347_USB_VCP 3
//CH347_USB_VENDOR支持CH341/7
#define CHIP_TYPE_CH341 0
#define CHIP_TYPE_CH347 1
//芯片功能接口号
#define CH347_FUNC_UART 0
#define CH347_FUNC_SPI_IIC 1
#define CH347_FUNC_JTAG_IIC 2
#define DEFAULT_READ_TIMEOUT 500 //默认读超时毫秒数
#define DEFAULT_WRITE_TIMEOUT 500 //默认写超时毫秒数
#define mCH347_PACKET_LENGTH 512 // CH347支持的数据包的长度
#pragma pack(1)
//SPI控制器配置
typedef struct _SPI_CONFIG{
UCHAR iMode; // 0-3:SPI Mode0/1/2/3
UCHAR iClock; // 0=60MHz, 1=30MHz, 2=15MHz, 3=7.5MHz, 4=3.75MHz, 5=1.875MHz, 6=937.5KHz7=468.75KHz
UCHAR iByteOrder; // 0=低位在前(LSB), 1=高位在前(MSB)
USHORT iSpiWriteReadInterval; // SPI接口常规读取写入数据命令单位为uS
UCHAR iSpiOutDefaultData; // SPI读数据时默认输出数据
ULONG iChipSelect; // 片选控制, 位7为0则忽略片选控制, 位7为1则参数有效: 位1位0为00/01分别选择CS1/CS2引脚作为低电平有效片选
UCHAR CS1Polarity; // 位0片选CS1极性控制0低电平有效1高电平有效
UCHAR CS2Polarity; // 位0片选CS2极性控制0低电平有效1高电平有效
USHORT iIsAutoDeativeCS; // 操作完成后是否自动撤消片选
USHORT iActiveDelay; // 设置片选后执行读写操作的延时时间,单位us
ULONG iDelayDeactive; // 撤消片选后执行读写操作的延时时间,单位us
}mSpiCfgS,*mPSpiCfgS;
//设备信息
typedef struct _DEV_INFOR{
UCHAR iIndex; // 当前打开序号
UCHAR DevicePath[MAX_PATH]; // 设备链接名,用于CreateFile
UCHAR UsbClass; // 0:CH347_USB_CH341, 2:CH347_USB_HID,3:CH347_USB_VCP
UCHAR FuncType; // 0:CH347_FUNC_UART,1:CH347_FUNC_SPI_I2C,2:CH347_FUNC_JTAG_I2C
CHAR DeviceID[64]; // USB\VID_xxxx&PID_xxxx
UCHAR ChipMode; // 芯片模式,0:Mode0(UART0/1); 1:Mode1(Uart1+SPI+I2C); 2:Mode2(HID Uart1+SPI+I2C) 3:Mode3(Uart1+Jtag+IIC)
HANDLE DevHandle; // 设备句柄
USHORT BulkOutEndpMaxSize; // 上传端点大小
USHORT BulkInEndpMaxSize; // 下传端点大小
UCHAR UsbSpeedType; // USB速度类型0:FS,1:HS,2:SS
UCHAR CH347IfNum; // 设备接口号: 0:UART,1:SPI/IIC/JTAG/GPIO
UCHAR DataUpEndp; // 端点地址
UCHAR DataDnEndp; // 端点地址
CHAR ProductString[64]; // USB产品字符串
CHAR ManufacturerString[64]; // USB厂商字符串
ULONG WriteTimeout; // USB写超时
ULONG ReadTimeout; // USB读超时
CHAR FuncDescStr[64]; // 接口功能描述符
UCHAR FirewareVer; // 固件版本
}mDeviceInforS,*mPDeviceInforS;
#pragma pack()
// CH347模式公用函数,支持CH347所有模式下的打开、关闭、USB读、USB写包含HID
//打开USB设备
HANDLE WINAPI CH347OpenDevice(ULONG DevI);
//关闭USB设备
BOOL WINAPI CH347CloseDevice(ULONG iIndex);
//获取设备信息
BOOL WINAPI CH347GetDeviceInfor(ULONG iIndex,mDeviceInforS *DevInformation);
// 获得驱动版本、库版本、设备版本、芯片类型(CH341(FS)/CH347HS)
BOOL WINAPI CH347GetVersion(ULONG iIndex,
PUCHAR iDriverVer,
PUCHAR iDLLVer,
PUCHAR ibcdDevice,
PUCHAR iChipType); //CHIP_TYPE_CH341/7
typedef VOID ( CALLBACK * mPCH347_NOTIFY_ROUTINE ) ( // 设备事件通知回调程序
ULONG iEventStatus ); // 设备事件和当前状态(在下行定义): 0=设备拔出事件, 3=设备插入事件
#define CH347_DEVICE_ARRIVAL 3 // 设备插入事件,已经插入
#define CH347_DEVICE_REMOVE_PEND 1 // 设备将要拔出
#define CH347_DEVICE_REMOVE 0 // 设备拔出事件,已经拔出
BOOL WINAPI CH347SetDeviceNotify( // 设定设备事件通知程序
ULONG iIndex, // 指定设备序号,0对应第一个设备
PCHAR iDeviceID, // 可选参数,指向字符串,指定被监控的设备的ID,字符串以\0终止
mPCH347_NOTIFY_ROUTINE iNotifyRoutine ); // 指定设备事件回调程序,为NULL则取消事件通知,否则在检测到事件时调用该程序
// 读取USB数据块
BOOL WINAPI CH347ReadData( ULONG iIndex, // 指定设备序号
PVOID oBuffer, // 指向一个足够大的缓冲区,用于保存读取的数据
PULONG ioLength ); // 指向长度单元,输入时为准备读取的长度,返回后为实际读取的长度
// 写取USB数据块
BOOL WINAPI CH347WriteData(ULONG iIndex, // 指定设备序号
PVOID iBuffer, // 指向一个缓冲区,放置准备写出的数据
PULONG ioLength ); // 指向长度单元,输入时为准备写出的长度,返回后为实际写出的长度
// 设置USB数据读写的超时
BOOL WINAPI CH347SetTimeout(ULONG iIndex, // 指定设备序号
ULONG iWriteTimeout, // 指定USB写出数据块的超时时间,以毫秒mS为单位,0xFFFFFFFF指定不超时(默认值)
ULONG iReadTimeout ); // 指定USB读取数据块的超时时间,以毫秒mS为单位,0xFFFFFFFF指定不超时(默认值)
/***************SPI********************/
// SPI控制器初始化
BOOL WINAPI CH347SPI_Init(ULONG iIndex,mSpiCfgS *SpiCfg);
//获取SPI控制器配置信息
BOOL WINAPI CH347SPI_GetCfg(ULONG iIndex,mSpiCfgS *SpiCfg);
//设置片选状态,使用前需先调用CH347SPI_Init对CS进行设置
BOOL WINAPI CH347SPI_ChangeCS(ULONG iIndex, // 指定设备序号
UCHAR iStatus); // 0=撤消片选,1=设置片选
//设置SPI片选
BOOL WINAPI CH347SPI_SetChipSelect(ULONG iIndex, // 指定设备序号
USHORT iEnableSelect, // 低八位为CS1高八位为CS2; 字节值为1=设置CS,为0=忽略此CS设置
USHORT iChipSelect, // 低八位为CS1高八位为CS2;片选输出,0=撤消片选,1=设置片选
ULONG iIsAutoDeativeCS, // 低16位为CS1高16位为CS2;操作完成后是否自动撤消片选
ULONG iActiveDelay, // 低16位为CS1高16位为CS2;设置片选后执行读写操作的延时时间,单位us
ULONG iDelayDeactive); // 低16位为CS1高16位为CS2;撤消片选后执行读写操作的延时时间,单位us
//SPI4写数据
BOOL WINAPI CH347SPI_Write(ULONG iIndex, // 指定设备序号
ULONG iChipSelect, // 片选控制, 位7为0则忽略片选控制, 位7为1进行片选操作
ULONG iLength, // 准备传输的数据字节数
ULONG iWriteStep, // 准备读取的单个块的长度
PVOID ioBuffer); // 指向一个缓冲区,放置准备从MOSI写出的数据
//SPI4读数据.无需先写数据效率较CH347SPI_WriteRead高很多
BOOL WINAPI CH347SPI_Read(ULONG iIndex, // 指定设备序号
ULONG iChipSelect, // 片选控制, 位7为0则忽略片选控制, 位7为1进行片选操作
ULONG oLength, // 准备发出的字节数
PULONG iLength, // 准备读入的数据字节数
PVOID ioBuffer); // 指向一个缓冲区,放置准备从DOUT写出的数据,返回后是从DIN读入的数据
// 处理SPI数据流,4线接口
BOOL WINAPI CH347SPI_WriteRead(ULONG iIndex, // 指定设备序号
ULONG iChipSelect, // 片选控制, 位7为0则忽略片选控制, 位7为1则操作片选
ULONG iLength, // 准备传输的数据字节数
PVOID ioBuffer ); // 指向一个缓冲区,放置准备从DOUT写出的数据,返回后是从DIN读入的数据
// 处理SPI数据流,4线接口
BOOL WINAPI CH347StreamSPI4(ULONG iIndex, // 指定设备序号
ULONG iChipSelect, // 片选控制, 位7为0则忽略片选控制, 位7为1则参数有效
ULONG iLength, // 准备传输的数据字节数
PVOID ioBuffer ); // 指向一个缓冲区,放置准备从DOUT写出的数据,返回后是从DIN读入的数据
/***************JTAG********************/
//JTAG接口初始化设置模式及速度
BOOL WINAPI CH347Jtag_INIT(ULONG iIndex,
UCHAR iClockRate); //通信速度有效值为0-5值越大通信速度越快
//获取Jtag速度设置
BOOL WINAPI CH347Jtag_GetCfg(ULONG iIndex, // 指定设备序号
UCHAR *ClockRate); //通信速度有效值为0-5值越大通信速度越快
//位带方式JTAG IR/DR数据读写.适用于少量数据的读写。如指令操作、状态机切换等控制类传输。如批量数据传输建议使用CH347Jtag_WriteRead_Fast
//命令包以4096字节为单位批量读写
//状态机:Run-Test->Shift-IR/DR..->Exit IR/DR -> Run-Test
BOOL WINAPI CH347Jtag_WriteRead(ULONG iIndex, // 指定设备序号
BOOL IsDR, // =TRUE: DR数据读写,=FALSE:IR数据读写
ULONG iWriteBitLength, // 写长度,准备写出的长度
PVOID iWriteBitBuffer, // 指向一个缓冲区,放置准备写出的数据
PULONG oReadBitLength, // 指向长度单元,返回后为实际读取的长度
PVOID oReadBitBuffer ); // 指向一个足够大的缓冲区,用于保存读取的数据
//JTAG IR/DR数据批量读写,用于多字节连续读写。如JTAG固件下载操作。因硬件有4K缓冲区如先写后读长度不超过4096字节。缓冲区大小可自行调整
//状态机:Run-Test->Shift-IR/DR..->Exit IR/DR -> Run-Test
BOOL WINAPI CH347Jtag_WriteRead_Fast(ULONG iIndex, // 指定设备序号
BOOL IsDR, // =TRUE: DR数据读写,=FALSE:IR数据读写
ULONG iWriteBitLength, // 写长度,准备写出的长度
PVOID iWriteBitBuffer, // 指向一个缓冲区,放置准备写出的数据
PULONG oReadBitLength, // 指向长度单元,返回后为实际读取的长度
PVOID oReadBitBuffer ); // 指向一个足够大的缓冲区,用于保存读取的数据
//切换JTAG状态机
BOOL WINAPI CH347Jtag_SwitchTapState(UCHAR TapState);
//JTAG DR写,以字节为单位,用于多字节连续读写。如JTAG固件下载操作。
//状态机:Run-Test->Shift-DR..->Exit DR -> Run-Test
BOOL WINAPI CH347Jtag_ByteWriteDR(ULONG iIndex, // 指定设备序号
ULONG iWriteLength, // 写长度,准备写出的字节长度
PVOID iWriteBuffer); // 指向一个缓冲区,放置准备写出的数据
//JTAG DR读,以字节为单位,多字节连续读。
//状态机:Run-Test->Shift-DR..->Exit DR -> Run-Test
BOOL WINAPI CH347Jtag_ByteReadDR(ULONG iIndex, // 指定设备序号
PULONG oReadLength, // 指向长度单元,返回后为实际读取的字节长度
PVOID oReadBuffer ); // 指向一个足够大的缓冲区,用于保存读取的数据
//JTAG IR写,以字节为单位,多字节连续写。
//状态机:Run-Test->Shift-IR..->Exit IR -> Run-Test
BOOL WINAPI CH347Jtag_ByteWriteIR(ULONG iIndex, // 指定设备序号
ULONG iWriteLength, // 写长度,准备写出的字节长度
PVOID iWriteBuffer); // 指向一个缓冲区,放置准备写出的数据
//JTAG IR读,以字节为单位,多字节连续读写。
//状态机:Run-Test->Shift-IR..->Exit IR -> Run-Test
BOOL WINAPI CH347Jtag_ByteReadIR(ULONG iIndex, // 指定设备序号
PULONG oReadLength, // 指向长度单元,返回后为实际读取的字节长度
PVOID oReadBuffer ); // 指向一个足够大的缓冲区,用于保存读取的数据
//位带方式JTAG DR数据写.适用于少量数据的读写。如指令操作、状态机切换等控制类传输。如批量数据传输建议使用USB20Jtag_ByeWriteDR
//状态机:Run-Test->Shift-DR..->Exit DR -> Run-Test
BOOL WINAPI CH347Jtag_BitWriteDR(ULONG iIndex, // 指定设备序号
ULONG iWriteBitLength, // 指向长度单元,返回后为实际读取的字节长度
PVOID iWriteBitBuffer ); // 指向一个足够大的缓冲区,用于保存读取的数据
//位带方式JTAG IR数据写.适用于少量数据的读写。如指令操作、状态机切换等控制类传输。如批量数据传输建议使用USB20Jtag_ByteWriteIR
//状态机:Run-Test->Shift-IR..->Exit IR -> Run-Test
BOOL WINAPI CH347Jtag_BitWriteIR(ULONG iIndex, // 指定设备序号
ULONG iWriteBitLength, // 指向长度单元,返回后为实际读取的字节长度
PVOID iWriteBitBuffer ); // 指向一个足够大的缓冲区,用于保存读取的数据
//位带方式JTAG IR数据读.适用于少量数据的读写。如指令操作、状态机切换等。如批量数据传输建议使用USB20Jtag_ByteReadIR
//状态机:Run-Test->Shift-IR..->Exit IR -> Run-Test
BOOL WINAPI CH347Jtag_BitReadIR(ULONG iIndex, // 指定设备序号
PULONG oReadBitLength, // 指向长度单元,返回后为实际读取的字节长度
PVOID oReadBitBuffer ); // 指向一个足够大的缓冲区,用于保存读取的数据
//位带方式JTAG DR数据读.适用于少量数据的读写。如批量和高速数据传输建议使用USB20Jtag_ByteReadDR
//状态机:Run-Test->Shift-DR..->Exit DR -> Run-Test
BOOL WINAPI CH347Jtag_BitReadDR(ULONG iIndex, // 指定设备序号
PULONG oReadBitLength, // 指向长度单元,返回后为实际读取的字节长度
PVOID oReadBitBuffer ); // 指向一个足够大的缓冲区,用于保存读取的数据
//获取CH347的GPIO方向和引脚电平值
BOOL WINAPI CH347GPIO_Get(ULONG iIndex,
UCHAR *iDir, //引脚方向:GPIO0-7对应位0-7.0输入1输出
UCHAR *iData); //GPIO0电平:GPIO0-7对应位0-7,0低电平1高电平)
//设置CH347的GPIO方向和引脚电平值
BOOL WINAPI CH347GPIO_Set(ULONG iIndex,
UCHAR iEnable, //数据有效标志:对应位0-7,对应GPIO0-7.
UCHAR iSetDirOut, //设置I/O方向,某位清0则对应引脚为输入,某位置1则对应引脚为输出.GPIO0-7对应位0-7.
UCHAR iSetDataOut); //输出数据,如果I/O方向为输出,那么某位清0时对应引脚输出低电平,某位置1时对应引脚输出高电平
//进入IAP固件升级模式
BOOL WINAPI CH347StartIapFwUpate(ULONG iIndex,
ULONG FwSize); // 固件长度
/**************HID/VCP串口**********************/
//打开串口
HANDLE WINAPI CH347Uart_Open(ULONG iIndex);
//关闭串口
BOOL WINAPI CH347Uart_Close(ULONG iIndex);
BOOL WINAPI CH347Uart_SetDeviceNotify( // 设定设备事件通知程序
ULONG iIndex, // 指定设备序号,0对应第一个设备
PCHAR iDeviceID, // 可选参数,指向字符串,指定被监控的设备的ID,字符串以\0终止
mPCH347_NOTIFY_ROUTINE iNotifyRoutine ); // 指定设备事件回调程序,为NULL则取消事件通知,否则在检测到事件时调用该程序
//获取UART硬件配置
BOOL WINAPI CH347Uart_GetCfg(ULONG iIndex, // 指定设备序号
PULONG BaudRate, // 波特率
PUCHAR ByteSize, // 数据位数(5,6,7,8,16)
PUCHAR Parity, // 校验位(0None; 1Odd; 2Even; 3Mark; 4Space)
PUCHAR StopBits, // 停止位数(01停止位; 11.5停止位; 22停止位)
PUCHAR ByteTimeout); //字节超时
//设置UART配置
BOOL WINAPI CH347Uart_Init(ULONG iIndex, // 指定设备序号
DWORD BaudRate, // 波特率
UCHAR ByteSize, // 数据位数(5,6,7,8,16)
UCHAR Parity, // 校验位(0None; 1Odd; 2Even; 3Mark; 4Space)
UCHAR StopBits, // 停止位数(01停止位; 11.5停止位; 22停止位)
UCHAR ByteTimeout);// 字节超时时间,单位100uS
// 设置USB数据读写的超时
BOOL WINAPI CH347Uart_SetTimeout(ULONG iIndex, // 指定设备序号
ULONG iWriteTimeout, // 指定USB写出数据块的超时时间,以毫秒mS为单位,0xFFFFFFFF指定不超时(默认值)
ULONG iReadTimeout ); // 指定USB读取数据块的超时时间,以毫秒mS为单位,0xFFFFFFFF指定不超时(默认值)
// 读取数据块
BOOL WINAPI CH347Uart_Read(ULONG iIndex, // 指定设备序号
PVOID oBuffer, // 指向一个足够大的缓冲区,用于保存读取的数据
PULONG ioLength );// 指向长度单元,输入时为准备读取的长度,返回后为实际读取的长度
// 写出数据块
BOOL WINAPI CH347Uart_Write(ULONG iIndex, // 指定设备序号
PVOID iBuffer, // 指向一个缓冲区,放置准备写出的数据
PULONG ioLength );// 指向长度单元,输入时为准备写出的长度,返回后为实际写出的长度
//查询读缓冲区有多少字节未取
BOOL WINAPI CH347Uart_QueryBufUpload(ULONG iIndex, // 指定设备序号
LONGLONG *RemainBytes);
//获取设备信息
BOOL WINAPI CH347Uart_GetDeviceInfor(ULONG iIndex,mDeviceInforS *DevInformation);
/********IIC***********/
// 设置串口流模式
BOOL WINAPI CH347I2C_Set(ULONG iIndex, // 指定设备序号
ULONG iMode ); // 指定模式,见下行
// 位1-位0: I2C接口速度/SCL频率, 00=低速/20KHz,01=标准/100KHz(默认值),10=快速/400KHz,11=高速/750KHz
// 其它保留,必须为0
// 设置硬件异步延时,调用后很快返回,而在下一个流操作之前延时指定毫秒数
BOOL WINAPI CH347I2C_SetDelaymS(ULONG iIndex, // 指定设备序号
ULONG iDelay ) ; // 指定延时的毫秒数
// 处理I2C数据流,2线接口,时钟线为SCL引脚,数据线为SDA引脚
BOOL WINAPI CH347StreamI2C( ULONG iIndex, // 指定设备序号
ULONG iWriteLength, // 准备写出的数据字节数
PVOID iWriteBuffer, // 指向一个缓冲区,放置准备写出的数据,首字节通常是I2C设备地址及读写方向位
ULONG iReadLength, // 准备读取的数据字节数
PVOID oReadBuffer ); // 指向一个缓冲区,返回后是读入的数据
#ifndef _CH341_DLL_H
typedef enum _EEPROM_TYPE {// EEPROM型号
ID_24C01,
ID_24C02,
ID_24C04,
ID_24C08,
ID_24C16,
ID_24C32,
ID_24C64,
ID_24C128,
ID_24C256,
ID_24C512,
ID_24C1024,
ID_24C2048,
ID_24C4096
} EEPROM_TYPE;
#endif
// 从EEPROM中读取数据块,速度约56K字节
BOOL WINAPI CH347ReadEEPROM(ULONG iIndex, // 指定设备序号
EEPROM_TYPE iEepromID, // 指定EEPROM型号
ULONG iAddr, // 指定数据单元的地址
ULONG iLength, // 准备读取的数据字节数
PUCHAR oBuffer ); // 指向一个缓冲区,返回后是读入的数据
// 向EEPROM中写入数据块
BOOL WINAPI CH347WriteEEPROM(ULONG iIndex, // 指定设备序号
EEPROM_TYPE iEepromID, // 指定EEPROM型号
ULONG iAddr, // 指定数据单元的地址
ULONG iLength, // 准备写出的数据字节数
PUCHAR iBuffer ); // 指向一个缓冲区,放置准备写出的数据
#ifdef __cplusplus
}
#endif
#endif // _CH347_DLL_H

View File

@ -0,0 +1,506 @@
/*****************************************************************************
** Copyright (C) WCH 2001-2022 **
** Web: http://wch.cn **
******************************************************************************
Abstract:
USB2.0 adapter chip ch347, based on 480mbps high-speed USB bus, extends UART/SPI/I2C/JTAG
Environment:
user mode only,VC6.0 and later
Notes:
Copyright (c) 2022 Nanjing Qinheng Microelectronics Co., Ltd.
--*/
#ifndef _CH347_DLL_H
#define _CH347_DLL_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _WIN64
#define mOFFSET( s, m ) ( (ULONG_PTR) & ( ( ( s * ) 0 ) -> m ) ) // Defines a macro that gets the relative offset address of a structure member
#else
#define mOFFSET( s, m ) ( (ULONG) & ( ( ( s * ) 0 ) -> m ) ) // Defines a macro that gets the relative offset address of a structure member
#endif
#ifndef max
#define max( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) ) // Larger value
#endif
#ifndef min
#define min( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) ) // Smaller Value
#endif
#ifdef ExAllocatePool
#undef ExAllocatePool // Delete memory allocation with TAG
#endif
#ifndef NTSTATUS
typedef LONG NTSTATUS; // Return status
#endif
//Sharing CH341WDM driver with CH341DLL
#ifndef _CH341_DLL_H
typedef struct _USB_SETUP_PKT { // Data request packet structure in the setup phase of USB control transfer
UCHAR mUspReqType; // 00H request type
UCHAR mUspRequest; // 01H request code
union {
struct {
UCHAR mUspValueLow; // 02H Value parameter low byte
UCHAR mUspValueHigh; // 03H Value parameter high byte
};
USHORT mUspValue; // 02H-03H value parameters
};
union {
struct {
UCHAR mUspIndexLow; // 04H index parameter low byte
UCHAR mUspIndexHigh; // 05H index parameter high byte
};
USHORT mUspIndex; // 04H-05H index parameter
};
USHORT mLength; // 06H-07H data length of data stage
} mUSB_SETUP_PKT, *mPUSB_SETUP_PKT;
typedef struct _WIN32_COMMAND { // Define the WIN32 command interface structure
union {
ULONG mFunction; // Specify function code or pipe number when inputting
NTSTATUS mStatus; // return operation status when output
};
ULONG mLength; // access length, return the length of subsequent data
union {
mUSB_SETUP_PKT mSetupPkt; // Data request in the setup phase of USB control transfer
UCHAR mBuffer[ 512]; // data buffer, the length is 0 to 255B
};
} mWIN32_COMMAND, *mPWIN32_COMMAND;
// WIN32 Application layer interface command
#define IOCTL_CH341_COMMAND ( FILE_DEVICE_UNKNOWN << 16 | FILE_ANY_ACCESS << 14 | 0x0f34 << 2 | METHOD_BUFFERED ) // private interface
#define mWIN32_COMMAND_HEAD mOFFSET( mWIN32_COMMAND, mBuffer ) // Header length of WIN32 command interface
#define mCH341_MAX_NUMBER 16 // Maximum number of CH375 connected at the same time
#define mMAX_BUFFER_LENGTH 0x1000 // The maximum length of the data buffer is 4MB
#define mMAX_COMMAND_LENGTH ( mWIN32_COMMAND_HEAD + mMAX_BUFFER_LENGTH ) // maximum data length plus the length of the command structure header
#define mDEFAULT_BUFFER_LEN 0x0400 // The default length of the data buffer is 1024
#define mDEFAULT_COMMAND_LEN ( mWIN32_COMMAND_HEAD + mDEFAULT_BUFFER_LEN ) // default data length plus the length of the command structure header
// CH341 endpoint address
#define mCH347_ENDP_DATA_UP 0x86 // The address of the data block upload endpoint of CH347
#define mCH347_ENDP_DATA_DOWN 0x06 // The address of the data block download endpoint of CH347
// Pipeline operation command provided by equipment layer interface
#define mPipeDeviceCtrl 0x00000004 // CH347 integrated control pipeline
#define mPipeDataUp 0x00000006 // CH347 data block upload pipeline
#define mPipeDataDown 0x00000007 // CH347 data block download pipeline
// Function code of application layer interface
#define mFuncNoOperation 0x00000000 // no operation
#define mFuncGetVersion 0x00000001 // Get the driver version number
#define mFuncGetConfig 0x00000002 // Get the USB device configuration descriptor
#define mFuncSetTimeout 0x00000009 // Set USB communication timeout
#define mFuncSetExclusive 0x0000000b // Set exclusive use
#define mFuncResetDevice 0x0000000c // Reset the USB device
#define mFuncResetPipe 0x0000000d // Reset the USB pipe
#define mFuncAbortPipe 0x0000000e // Cancel the data request of the USB pipe
#define mFuncBufferMode 0x00000020 // Set the buffer upload mode and query the data length in the buffer
#define mFuncBufferModeDn 0x00000021 // Set the buffer download mode and query the data length in the buffer
#define mFuncGetVersionEx 0x00000022 // Get the driver version number and chip model
// USB device standard request code
#define mUSB_CLR_FEATURE 0x01
#define mUSB_SET_FEATURE 0x03
#define mUSB_GET_STATUS 0x00
#define mUSB_SET_ADDRESS 0x05
#define mUSB_GET_DESCR 0x06
#define mUSB_SET_DESCR 0x07
#define mUSB_GET_CONFIG 0x08
#define mUSB_SET_CONFIG 0x09
#define mUSB_GET_INTERF 0x0a
#define mUSB_SET_INTERF 0x0b
#define mUSB_SYNC_FRAME 0x0c
// CH341 manufacturer specific request type for control transmission
#define mCH341_VENDOR_READ 0xC0 // CH347 vendor-specific read operation through control transfer
#define mCH341_VENDOR_WRITE 0x40 // CH347 vendor-specific write operation through control transfer
#define mCH341A_CMD_I2C_STREAM 0xAA // The command package of the I2C interface, starting from the secondary byte, is the I2C command stream
#define mCH341A_CMD_UIO_STREAM 0xAB // The command package of the UIO interface, starting from the secondary byte, is the command stream
#define mCH341A_CMD_PIO_STREAM 0xAE // The command package of PIO interface, starting from the secondary byte, is the data stream
// CH341A manufacturer specific request code for control transmission
#define mCH341A_BUF_CLEAR 0xB2 // Clear incomplete data
#define mCH341A_I2C_CMD_X 0x54 // Issue the command of I2C interface and execute it immediately
#define mCH341A_DELAY_MS 0x5E // Delay the specified time in microseconds
#define mCH341A_GET_VER 0x5F // Get chip version
#define mCH341A_CMD_I2C_STM_STA 0x74 // Command flow of I2C interface: generate start bit
#define mCH341A_CMD_I2C_STM_STO 0x75 // Command flow of I2C interface: generate stop bit
#define mCH341A_CMD_I2C_STM_OUT 0x80 // Command flow of I2C interface: output data, bit 5- bit 0 is the length, subsequent bytes are data, and length 0 only sends one byte and returns an answer
#define mCH341A_CMD_I2C_STM_IN 0xC0 // I2C interface command flow: input data, bit 5-bit 0 is the length, and 0 length only receives one byte and sends no response
#define mCH341A_CMD_I2C_STM_MAX ( min( 0x3F, mCH341_PACKET_LENGTH ) ) // The maximum length of input and output data of a single command in the command stream of I2C interface
#define mCH341A_CMD_I2C_STM_SET 0x60 // Command flow of I2C interface: set parameters, bit 2=i/o number of SPI (0= single input single output, 1= double input double output), bit 1 0=i2c speed (00= low speed, 01= standard, 10= fast, 11= high speed)
#define mCH341A_CMD_I2C_STM_US 0x40 // Command flow of I2C interface: delay in microseconds, bit 3- bit 0 as delay value
#define mCH341A_CMD_I2C_STM_MS 0x50 // Command flow of I2C interface: delay in microseconds, bit 3-bit 0 as delay value
#define mCH341A_CMD_I2C_STM_DLY 0x0F // Maximum value of single command delay of command flow of I2C interface
#define mCH341A_CMD_I2C_STM_END 0x00 // Command flow of I2C interface: Command package ends in advance
#define mCH341A_CMD_UIO_STM_IN 0x00 // Command flow of UIO interface: input data D7-D0
#define mCH341A_CMD_UIO_STM_DIR 0x40 // Command flow of UIO interface: set i/o direction D5-D0, bit 5- bit 0 as direction data
#define mCH341A_CMD_UIO_STM_OUT 0x80 // Command flow of UIO interface: output data D5-D0, bit 5-bit 0 is data
#define mCH341A_CMD_UIO_STM_US 0xC0 // Command flow of UIO interface: delay in microseconds, bit 5- bit 0 as delay value
#define mCH341A_CMD_UIO_STM_END 0x20 // Command flow of UIO interface: Command package ends in advance
#define MAX_DEVICE_PATH_SIZE 128 // Maximum number of characters for device name
#define MAX_DEVICE_ID_SIZE 64 // Maximum number of characters for device ID
#endif _CH341_DLL_H
//Drive Interface
#define CH347_USB_VENDOR 0
#define CH347_USB_HID 2
#define CH347_USB_VCP 3
//CH347_USB_VENDOR support CH341/7
#define CHIP_TYPE_CH341 0
#define CHIP_TYPE_CH347 1
//Chip Function Interface Number
#define CH347_FUNC_UART 0
#define CH347_FUNC_SPI_IIC 1
#define CH347_FUNC_JTAG_IIC 2
#define DEFAULT_READ_TIMEOUT 500 // Default read timeout duration (mS)
#define DEFAULT_WRITE_TIMEOUT 500 // Default write timeout duration (mS)
#define mCH347_PACKET_LENGTH 512 // Length of packets supported by ch347
#pragma pack(1)
//SPI Controller Configuration
typedef struct _SPI_CONFIG{
UCHAR iMode; // 0-3:SPI Mode0/1/2/3
UCHAR iClock; // 0=60MHz, 1=30MHz, 2=15MHz, 3=7.5MHz, 4=3.75MHz, 5=1.875MHz, 6=937.5KHz,7=468.75KHz
UCHAR iByteOrder; // 0=LSB first(LSB), 1=MSB first(MSB)
USHORT iSpiWriteReadInterval; // The SPI interface routinely reads and writes data command, the unit is uS
UCHAR iSpiOutDefaultData; // SPI prints data by default when it reads data
ULONG iChipSelect; // Piece of selected control, if bit 7 is 0, slice selection control is ignored, if bit 7 is 1, the parameter is valid: bit 1 bit 0 is 00/01 and CS1/CS2 pins are selected as low level active chip options respectively
UCHAR CS1Polarity; // Bit 0: CS1 polarity control: 0: effective low level; 1: effective lhigh level;
UCHAR CS2Polarity; // Bit 0: CS2 polarity control: 0: effective low level; 1: effective lhigh level;
USHORT iIsAutoDeativeCS; // Whether to undo slice selection automatically after the operation is complete
USHORT iActiveDelay; // Set the latency for read/write operations after slice selection,the unit is us
ULONG iDelayDeactive; // Delay time for read and write operations after slice selection is unselected,the unit is us
}mSpiCfgS,*mPSpiCfgS;
//Device Information
typedef struct _DEV_INFOR{
UCHAR iIndex; // Current open number
UCHAR DevicePath[MAX_PATH]; // Device link name, used for CreateFile
UCHAR UsbClass; // 0:CH347_USB_CH341, 2:CH347_USB_HID,3:CH347_USB_VCP
UCHAR FuncType; // 0:CH347_FUNC_UART,1:CH347_FUNC_SPI_IIC,2:CH347_FUNC_JTAG_IIC
CHAR DeviceID[64]; // USB\VID_xxxx&PID_xxxx
UCHAR ChipMode; // Chip Mode, 0:Mode0(UART0/1); 1:Mode1(Uart1+SPI+IIC); 2:Mode2(HID Uart1+SPI+IIC) 3:Mode3(Uart1+Jtag+IIC)
HANDLE DevHandle; // Device handle
USHORT BulkOutEndpMaxSize; // Upload endpoint size
USHORT BulkInEndpMaxSize; // The size of the downstream endpoint
UCHAR UsbSpeedType; // USB Speed type,0:FS,1:HS,2:SS
UCHAR CH347IfNum; // USB interface number: 0:UART,1:SPI/IIC/JTAG/GPIO
UCHAR DataUpEndp; // The endpoint address
UCHAR DataDnEndp; // The endpoint address
CHAR ProductString[64]; // Product string in USB descriptor
CHAR ManufacturerString[64]; // Manufacturer string in USB descriptor
ULONG WriteTimeout; // USB write timeout
ULONG ReadTimeout; // USB read timeout
CHAR FuncDescStr[64]; // Interface functions
UCHAR FirewareVer; // Firmware version
}mDeviceInforS,*mPDeviceInforS;
#pragma pack()
//CH347 Mode Common Function,support open,close,USB read,USB written and HID of all modes.
//Open USB device
HANDLE WINAPI CH347OpenDevice(ULONG DevI);
//Close USB device
BOOL WINAPI CH347CloseDevice(ULONG iIndex);
//Get Device Information
BOOL WINAPI CH347GetDeviceInfor(ULONG iIndex,mDeviceInforS *DevInformation);
// Obtain driver version, library version, device version and chip type(CH341(FS)/CH347HS)
BOOL WINAPI CH347GetVersion(ULONG iIndex,
PUCHAR iDriverVer,
PUCHAR iDLLVer,
PUCHAR ibcdDevice,
PUCHAR iChipType); //CHIP_TYPE_CH341/7
typedef VOID ( CALLBACK * mPCH347_NOTIFY_ROUTINE ) ( // Device event notification callback routine
ULONG iEventStatus ); // Device event and current status (refer to the description below): 0=Device unplug event, 3=Device insertion event
#define CH347_DEVICE_ARRIVAL 3 // Device insertion event,has been inserted
#define CH347_DEVICE_REMOVE_PEND 1 // Device wil be unplugged
#define CH347_DEVICE_REMOVE 0 // Device unplug event,has been pulled out
BOOL WINAPI CH347SetDeviceNotify( // Configure device event notifier
ULONG iIndex, // Specifies the device number,bit 0 corresponds to the first device
PCHAR iDeviceID, // Optional parameter,pointing to a string terminated by \0,specifying the ID of the monitored device
mPCH347_NOTIFY_ROUTINE iNotifyRoutine ); // Specifies the port device event callback program. If it is NULL, the event notification will be canceled. Otherwise, the program will be called when an event is detected.
// Read USB data block
BOOL WINAPI CH347ReadData( ULONG iIndex, // Specifies the device number
PVOID oBuffer, // Points to a buffer large enough to save the read data
PULONG ioLength ); // Points to the length unit, the length to be read when input is the length to be read, and the actual read length after return
// Write USB data block
BOOL WINAPI CH347WriteData(ULONG iIndex, // Specifies the device number
PVOID iBuffer, // Points to a buffer large enough to save the written data
PULONG ioLength ); // Points to the length unit,the input length is the intended length, and the return length is the actual length
// Set the timeout of USB data read and write
BOOL WINAPI CH347SetTimeout(ULONG iIndex, // Specifies the device number
ULONG iWriteTimeout, // Specifies the timeout for USB to write data blocks, in milliseconds mS,0xFFFFFFFF specifies no timeout (default)
ULONG iReadTimeout ); // Specifies the timeout for USB to read data blocks, in milliseconds mS,0xFFFFFFFF specifies no timeout (default)
/***************SPI********************/
// SPI Controller Initialization
BOOL WINAPI CH347SPI_Init(ULONG iIndex,mSpiCfgS *SpiCfg);
// Get SPI controller configuration information
BOOL WINAPI CH347SPI_GetCfg(ULONG iIndex,mSpiCfgS *SpiCfg);
// Before setting the chip selection status, call CH347SPI_Init to set CS
BOOL WINAPI CH347SPI_ChangeCS(ULONG iIndex, // Specify device number
UCHAR iStatus); // 0=Cancel the piece to choose,1=Set piece selected
// Set SPI slice selection
BOOL WINAPI CH347SPI_SetChipSelect(ULONG iIndex, // Specify device number
USHORT iEnableSelect, // The lower octet is CS1 and the higher octet is CS2. A byte value of 1= sets CS, 0= ignores this CS setting
USHORT iChipSelect, // The lower octet is CS1 and the higher octet is CS2. A byte value of 1= sets CS, 0= ignores this CS setting
ULONG iIsAutoDeativeCS, // The lower 16 bits are CS1 and the higher 16 bits are CS2. Whether to undo slice selection automatically after the operation is complete
ULONG iActiveDelay, // The lower 16 bits are CS1 and the higher 16 bits are CS2. Set the latency of read/write operations after chip selection, the unit is us
ULONG iDelayDeactive); // The lower 16 bits are CS1 and the higher 16 bits are CS2. Delay time for read and write operations after slice selection the unit is us
//SPI4 write data
BOOL WINAPI CH347SPI_Write(ULONG iIndex, // Specify device number
ULONG iChipSelect, // Slice selection control, when bit 7 is 0, slice selection control is ignored, and when bit 7 is 1, slice selection operation is performed
ULONG iLength, // Number of bytes of data to be transferred
ULONG iWriteStep, // The length of a single block to be read
PVOID ioBuffer); // Point to a buffer to place the data to be written out from MOSI
//SPI4 read data. No need to write data first, the efficiency is higher than that of the CH347SPI_WriteRead
BOOL WINAPI CH347SPI_Read(ULONG iIndex, // Specify device number
ULONG iChipSelect, // Slice selection control, when bit 7 is 0, slice selection control is ignored, and when bit 7 is 1, slice selection operation is performed
ULONG oLength, // Number of bytes to send
PULONG iLength, // Number of bytes of data to be read in
PVOID ioBuffer); // Points to a buffer that place the data to be written out from DOUT, return the data read in from DIN
// Handle SPI data stream 4-wire interface
BOOL WINAPI CH347SPI_WriteRead(ULONG iIndex, // Specify the device number
ULONG iChipSelect, // Selection control, if the film selection control bit 7 is 0, ignore the film selection control bit 7 is 1 and operate the film selection
ULONG iLength, // Number of bytes of data to be transferred
PVOID ioBuffer ); // Points to a buffer that place the data to be written out from DOUT, return the data read in from DIN
//place the data to be written from MOSI, return the data read in from MISO
BOOL WINAPI CH347StreamSPI4(ULONG iIndex, // Specify the device number
ULONG iChipSelect, // Film selection control, if bit 7 is 0, slice selection control is ignored.If bit 7 is 1, the parameter is valid:Bit 1 bit 0 is 00/01/10. Select D0/D1/D2 pins as low level active chip options respectively
ULONG iLength, // Number of bytes of data to be transferred
PVOID ioBuffer ); // Points to a buffer, places data to be written out from DOUT, and returns data to be read in from DIN
/***************JTAG********************/
//JTAG interface initialization, set mode and speed
BOOL WINAPI CH347Jtag_INIT(ULONG iIndex,
UCHAR iClockRate); // Communication speed; The value ranges from 0 to 5. A larger value indicates a faster communication speed
//Gets Jtag speed configuration
BOOL WINAPI CH347Jtag_GetCfg(ULONG iIndex, // Specify the device number
UCHAR *ClockRate); // Communication speed; The value ranges from 0 to 5. A larger value indicates a faster communication speed
//Bit band mode JTAG IR/DR data read and write. Suitable for reading and writing small amounts of data. Such as command operation, state machine switching and other control transmission. For batch data transmission, you are advised to use CH347Jtag_WriteRead_Fast
//Command packages are read and written in batches in 4096 bytes
//The state machine: Run-Test->Shift-IR/DR..->Exit IR/DR -> Run-Test
BOOL WINAPI CH347Jtag_WriteRead(ULONG iIndex, // Specify the device number
BOOL IsDR, // =TRUE: DR data read/write, =FALSE:IR data read/write
ULONG iWriteBitLength, // Write length, the length to be written
PVOID iWriteBitBuffer, // Points to a buffer to place data ready to be written out
PULONG oReadBitLength, // Points to the length unit and returns the length actually read
PVOID oReadBitBuffer ); // Points to a buffer large enough to hold the read data
//JTAG IR/DR data batch read and write The IR/DR data is used for multi-byte continuous read and write. For example, download firmware. The hardware has four buffers. If the buffer is written before the buffer is read, the length cannot exceed 4096 bytes. Buffer size can be adjusted
//The state machine: Run-Test->Shift-IR/DR..->Exit IR/DR -> Run-Test
BOOL WINAPI CH347Jtag_WriteRead_Fast(ULONG iIndex, // Specify the device number
BOOL IsDR, // =TRUE: DRdata read/write, =FALSE:IR data read/write
ULONG iWriteBitLength, // Write length. The length to be written
PVOID iWriteBitBuffer, // Points to a buffer to place data ready to be written out
PULONG oReadBitLength, // Point to the length unit and return the actual read length
PVOID oReadBitBuffer ); // Points to a buffer large enough to hold the read data
//Switch the JTAG state machine
BOOL WINAPI CH347Jtag_SwitchTapState(UCHAR TapState);
//JTAG DR Write, in bytes, for multi-byte sequential reads and writes. For example, download firmware.
//The state machine: Run-Test->Shift-DR..->Exit DR -> Run-Test
BOOL WINAPI CH347Jtag_ByteWriteDR(ULONG iIndex, // Specify the device number
ULONG iWriteLength, // Write length, length of bytes to be written
PVOID iWriteBuffer); // Points to a buffer to place data ready to be written out
//JTAG DR Read, read multiple bytes consecutively in bytes.
//The state machine: Run-Test->Shift-DR..->Exit DR -> Run-Test
BOOL WINAPI CH347Jtag_ByteReadDR(ULONG iIndex, // Specify the device number
PULONG oReadLength, // Points to the length unit and returns the length of the bytes actually read
PVOID oReadBuffer ); // Points to a buffer large enough to hold the read data
//JTAG IR write, written in bytes, multiple bytes are written consecutively.
//The state machine: Run-Test->Shift-IR..->Exit IR -> Run-Test
BOOL WINAPI CH347Jtag_ByteWriteIR(ULONG iIndex, // Specify the CH347 device number
ULONG iWriteLength, // Write length, the length of bytes to be written
PVOID iWriteBuffer); // Points to a buffer to place data ready to be written out
//JTAG IR read, readen in bytes, multiple bytes are readen consecutively.
//The state machine: Run-Test->Shift-IR..->Exit IR -> Run-Test
BOOL WINAPI CH347Jtag_ByteReadIR(ULONG iIndex, // Specify the device number
PULONG oReadLength, // Points to the length unit and returns the length of the bytes actually read
PVOID oReadBuffer ); // Points to a buffer large enough to hold the read data
//Bit band mode JTAG DR data write. Suitable for reading and writing small amounts of data. Such as command operation, state machine switching and other control transmission. For batch data transmission, CH347Jtag_ByteWriteDR is recommended
//The state machine: Run-Test->Shift-DR..->Exit DR -> Run-Test
BOOL WINAPI CH347Jtag_BitWriteDR(ULONG iIndex, // Specify the device number
ULONG iWriteBitLength, // Points to the length unit and returns the length of the bytes actually read
PVOID iWriteBitBuffer ); // Points to a buffer large enough to hold the read data
//Bit band mode JTAG IR data write. Suitable for reading and writing small amounts of data. Such as command operation, state machine switching and other control transmission. For batch data transmission, CH347Jtag_ByteWriteIR is recommended
//The state machine: Run-Test->Shift-IR..->Exit IR -> Run-Test
BOOL WINAPI CH347Jtag_BitWriteIR(ULONG iIndex, // Specify the device number
ULONG iWriteBitLength, // Points to the length unit and returns the length of the bytes actually read
PVOID iWriteBitBuffer ); // Points to a buffer large enough to hold the read data
//Bit band mode JTAG IR data read. Suitable for reading and writing small amounts of data. Such as command operation, state machine switching, etc. For batch data transmission, CH347Jtag_ByteReadIR is recommended.
//The state machine: Run-Test->Shift-IR..->Exit IR -> Run-Test
BOOL WINAPI CH347Jtag_BitReadIR(ULONG iIndex, // Specify the device number
PULONG oReadBitLength, // Points to the length unit and returns the length of the bytes actually read
PVOID oReadBitBuffer ); // Points to a buffer large enough to hold the read data
//Bit band mode JTAG DR data read. Suitable for reading and writing small amounts of data. For batch and high-speed data transmission, CH347Jtag_ByteReadDR is recommended
//The state machine: Run-Test->Shift-DR..->Exit DR -> Run-Test
BOOL WINAPI CH347Jtag_BitReadDR(ULONG iIndex, // Specify the device number
PULONG oReadBitLength, // Points to the length unit and returns the length of the bytes actually read
PVOID oReadBitBuffer ); // Points to a buffer large enough to hold the read data
//Get the GPIO direction and pin level of CH347
BOOL WINAPI CH347GPIO_Get(ULONG iIndex,
UCHAR *iDir, // Pin direction: GPIo0-7 corresponding bit 0-7,0: input; 1: output
UCHAR *iData); // GPIO0 level: GPIO0-7 corresponding bit 0-7,0: low level; 1: high level
//Set the GPIO direction and pin level of CH347
BOOL WINAPI CH347GPIO_Set(ULONG iIndex,
UCHAR iEnable, // Data validity flag: The corresponding bits 0-7 correspond to GPIO0-7.
UCHAR iSetDirOut, // Sets the I/O direction, with pin 0 corresponding to input and pin 1 corresponding to output. Gpio0-7 corresponds to bits 0-7.
UCHAR iSetDataOut); // Outputs data. If the I/O direction is output, then a pin outputs low level at a clear 0 and high level at a position 1
//Enter the IAP firmware upgrade mode
BOOL WINAPI CH347StartIapFwUpate(ULONG iIndex,
ULONG FwSize); // The length of the firmware
/**************HID/VCP Serial Port*********************/
//Open serial port
HANDLE WINAPI CH347Uart_Open(ULONG iIndex);
//Close serial port
BOOL WINAPI CH347Uart_Close(ULONG iIndex);
//Set the device event notification program
BOOL WINAPI CH347Uart_SetDeviceNotify(
ULONG iIndex, // Specify the device number, 0 corresponds to the first device
PCHAR iDeviceID, // Optional parameter,points to a string specifying the ID of the device to be monitored, terminated with \0
mPCH347_NOTIFY_ROUTINE iNotifyRoutine ); // Specifies the device event callback. NULL cancels event notification, otherwise it will be called when an event is detected
//Obtain UART hardware configuration
BOOL WINAPI CH347Uart_GetCfg(ULONG iIndex, // Specify the device number
PULONG BaudRate, // Baud rate
PUCHAR ByteSize, // Data bits (5,6,7,8,16)
PUCHAR Parity, // Parity bits(0:None; 1:Odd; 2:Even; 3:Mark; 4:Space)
PUCHAR StopBits, // Stop bits (0:1 stop bits; 1:1.5 stop bit; 2:2 stop bit);
PUCHAR ByteTimeout); // Byte timeout
//Set UART configuration
BOOL WINAPI CH347Uart_Init(ULONG iIndex, // Specify the device number
DWORD BaudRate, // Baud rate
UCHAR ByteSize, // Data bits (5,6,7,8,16)
UCHAR Parity, // Check bit (0:None; 1:Odd; 2:Even; 3:Mark; 4:Space)
UCHAR StopBits, // Stop bits 0:1 Stop bit; 1:1.5 stop bit; 2:2 stop bit);
UCHAR ByteTimeout);// Byte Timeout duration, in unit of 100uS
//Set the timeout of USB data read and write
BOOL WINAPI CH347Uart_SetTimeout(ULONG iIndex, // Specify the device number
ULONG iWriteTimeout, // Specifies the timeout for USB to write data blocks, in milliseconds mS,0xFFFFFFFF specifies no timeout (default)
ULONG iReadTimeout ); // Specifies the timeout for USB to read data blocks, in milliseconds mS,0xFFFFFFFF specifies no timeout (default)
//Read data block
BOOL WINAPI CH347Uart_Read(ULONG iIndex, // Specify the device number
PVOID oBuffer, // Points to a buffer large enough to hold the read data
PULONG ioLength );// Refers to the length unit. The input is the length to be read and the return is the actual length to be read
//Write out blocks of data
BOOL WINAPI CH347Uart_Write(ULONG iIndex, // Specify the device number
PVOID iBuffer, // Points to a buffer to place data ready to be written out
PULONG ioLength );// Point to the length unit. The input is the intended length and the return is the actual length
//Query how many bytes are unfetched in the read buffer
BOOL WINAPI CH347Uart_QueryBufUpload(ULONG iIndex, // Specify the device number
LONGLONG *RemainBytes);
//Obtaining Device Information
BOOL WINAPI CH347Uart_GetDeviceInfor(ULONG iIndex,mDeviceInforS *DevInformation);
/********IIC***********/
//Set the serial port flow mode
BOOL WINAPI CH347I2C_Set(ULONG iIndex, // Specify the device number
ULONG iMode ); // See downlink for the specified mode
//bit 1-bit 0: I2C interface speed /SCL frequency, 00= low speed /20KHz,01= standard /100KHz(default),10= fast /400KHz,11= high speed /750KHz
//Other reservations, must be 0
//Set the hardware asynchronous delay to a specified number of milliseconds before the next stream operation
BOOL WINAPI CH347I2C_SetDelaymS(ULONG iIndex, // Specify the device number
ULONG iDelay ) ; // Specifies the delay duration (mS)
//Process I2C data stream, 2-wire interface, clock line for SCL pin, data line for SDA pin
BOOL WINAPI CH347StreamI2C( ULONG iIndex, // Specify the device number
ULONG iWriteLength, // The number of bytes of data to write
PVOID iWriteBuffer, // Points to a buffer to place data ready to be written out, the first byte is usually the I2C device address and read/write direction bit
ULONG iReadLength, // Number of bytes of data to be read
PVOID oReadBuffer ); // Points to a buffer to place data ready to be read in
#ifndef _CH341_DLL_H
typedef enum _EEPROM_TYPE {// EEPROM type
ID_24C01,
ID_24C02,
ID_24C04,
ID_24C08,
ID_24C16,
ID_24C32,
ID_24C64,
ID_24C128,
ID_24C256,
ID_24C512,
ID_24C1024,
ID_24C2048,
ID_24C4096
} EEPROM_TYPE;
#endif
// Reads data blocks from EEPROM at a speed of about 56 KB
BOOL WINAPI CH347ReadEEPROM(ULONG iIndex, // Specify the device number
EEPROM_TYPE iEepromID, // Specifies the EEPROM model
ULONG iAddr, // Specifies the address of data unit
ULONG iLength, // Number of bytes of data to be read
PUCHAR oBuffer ); // Points to a buffer to place data ready to be read in
// Writes a data block to the EEPROM
BOOL WINAPI CH347WriteEEPROM(ULONG iIndex, // Specify the device number
EEPROM_TYPE iEepromID, // Specifies the EEPROM model
ULONG iAddr, // Specifies the address of data unit
ULONG iLength, // Number of bytes of data to be written out
PUCHAR iBuffer ); // Points to a buffer to place data ready to be written out
#ifdef __cplusplus
}
#endif
#endif // _CH347_DLL_H

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<settings>
<locale lang="en"/>
<options hw="ch341a" CHIP="_24LC1025" clear="0" skipff="1" unprot="0" verify="0" busyskip="0" mw_speed="32Khz" spi_speed="1_5Mhz" blankcheck="0" LoadLastDev="1" arduino_comport="" arduino_baudrate="1000000"/>
<Windows DPI="96" Top="101" Left="335" LogH="101" Width="766" Height="550"/>
<options hw="ch341a" CHIP="AT24C01" clear="0" skipff="1" unprot="0" verify="0" busyskip="0" mw_speed="32Khz" spi_speed="1_5Mhz" blankcheck="0" LoadLastDev="1" arduino_comport="" arduino_baudrate="1000000"/>
<Windows DPI="96" Top="430" Left="335" LogH="101" Width="766" Height="728"/>
</settings>

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,953 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This XML Chip settings file was imported from AsProgrammer Project.
It was initially created by nofeletru.
The source code of AsProgrammer was available at https://github.com/nofeletru/UsbAsp-flash
-->
<chiplist>
<SPI>
<ADESTO>
<AT25DN256 id="1F4000" page="256" size="32768"/>
</ADESTO>
<AMIC>
<A25L05PT id="372020" page="256" size="65536"/>
<A25L05PU id="372010" page="256" size="65536"/>
<A25L10PT id="372021" page="256" size="131072"/>
<A25L10PU id="372011" page="256" size="131072"/>
<A25L20PT id="372022" page="256" size="262144"/>
<A25L20PU id="372012" page="256" size="262144"/>
<A25L40PT id="372023" page="256" size="524288"/>
<A25L40PU id="372013" page="256" size="524288"/>
<A25L80PT id="372024" page="256" size="1048576"/>
<A25L80PU id="372014" page="256" size="1048576"/>
<A25L16PT id="372025" page="256" size="2097152"/>
<A25L16PU id="372015" page="256" size="2097152"/>
<A25L512 id="373010" page="256" size="65536"/>
<A25L010 id="373011" page="256" size="131072"/>
<A25L020 id="373012" page="256" size="262144"/>
<A25L040 id="373013" page="256" size="524288"/>
<A25L080 id="373014" page="256" size="1048576"/>
<A25L016 id="373015" page="256" size="2097152"/>
<A25L032 id="373016" page="256" size="4194304"/>
<A25LQ16 id="374015" page="256" size="2097152"/>
<A25LQ32A id="374016" page="256" size="4194304"/>
</AMIC>
<APLUS>
<AF25BC08 page="32" size="1024" spicmd="95"/>
<AF25BC16 page="32" size="2048" spicmd="95"/>
<AF25BC32 page="32" size="4096" spicmd="95"/>
<AF25BC64 page="32" size="8192" spicmd="95"/>
<AF25BC128 page="64" size="16384" spicmd="95"/>
<AF25BC256 page="64" size="32768" spicmd="95"/>
</APLUS>
<Boya>
<BY25D80 id="684014" page="256" size="1048576"/>
</Boya>
<CATALYST_CSI>
<CAT25010 page="16" size="128" spicmd="95"/>
<CAT25020 page="16" size="256" spicmd="95"/>
<CAT25040 page="16" size="512" spicmd="95"/>
<CAT25080 page="32" size="1024" spicmd="95"/>
<CAT25160 page="32" size="2048" spicmd="95"/>
<CAT25320 page="32" size="4096" spicmd="95"/>
<CAT25640 page="64" size="8192" spicmd="95"/>
<CAT25128 page="64" size="16384" spicmd="95"/>
<CAT25256 page="64" size="32768" spicmd="95"/>
<CAT25C01 page="16" size="128" spicmd="95"/>
<CAT25C02 page="16" size="256" spicmd="95"/>
<CAT25C03 page="16" size="256" spicmd="95"/>
<CAT25C04 page="16" size="512" spicmd="95"/>
<CAT25C05 page="16" size="512" spicmd="95"/>
<CAT25C08 page="32" size="1024" spicmd="95"/>
<CAT25C09 page="32" size="1024" spicmd="95"/>
<CAT25C16 page="32" size="2048" spicmd="95"/>
<CAT25C17 page="32" size="2048" spicmd="95"/>
<CAT25C32 page="32" size="4096" spicmd="95"/>
<CAT25C33 page="32" size="4096" spicmd="95"/>
<CAT25C64 page="64" size="8192" spicmd="95"/>
<CAT25C65 page="64" size="8192" spicmd="95"/>
<CAT25C128 page="64" size="16384" spicmd="95"/>
<CAT25C256 page="64" size="32768" spicmd="95"/>
</CATALYST_CSI>
<EON>
<EN25B05 id="1C2010" page="256" size="65536"/>
<EN25B05T id="1C2010" page="256" size="65536"/>
<EN25B10 id="1C2011" page="256" size="131072"/>
<EN25B10T id="1C2011" page="256" size="131072"/>
<EN25B20 id="1C2012" page="256" size="262144"/>
<EN25B20T id="1C2012" page="256" size="262144"/>
<EN25B40 id="1C2013" page="256" size="524288"/>
<EN25B40T id="1C2013" page="256" size="524288"/>
<EN25B80 id="1C2014" page="256" size="1048576"/>
<EN25B80T id="1C2014" page="256" size="1048576"/>
<EN25B16 id="1C2015" page="256" size="2097152"/>
<EN25B16T id="1C2015" page="256" size="2097152"/>
<EN25B32 id="1C2016" page="256" size="4194304"/>
<EN25B32T id="1C2016" page="256" size="4194304"/>
<EN25B64 id="1C2017" page="256" size="8388608"/>
<EN25B64T id="1C2017" page="256" size="8388608"/>
<EN25F05 id="1C3110" otp="240" page="256" size="65536"/>
<EN25F10 id="1C3111" otp="496" page="256" size="131072"/>
<EN25F20 id="1C3112" otp="1008" page="256" size="262144"/>
<EN25F40 id="1C3113" otp="2032" page="256" size="524288"/>
<EN25F80 id="1C3114" otp="4080" page="256" size="1048576"/>
<EN25F16 id="1C3115" otp="8176" page="256" size="2097152"/>
<EN25F32 id="1C3116" otp="16368" page="256" size="4194304"/>
<EN25LF05 id="1C3110" page="256" size="65536"/>
<EN25LF10 id="1C3111" page="256" size="131072"/>
<EN25LF20 id="1C3112" page="256" size="262144"/>
<EN25LF40 id="1C3113" page="256" size="524288"/>
<EN25P05 id="1C2010" page="256" size="65536"/>
<EN25P10 id="1C2011" page="256" size="131072"/>
<EN25P20 id="1C2012" page="256" size="262144"/>
<EN25P40 id="1C2013" page="256" size="524288"/>
<EN25P80 id="1C2014" page="256" size="1048576"/>
<EN25P16 id="1C2015" page="256" size="2097152"/>
<EN25P32 id="1C2016" page="256" size="4194304"/>
<EN25P64 id="1C2017" page="256" size="8388608"/>
<EN25Q40 id="1C3013" otp="2032" page="256" size="524288"/>
<EN25Q80A id="1C3014" otp="4080" page="256" size="1048576"/>
<EN25Q16A id="1C3015" otp="8176" page="256" size="2097152"/>
<EN25Q32A id="1C3016" otp="16368" page="256" size="4194304"/>
<EN25Q32A id="1C7016" otp="16368" page="256" size="4194304"/>
<EN25Q32B id="1C3016" otp="16368" page="256" size="4194304"/>
<EN25Q64 id="1C3017" otp="32752" page="256" size="8388608"/>
<EN25Q128 id="1C3018" otp="65520" page="256" size="16777216"/>
<EN25QH16 id="1C7015" otp="8176" page="256" size="2097152"/>
<EN25QH32 id="1C7016" otp="16368" page="256" size="4194304"/>
<EN25QH64 id="1C7017" otp="32752" page="256" size="8388608"/>
<EN25QH128 id="1C7018" otp="65520" page="256" size="16777216"/>
<EN25QH256 id="1C7019" otp="0" page="256" size="33554432"/>
<EN25T80 id="1C5114" otp="4080" page="256" size="1048576"/>
<EN25T16 id="1C5115" otp="8176" page="256" size="2097152"/>
<EN25F64 id="1C3117" otp="32752" page="256" size="8388608"/>
</EON>
<PMC>
<PM25LD256C id="9D2F" page="256" size="32768"/>
<PM25LD512 id="9D20" page="256" size="65536"/>
<PM25LD512C id="9D20" page="256" size="65536"/>
<PM25LD010 id="9D21" page="256" size="131072"/>
<PM25LD010C id="9D21" page="256" size="131072"/>
<PM25LD020 id="9D22" page="256" size="262144"/>
<PM25LD020C id="9D22" page="256" size="262144"/>
<PM25LD040 id="9D7E" page="256" size="524288"/>
<PM25LD040C id="9D7E" page="256" size="524288"/>
<PM25LV512 id="9D7B" page="256" size="65536"/>
<PM25LV512A id="9D7B" page="256" size="65536"/>
<PM25LV010 id="9D7C" page="256" size="131072"/>
<PM25LV010A id="9D7C" page="256" size="131072"/>
<PM25LV020 id="9D7D" page="256" size="262144"/>
<PM25LV040 id="9D7E" page="256" size="524288"/>
<PM25LV080B id="9D13" page="256" size="1048576"/>
<PM25LV016B id="9D14" page="256" size="2097152"/>
<PM25WD020 id="9D32" page="256" size="262144"/>
<PM25WD040 id="9D33" page="256" size="524288"/>
</PMC>
<PFLASH>
<Pm25LV010 id="7F9D7C" page="256" size="131072"/>
<Pm25LD010 id="7F9D21" page="256" size="131072"/>
<Pm25LV020 id="7F9D22" page="256" size="262144"/>
<Pm25W020 id="7F9D7D" page="256" size="262144"/>
</PFLASH>
<TERRA>
<TS25L512A id="373010" page="256" size="65536"/>
<TS25L010A id="373011" page="256" size="131072"/>
<TS25L020A id="373012" page="256" size="262144"/>
<TS25L16AP id="202015" page="256" size="2097152"/>
<TS25L16BP id="202015" page="256" size="2097152"/>
<ZP25L16P id="202015" page="256" size="2097152"/>
<TS25L16PE id="208015" page="256" size="2097152"/>
<TS25L80PE id="208014" page="256" size="1048576"/>
<TS25L032A id="373016" page="256" size="4194304"/>
<TS25L40P id="202013" page="256" size="524288"/>
</TERRA>
<Generalplus>
<GPR25L005E id="C22010" page="256" size="65536"/>
<GPR25L161B id="C22015" page="256" size="262144"/>
<GPR25L020B id="C22012" page="256" size="262144"/>
</Generalplus>
<DEUTRON>
<AC25LV512 id="9D7B00" page="256" size="65536"/>
<AC25LV010 id="9D7C00" page="256" size="131072"/>
</DEUTRON>
<EFST>
<EM25LV512 id="9D7B00" page="256" size="65536"/>
<EM25LV010 id="9D7C00" page="256" size="131072"/>
<F25L004A id="8C2013" page="256" size="524288"/>
<F25L008A id="8C2014" page="256" size="1048576"/>
<F25L016A id="8C2015" page="256" size="2097152"/>
<F25L04UA id="8C8C8C" page="256" size="524288"/>
<F25L04P id="8C2013" page="256" size="524288"/>
<F25S04P id="8C3013" page="256" size="524288"/>
<F25L08P id="8C2014" page="256" size="1048576"/>
<F25L16P id="8C2015" page="256" size="2097152"/>
<F25L32P id="8C2016" page="256" size="4194304"/>
<F25L32Q id="8C4016" page="256" size="4194304"/>
</EFST>
<EXCELSEMI>
<ES25P10 id="4A2011" page="256" size="131072"/>
<ES25P20 id="4A2012" page="256" size="262144"/>
<ES25P40 id="4A2013" page="256" size="524288"/>
<ES25P80 id="4A2014" page="256" size="1048576"/>
<ES25P16 id="4A2015" page="256" size="2097152"/>
<ES25P32 id="4A2016" page="256" size="4194304"/>
<ES25M40A id="4A3213" page="256" size="524288"/>
<ES25M80A id="4A3214" page="256" size="1048576"/>
<ES25M16A id="4A3215" page="256" size="2097152"/>
</EXCELSEMI>
<FIDELIX>
<FM25Q08A id="F83214" page="256" size="1048576"/>
<FM25Q16A id="F83215" page="256" size="2097152"/>
<FM25Q16B id="F83215" page="256" size="2097152"/>
<FM25Q32A id="F83216" page="256" size="4194304"/>
<FM25Q64A id="F83217" page="256" size="8388608"/>
</FIDELIX>
<GIANTEC>
<GT25C01 page="8" size="128" spicmd="95"/>
<GT25C02 page="8" size="256" spicmd="95"/>
<GT25C04 page="8" size="512" spicmd="95"/>
<GT25C08 page="32" size="1024" spicmd="95"/>
<GT25C16 page="32" size="2048" spicmd="95"/>
<GT25C32 page="32" size="4096" spicmd="95"/>
<GT25C32A page="32" size="4096" spicmd="95"/>
<GT25C64 page="32" size="8192" spicmd="95"/>
<GT25C128 page="64" size="16384" spicmd="95"/>
<GT25C128A page="64" size="16384" spicmd="95"/>
<GT25C256 page="64" size="32768" spicmd="95"/>
</GIANTEC>
<GIGADEVICE>
<GD25D40 id="C83013" page="256" size="524288"/>
<GD25D80 id="C83014" page="256" size="1048576"/>
<GD25F40 id="C82013" page="256" size="524288"/>
<GD25F80 id="C82014" page="256" size="1048576"/>
<GD25Q512 id="C84010" page="256" size="65536"/>
<GD25Q10 id="C84011" page="256" size="131072"/>
<GD25Q20 id="C84012" page="256" size="262144"/>
<GD25Q40 id="C84013" page="256" size="524288"/>
<GD25Q80 id="C84014" page="256" size="1048576"/>
<GD25Q80B id="C84014" page="256" size="1048576"/>
<GD25Q16 id="C84015" page="256" size="2097152"/>
<GD25Q16B id="C84015" page="256" size="2097152"/>
<GD25Q32 id="C84016" page="256" size="4194304"/>
<GD25Q32B id="C84016" page="256" size="4194304"/>
<GD25Q64 id="C84017" page="256" size="8388608"/>
<GD25Q64B id="C84017" page="256" size="8388608"/>
<GD25Q128B id="C84018" page="256" size="16777216"/>
<GD25Q128C id="C84018" page="256" size="16777216"/>
<GD25LQ128C_1.8V id="C86018" page="256" size="16777216"/>
<GD25LQ256C_1.8V id="C86019" page="256" size="33554432"/>
<MD25T80 id="C83114" page="256" size="1048576"/>
<MD25D20 id="514012" page="256" size="262144"/>
<MD25D40 id="514013" page="256" size="524288"/>
<MD25D80 id="514014" page="256" size="1048576"/>
<MD25D16 id="514015" page="256" size="2097152"/>
</GIGADEVICE>
<ICE>
<ICE25P05 id="1C2010" page="128" size="65536"/>
</ICE>
<ICMIC>
<X25020 page="4" size="256" spicmd="95"/>
<X25021 page="4" size="256" spicmd="95"/>
<X25040 page="4" size="512" spicmd="95"/>
<X25041 page="4" size="512" spicmd="95"/>
<X25080 page="32" size="1024" spicmd="95"/>
<X25128 page="32" size="16384" spicmd="95"/>
<X25160 page="32" size="2048" spicmd="95"/>
<X25170 page="32" size="2048" spicmd="95"/>
<X25320 page="32" size="4096" spicmd="95"/>
<X25330 page="32" size="4096" spicmd="95"/>
<X25640 page="32" size="8192" spicmd="95"/>
<X25642 page="32" size="8192" spicmd="95"/>
<X25650 page="32" size="8192" spicmd="95"/>
</ICMIC>
<INTEGRAL>
<IN25AA020 page="16" size="256" spicmd="95"/>
<IN25AA040 page="16" size="512" spicmd="95"/>
<IN25AA080 page="16" size="1024" spicmd="95"/>
<IN25AA160 page="16" size="2048" spicmd="95"/>
</INTEGRAL>
<INTEL>
<QB25F016S33B id="898911" page="256" size="2097152"/>
<QB25F160S33B id="898911" page="256" size="2097152"/>
<QB25F320S33B id="898912" page="256" size="4194304"/>
<QB25F640S33B id="898913" page="256" size="8388608"/>
<QH25F016S33B id="898911" page="256" size="2097152"/>
<QH25F160S33B id="898911" page="256" size="2097152"/>
<QH25F320S33B id="898912" page="256" size="4194304"/>
</INTEL>
<ISSI>
<IS25C01 page="8" size="128" spicmd="95"/>
<IS25C02 page="16" size="256" spicmd="95"/>
<IS25C04 page="16" size="512" spicmd="95"/>
<IS25C08 page="16" size="1024" spicmd="95"/>
<IS25C16 page="16" size="2048" spicmd="95"/>
<IS25C32 page="32" size="4096" spicmd="95"/>
<IS25C32A page="32" size="4096" spicmd="95"/>
<IS25C64 page="64" size="8192" spicmd="95"/>
<IS25C128 page="64" size="16384" spicmd="95"/>
<IS25C256 page="64" size="32768" spicmd="95"/>
</ISSI>
<KHIC>
<KH25L1005 id="C22011" page="256" size="131072"/>
<KH25L1005A id="C22011" page="256" size="131072"/>
<KH25L2005 id="C22012" page="256" size="262144"/>
<KH25L4005 id="C22013" page="256" size="524288"/>
<KH25L4005A id="C22013" page="256" size="524288"/>
<KH25L512 id="C22010" page="256" size="65536"/>
<KH25L512A id="C22010" page="256" size="65536"/>
<KH25L8005 id="C22014" page="256" size="1048576"/>
<KH25L8036D id="C22615" page="256" size="1048576"/>
</KHIC>
<MACRONIX>
<MX25L1005 id="C22011" page="256" size="131072"/>
<MX25L1005A id="C22011" page="256" size="131072"/>
<MX25L1005C id="C22011" page="256" size="131072"/>
<MX25L1006E id="C22011" page="256" size="131072"/>
<MX25L1021E id="C22211" page="32" size="131072"/>
<MX25L1025C id="C22011" page="256" size="131072"/>
<MX25L1026E id="C22011" page="256" size="131072"/>
<MX25L12805D id="C22018" page="256" size="16777216"/>
<MX25L12835E id="C22018" page="256" size="16777216"/>
<MX25L12835F id="C22018" page="256" size="16777216"/>
<MX25L12836E id="C22018" page="256" size="16777216"/>
<MX25L12839F id="C22018" page="256" size="16777216"/>
<MX25L12845E id="C22018" page="256" size="16777216"/>
<MX25L12845G id="C22018" page="256" size="16777216"/>
<MX25L12845F id="C22018" page="256" size="16777216"/>
<MX25L12865E id="C22018" page="256" size="16777216"/>
<MX25L12865F id="C22018" page="256" size="16777216"/>
<MX25L12873F id="C22018" page="256" size="16777216"/>
<MX25L12875F id="C22018" page="256" size="16777216"/>
<MX25L25635E id="C22019" page="256" size="33554432"/>
<MX25L1605 id="C22015" page="256" size="2097152"/>
<MX25L1605A id="C22015" page="256" size="2097152"/>
<MX25L1605D id="C22015" page="256" size="2097152"/>
<MX25L1606E id="C22015" page="256" size="2097152"/>
<MX25L1633E id="C22415" page="256" size="2097152"/>
<MX25L1635D id="C22415" page="256" size="2097152"/>
<MX25L1635E id="C22515" page="256" size="2097152"/>
<MX25L1636D id="C22415" page="256" size="2097152"/>
<MX25L1636E id="C22515" page="256" size="2097152"/>
<MX25L1673E id="C22415" page="256" size="2097152"/>
<MX25L1675E id="C22415" page="256" size="2097152"/>
<MX25L2005 id="C22012" page="256" size="262144"/>
<MX25L2005C id="C22012" page="256" size="262144"/>
<MX25L2006E id="C22012" page="256" size="262144"/>
<MX25L2026C id="C22012" page="256" size="262144"/>
<MX25L2026E id="C22012" page="256" size="262144"/>
<MX25L3205 id="C22016" page="256" size="4194304"/>
<MX25L3205A id="C22016" page="256" size="4194304"/>
<MX25L3205D id="C22016" page="256" size="4194304"/>
<MX25L3206E id="C22016" page="256" size="4194304"/>
<MX25L3208E id="C22016" page="256" size="4194304"/>
<MX25L3225D id="C25E16" page="256" size="4194304"/>
<MX25L3233F id="C22016" page="256" size="4194304"/>
<MX25L3235D id="C25E16" page="256" size="4194304"/>
<MX25L3235E id="C22016" page="256" size="4194304"/>
<MX25L3236D id="C25E16" page="256" size="4194304"/>
<MX25L3237D id="C25E16" page="256" size="4194304"/>
<MX25L3239E id="C22536" page="256" size="4194304"/>
<MX25L3273E id="C22016" page="256" size="4194304"/>
<MX25L3273F id="C22016" page="256" size="4194304"/>
<MX25L3275E id="C22016" page="256" size="4194304"/>
<MX25L4005 id="C22013" page="256" size="524288"/>
<MX25L4005A id="C22013" page="256" size="524288"/>
<MX25L4005C id="C22013" page="256" size="524288"/>
<MX25L4006E id="C22013" page="256" size="524288"/>
<MX25L4026E id="C22013" page="256" size="524288"/>
<MX25L512 id="C22010" page="256" size="65536"/>
<MX25L512A id="C22010" page="256" size="65536"/>
<MX25L512C id="C22010" page="256" size="65536"/>
<MX25L5121E id="C22210" page="32" size="65536"/>
<MX25L6405 id="C22017" page="256" size="8388608"/>
<MX25L6405D id="C22017" page="256" size="8388608"/>
<MX25L6406E id="C22017" page="256" size="8388608"/>
<MX25L6408E id="C22017" page="256" size="8388608"/>
<MX25L6433F id="C22017" page="256" size="8388608"/>
<MX25L6435E id="C22017" page="256" size="8388608"/>
<MX25L6436E id="C22017" page="256" size="8388608"/>
<MX25L6439E id="C22537" page="256" size="8388608"/>
<MX25L6445E id="C22017" page="256" size="8388608"/>
<MX25L6465E id="C22017" page="256" size="8388608"/>
<MX25L6473E id="C22017" page="256" size="8388608"/>
<MX25L6473F id="C22017" page="256" size="8388608"/>
<MX25L6475E id="C22017" page="256" size="8388608"/>
<MX25L8005 id="C22014" page="256" size="1048576"/>
<MX25L8006E id="C22014" page="256" size="1048576"/>
<MX25L8008E id="C22014" page="256" size="1048576"/>
<MX25L8035E id="C22014" page="256" size="1048576"/>
<MX25L8036E id="C22014" page="256" size="1048576"/>
<MX25L8073E id="C22014" page="256" size="1048576"/>
<MX25L8075E id="C22014" page="256" size="1048576"/>
<MX25R512F id="C22810" page="256" size="65536"/>
<MX25R1035F id="C22811" page="256" size="131072"/>
<MX25R1635F id="C22815" page="256" size="2097152"/>
<MX25R2035F id="C22812" page="256" size="262144"/>
<MX25R3235F id="C22816" page="256" size="4194304"/>
<MX25R4035F id="C22813" page="256" size="524288"/>
<MX25R6435F id="C22817" page="256" size="8388608"/>
<MX25R8035F id="C22814" page="256" size="1048576"/>
<MX25U1001E_1.8V id="C22531" page="256" size="131072"/>
<MX25U12835F_1.8V id="C22518" page="256" size="16777216"/>
<MX25U1635E_1.8V id="C22535" page="256" size="2097152"/>
<MX25U1635F_1.8V id="C22535" page="256" size="2097152"/>
<MX25U2032E_1.8V id="C22532" page="256" size="262144"/>
<MX25U2033E_1.8V id="C22532" page="256" size="262144"/>
<MX25U3235E_1.8V id="C22536" page="256" size="4194304"/>
<MX25U3235F_1.8V id="C22536" page="256" size="4194304"/>
<MX25U4032E_1.8V id="C22533" page="256" size="524288"/>
<MX25U4033E_1.8V id="C22533" page="256" size="524288"/>
<MX25U4035_1.8V id="C22533" page="256" size="524288"/>
<MX25U5121E_1.8V id="C22530" page="256" size="65536"/>
<MX25U6435F_1.8V id="C22537" page="256" size="8388608"/>
<MX25U6473F_1.8V id="C22537" page="256" size="8388608"/>
<MX25U8032E_1.8V id="C22534" page="256" size="1048576"/>
<MX25U8033E_1.8V id="C22534" page="256" size="1048576"/>
<MX25U8035_1.8V id="C22534" page="256" size="1048576"/>
<MX25U8035E_1.8V id="C22534" page="256" size="1048576"/>
<MX25V1006E id="C22011" page="256" size="131072"/>
<MX25V1035F id="C22311" page="256" size="131072"/>
<MX25V2006E id="C22012" page="256" size="262144"/>
<MX25V2035F id="C22312" page="256" size="262144"/>
<MX25V512 id="C22010" page="256" size="65536"/>
<MX25V512C id="C22010" page="256" size="65536"/>
<MX25V512E id="C22010" page="256" size="65536"/>
<MX25V512F id="C22310" page="256" size="65536"/>
<MX25V4005 id="C22013" page="256" size="524288"/>
<MX25V4006E id="C22013" page="256" size="524288"/>
<MX25V4035 id="C22553" page="256" size="524288"/>
<MX25V4035F id="C22313" page="256" size="524288"/>
<MX25V8005 id="C22014" page="256" size="1048576"/>
<MX25V8006E id="C22014" page="256" size="1048576"/>
<MX25V8035 id="C22554" page="256" size="1048576"/>
<MX25V8035F id="C22314" page="256" size="1048576"/>
<MX66U51235F_1.8V id="C2253A" page="256" size="67108864"/>
<MX66U1G45G_1.8V id="C2253B" page="256" size="134217728"/>
</MACRONIX>
<MICROCHIP>
<_25AA010A page="16" size="128" spicmd="95"/>
<_25AA020A page="16" size="256" spicmd="95"/>
<_25AA040 page="16" size="512" spicmd="95"/>
<_25AA040A page="16" size="512" spicmd="95"/>
<_25AA080 page="16" size="1024" spicmd="95"/>
<_25AA080A page="16" size="1024" spicmd="95"/>
<_25AA080B page="32" size="1024" spicmd="95"/>
<_25AA080C page="16" size="1024" spicmd="95"/>
<_25AA080D page="32" size="1024" spicmd="95"/>
<_25AA1024 page="256" size="131072" spicmd="95"/>
<_25AA128 page="64" size="16384" spicmd="95"/>
<_25AA160 page="16" size="2048" spicmd="95"/>
<_25AA160A page="16" size="2048" spicmd="95"/>
<_25AA160B page="32" size="2048" spicmd="95"/>
<_25AA256 page="64" size="32768" spicmd="95"/>
<_25AA320 page="32" size="4096" spicmd="95"/>
<_25AA512 page="128" size="65536" spicmd="95"/>
<_25AA640 page="32" size="8192" spicmd="95"/>
<_25C040 page="16" size="512" spicmd="95"/>
<_25C080 page="16" size="1024" spicmd="95"/>
<_25C160 page="16" size="2048" spicmd="95"/>
<_25C320 page="32" size="4096" spicmd="95"/>
<_25C640 page="32" size="8192" spicmd="95"/>
<_25LC010A page="16" size="128" spicmd="95"/>
<_25LC020A page="16" size="256" spicmd="95"/>
<_25LC040 page="16" size="512" spicmd="95"/>
<_25LC040A page="16" size="512" spicmd="95"/>
<_25LC080 page="16" size="1024" spicmd="95"/>
<_25LC080A page="16" size="1024" spicmd="95"/>
<_25LC080B page="32" size="1024" spicmd="95"/>
<_25LC080C page="16" size="1024" spicmd="95"/>
<_25LC080D page="32" size="1024" spicmd="95"/>
<_25LC1024 page="256" size="131072" spicmd="95"/>
<_25LC128 page="64" size="16384" spicmd="95"/>
<_25LC160 page="16" size="2048" spicmd="95"/>
<_25LC160A page="16" size="2048" spicmd="95"/>
<_25LC160B page="32" size="2048" spicmd="95"/>
<_25LC256 page="64" size="32768" spicmd="95"/>
<_25LC320 page="32" size="4096" spicmd="95"/>
<_25LC512 page="128" size="65536" spicmd="95"/>
<_25LC640 page="32" size="8192" spicmd="95"/>
</MICROCHIP>
<MICRON>
<N25Q032A id="20BA16" page="256" size="4194304"/>
<N25Q064A id="20BA17" page="256" size="8388608"/>
<N25Q256A13 id="20BA19" page="256" size="33554432"/>
<N25Q512A83 id="20BA20" page="256" size="67108864"/>
<N25W256A11 id="2CCB19" page="256" size="33554432"/>
<MT25QL128AB id="20BA18" page="256" size="16777216"/>
<MT25QL256A id="20BA19" page="256" size="33554432"/>
<MT25QL512A id="20BA20" page="256" size="67108864"/>
<MT25QL02GC id="20BA22" page="256" size="268435456"/>
<N25Q00AA13G id="20BA21" page="256" size="134217728"/>
</MICRON>
<MSHINE>
<MS25X512 id="373010" page="256" size="65536"/>
<MS25X10 id="373011" page="256" size="131072"/>
<MS25X20 id="373012" page="256" size="262144"/>
<MS25X40 id="373013" page="256" size="524288"/>
<MS25X80 id="373014" page="256" size="1048576"/>
<MS25X16 id="373015" page="256" size="2097152"/>
<MS25X32 id="373016" page="256" size="4194304"/>
</MSHINE>
<NANTRONICS>
<N25S10 id="D53011" page="256" size="131072"/>
<N25S20 id="D53012" page="256" size="262144"/>
<N25S40 id="D53013" page="256" size="524288"/>
<N25S16 id="D53015" page="256" size="2097152"/>
<N25S32 id="D53016" page="256" size="4194304"/>
<N25S80 id="D53014" page="256" size="1048576"/>
</NANTRONICS>
<NEXFLASH>
<NX25P10 id="9D7F7C" page="256" size="131072"/>
<NX25P16 id="EF2015" page="256" size="2097152"/>
<NX25P20 id="9D7F7D" page="256" size="262144"/>
<NX25P32 id="EF2016" page="256" size="4194304"/>
<NX25P40 id="9D7F7E" page="256" size="524288"/>
<NX25P80 id="9D7F13" page="256" size="1048576"/>
</NEXFLASH>
<NUMONYX>
<M25P05 id="202010" page="128" size="65536"/>
<M25P05A id="202010" page="256" size="65536"/>
<M25P10 id="202011" page="128" size="131072"/>
<M25P10A id="202011" page="256" size="131072"/>
<M25P20 id="202012" page="256" size="262144"/>
<M25P40 id="202013" page="256" size="524288"/>
<M25P80 id="202014" page="256" size="1048576"/>
<M25P16 id="202015" page="256" size="2097152"/>
<M25P32 id="202016" page="256" size="4194304"/>
<M25P64 id="202017" page="256" size="8388608"/>
<M25P128_ST25P28V6G id="202018" page="256" size="16777216"/>
<M25PE10 id="208011" page="256" size="131072"/>
<M25PE16 id="208015" page="256" size="2097152"/>
<M25PE20 id="208012" page="256" size="262144"/>
<M25PE40 id="208013" page="256" size="524288"/>
<M25PE80 id="208014" page="256" size="1048576"/>
</NUMONYX>
<PCT>
<PCT25LF020A id="BF4300" page="256" size="262144"/>
<PCT25VF010A id="BF4900" page="256" size="131072"/>
<PCT25VF016B id="BF2541" page="256" size="2097152"/>
<PCT25VF020A id="BF4300" page="256" size="262144"/>
<PCT25VF032B id="BF254A" page="256" size="4194304"/>
<PCT25VF040A id="BF4400" page="256" size="524288"/>
<PCT25VF040B id="BF258D" page="256" size="524288"/>
<PCT25VF080B id="BF258E" page="256" size="1048576"/>
</PCT>
<RAMTRON>
<FM25040 page="32" size="512" spicmd="95"/>
<FM25C160 page="32" size="2048" spicmd="95"/>
<FM25640 page="32" size="8192" spicmd="95"/>
<FM25CL04 page="32" size="512" spicmd="95"/>
<FM25CL64 page="32" size="8192" spicmd="95"/>
<FM25L16 page="32" size="2048" spicmd="95"/>
<FM25L256 page="32" size="32768" spicmd="95"/>
<FM25L512 page="32" size="65536" spicmd="95"/>
<FM25W256 page="32" size="32768" spicmd="95"/>
</RAMTRON>
<RENESAS>
<HN58X2502 page="16" size="256" spicmd="95"/>
<HN58X2504 page="16" size="512" spicmd="95"/>
<HN58X2508 page="16" size="1024" spicmd="95"/>
<HN58X25128 page="64" size="16384" spicmd="95"/>
<HN58X2516 page="16" size="2048" spicmd="95"/>
<HN58X25256 page="64" size="32768" spicmd="95"/>
<HN58X2532 page="32" size="4096" spicmd="95"/>
<HN58X2564 page="32" size="8192" spicmd="95"/>
<R1EX25002A page="16" size="256" spicmd="95"/>
<R1EX25004A page="16" size="512" spicmd="95"/>
<R1EX25008A page="16" size="1024" spicmd="95"/>
<R1EX25016A page="16" size="2048" spicmd="95"/>
<R1EX25032A page="32" size="4096" spicmd="95"/>
<R1EX25064A page="32" size="8192" spicmd="95"/>
</RENESAS>
<ROHM>
<BR25010 page="16" size="128" spicmd="95"/>
<BR25020 page="16" size="256" spicmd="95"/>
<BR25040 page="16" size="512" spicmd="95"/>
<BR25080 page="16" size="1024" spicmd="95"/>
<BR25160 page="16" size="2048" spicmd="95"/>
<BR25320 page="32" size="4096" spicmd="95"/>
<BR25H010 page="16" size="128" spicmd="95"/>
<BR25H020 page="16" size="256" spicmd="95"/>
<BR25H040 page="16" size="512" spicmd="95"/>
<BR25H080 page="16" size="1024" spicmd="95"/>
<BR25H160 page="16" size="2048" spicmd="95"/>
<BR25H320 page="32" size="4096" spicmd="95"/>
<BR25L010 page="16" size="128" spicmd="95"/>
<BR25L010 page="16" size="128" spicmd="95"/>
<BR25L020 page="16" size="256" spicmd="95"/>
<BR25L040 page="16" size="512" spicmd="95"/>
<BR25L080 page="16" size="1024" spicmd="95"/>
<BR25L160 page="16" size="2048" spicmd="95"/>
<BR25L320 page="32" size="4096" spicmd="95"/>
<BR25L640 page="32" size="8192" spicmd="95"/>
<BR25S320 page="32" size="4096" spicmd="95"/>
<BR25S640 page="32" size="8192" spicmd="95"/>
<BR25S128 page="64" size="16384" spicmd="95"/>
<BR25S256 page="64" size="32768" spicmd="95"/>
<BR95010 page="8" size="128" spicmd="95"/>
<BR95020 page="8" size="256" spicmd="95"/>
<BR95040 page="8" size="512" spicmd="95"/>
<BR95080 page="32" size="1024" spicmd="95"/>
<BR95160 page="32" size="2048" spicmd="95"/>
</ROHM>
<SAIFUN>
<SA25C1024H page="128" size="131072" spicmd="95"/>
<SA25C1024L page="128" size="131072" spicmd="95"/>
<SA25C512H page="128" size="65536" spicmd="95"/>
<SA25C512L page="128" size="65536" spicmd="95"/>
</SAIFUN>
<SANYO>
<LE25FU106BMA id="621D" page="256" size="131072"/>
<LE25FU206MA id="6244" page="256" size="262144"/>
<LE25FU406BMA id="621E" page="256" size="524288"/>
<LE25FW206M id="6226" page="256" size="262144"/>
<LE25FW406M id="6207" page="256" size="524288"/>
<LE25FW406AM id="621A" page="256" size="524288"/>
<LE25FW806M id="6226" page="256" size="1048576"/>
</SANYO>
<SEIKO>
<S-25A010A page="8" size="128" spicmd="95"/>
<S-25A020A page="8" size="256" spicmd="95"/>
<S-25A040A page="8" size="512" spicmd="95"/>
<S-25A080A page="32" size="1024" spicmd="95"/>
<S-25A160A page="32" size="2048" spicmd="95"/>
<S-25A320A page="32" size="4096" spicmd="95"/>
<S-25A640A page="32" size="8192" spicmd="95"/>
<S-25C010A page="8" size="128" spicmd="95"/>
<S-25C020A page="8" size="256" spicmd="95"/>
<S-25C040A page="8" size="512" spicmd="95"/>
<S-25C080A page="32" size="1024" spicmd="95"/>
<S-25C160A page="32" size="2048" spicmd="95"/>
<S-25C320A page="32" size="4096" spicmd="95"/>
<S-25C640A page="32" size="8192" spicmd="95"/>
</SEIKO>
<SIEMENS>
<SLA25010 page="16" size="128" spicmd="95"/>
<SLA25020 page="16" size="256" spicmd="95"/>
<SLA25040 page="16" size="512" spicmd="95"/>
<SLA25080 page="32" size="1024" spicmd="95"/>
<SLA25160 page="32" size="2048" spicmd="95"/>
<SLA25320 page="32" size="4096" spicmd="95"/>
<SLE25010 page="16" size="128" spicmd="95"/>
<SLE25020 page="16" size="256" spicmd="95"/>
<SLE25040 page="16" size="512" spicmd="95"/>
<SLE25080 page="32" size="1024" spicmd="95"/>
<SLE25160 page="32" size="2048" spicmd="95"/>
<SLE25320 page="32" size="4096" spicmd="95"/>
</SIEMENS>
<SPANSION>
<S25FL001D id="010210" page="256" size="131072"/>
<S25FL002D id="010211" page="256" size="262144"/>
<S25FL004A id="010212" page="256" size="524288"/>
<S25FL004D id="010212" page="256" size="524288"/>
<S25FL004K id="EF4013" page="256" size="524288"/>
<S25FL008A id="010213" page="256" size="1048576"/>
<S25FL008D id="010213" page="256" size="1048576"/>
<S25FL008K id="EF4014" page="256" size="1048576"/>
<S25FL016A id="010214" page="256" size="2097152"/>
<S25FL016K id="EF4015" page="256" size="2097152"/>
<S25FL032A id="010215" page="256" size="4194304"/>
<S25FL032K id="EF4016" page="256" size="4194304"/>
<S25FL032P id="010215" page="256" size="4194304"/>
<S25FL040A id="010212" page="256" size="524288"/>
<S25FL040A_BOT id="010226" page="256" size="524288"/>
<S25FL040A_TOP id="010225" page="256" size="524288"/>
<S25FL064A id="010216" page="256" size="8388608"/>
<S25FL064K id="EF4017" page="256" size="8388608"/>
<S25FL064P id="010216" page="256" size="8388608"/>
<S25FL116K id="014015" page="256" size="2097152"/>
<S25FL128K id="EF4018" page="256" size="16777216"/>
<S25FL128P id="012018" page="256" size="16777216"/>
<S25FL128S id="012018" page="256" size="16777216"/>
<S25FL132K id="014016" page="256" size="4194304"/>
<S25FL164K id="014017" page="256" size="8388608"/>
</SPANSION>
<SST>
<SST25LF020A id="BF43" page="SSTB" size="262144"/>
<SST25LF040A id="BF44" page="SSTB" size="524288"/>
<SST25LF080A id="BF80" page="SSTB" size="1048576"/>
<SST25VF010 id="BF49" page="SSTB" size="131072"/>
<SST25VF010A id="BF49" page="SSTB" size="131072"/>
<SST25VF016B id="BF2541" page="SSTW" size="2097152"/>
<SST25VF020 id="BF43" page="SSTB" size="262144"/>
<SST25VF020A id="BF43" page="SSTB" size="262144"/>
<SST25VF020B id="BF258C" page="SSTW" size="262144"/>
<SST25VF032B id="BF254A" page="SSTW" size="4194304"/>
<SST25VF064C id="BF254B" page="256" size="8388608"/>
<SST25VF040 id="BF44" page="SSTB" size="524288"/>
<SST25VF040A id="BF44" page="SSTB" size="524288"/>
<SST25VF040B id="BF258D" page="SSTW" size="524288"/>
<SST25VF080B id="BF258E" page="SSTW" size="1048576"/>
<SST25VF512 id="BF48" page="SSTB" size="65536"/>
<SST25VF512A id="BF48" page="SSTB" size="65536"/>
</SST>
<ST>
<M25C16 page="16" size="2048" spicmd="95"/>
<M25PX16 id="207115" page="256" size="2097152"/>
<M25PX32 id="207116" page="256" size="4194304"/>
<M25PX64 id="207117" page="256" size="8388608"/>
<M25PX80 id="207114" page="256" size="1048576"/>
<M25W16 page="16" size="2048" spicmd="95"/>
<M35080-3 page="32" size="1024" spicmd="95"/>
<M35080-6 page="32" size="1024" spicmd="95"/>
<M35080V6 page="32" size="1024" spicmd="95"/>
<M35080VP page="32" size="1024" spicmd="95"/>
<M95010 page="8" size="128" spicmd="95"/>
<M95010R page="8" size="128" spicmd="95"/>
<M95010W page="8" size="128" spicmd="95"/>
<M95020 page="8" size="256" spicmd="95"/>
<M95020R page="8" size="256" spicmd="95"/>
<M95020W page="8" size="256" spicmd="95"/>
<M95040 page="8" size="512" spicmd="95"/>
<M95040R page="8" size="512" spicmd="95"/>
<M95040W page="8" size="512" spicmd="95"/>
<M95080 page="32" size="1024" spicmd="95"/>
<M95080R page="32" size="1024" spicmd="95"/>
<M95080W page="32" size="1024" spicmd="95"/>
<M95128 page="64" size="16384" spicmd="95"/>
<M95128R page="64" size="16384" spicmd="95"/>
<M95128W page="64" size="16384" spicmd="95"/>
<M95160 page="32" size="2048" spicmd="95"/>
<M95160R page="32" size="2048" spicmd="95"/>
<M95160W page="32" size="2048" spicmd="95"/>
<M95256 page="64" size="32768" spicmd="95"/>
<M95256R page="64" size="32768" spicmd="95"/>
<M95256W page="64" size="32768" spicmd="95"/>
<M95320 page="32" size="4096" spicmd="95"/>
<M95320R page="32" size="4096" spicmd="95"/>
<M95320W page="32" size="4096" spicmd="95"/>
<M95512R page="128" size="65536" spicmd="95"/>
<M95512W page="128" size="65536" spicmd="95"/>
<M95640 page="32" size="8192" spicmd="95"/>
<M95640R page="32" size="8192" spicmd="95"/>
<M95640W page="32" size="8192" spicmd="95"/>
<M95M01R page="256" size="131072" spicmd="95"/>
<M95M01W page="256" size="131072" spicmd="95"/>
<ST25C16 page="16" size="2048" spicmd="95"/>
<ST25P05 id="202010" page="128" size="65536"/>
<ST25P05A id="202010" page="256" size="65536"/>
<ST25P10 id="202011" page="128" size="131072"/>
<ST25P10A id="202011" page="256" size="131072"/>
<ST25P16 id="202015" page="256" size="2097152"/>
<ST25P20 id="202012" page="256" size="262144"/>
<ST25P32 id="202016" page="256" size="4194304"/>
<ST25P40 id="202013" page="256" size="524288"/>
<ST25P64 id="202017" page="256" size="8388608"/>
<ST25P80 id="202014" page="256" size="1048576"/>
</ST>
<WINBOND>
<W25P10 id="EF1000" page="256" size="131072"/>
<W25P16 id="EF2015" page="256" size="2097152"/>
<W25P20 id="EF1100" page="256" size="262144"/>
<W25P32 id="EF2016" page="256" size="4194304"/>
<W25P40 id="EF1200" page="256" size="524288"/>
<W25P64 id="EF2017" page="256" size="8388608"/>
<W25P80 id="EF2014" page="256" size="1048576"/>
<W25Q10EW_1.8V id="EF6011" page="256" size="131072"/>
<W25Q128BV id="EF4018" page="256" size="16777216"/>
<W25Q128FV id="EF4018" page="256" size="16777216"/>
<W25Q256FV id="EF4019" page="256" size="33554432"/>
<W25Q128FW_1.8V id="EF6018" page="256" size="16777216"/>
<W25Q16 id="EF4015" page="256" size="2097152"/>
<W25Q16BV id="EF4015" page="256" size="2097152"/>
<W25Q16CL id="EF4015" page="256" size="2097152"/>
<W25Q16CV id="EF4015" page="256" size="2097152"/>
<W25Q16DV id="EF4015" page="256" size="2097152"/>
<W25Q16FW_1.8V id="EF6015" page="256" size="2097152"/>
<W25Q16V id="EF4015" page="256" size="2097152"/>
<W25Q20CL id="EF4012" page="256" size="262144"/>
<W25Q20EW_1.8V id="EF6012" page="256" size="262144"/>
<W25Q32 id="EF4016" page="256" size="4194304"/>
<W25Q32BV id="EF4016" page="256" size="4194304"/>
<W25Q32FV id="EF4016" page="256" size="4194304"/>
<W25Q32FW_1.8V id="EF6016" page="256" size="4194304"/>
<W25Q32V id="EF4016" page="256" size="4194304"/>
<W25Q40BL id="EF4013" page="256" size="524288"/>
<W25Q40BV id="EF4013" page="256" size="524288"/>
<W25Q40CL id="EF4013" page="256" size="524288"/>
<W25Q40EW_1.8V id="EF6013" page="256" size="524288"/>
<W25Q64BV id="EF4017" page="256" size="8388608"/>
<W25Q64CV id="EF4017" page="256" size="8388608"/>
<W25Q64FV id="EF4017" page="256" size="8388608"/>
<W25Q64FW_1.8V id="EF6017" page="256" size="8388608"/>
<W25Q80BL id="EF4014" page="256" size="1048576"/>
<W25Q80BV id="EF4014" page="256" size="1048576"/>
<W25Q80DV id="EF4014" page="256" size="1048576"/>
<W25Q80EW_1.8V id="EF6014" page="256" size="1048576"/>
<W25X05 id="EF3010" page="256" size="65536"/>
<W25X05CL id="EF3010" page="256" size="65536"/>
<W25X10AV id="EF3011" page="256" size="131072"/>
<W25X10BL id="EF3011" page="256" size="131072"/>
<W25X10BV id="EF3011" page="256" size="131072"/>
<W25X10CL id="EF3011" page="256" size="131072"/>
<W25X10L id="EF3011" page="256" size="131072"/>
<W25X10V id="EF3011" page="256" size="131072"/>
<W25X16 id="EF3015" page="256" size="2097152"/>
<W25X16AL id="EF3015" page="256" size="2097152"/>
<W25X16AV id="EF3015" page="256" size="2097152"/>
<W25X16BV id="EF3015" page="256" size="2097152"/>
<W25X16V id="EF3015" page="256" size="2097152"/>
<W25X20AL id="EF3012" page="256" size="262144"/>
<W25X20AV id="EF3012" page="256" size="262144"/>
<W25X20BL id="EF3012" page="256" size="262144"/>
<W25X20BV id="EF3012" page="256" size="262144"/>
<W25X20CL id="EF3012" page="256" size="262144"/>
<W25X20L id="EF3012" page="256" size="262144"/>
<W25X20V id="EF3012" page="256" size="262144"/>
<W25X32 id="EF3016" page="256" size="4194304"/>
<W25X32AV id="EF3016" page="256" size="4194304"/>
<W25X32BV id="EF3016" page="256" size="4194304"/>
<W25X32V id="EF3016" page="256" size="4194304"/>
<W25X40AL id="EF3013" page="256" size="524288"/>
<W25X40AV id="EF3013" page="256" size="524288"/>
<W25X40BL id="EF3013" page="256" size="524288"/>
<W25X40BV id="EF3013" page="256" size="524288"/>
<W25X40CL id="EF3013" page="256" size="524288"/>
<W25X40L id="EF3013" page="256" size="524288"/>
<W25X40V id="EF3013" page="256" size="524288"/>
<W25X64 id="EF3017" page="256" size="8388608"/>
<W25X64BV id="EF3017" page="256" size="8388608"/>
<W25X64V id="EF3017" page="256" size="8388608"/>
<W25X80AL id="EF3014" page="256" size="1048576"/>
<W25X80AV id="EF3014" page="256" size="1048576"/>
<W25X80BV id="EF3014" page="256" size="1048576"/>
<W25X80L id="EF3014" page="256" size="1048576"/>
<W25X80V id="EF3014" page="256" size="1048576"/>
<W25M512JV id="EF7119" page="256" size="67108864"/>
</WINBOND>
<XICOR>
<X25010 page="4" size="128" spicmd="95"/>
<X25043 page="4" size="512" spicmd="95"/>
<X25045 page="4" size="512" spicmd="95"/>
<X25F008 page="32" size="1024" spicmd="95"/>
<X25F016 page="32" size="2048" spicmd="95"/>
<X25F032 page="32" size="4096" spicmd="95"/>
<X25F064 page="32" size="8192" spicmd="95"/>
<X5043 page="16" size="512" spicmd="95"/>
<X5045 page="16" size="512" spicmd="95"/>
</XICOR>
<ZEMPRO>
<TS25L512A id="372010" page="256" size="65536"/>
<TS25L010A id="373011" page="256" size="131072"/>
<TS25L020A id="373012" page="256" size="262144"/>
<TS25L16AP id="202015" page="256" size="2097152"/>
<TS25L16BP id="202015" page="256" size="2097152"/>
<TS25L16P id="372015" page="256" size="2097152"/>
</ZEMPRO>
<Zbit>
<ZB25D16 id="5E4015" page="256" size="2097152"/>
</Zbit>
<Berg_Micro>
<BG25Q40A id="E04013" page="256" size="524288"/>
<BG25Q80A id="E04014" page="256" size="1048576"/>
<BG25Q16A id="E04015" page="256" size="2097152"/>
<BG25Q32A id="E04016" page="256" size="4194304"/>
</Berg_Micro>
<ATMEL>
<AT45DB021D id="1F2300" page="264" size="270336" spicmd="45"/>
<AT45DB041D id="1F2400" page="264" size="540672" spicmd="45"/>
<AT45DB161D id="1F2600" page="528" size="2162688" spicmd="45"/>
<AT45DB321D id="1F2701" page="528" size="4325376" spicmd="45"/>
<AT25010 page="8" size="128" spicmd="95"/>
<AT25010A page="8" size="128" spicmd="95"/>
<AT25020 page="8" size="256" spicmd="95"/>
<AT25020A page="8" size="256" spicmd="95"/>
<AT25040 page="8" size="512" spicmd="95"/>
<AT25040A page="8" size="512" spicmd="95"/>
<AT25080 page="32" size="1024" spicmd="95"/>
<AT25080A page="32" size="1024" spicmd="95"/>
<AT25080B page="32" size="1024" spicmd="95"/>
<AT25160 page="32" size="2048" spicmd="95"/>
<AT25160A page="32" size="2048" spicmd="95"/>
<AT25160B page="32" size="2048" spicmd="95"/>
<AT25320 page="32" size="4096" spicmd="95"/>
<AT25320A page="32" size="4096" spicmd="95"/>
<AT25320B page="32" size="4096" spicmd="95"/>
<AT25640 page="32" size="8192" spicmd="95"/>
<AT25640A page="32" size="8192" spicmd="95"/>
<AT25640B page="32" size="8192" spicmd="95"/>
<AT25128 page="64" size="16384" spicmd="95"/>
<AT25128A page="64" size="16384" spicmd="95"/>
<AT25128B page="64" size="16384" spicmd="95"/>
<AT25256 page="64" size="32768" spicmd="95"/>
<AT25256A page="64" size="32768" spicmd="95"/>
<AT25256B page="64" size="32768" spicmd="95"/>
<AT25512 page="128" size="65536" spicmd="95"/>
<AT25DF021 id="1F4300" page="256" size="262144"/>
<AT25DF041 id="1F4400" page="256" size="524288"/>
<AT25DF041A id="1F4400" page="256" size="524288"/>
<AT25SF041 id="1F8400" page="256" size="524288"/>
<AT25DF081 id="1F4500" page="256" size="1048576"/>
<AT25DF081A id="1F4500" page="256" size="1048576"/>
<AT25DF161 id="1F4600" page="256" size="2097152"/>
<AT25DF321 id="1F4700" page="256" size="4194304"/>
<AT25DF321A id="1F4700" page="256" size="4194304"/>
<AT25DF641 id="1F4800" page="256" size="8388608"/>
<AT25F512 id="1F65" page="256" size="65536"/>
<AT25F512A id="1F65" page="128" size="65536"/>
<AT25F512B id="1F6500" page="256" size="65536"/>
<AT25F1024 id="1F60" page="256" size="131072"/>
<AT25F1024A id="1F60" page="256" size="131072"/>
<AT25F2048 id="1F63" page="256" size="262144"/>
<AT25F2048A id="1F63" page="256" size="262144"/>
<AT25F4096 id="1F64" page="256" size="524288"/>
<AT25F4096A id="1F64" page="256" size="524288"/>
<AT25HP256 page="128" size="32768" spicmd="95"/>
<AT25HP512 page="128" size="65536" spicmd="95"/>
<AT26DF081 id="1F4500" page="256" size="1048576"/>
<AT26DF081A id="1F4500" page="256" size="1048576"/>
<AT26DF161 id="1F4600" page="256" size="2097152"/>
<AT26DF161A id="1F4600" page="256" size="2097152"/>
<AT26DF321 id="1F4700" page="256" size="4194304"/>
<AT26DF321A id="1F4700" page="256" size="4194304"/>
<AT26F004 id="1F0400" page="256" size="524288"/>
</ATMEL>
<ACE>
<ACE25A128G_1.8V id="E06018" page="256" size="16777216"/>
</ACE>
<ATO>
<ATO25Q32 id="9B3216" page="256" size="4194304"/>
</ATO>
<DOUQI>
<DQ25Q64A id="544017" page="256" size="8388608"/>
</DOUQI>
<Fremont>
<FT25H16 id="0E4015" page="256" size="2097152"/>
</Fremont>
<Fudan>
<FM25Q32 id="A14016" page="256" size="4194304"/>
</Fudan>
<Genitop>
<GT25Q80A id="E04014" page="256" size="1048576"/>
</Genitop>
<Paragon>
<PN25F04A id="E04013" page="256" size="524288"/>
</Paragon>
</SPI>
<I2C>
<_24Cxxx>
<AT24C01 page="1" size="128" addrtype="0"/>
<_24C01 page="1" size="128" addrtype="1"/>
<_24C02 page="1" size="256" addrtype="1"/>
<_24C04 page="1" size="512" addrtype="2"/>
<_24C08 page="16" size="1024" addrtype="3"/>
<_24C16 page="16" size="2048" addrtype="4"/>
<_24C32 page="32" size="4096" addrtype="5"/>
<_24C64 page="32" size="8192" addrtype="5"/>
<_24C128 page="64" size="16384" addrtype="5"/>
<_24C256 page="64" size="32768" addrtype="5"/>
<_24C512 page="128" size="65536" addrtype="5"/>
<_24C1024 page="128" size="131072" addrtype="6"/>
</_24Cxxx>
</I2C>
<MW>
<Microchip>
<M93C86 size="2048" addrbitlen="10"/>
<M93C76 size="1024" addrbitlen="10"/>
<M93C66 size="512" addrbitlen="8"/>
<M93C56 size="256" addrbitlen="8"/>
<M93C46 size="128" addrbitlen="6"/>
<M93C06 size="16" addrbitlen="6"/>
</Microchip>
</MW>
</chiplist>