06 2013 档案
摘要:6.4 Device Error HandlingThe device may not be able to fully satisfy the host's request.At the point when the device discovers that itcannot fully satisfy the request,there may be a Data-In or Data-Out transfer in progress on the bus,and the hostmay have other pending requests.The device may cau
阅读全文
摘要:http://stackoverflow.com/questions/14363152/send-custom-commands-to-mass-storage-deviceI have developed a mass-storage device, and I'd a like a PC application to send/receive some custom commands to it. Normally one would create a composite USB device for this (MSC+HID) and send the commands ove
阅读全文
摘要:http://social.msdn.microsoft.com/Forums/windowsdesktop/zh-CN/35620a05-43be-46a8-8cbe-846bc8295d85/usb-mass-storage-cWe have an USB mass storage / Memory Stick device with an additional device on it. We communicate with PassThrough mechanism to the device.Normally USB spec says that on USB level not
阅读全文
摘要:http://arm-utilities.googlecode.com/svn-history/r47/trunk/stlink-download/stlink-download.c/* STLink download/debug interface for Linux. *//* This program interacts with the STMicro USB STLink programming/debug interface for STMicro microcontrollers. The STLink is found on STM8 and STM32VLDiscovery.
阅读全文
摘要:http://code.msdn.microsoft.com/SCSI-Pass-Through-a906ceef/sourcecode?fileId=59048&pathId=1919073465http://code.msdn.microsoft.com/SCSI-Pass-Through-a906ceef/file/59048/13/SCSI%20Pass-Through%20Interface%20Tool.zip/*++ Copyright (c) 1992 Microsoft Corporation Module Name: spti.h Abstract: ...
阅读全文
摘要:http://www.ezblog.idv.tw/Download/USBStorage.rar這是一個不透過檔案系統,去讀寫USB Mass Storage 任何位置(包含FAT)的方式首先需安裝微軟的DDK並include "usbioctl.h" , "usbdi.h" , "ntddscsi.h"有幾個資料結構要定義typedef struct _SCSI_Device_Info_{ SCSI_PASS_THROUGH Spt; BYTE Sense[ 18 ]; BYTE Data[ 36 ];} SCSI_Device_I
阅读全文
摘要:http://cutebunny.blog.51cto.com/301216/674443最近碰到了个新问题,记录下来作为windows的磁盘操作那个系列的续篇吧。一些时候我们的程序需要区分本地存储设备和USB存储设备。在网上搜一搜一般会找到一个最直接的API,GetDriveType,其原型为UINT GetDriveType(LPCTSTR lpRootPathName)参数lpRootPathName是存储设备的根目录,例如C:\,返回值即为设备类型。Return codeDescriptionDRIVE_REMOVABLEThe drive has removable media; f
阅读全文
摘要:http://bbs3.driverdevelop.com/simple/?t84347.html{ BOOL status = 0; DWORD accessMode = 0, shareMode = 0; HANDLE fileHandle = NULL;//PUCHAR dataBuffer = NULL; SCSI_PASS_THROUGH_WITH_BUFFERS sptwb; SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER sptdwb; UCHAR buffer[ 2048 ]; UCHAR string[ 25 ]; ULONG len...
阅读全文
摘要:http://flyxxtt.blogbus.com/logs/43181576.html函数原型:UINTGetDriveType(LPCTSTR lpRootPathName)参数lpRootPathName是根目录,如"C:\",一定要加上反斜杠。如果给此参数传入NULL将返回程序当前目录的驱动器类型。返回值所代表的类型请看下面的例子。使用例子:wstring getDriveType( LPCTSTR lpRootPathName ){ wstring typename; unsigned int type = GetDriveType( _T( "C:\
阅读全文
摘要:http://banderlogi.blogspot.com/2011/06/enum-drive-letters-attached-for-usb.htmltypedef enum _STORAGE_BUS_TYPE { BusTypeUnknown = 0x00, BusTypeScsi = 0x01, BusTypeAtapi = 0x02, BusTypeAta = 0x03, BusType1394 = 0x04, BusTypeSsa = 0x05, BusTypeFibre...
阅读全文
摘要:http://www.jubao163.com/it/bianchengwendang/2007-06-17/14948.shtmltypedef struct _SCSI_PASS_THROUGH{ USHORT Length; UCHAR ScsiStatus; UCHAR PathId; UCHAR TargetId; UCHAR Lun; UCHAR CdbLength; UCHAR SenseInfoLength; UCHAR DataIn; ULONG DataTransferLength; ULONG TimeOutValue; ULONG_PTR Data...
阅读全文
摘要:http://fx.damasgate.com/more-about-stall/In other USB classes, a sender can indicate the end of a transfer by transmitting a short packet, which is a data packet that contains zero data bytes or any quantity fewer than wMaxPacketSize.The mass-storage class is unique in its use of the STALL handshake
阅读全文
摘要:http://210.240.55.2/~t311/moe/engb5/b5grammar/b5tooeither.htm本单元中所谈论的是「也」在英文中的讲法:英文中的「也」共有五种说法,分别是too/either 、 so/neither,及also:(一)too/either:肯定的用too;否定的用either;两者均是放在句尾,且其前加逗号。eg1. He is a student,andI am (a student),too.2. Susan collected stamps,andher sister did/collected stamps,too.3. John doesn
阅读全文
摘要:http://www.yywords.com/Article/200806/347.html1.这三个词都用来谈论两者:both意为“(两者)都”,either意为“(两者中)任意一个”,neither意为“(两者)都不”。若要指三者或三者以上,分别用all意为“(三者)都”,any意为“(三者中)任何一个”,none意为“(三者)都不”等。比较:He has two sons; both of them are clever.He has two sons; either of them is clever.He has two sons; neither of them is clever
阅读全文
摘要:http://msdn.microsoft.com/zh-cn/library/ae5bf541(v=vs.80).aspx正则表达式是一种文本模式,包括普通字符(例如,a 到 z 之间的字母)和特殊字符(称为“元字符”)。模式描述在搜索文本时要匹配的一个或多个字符串。正则表达式示例表达式匹配/^\s*$/匹配空行。/\d{2}-\d{5}/验证由两位数字、一个连字符再加 5 位数字组成的 ID 号。/]*)?>[\s\S]*/匹配 HTML 标记。下表包含了元字符的完整列表以及它们在正则表达式上下文中的行为:字符说明\将下一字符标记为特殊字符、文本、反向引用或八进制转义符。例如,“n”
阅读全文
摘要:http://code.riaos.com/?p=5011676硬盘按照存储介质分为机械硬盘(HDD)和固硬盘(SSD)硬盘的数据接口主要分为以下几种 :ATA(IDE):从ATA1 到ATA7, 兼容性比较好,采用40pin并口数据线SATA:ATA的继任者,串行的ATA接口,采用4pin的数据线,支持热插拔SCSI:小型机系统接口,支持高转速的硬盘,传输时占用CPU资源较低,有50pin,68pin,80pin多种规格SAS:串行 SCSI,是由SCSI演化过来的,比SCSI更快并且配置更简单。兼容SATA设备,可以使用相同的电缆。SATA的硬盘可以接在SAS接口上使用硬盘的电源接口主要和
阅读全文
摘要:http://blog.csdn.net/xgbing/article/details/7002558USB Mass Storage 6.7 The Thirteen Class章节的理解Case(1), case(6), case(12)状态下是正常的数据传输,被称为“The thin diagonal”。其它的状态是协议外的内容,是一些判断。6.7.1 主机期望发起一次无数据传输的命令CBW包中的dCBWDataTransferLength字段=0,Direction位不考虑。主机做的工作:(1) 发送一个CBW(2) 偿试接收CSW(3) 如果在STALL状态下接收到CSW:先清空BU
阅读全文
摘要:http://www.allapplabs.com/eclipse/eclipse_shortcuts.htmEclipse ShortcutsNavigational ShortcutsF10Main menuShift F10Context menuCtrl F10View menuWorkspace navigationF12Activate editorCtrl+Shift+WSwitch editorCtrl F6Next editorCtrl Shift F6Prev editorCtrl F7Next workspaceCtrl Shift F7Prev workspaceCtr
阅读全文
摘要:How do I make a lower case string in Eclipse to be upper case?Using Eclipse, I want to select a string and either uppercase it or lower case it.How?By default, the hotkey :changes to lower case : CTRL + SHIFT + Ychanges to upper case : CTRL + SHIFT + Xdo you know if this can be added to the Eclipse
阅读全文
摘要:http://bbs.csdn.net/topics/380028485整型常量的类型是下列相应表中第一个能表示其值的类型:int --> longint-->longlongint无后缀的十进制整数常量:int,longint,longlongint以字母u或U为后缀的十进制整型常量:unsignedint,unsignedlongint,unsignedlonglongint以字母l或L为后缀的十进制整型常量:longint,longlongint同时以字母u或U和字母l或L为后缀的十进制整型常量:unsignedlongint,unsignedlonglongint以字母ll
阅读全文
摘要:http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0499b/BEHEIHCE.htmlhe ARM JTAG 20 connector is a 20-way 2.54mm pitch connector. It can be used in either standard JTAG (IEEE 1149.1) mode orSerial Wire Debug(SWD) mode.The following figure shows the ARM JTAG 20 connector pinout:The follo
阅读全文
摘要:TL431作为一个高性价比的常用分流式电压基准,有很广泛的用途。图(1)是TL431的典型接法,输出一个固定电压值,计算公式是:Vout = ( (R1+R2) / R2 ) * 2.5 V同时R3的数值应该满足1mA < (Vcc-Vout)/R3 < 500mA当R1取值为0的时候,R2可以省略,这时候电路变成图(2)的形式TL431在这里相当于一个2.5V稳压管。MC1403是2.5V输出电压基准源,初始电压误差+-25mV,输入电压范围很宽,4.5V-40V的电压输入范围内都可以正常工作,工作电流1.2mA,输出驱动能力是10mA,典型温漂是10ppm/℃,8个引脚中1脚接
阅读全文
摘要:This circuit is much simpler than it sounded like it was going to need to be, due to the revelation that the USB power feed could easily accomodate a ...
阅读全文
摘要:IDA supports more than 50 families of processors. The source code of some of the processor modules is available in our free SDK.IDA Starter EditionIDA Starter Edition supports the following families (64-bit analysis is possible only with IDA Professional Edition)AMD K6-2 3D-Now! extensionsARM Archit
阅读全文
摘要:https://www.hex-rays.com/products/decompiler/We are pleased to present our flagship product, the Hex-Rays Decompiler, which brings binary software analysis within reach of millions of programmers. It converts executable programs into a human readable C-like pseudocode text.In comparison to low level
阅读全文
摘要:http://sourceforge.net/projects/openprogrammer/?source=navbarOpen Programmerhttp://openprog.altervista.org/OP_eng.html#QuickOpen Programmer v0.8.xQuic...
阅读全文
摘要:SIMPLIFIED DIRECT-ACCESS DEVICE (RBC)------------------------------------------OP B Description------------------------------------------00 M TEST UNIT READY12 M INQUIRY1B M START STOP UNIT25 M READ CAPACITY(10)28 M READ(10)2A M WRITE(10)2E M WRITE AND VERIFY(...
阅读全文
摘要:struct tagDrives{ WCHAR letter; WCHAR volume[ BUFFER_SIZE ];} g_drives[ 26 ];//WCHAR GetUSBDrive( ){ LPTSTR lpDevID; WCHAR cDrive; DWORD dwSize = BUFFER_SIZE; // Get all removable disks on user laptop. if ( !GetAllRemovableDisks( ) ) { WRITELOG( "Error - GetAllRemovableDisks failed\n" ); .
阅读全文
摘要:http://www.tldp.org/HOWTO/archived/SCSI-Programming-HOWTO/SCSI-Programming-HOWTO-23.html23. A SCSI command code quick referenceTable 365 is a numerical order listing of the command operation codes. Table 365: SCSI-2 Operation Codes+=============================================...
阅读全文
摘要:a) USB transfer speed of MSC-BOT (Mass-Storage Class - Bulk-Only Transport)MSC-BOT protocol has overhead to transfer data on both direction.READ10/WRITE10 SCSI commands are carried by this BOT protocol.CBW - Data transport (IN/OUT) - CSWWhen Host runs OHCI or UHCI host controller (as usual on PCs),
阅读全文
摘要:http://denniskubes.com/2012/08/14/do-you-know-what-p-does-in-c/Update 1: There were some errors in the first version of this post. Thanks to lmm from hacker news for catching them. Code has been updated.Update 2: Thanks to memorylane from reddit for bugfixes with the last example and suggestions abo
阅读全文
摘要:http://en.cppreference.com/w/cpp/language/operator_precedenceThe following table lists the precedence and associativity of C++ operators. Operators are listed top to bottom, in descending precedence.PrecedenceOperatorDescriptionAssociativity1::Scope resolutionLeft-to-right2++--Suffix/postfix increme
阅读全文
摘要:http://www.crifan.com/files/doc/docbook/usb_disk_driver/release/htmls/ch02_msc_basic.htmlUSB Mass Storage FrameworkPC电脑和U盘之间的关系,以及物理上的组成,可以用下图表示更深入的剖析,对于普通U盘的内部结构,则是一个USB物理接口,加上对应的控制芯片(微控制器(含Nand Flash的控制器)+ USB设备控制器)和一个Nand Flash芯片:PC和U盘的内部逻辑框图PC和U盘的之间的抽象的逻辑关系,可用下图来表示:USB MSC设备中的固件(firmware)或者硬件(ha
阅读全文
摘要:#define PP_ARG_N( \ _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, \ _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, \ _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, \ _41, _42, _43, _44, _45, _46, _4...
阅读全文
摘要:http://delphi.about.com/od/objectpascalide/ss/debug-vs-release-in-delphi-build-configurations.htmThe Project Manager window in your Delphi (RAD Studio) IDE displays and organizes the contents of your current project group and any projects it contains. It will list all the units that are part of your
阅读全文
摘要:http://sourceforge.net/projects/dxgettext/DescriptionGNU GetText translation tools for Borland Delphi and Borland C++ Builderhttp://downloads.sourceforge.net/project/dxgettext/For%20Delphi%20and%20C%2B%2B%20Builder/1.2.2/dxgettext-1.2.2.exeBugfixes and improvements to gnugettext.pasThese changes are
阅读全文
摘要:http://blog.dummzeuch.de/category/delphi/Samstag, Dezember 29th, 2012Some might know that I have been using and contributing to theGnuGetText for Delphi and C++ Builderproject. I just had another look into the gnugettext unit and found that it was rather difficult to understand the logic behind all
阅读全文
摘要:{$R filename}{$RESOURCE filename}{$R *.xxx}{$R 'My file'}.{$R filename.res filename.rc} The $R directive specifies the name of a resource file to be included in an application or library. The named file must be a Windows resource file and the default extension for filenames is .res. To speci
阅读全文
摘要:http://www.beck-ipc.com/files/api/scxxx/rtxover.htmSemaphores are used to guarantee a task mutually exclusive access to a critical resource. Semaphores synchronize asynchronous occurring activities. They are an essential part of a multitasking system. A good description of multitasking systems and..
阅读全文
摘要:The#pragma packdirective modifies the current alignment rule for members of structures following the directive.The#pragma packdirective modifies the current alignment rule for only the members of structures whose declarations follow the directive.It does not affect the alignment of the structure dir
阅读全文
摘要:#pragmadirective :Specifies implementation-defined instructions to the compiler.C90 does not permit a#pragmadirective to be produced as the result of a macro expansion. However, the C99_Pragmaoperator enables you to embed a preprocessor macro in a pragma directive, and_Pragmais permitted in C90 if--
阅读全文
摘要:在做同步时经常会用到 pend, post, accept;现在做下简单的记录:accept: 是去取某个信号量,如果无效则立即返回; Requestpend: 是去取某个信号量, 如果无效则进入休眠; Wait ( P )post: 释放一个信号量; Signal ( V )
阅读全文
摘要:http://msdn.microsoft.com/en-us/library/windows/hardware/hh920375(v=vs.85).aspxA Universal Serial Bus (USB) device defines its capabilities and features through configurations, interfaces, alternate settings, and endpoints. This topic provides a high-level overview of those concepts. For details, se
阅读全文