⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 2_cypress usb starter kit device driver complete with source code.htm

📁 Cypress公司的USB starter kit驱动源码
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0042)http://www.beyondlogic.org/usb/cypress.htm -->
<HTML><HEAD><TITLE>Cypress USB Starter Kit Device Driver complete with Source Code</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META 
content="Can't find a driver with Source Code for your Cypress USB Starter Kit? Look no further. We have a modified driver based on Microsoft's ISO_USB example for download." 
name=description>
<META 
content="Cypress, CY3640 USB Starter Kit, USB Device Driver, USB Thermometer, \.\\Thermometer_0, IOCTLISO.C, ISOUSB" 
name=keywords>
<META content="MSHTML 6.00.2716.2200" name=GENERATOR></HEAD>
<BODY leftMargin=0 
background="Cypress USB Starter Kit Device Driver complete with Source Code_files/bgyellow.gif" 
topMargin=0 FACE="ARIAL" BASEFONT marginwidth="0" marginheight="0">
<STYLE type=text/css>#TITLEBLOCK {
	COLOR: #ffffff; TEXT-DECORATION: none
}
TD {
	FONT-FAMILY: Arial
}
P {
	FONT-FAMILY: Arial
}
FONT {
	FONT-FAMILY: Arial
}
A {
	FONT-FAMILY: Arial
}
TD {
	FONT-FAMILY: Arial
}
</STYLE>

<SCRIPT language=javascript 
src="Cypress USB Starter Kit Device Driver complete with Source Code_files/beyondmenu.js"></SCRIPT>

<CENTER>
<TABLE width="95%">
  <TBODY>
  <TR>
    <TD><BR>
      <CENTER><FONT color=green size=5>A USB Driver for the Cypress USB Starter 
      Kit</FONT> </CENTER><BR>
      <P>One of the most helpful aids when first starting out in something new 
      is examples. Cypress forgot this when they introduced their USB Starter 
      Kit. But then for $99 U.S., you can't expect the world. The USB 
      Thermometer Driver and Application was developed under contract by System 
      Solutions 72410.77@compuserve.com. The code is not freely available. </P>
      <P>What I have done is modified the WDM ISO USB driver distributed with 
      the Windows Device Driver Kit for use with the Cypress Digital Themometer. 
      I've kept it basically the same, so you can actually run the Digital 
      Temperature Application on this driver to see that in-fact it does work! I 
      will cop some flap for this, as the driver isn't really a good example to 
      start with, especially if you know little about WDM Programming, as you 
      will learn some bad habits. I'll point these out. </P>
      <P>As the driver is based on copyright material developed by Microsoft, I 
      will not distribute the entire driver. What I will attempt to do, is show 
      you the modifications necessary to change the driver so that it works with 
      the Cypress USB Starter Kit. This hopefully will also give you a better 
      understanding as we work through the example. </P>
      <P>The driver is simply the ISO_USB driver featured in the Microsoft DDK 
      with modifications in IsoUsb_CreateDeviceObject so you can talk to the 
      Kernel Mode Device Driver using "\.\\Thermometer_0". This allows the 
      Cypress application to talk to the driver, rather than using the GUID 
      which Microsoft uses in their example. </P>
      <P>The IOCTL handler has been totally modified to handle calls from the 
      thermometer application which comes with the Cypress Kit. This allows you 
      to run the Cypress Thermometer Application on this device driver. It 
      includes all the IOCTL Control Code 4 Functions such as Set LED 
      Brightness, Read Thermometer, Read Port, Write Port, Read RAM, Write RAM 
      &amp; Read ROM as per the Cypress Starter Kit User Guide(Ver 0.993) Page 
      48. </P>
      <P><B>Modifiying the IOCTL Call Handler.</B> </P>
      <P>O.K., forget the modifications. We will start the handler for the 
      IRP_MJ_DEVICE_CONTROL from scratch. Delete or rename IOCTLISO.C. </P>
      <P>Below is the table of functions we will have to implement. This is 
      simular to the table provided by Cypress for compatibility. </P>
      <P align=center>
      <CENTER>
      <TABLE cellSpacing=1 cellPadding=7 width=583 border=1>
        <TBODY>
        <TR>
          <TD vAlign=top width="19%"><B><FONT face=Arial size=1>
            <P align=center>Command</B></FONT></P></TD>
          <TD vAlign=top width="40%" colSpan=4><B><FONT face=Arial size=1>
            <P align=center>Command Value</B></FONT></P></TD>
          <TD vAlign=top width="40%" colSpan=4><B><FONT face=Arial size=1>
            <P align=center>Out Value</B></FONT></P></TD></TR>
        <TR>
          <TD vAlign=top width="19%">&nbsp;</TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>MSB</FONT></P></TD>
          <TD vAlign=top width="10%">&nbsp;</TD>
          <TD vAlign=top width="10%">&nbsp;</TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>LSB</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>MSB</FONT></P></TD>
          <TD vAlign=top width="10%">&nbsp;</TD>
          <TD vAlign=top width="10%">&nbsp;</TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>LSB</FONT></P></TD></TR>
        <TR>
          <TD vAlign=top width="19%"><FONT face=Arial size=1>
            <P>Set LED Brightness</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>-</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>-</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>Brightness</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>0x0E</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>-</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>-</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>-</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>Status</FONT></P></TD></TR>
        <TR>
          <TD vAlign=top width="19%"><FONT face=Arial size=1>
            <P>Read Thermometer</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>-</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>-</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>-</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>0x0B</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>Button</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>Sign</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>Temp</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>Status</FONT></P></TD></TR>
        <TR>
          <TD vAlign=top width="19%"><FONT face=Arial size=1>
            <P>Read Port</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>-</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>-</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>Port</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>0x14</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>-</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>-</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>Value</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>Status</FONT></P></TD></TR>
        <TR>
          <TD vAlign=top width="19%"><FONT face=Arial size=1>
            <P>Write Port</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>-</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>Value</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>Port</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>0x15</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>-</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>-</FONT></P></TD>
          <TD vAlign=top width="10%"><FONT face=Arial size=1>
            <P align=center>-</FONT></P></TD>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -