Cypress USB教程第8讲_第1页
Cypress USB教程第8讲_第2页
Cypress USB教程第8讲_第3页
Cypress USB教程第8讲_第4页
Cypress USB教程第8讲_第5页
已阅读5页,还剩50页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Lecture8Agenda USBDeviceDriversGuestlecturer MarkMcCoyWindowsinterfaceBindingyourdevicetothecontrolpanelUSBOn The Go USBDeviceDrivers markmccoyCypressSemiconductorSeptember6 2001 Topics OperatingSystemSupportforUSBDriverBasicsDriverDevelopmentDriverResources HostControllerDriver FundamentalcomponentofOperatingSystemsupportforUSBUSBhostcontrollersarePCIdevicesWhatDoesitDo HandlesUSBperipheralenumerationProvidesUSBservicesforhigherleveldrivers AllaccesstoUSBperipheralsisviatheseservices USBPeripheralDrivers ClassDriversGenericdriverthatsupportsacertainclassofdeviceHumanInterfaceDevices HID USBhubs speakers massstorage modemsCustomDriversOperatingSystemsoftenincludevendorspecificdriversthathavepassedcertification e g WHQL WhichOS ssupportUSB Prettymuchallofthem MacOSLinuxSolarisButI mjustgoingtotalkaboutWindows Windows95OSR2 1 Microsoft sfirstattempttosupportUSBOnlyavailabletoOEMsFullofbugsNoHIDsupportAvoidit Windows98 98SE FirstMicrosoftOSwithfullUSBsupportClassdriversforHIDandUSBspeakers98SEfixedafewminorbugs enhancedperformance addedclassdriversforUSBmodems Windows2000 OnlyversionofWindowsNTthatwillhaveUSBsupportSharescommondrivermodel WDM withWindows983rdpartyNT4 0USBdriversareavailable WindowsMe Millennium Windows98wassupposedtobethelastOSintheWin9xfamily but FollowontoWindows98Addsperformancetweaks bugfixes USBaudiowithoutclicksandpops USBMassStorageclassdriver WindowsXP Microsoft sunifiedhome businessoperatingsystemtobereleasedinOctoberBasedonWindows2000SamebasicUSBsupportasWindows2000withsomechangesunderthehood USB2 0 DoesnotrequireanychangestoperipheraldriversMicrosoftwillprovidehostcontrollerdriversforWindows2000andWindowsXP currentlyinBetaAdd incardvendorsareprovidingsupportforotherOperatingSystemsWindows98 98SE ME MacOS Topics OperatingSystemSupportforUSBDriverBasicsDriverDevelopmentDriverResources UserMode UserModeiswheremostapplicationsrunApplicationsrunintheirownprotectedaddressspaceProvidesaccesstoafullsetofAPI sWhenausermodeapplicationcrashesitusuallycrashesaloneUnlikestandardserialports USBportscannotbeaccesseddirectlyfromusermode KernelMode KernelmodeiswhereOSservicesanddriversrunOffersnoprotectionProvidesalimitedsetofAPI sRunsatRing0 allowingaccesstoallsystemhardwareWhenakernelmodeprocesscrashesitusuallybringsdownthesystem WindowsNTKernelModeDrivers DrivermodelusedbyWindowsNTLayeredNotshackledbybackwardscompatibilityIncompatiblewithWindows3 1andWindows95I ORequestPacket IRP based devicedriver devicehardware UserApplication usermode kernelmode MonolithicDeviceDriver Win32DriverModel WDM SupersetoftheNTkernelmodedevicedriver addsPlugandPlay PnP andpowermanagementBinarycompatibleacrossfutureversionsofWindowsandWindowsNTUsedbyWindows98forUSBandFirewireEncouragesuseofdeviceclasses WDMStreamingClassDriver STREAM SYS UserApplication usermode kernelmode USBHostController UHCD SYS USBDriver USBD SYS mini driver INTELCAM SYS 3rdParty Microsoft IHV LayeredDriverModelUsingDeviceClasses USBDrivers USBfunctiondriversdonottalkdirectlytoUSBhardwareUSBfunctiondriverstalktoaMicrosoftdrivercalledUSBD USBDriver DevicerequestsareissuedbyfillinginadatastructurecalledanURBandpassingittoUSBDThereare17differentURBsdocumentedintheDDK PnPandUSB USBdevicesareenumeratedandidentifiedbythesystemastheyarepluggedinoratboottimeUSBdevicesareuniquelyidentifiedbyvendor productandversionID sreturnedindescriptorsFailingadirectmatchthere driverscanalsobeloadedbasedonclasscode Vendor productandversionID sarematchedtoacorrespondingINFfilewhichtellsWindowswhattodotosupportthedevice BasedoninformationintheINFfile WindowsloadstheappropriatedevicedriversandmakeschangestothesystemregistryDeviceinformationiscopiedtotheregistrysothattheaboveprocessonlyhappensonceperdevice PnPandUSB USBdeviceinformationisstoredintheregistryinthefollowinglocationsWindows98HKEY LOCAL MACHINE enum USBWindows2000HKEY LOCAL MACHINE SYSTEM CurrentControlSet Enum USBAccesstheregistryusingregedit exeMicrosoftwhitepaperonUSBplugandplay PnPandUSB Topics OperatingSystemSupportforUSBDriverBasicsDriverDevelopmentDriverResources DriverDevelopmentTools USBCapablePCrunningWindows98orWindows2000MicrosoftVisualC 5 0orlater Windows98DDKorWindows2000DDKNumegaSoftICE debugger DDK Driversarebuiltusingthebuild exeutility runsattheDOSprompt TheDDKinstallationsetsupshortcutsfor Checked and Free builds TheseshortcutssetupthebuildenvironmentandopenupaDOSbox DDK The Checked buildofadrivercontainsdebugcodesuchasadditionalparametercheckinganddebugprintstatementsThe Free buildhasnodebughooks andthereforeissmallerEachdriverhasa sources fileassociatedwithitthattellsbuild exehowtobuildthedriver WhichDDKtouse DriverscompiledwiththeWin98DDKwillworkunderWindows2000DriverscompiledwiththeWindows2000DDKwillworkunderWin98ExamplecodeanddocumentationisbetterintheWindows2000DDKWindows2000hassomeWDMfeatures notrelatedtoUSB thatarenotinWin98 sobecareful SoftICE AllowssourceleveldriverdebugonasinglemachineMucheasiertousethanMicrosoftWinDebug akaWinBug DriverToolkits SeveralsoftwarevendorsprovidetoolstosimplifydriverdevelopmentTwobasictypes KernelmodetoolkitsBSquareWinDKCompuwareDriverWorksJungoKernelDriverUsermodetoolkitsBSquareWinRTJungoWinDriver Topics OperatingSystemSupportforUSBDriverBasicsDriverDevelopmentDriverResources WebResources MicrosoftDDKs Free comp os ms windows programmer nt kernel mode DriverBooks WindowsNTDeviceDriverDevelopmentViscarolaandMasonWritingWindowsWDMDeviceDriversChrisCantProgrammingtheMicrosoftWindowsDriverModelWalterOney QuestionsforMark WindowsInterface Windowsassociatesyourdevicewithadriverandregistersitusinginformationitfindsinan INFfileStoredin windows infExample ezusbw2k infStoreyourdriverhere forWin98Me C WINDOWS SYSTEM32 DRIVERSExample ezusb sys ezmon sys ezusbw2k inf example StudyitwhilereadingAxelsonCh11Thenextslidesillustratehowtobindanewdevice VID PID totheAnchortoolsMyadditionsareshowningreenDon tmodifytheothersections ezusbw2k infheader Version Signature CHICAGO Class USBprovider Cypress LayoutFile layout inf Manufacturer Cypress Cypress BetanameforW95 stillusedforW98 W2000 Stringdefinedlaterinthe inffile means string Namestheinstallsection next Cypress ThisistheVID PIDfortheEZ USBdevelopmentboard Thisdevice isboundtoaversionofthegeneralpurposedriverthatwill automaticallydownloadtheKeil8051monitortoexternalRAM DonotusethisVID PIDforyourowndeviceorthemonitorwill wipeoutyourfirmware USB VID 0547 USB VID 0547 PID 1002 DeviceDesc EZUSB Dev USB VID 0547 PID 1002 ezusb inf Anchor section ThefolowingPIDsareforallofthedevicesintheEZ USBfamily ThesearethehardcodedPIDsthatwillbereportedbyanEZ USB devicewithnoexternalEEPROM Boundtothegeneralpurposedriver USB VID 0547 USB VID 04B4 PID 8613 DeviceDesc EZUSB Dev USB VID 04B4 PID 8613 ezusb infMultiplevid pidscanusethesamedriver EZUSB Files Ext ezusb sys EZUSB Files Inf ezusbw2k Inf ezusb infHere swherethedriverfilesareidentified Strings Anchor AnchorChips USB VID 0547 PID 0080 DeviceDesc AnchorChipsEZ USBDevelopmentBoard USB VID 0547 PID 1002 DeviceDesc AnchorChipsEZ USBSampleDevice USB VID 0547 PID 2131 DeviceDesc AnchorChipsEZ USB 2131Q 2131S 2135S EEPROMmissing USB VID 0547 PID 2126 DeviceDesc AnchorChipsEZ USB 2126S EEPROMmissing USB VID 0547 PID 2125 DeviceDesc AnchorChipsEZ USB 2121S 2125S EEPROMmissing USB VID 0547 PID 2136 DeviceDesc AnchorChipsEZ USB 2136S EEPROMmissing USB VID 0547 PID 2122 DeviceDesc AnchorChipsEZ USB 2122S EEPROMmissing USB VID 0547 PID 2235 DeviceDesc AnchorChipsEZ USB 2235 EEPROMmissing USB VID 0547 PID 2236 DeviceDesc AnchorChipsEZ USB 2236 EEPROMmissing USB VID 0547 PID 2225 DeviceDesc AnchorChipsEZ USB 2225 EEPROMmissing USB VID 0547 PID 2226 DeviceDesc AnchorChipsEZ USB 2226 EEPROMmissing USB VID 04B4 PID 8613 DeviceDesc CypressSemiconductorFX2 noEEPROM EZUSB SvcDesc AnchorChipsGeneralPurposeUSBDriver ezusb sys EZUSBDEV SvcDesc AnchorChipsGeneralPurposeUSBDriverw KeilMonitor ezmon sys ezusb infstrings USBOnTheGoPRELIMINARYInformationfollowsSpecificationisnotyetratifiedVersion0 9onwww usb org9 4 01 USBOTGGoals Connecttwo peripherals togetherPCisnotrequired butstillsupported AllowperipheralstowakeuphostsAllowtwodevicestoexchangethehostroleNewOTGdevicescantapintotheexisting900millionUSBdevicesForecast 1billiondevicesby2003 OTGExampleApplicationsSource Beeman USBOTGDetails Definesanewconnectorandcable MiniAB receptacleMini AtoMini BcableCableestablishesthedefaulthostA DeviceisthedefaulthostHostturnsonVBUSDual roleUSBdevices Aresometimesaperipheral sometimesahostMustusethenewABconnectorProvidelimitedhostcapabilityTargetedperipherallistSupply8mA min onVBUSOperateatfullspeed highspeedoptional USBOTGNew Mini AB Receptacle USBOTGNewCable Mini AtoMini B USBOTGCableconnectiondeterminesdefaultmaster DefaultMaster USBOTGCableconnectiondeterminesdefaultmaster DefaultMaster USBOTGTwonewprotocols SRPandHNP AugmentsthestandardUSBprotocolSRP SessionRequestProtocol Session aperiodoftimethatVbusisaboveathresholdvoltageB DevicerequeststheA DevicetoturnonVBUSandstartasessionAnA DevicecanturnoffVBUSandstillbeawakenedbyaB DeviceAllowsA DevicetoconservepowerHNP HostNegotiationProtocolOrderlychangeoverofbusmastershipHostfunc

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论