usb100.h in USBexample.rar


Usb programming to learn a good example...Original Link
    Sponsored links

			
#ifndef   __USB100_H__
#define   __USB100_H__


#include <PSHPACK1.H>


//bmRequest.Dir
#define BMREQUEST_HOST_TO_DEVICE        0
#define BMREQUEST_DEVICE_TO_HOST        1

//bmRequest.Type
#define BMREQUEST_STANDARD              0
#define BMREQUEST_CLASS                 1
#define BMREQUEST_VENDOR                2

//bmRequest.Recipient
#define BMREQUEST_TO_DEVICE             0
#define BMREQUEST_TO_INTERFACE          1
#define BMREQUEST_TO_ENDPOINT           2
#define BMREQUEST_TO_OTHER              3


#define MAXIMUM_USB_STRING_LENGTH 255

// values for the bits returned by the USB GET_STATUS command
#define USB_GETSTATUS_SELF_POWERED                0x01
#define USB_GETSTATUS_REMOTE_WAKEUP_ENABLED       0x02


#define USB_DEVICE_DESCRIPTOR_TYPE                0x01
#define USB_CONFIGURATION_DESCRIPTOR_TYPE         0x02
#define USB_STRING_DESCRIPTOR_TYPE                0x03
#define USB_INTERFACE_DESCRIPTOR_TYPE             0x04
#define USB_ENDPOINT_DESCRIPTOR_TYPE              0x05

// descriptor types defined by DWG documents
#define USB_RESERVED_DESCRIPTOR_TYPE              0x06
#define USB_CONFIG_POWER_DESCRIPTOR_TYPE          0x07
#define USB_INTERFACE_POWER_DESCRIPTOR_TYPE       0x08

#define USB_DESCRIPTOR_MAKE_TYPE_AND_INDEX(d, i) ((USHORT)((USHORT)d<<8 | i))

//
// Values for bmAttributes field of an
// endpoint descriptor
//

#define USB_ENDPOINT_TYPE_MASK                    0x03

#define USB_ENDPOINT_TYPE_CONTROL                 0x00
#define USB_ENDPOINT_TYPE_ISOCHRONOUS             0x01
#define USB_ENDPOINT_TYPE_BULK                    0x02
#define USB_ENDPOINT_TYPE_INTERRUPT               0x03


//
// definitions for bits in the bmAttributes field of a 
// configuration descriptor.
//
#define USB_CONFIG_POWERED_MASK                   0xc0

#define USB_CONFIG_BUS_POWERED                    0x80
#define USB_CONFIG_SELF_POWERED                   0x40
#define USB_CONFIG_REMOTE_WAKEUP                  0x20

//
// Endpoint direction bit, sto			

			...
			...
			... to be continued.

  This is a preview. To get the complete source file, 
  please click here to download the whole source code package.

			
			


Project Files

    Sponsored links
NameSizeDate
 <USB_Interrupt>0.00 B21-05-07 20:33
 <Driver_Source>0.00 B21-05-07 20:33
 intdev.c35.10 kB13-02-07 15:32
 intdev.h1.90 kB13-02-07 15:32
 intpnp.c73.07 kB13-02-07 15:32
 intpnp.h3.18 kB13-02-07 15:32
 intpwr.c39.15 kB13-02-07 15:32
 intpwr.h2.95 kB13-02-07 15:32
 intrwr.c27.17 kB13-02-07 15:32
 intrwr.h1.84 kB13-02-07 15:32
 intusb.bmf698.00 B13-02-07 15:32
 intusb.c12.75 kB13-02-07 15:32
 intusb.h6.98 kB13-02-07 15:32
 intusb.mof572.00 B13-02-07 15:32
 intusb.rc2.88 kB13-02-07 15:32
 intusr.h1.61 kB13-02-07 15:32
 intwdm98.c2.74 kB13-02-07 15:32
 intwdm98.h843.00 B13-02-07 15:32
 intwmi.c15.72 kB13-02-07 15:32
 intwmi.h1.61 kB13-02-07 15:32
 makefile269.00 B13-02-07 15:32
 makefile.inc128.00 B13-02-07 15:32
 ReadMe.txt3.25 kB13-02-07 15:32
 resource.h453.00 B13-02-07 15:32
 sources602.00 B13-02-07 15:32
 <Firmware>0.00 B01-08-07 13:15
 cyglink.txt477.00 B01-08-07 13:15
 F34x_USB0_Interrupt.wsp35.28 kB13-02-07 15:32
 F34X_USB_DESCRIPTOR16.46 kB01-08-07 13:15
 F34x_USB_Descriptor.#112.43 kB01-08-07 13:13
 F34x_USB_Descriptor.#212.43 kB23-05-07 09:07
 F34x_USB_Descriptor.c4.59 kB13-02-07 15:32
 F34x_USB_Descriptor.h5.95 kB13-02-07 15:32
 F34x_USB_Descriptor.LST8.20 kB01-08-07 13:13
 F34X_USB_DESCRIPTOR.M5154.31 kB01-08-07 13:15
 F34x_USB_Descriptor.OBJ1.85 kB01-08-07 13:13
 F34x_USB_ISR.c18.84 kB13-02-07 15:32
 F34x_USB_ISR.LST27.60 kB01-08-07 13:13
 F34x_USB_ISR.OBJ6.83 kB01-08-07 13:13
 F34x_USB_Main.c13.64 kB13-02-07 15:32
 F34x_USB_Main.h8.38 kB13-02-07 15:32
 F34x_USB_Main.LST19.78 kB01-08-07 13:13
 F34x_USB_Main.OBJ3.90 kB01-08-07 13:13
 F34x_USB_Register.h5.17 kB13-02-07 15:32
 F34x_USB_Standard_Requests.c21.45 kB13-02-07 15:32
 F34x_USB_Standard_Requests.LST31.58 kB01-08-07 13:13
 F34x_USB_Standard_Requests.OBJ6.92 kB01-08-07 13:13
 <Interrupt>0.00 B39896 28194
 ReadMe.txt2.43 kB13-02-07 15:32
 tmp.out684.00 B01-08-07 13:15
 <Host>0.00 B0 0%
 3DMeterCtrl.cpp14.69 kB13-02-07 15:32
 3DMeterCtrl.h2.40 kB13-02-07 15:32
 DynamicLED.cpp11.51 kB13-02-07 15:32
 DynamicLED.h2.25 kB13-02-07 15:32
 DynLED.h1.15 kB13-02-07 15:32
 MemDC.h3.21 kB13-02-07 15:32
 ReadMe.txt1.85 kB13-02-07 15:32
 <res>0.00 B23-05-07 08:57
 bitmap1.bmp13.03 kB13-02-07 15:32
 blackchip.ico3.19 kB13-02-07 15:32
 SilabsLogo.ico3.19 kB13-02-07 15:32
 Thumbs.db4.50 kB23-05-07 08:58
 USBTest.rc2398.00 B13-02-07 15:32
 resource.h1.43 kB13-02-07 15:32
 StdAfx.cpp209.00 B13-02-07 15:32
 StdAfx.h1.03 kB13-02-07 15:32
 usb100.h7.90 kB13-02-07 15:32
 UsbIF.cpp3.35 kB13-02-07 15:32
 UsbIF.h1.04 kB13-02-07 15:32
 USBTest.cpp1.93 kB13-02-07 15:32
 USBTest.dsp4.75 kB13-02-07 15:32
 USBTest.h1.30 kB13-02-07 15:32
 USBTest.rc7.33 kB13-02-07 15:32
 USBTest.sln903.00 B13-02-07 15:32
 USBTest.vcproj8.07 kB13-02-07 15:32
 USBTestDlg.cpp10.35 kB13-02-07 15:32
 USBTestDlg.h1.93 kB13-02-07 15:32
 ReadMe.txt3.29 kB13-02-07 15:32
 SiInt.sys38.25 kB13-02-07 15:32
 SilabsInt.inf2.05 kB13-02-07 15:32
 USBTest.exe220.00 kB13-02-07 15:32
...

Related Items

    Sponsored links