diff --git a/biometrics/README.md b/biometrics/README.md index 2f6371b5a..abf0235e6 100644 --- a/biometrics/README.md +++ b/biometrics/README.md @@ -12,12 +12,12 @@ products: The Windows Biometric Driver Samples contain the Windows Biometric Driver Interface sample and the Windows Biometric Service Adapter samples. -The following table describes the samples contained in this sample set: +## Windows Biometric Driver Interface -*Windows Biometric Driver Interface* This sample implements the Windows Biometric Driver Interface (WBDI). It contains skeleton code for handling the mandatory IOCTLs necessary to interoperate with the Windows Biometric Framework. A WBDI driver can be deployed in conjunction with an engine adapter DLL to allow a sensor to be exposed from the Windows Biometric Framework. This sample has been written to make use of the UMDF framework, which allows for ease of development and system stability. -*Windows Biometric Service Adapters* +## Windows Biometric Service Adapters + These samples provide skeleton code that developers can use as a basis for writing Sensor, Engine, and Storage Adapters for the Windows Biometric Service. Note that the stubs in these samples are non-functional, and Adapter writers will need to follow the programming guidelines in the WinBio Service documentation in order produce a working Adapter component. ## Build the sample diff --git a/usb/UcmTcpciCxClientSample/README.md b/usb/UcmTcpciCxClientSample/README.md index a59bf2bb9..d048245a9 100644 --- a/usb/UcmTcpciCxClientSample/README.md +++ b/usb/UcmTcpciCxClientSample/README.md @@ -54,7 +54,7 @@ UcmTcpciCx is intended for system port controller drivers. If you are bringing u This section outlines a procedure for installing and testing a TCPCI implementation for Windows 10 on a Raspberry Pi computer running Windows 10 IoT Core. You will need a Raspberry Pi 2 or 3, your TCPC device, a USB-to-Serial converter for debugging, and 7 jumper wires to connect your TCPC to the Raspberry Pi (3 for the debug board, 4 for the TCPC). -You will also need the Windows 10 IoT Core Insider Preview builds, the IoT tool set and WDK available for download on MSDN, and the UcmTcpciCxClientSample source code. +You will also need the Windows 10 IoT Core Insider Preview builds, the IoT tool set, the [Windows Driver Kit (WDK)](https://docs.microsoft.com/windows-hardware/drivers/download-the-wdk), and the UcmTcpciCxClientSample source code. ### Setup diff --git a/usb/umdf2_fx2/README.md b/usb/umdf2_fx2/README.md index 1e9c148d0..4ebf9ae2e 100644 --- a/usb/umdf2_fx2/README.md +++ b/usb/umdf2_fx2/README.md @@ -12,11 +12,11 @@ products: The umdf2\_fx2 sample is a User-Mode Driver Framework (UMDF) version 2 driver for the OSR USB-FX2 device. -The specification for the device can be found at . The driver and sample device metadata also work with the [Custom driver access](http://go.microsoft.com/fwlink/p/?LinkID=248288) sample. + For more information, see the specification for the [OSR USB FX-2 Learning Kit](http://www.osronline.com/hardware/OSRFX2_32.pdf). The driver and sample device metadata also work with the [Custom driver access](https://code.msdn.microsoft.com/windowsapps/Custom-device-access-sample-43bde679) sample. ## Related technologies -[User-Mode Driver Framework](http://msdn.microsoft.com/en-us/library/windows/hardware/ff560456) +[User-Mode Driver Framework](https://docs.microsoft.com/windows-hardware/drivers/wdf/getting-started-with-umdf-version-2) ## Run the sample @@ -29,8 +29,11 @@ The process of moving the driver package to the target computer and installing t Before you automatically deploy a driver, you must provision the target computer. For instructions, see [Provision a computer for driver deployment and testing (WDK 10)](https://docs.microsoft.com/windows-hardware/drivers/gettingstarted/provision-a-target-computer-wdk-8-1). 1. Plug in the OSR USB-FX2 board to the target computer. + 1. On the host computer, in Visual Studio, in Solution Explorer, right click **package** (lower case), and choose **Properties**. Navigate to **Configuration Properties \> Driver Install \> Deployment**. + 1. Check **Enable deployment**, and check **Remove previous driver versions before deployment**. For **Target Computer Name**, select the name of a target computer that you provisioned previously. Select **Install and Verify**. Click **OK**. + 1. On the **Build** menu, choose **Deploy Package** or **Build Solution**. ### Manual deployment (FX2 board) @@ -38,14 +41,16 @@ Before you automatically deploy a driver, you must provision the target computer Before you manually deploy a driver, you must turn on test signing and install a certificate on the target computer. You also need to copy the [DevCon](https://docs.microsoft.com/windows-hardware/drivers/devtest/devcon) tool to the target computer. For instructions, see [Preparing a Computer for Manual Driver Deployment](https://docs.microsoft.com/windows-hardware/drivers/develop/preparing-a-computer-for-manual-driver-deployment). 1. Copy all of the files in your driver package to a folder on the target computer (for example, c:\\umdf2\_fx2). + 1. Plug in the OSR USB-FX2 board to the target computer. Open a Command Prompt window and enter **dvmgmt** to open Device Manager. In Device Manager, locate the node for the OSR USB-FX2 board. Right click the node, and choose **Properties**. In the **Details** tab, under **Properties**, choose **Hardware Ids**. Note the hardware IDs listed for your FX2 board. One of these IDs should match one of the IDs in the osrusbfx2um.inf file. For example, Device Manager might show an ID of USB\\VID\_0547&PID\_1002, which matches one of the IDs in the [Microsoft.*xxx*] section of osrusbfx2um.inf. + 1. On the target computer, open a Command Prompt window as Administrator. Navigate to your driver package folder, and enter this command: - **devcon update osrusbfx2um.inf"***HardwareID***"** + `devcon update osrusbfx2um.inf"***HardwareID***"` where *HardwareID* is the hardware ID of your FX2 board. Here is an example: - **devcon update osrusbfx2um.inf "USB\\VID\_0547&PID\_1002"** + `devcon update osrusbfx2um.inf "USB\VID_0547&PID_1002"` ## View the driver for the OSR USB-FX2 board in Device Manager @@ -57,6 +62,6 @@ In Device Manager, on the **View** menu, choose **Devices by connection**. Locat As an alternative to building the driver sample in Visual Studio, you can build it in a Visual Studio Command Prompt window. In Visual Studio, on the **Tools** menu, choose **Visual Studio Command Prompt**. In the Visual Studio Command Prompt window, navigate to the folder that has the solution file, umdf2echo.sln. Use the MSBuild command to build the solution. Here is an example: - **msbuild /p:configuration=Win8 Release /p:platform=Win32 umdf2\_fx2.sln** +`msbuild /p:configuration=Win8 Release /p:platform=Win32 umdf2_fx2.sln` For more information about using MSBuild to build a driver package, see [Building a Driver with Visual Studio and the WDK](https://docs.microsoft.com/windows-hardware/drivers/develop/building-a-driver). diff --git a/usb/umdf_fx2/README.md b/usb/umdf_fx2/README.md index b38692c0e..20a6a7e91 100644 --- a/usb/umdf_fx2/README.md +++ b/usb/umdf_fx2/README.md @@ -12,7 +12,7 @@ products: The umdf\_fx2 sample is a User-Mode Driver Framework (UMDF) driver for the OSR USB-FX2 device. It includes a test app and sample device metadata, and supports impersonation and idle power down. -The sample can also be used with the CustomDeviceAccess MSDK sample. The sample demonstrates how to perform bulk and interrupt data transfers to an USB device. The specification for the device is at . The driver and sample device metadata also work with the [Custom driver access](https://code.msdn.microsoft.com/windowsapps/Custom-device-access-sample-43bde679) sample. +The sample can also be used with the CustomDeviceAccess SDK sample. The sample demonstrates how to perform bulk and interrupt data transfers to an USB device. For more information, see the specification for the [OSR USB FX-2 Learning Kit](http://www.osronline.com/hardware/OSRFX2_32.pdf). The driver and sample device metadata also work with the [Custom driver access](https://code.msdn.microsoft.com/windowsapps/Custom-device-access-sample-43bde679) sample. The osrusbfx2 sample is divided into three samples: @@ -27,25 +27,41 @@ The osrusbfx2 sample is divided into three samples: The default Solution build configuration is Debug and Win32. 1. Open the driver project or solution in Visual Studio 2015 (find *filtername*.sln or *filtername*.vcxproj). + 1. Right-click the solution in the **Solutions Explorer** and select **Configuration Manager**. + 1. From the **Configuration Manager**, select the **Active Solution Configuration** and the **Active Solution Platform** (for example, Win32) that correspond to the type of build you are interested in. + 1. From the **Build** menu, click **Build Solution** (Ctrl+Shift+B). ## Overview - The device is based on the development board supplied with the Cypress EZ-USB FX2 Development Kit (CY3681). + - It contains 1 interface and 3 endpoints (Interrupt IN, Bulk Out, Bulk IN). + - Firmware supports vendor commands to query or set LED Bar graph display and 7-segment LED display, and to query toggle switch states. + - Interrupt Endpoint: -- Sends an 8-bit value that represents the state of the switches. + + - Sends an 8-bit value that represents the state of the switches. + - Sent on startup, resume from suspend, and whenever the switch pack setting changes. + - Firmware does not de-bounce the switch pack. + - One switch change can result in multiple bytes being sent. + - Bits are in the reverse order of the labels on the pack (for example, bit 0x80 is labeled 1 on the pack). + - Bulk Endpoints are configured for loopback: -- The device moves data from IN endpoint to OUT endpoint. + + - The device moves data from IN endpoint to OUT endpoint. + - The device does not change the values of the data it receives nor does it internally create any data. + - Endpoints are always double buffered. + - Maximum packet size depends on speed (64 full speed, 512 high speed). ## Testing the driver @@ -57,18 +73,26 @@ This sample also includes a test application, osrusbfx2.exe, that you can use to Usage for Read/Write test: - -r [*n*], where *n* is number of bytes to read. + - -w [*n*], where *n* is number of bytes to write. + - -c [*n*], where *n* is number of iterations (default = 1). + - -v, shows verbose read data. + - -p, plays with Bar Display, Dip Switch, 7-Segment Display. + - -a, performs asynchronous I/O operation. + - -u, dumps USB configuration and pipe information. + - -f \<*filename*\> [*interval-seconds*], where *interval-seconds* is a delay in milliseconds, to send a text file to the seven-segment display (UMDF only) -**Playing with the 7 segment display, toggle switches, and bar graph display** +### Playing with the 7 segment display, toggle switches, and bar graph display -Use the command **osrusbfx2.exe -p** with options 1 through 9 to set and clear bar graph display, set and get 7 segment state, and read the toggle switch states. The following shows the function options: +Use the command `osrusbfx2.exe -p` with options 1 through 9 to set and clear bar graph display, set and get 7 segment state, and read the toggle switch states. The following shows the function options: +```cmd 1. Light Bar 2. Clear Bar 3. Light entire Bar graph @@ -84,253 +108,266 @@ Use the command **osrusbfx2.exe -p** with options 1 through 9 to set and clear b 0. Exit Selection: +``` -**Reset and re-enumerate the device** +### Reset and re-enumerate the device -Use the command **osrusbfx2.exe -p** with options 10 and 11 to either reset the device or re-enumerate the device. +Use the command `osrusbfx2.exe -p` with options 10 and 11 to either reset the device or re-enumerate the device. -**Read and write to bulk endpoints** +### Read and write to bulk endpoints The following commands send read and write requests to the device's bulk endpoint. -- `osrusbfx2.exe -r 64` +- `osrusbfx2.exe -r 64` The preceding command reads 64 bytes to the bulk IN endpoint. -- `osrusbfx2.exe -w 64 ` +- `osrusbfx2.exe -w 64` The preceding command writes 64 bytes to the bulk OUT endpoint. -- `osrusbfx2.exe -r 64 -w 64 -c 100 -v` +- `osrusbfx2.exe -r 64 -w 64 -c 100 -v` The preceding command first writes 64 bytes of data to bulk OUT endpoint (Pipe 1), then reads 64 bytes from bulk IN endpoint (Pipe 2), and then compares the read buffer with write buffer to see if they match. If the buffer contents match, it repeats this operation 100 times. -- `osrusbfx2.exe -a` +- `osrusbfx2.exe -a` The preceding command reads and writes to the device asynchronously in an infinite loop. The bulk endpoints are double buffered. Depending on the operational speed (full or high), the buffer size is either 64 bytes or 512 bytes, respectively. A request to read data does not complete if the buffers are empty. If the buffers are full, a request to write data does not complete until the buffers are emptied. When you are doing a synchronous read, make sure the endpoint buffer has data (for example, when you send 512 bytes write request to the device operating in full speed mode). Because the endpoints are double buffered, the total buffer capacity is 256 bytes. The first 256 bytes fills the buffer and the write request waits in the USB stack until the buffers are emptied. If you run another instance of the application to read 512 bytes of data, both write and read requests complete successfully. -**Displaying descriptors** +### Displaying descriptors The following command displays all the descriptors and endpoint information. -**osrusbfx2.exe -u** +`osrusbfx2.exe -u` If the device is operating in high speed mode, you get the following information: -`===================` +```cmd +=================== -`USB_CONFIGURATION_DESCRIPTOR` +USB_CONFIGURATION_DESCRIPTOR -`bLength = 0x9, decimal 9` +bLength = 0x9, decimal 9 -`bDescriptorType = 0x2 ( USB_CONFIGURATION_DESCRIPTOR_TYPE )` +bDescriptorType = 0x2 ( USB_CONFIGURATION_DESCRIPTOR_TYPE ) -`wTotalLength = 0x27, decimal 39` +wTotalLength = 0x27, decimal 39 -`bNumInterfaces = 0x1, decimal 1` +bNumInterfaces = 0x1, decimal 1 -`bConfigurationValue = 0x1, decimal 1` +bConfigurationValue = 0x1, decimal 1 -`iConfiguration = 0x4, decimal 4` +iConfiguration = 0x4, decimal 4 -`bmAttributes = 0xa0 ( USB_CONFIG_BUS_POWERED )` +bmAttributes = 0xa0 ( USB_CONFIG_BUS_POWERED ) -`MaxPower = 0x32, decimal 50` +MaxPower = 0x32, decimal 50 -`-----------------------------` +----------------------------- -`USB_INTERFACE_DESCRIPTOR #0` +USB_INTERFACE_DESCRIPTOR #0 -`bLength = 0x9` +bLength = 0x9 -`bDescriptorType = 0x4 ( USB_INTERFACE_DESCRIPTOR_TYPE )` +bDescriptorType = 0x4 ( USB_INTERFACE_DESCRIPTOR_TYPE ) -`bInterfaceNumber = 0x0` +bInterfaceNumber = 0x0 -`bAlternateSetting = 0x0` +bAlternateSetting = 0x0 -`bNumEndpoints = 0x3` +bNumEndpoints = 0x3 -`bInterfaceClass = 0xff` +bInterfaceClass = 0xff -`bInterfaceSubClass = 0x0` +bInterfaceSubClass = 0x0 -`bInterfaceProtocol = 0x0` +bInterfaceProtocol = 0x0 -`bInterface = 0x0` +bInterface = 0x0 -`------------------------------` +------------------------------ -`USB_ENDPOINT_DESCRIPTOR for Pipe00` +USB_ENDPOINT_DESCRIPTOR for Pipe00 -`bLength = 0x7` +bLength = 0x7 -`bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE )` +bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE ) -`bEndpointAddress= 0x81 ( INPUT )` +bEndpointAddress= 0x81 ( INPUT ) -`bmAttributes= 0x3 ( USB_ENDPOINT_TYPE_INTERRUPT )` +bmAttributes= 0x3 ( USB_ENDPOINT_TYPE_INTERRUPT ) -`wMaxPacketSize= 0x49, decimal 73` +wMaxPacketSize= 0x49, decimal 73 -`bInterval = 0x1, decimal 1` +bInterval = 0x1, decimal 1 -`------------------------------` +------------------------------ -`USB_ENDPOINT_DESCRIPTOR for Pipe01` +USB_ENDPOINT_DESCRIPTOR for Pipe01 -`bLength = 0x7` +bLength = 0x7 -`bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE )` +bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE ) -`bEndpointAddress= 0x6 ( OUTPUT )` +bEndpointAddress= 0x6 ( OUTPUT ) -`bmAttributes= 0x2 ( USB_ENDPOINT_TYPE_BULK )` +bmAttributes= 0x2 ( USB_ENDPOINT_TYPE_BULK ) -`wMaxPacketSize= 0x200, ` +wMaxPacketSize= 0x200, -`decimal 512 bInterval = 0x0, ` +decimal 512 bInterval = 0x0, -`decimal 0` +decimal 0 -`------------------------------` +------------------------------ -`USB_ENDPOINT_DESCRIPTOR for Pipe02` +USB_ENDPOINT_DESCRIPTOR for Pipe02 -`bLength = 0x7` +bLength = 0x7 -`bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE )` +bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE ) -`bEndpointAddress= 0x88 ( INPUT )` +bEndpointAddress= 0x88 ( INPUT ) -`bmAttributes= 0x2 ( USB_ENDPOINT_TYPE_BULK )` +bmAttributes= 0x2 ( USB_ENDPOINT_TYPE_BULK ) -`wMaxPacketSize= 0x200, decimal 512` +wMaxPacketSize= 0x200, decimal 512 -`bInterval = 0x0, decimal 0` +bInterval = 0x0, decimal 0 +``` If the device is operating in low speed mode, you will get the following information: -`===================` +```cmd +=================== -`USB_CONFIGURATION_DESCRIPTOR` +USB_CONFIGURATION_DESCRIPTOR -`bLength = 0x9, decimal 9` +bLength = 0x9, decimal 9 -`bDescriptorType = 0x2 ( USB_CONFIGURATION_DESCRIPTOR_TYPE )` +bDescriptorType = 0x2 ( USB_CONFIGURATION_DESCRIPTOR_TYPE ) -`wTotalLength = 0x27, decimal 39` +wTotalLength = 0x27, decimal 39 -`bNumInterfaces = 0x1, decimal 1` +bNumInterfaces = 0x1, decimal 1 -`bConfigurationValue = 0x1, decimal 1` +bConfigurationValue = 0x1, decimal 1 -`iConfiguration = 0x3, decimal 3` +iConfiguration = 0x3, decimal 3 -`bmAttributes = 0xa0 ( USB_CONFIG_BUS_POWERED )` +bmAttributes = 0xa0 ( USB_CONFIG_BUS_POWERED ) -`MaxPower = 0x32, decimal 50 ` +MaxPower = 0x32, decimal 50 -`-----------------------------` +----------------------------- -`USB_INTERFACE_DESCRIPTOR #0` +USB_INTERFACE_DESCRIPTOR #0 -`bLength = 0x9` +bLength = 0x9 -`bDescriptorType = 0x4 ( USB_INTERFACE_DESCRIPTOR_TYPE )` +bDescriptorType = 0x4 ( USB_INTERFACE_DESCRIPTOR_TYPE ) -`bInterfaceNumber = 0x0 bAlternateSetting = 0x0` +bInterfaceNumber = 0x0 bAlternateSetting = 0x0 -`bNumEndpoints = 0x3` +bNumEndpoints = 0x3 -`bInterfaceClass = 0xff` +bInterfaceClass = 0xff -`bInterfaceSubClass = 0x0` +bInterfaceSubClass = 0x0 -`bInterfaceProtocol = 0x0` +bInterfaceProtocol = 0x0 -`bInterface = 0x0` +bInterface = 0x0 -`------------------------------` +------------------------------ -`USB_ENDPOINT_DESCRIPTOR for Pipe00` +USB_ENDPOINT_DESCRIPTOR for Pipe00 -`bLength = 0x7` +bLength = 0x7 -`bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE )` +bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE ) -`bEndpointAddress= 0x81 ( INPUT )` +bEndpointAddress= 0x81 ( INPUT ) -`bmAttributes= 0x3 ( USB_ENDPOINT_TYPE_INTERRUPT )` +bmAttributes= 0x3 ( USB_ENDPOINT_TYPE_INTERRUPT ) -`wMaxPacketSize= 0x49, decimal 73` +wMaxPacketSize= 0x49, decimal 73 -`bInterval = 0x1, decimal 1` +bInterval = 0x1, decimal 1 -`------- -----------------------` +------- ----------------------- -`USB_ENDPOINT_DESCRIPTOR for Pipe01` +USB_ENDPOINT_DESCRIPTOR for Pipe01 -`bLength = 0x7` +bLength = 0x7 -`bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE )` +bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE ) -`bEndpointAddress= 0x6 ( OUTPUT )` +bEndpointAddress= 0x6 ( OUTPUT ) -`bmAttributes= 0x2 ( USB_ENDPOINT_TYPE_BULK )` +bmAttributes= 0x2 ( USB_ENDPOINT_TYPE_BULK ) -`wMaxPacketSize= 0x40, decimal 64` +wMaxPacketSize= 0x40, decimal 64 -`bInterval = 0x0, decimal 0` +bInterval = 0x0, decimal 0 -`------------------------------` +------------------------------ -`USB_ENDPOINT_DESCRIPTOR for Pipe02` +USB_ENDPOINT_DESCRIPTOR for Pipe02 -`bLength = 0x7` +bLength = 0x7 -`bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE )` +bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE ) -`bEndpointAddress= 0x88 ( INPUT )` +bEndpointAddress= 0x88 ( INPUT ) -`bmAttributes= 0x2 ( USB_ENDPOINT_TYPE_BULK )` +bmAttributes= 0x2 ( USB_ENDPOINT_TYPE_BULK ) -`wMaxPacketSize= 0x40, decimal 64` +wMaxPacketSize= 0x40, decimal 64 -`bInterval = 0x0, decimal 0 ` +bInterval = 0x0, decimal 0 +``` -Sample Contents ---------------- +## Sample Contents -Folder +### usb\\umdf\_fx2\\driver -Description +This directory contains driver code that demonstrates the following functionality: -usb\\umdf\_fx2\\driver +- Loads the driver and responds to PnP and Power events. You can install, uninstall, disable, enable, suspend, and resume the system. -This directory contains driver code that demonstrates the following functionality: +- Registers a PnP device interface so that application can open a handle to the device. + +- Implements **IPnpCallbackHardware** interface and initializes USB I/O targets in **IPnpCallbackHardware::OnPrepareHardware** method. + +- Creates a sequential queue for handling IOCTL requests. + +- Adds code to handle the IOCTL to set bar graph display. + +- Creates a parallel queue for handling read and write requests. + +- Retrieves memory from read and write requests, format the requests, and sends them to a USB target. + +- Supports additional IOCTLs to get and set the 7-segment display, get bar graph display, and get config descriptor. + +- Sets power policy for the device. + +- Adds code to indicate that the device is ready by lighting up the period on 7-segment display. + +- Calls **SetupDi** functions to determine the "BusTypeGUID" of the device, and uses impersonation to access resources that only the caller has access to. + +- Shows how to implement idle and wake functionality to make the driver the power policy owner (PPO). The sample achieves this using power-managed queues and UMDF DDIs, AssignS0IdleSettings, and AssignSxWakeSettings. + +- Demonstrates implementation of a continuous reader. + +- Demonstrates the use of impersonation. -- Loads the driver and responds to PnP and Power events. You can install, uninstall, disable, enable, suspend, and resume the system. -- Registers a PnP device interface so that application can open a handle to the device. -- Implements **IPnpCallbackHardware** interface and initializes USB I/O targets in **IPnpCallbackHardware::OnPrepareHardware** method. -- Creates a sequential queue for handling IOCTL requests. -- Adds code to handle the IOCTL to set bar graph display. -- Creates a parallel queue for handling read and write requests. -- Retrieves memory from read and write requests, format the requests, and sends them to a USB target. -- Supports additional IOCTLs to get and set the 7-segment display, get bar graph display, and get config descriptor. -- Sets power policy for the device. -- Adds code to indicate that the device is ready by lighting up the period on 7-segment display. -- Calls **SetupDi** functions to determine the "BusTypeGUID" of the device, and uses impersonation to access resources that only the caller has access to. -- Shows how to implement idle and wake functionality to make the driver the power policy owner (PPO). The sample achieves this using power-managed queues and UMDF DDIs, AssignS0IdleSettings, and AssignSxWakeSettings. -- Demonstrates implementation of a continuous reader. -- Demonstrates the use of impersonation. - -usb\\umdf\_fx2\\exe +### usb\\umdf\_fx2\\exe This directory contains a test application that can be used to drive the UMDF driver and FX2 device. This is a modified version of the test application for the KMDF Fx2 driver. -usb\\umdf\_fx2\\deviceMetadata +### usb\\umdf\_fx2\\deviceMetadata This directory contains the device metadata package for the sample. You must copy the device metadata to the system before installing the device. For information on how to update and deploy device metadata, see [Custom driver access sample](https://code.msdn.microsoft.com/windowsapps/Custom-device-access-sample-43bde679). diff --git a/usb/usbsamp/README.md b/usb/usbsamp/README.md index 0669e8429..6eb899fd7 100644 --- a/usb/usbsamp/README.md +++ b/usb/usbsamp/README.md @@ -24,7 +24,7 @@ This sample builds a Universal Windows Driver. It uses only APIs and DDIs that a The sample driver can be loaded as the function driver for any of these devices: -- OSR FX2 learning kit. You can get the kit from [OSR Online](http://www.osronline.com/). +- OSR FX2 learning kit. You can get the kit from [OSR Online](http://www.osronline.com/). For more information, see the specification for the [OSR USB FX-2 Learning Kit](http://www.osronline.com/hardware/OSRFX2_32.pdf) - [MUTT devices](https://docs.microsoft.com/windows-hardware/drivers/usbcon/microsoft-usb-test-tool--mutt--devices). To order those devices, see [How to get MUTT devices](https://docs.microsoft.com/windows-hardware/drivers/usbcon/microsoft-usb-test-tool--mutt--devices#how-to-get-mutt-devices). - Intel 82930 USB test board. @@ -48,7 +48,7 @@ The driver folder contains these files: | File | Description | | --- | --- | -| usbsamp.sys | The driver file. | +| usbsamp.sys | The driver file | | usbsamp.inf | An information (INF) file that contains information needed to install the driver. | | kmdfsamples.cat | A signed catalog file, which serves as the signature for the entire package. | @@ -63,7 +63,9 @@ The process of moving the driver package to the target computer and installing t Before you automatically deploy a driver, you must provision the target computer. For instructions, see [Provision a computer for driver deployment and testing (WDK 10)](https://docs.microsoft.com/windows-hardware/drivers/gettingstarted/provision-a-target-computer-wdk-8-1). 1. On the host computer, in Visual Studio, in Solution Explorer, right click **package** (lower case), and choose **Properties**. Navigate to **Configuration Properties \> Driver Install \> Deployment**. + 1. Check **Enable deployment**, and check **Remove previous driver versions before deployment**. For **Target Computer Name**, select the name of a target computer that you provisioned previously. Select **Install and Verify**. Click **OK**. + 1. On the **Build** menu, choose **Deploy Package** or **Build Solution**. ### Manual deployment @@ -71,9 +73,10 @@ Before you automatically deploy a driver, you must provision the target computer Before you manually deploy a driver, you must turn on test signing and install a certificate on the target computer. You also need to copy the [DevCon](https://docs.microsoft.com/windows-hardware/drivers/devtest/devcon) tool to the target computer. For instructions, see [Preparing a Computer for Manual Driver Deployment](https://docs.microsoft.com/windows-hardware/drivers/develop/preparing-a-computer-for-manual-driver-deployment). 1. Copy all of the files in your driver package to a folder on the target computer (for example, c:\\Usbsamp). + 1. On the target computer, open a Command Prompt window as Administrator. Navigate to your driver package folder, and enter the following command: - **devcon install usbsamp.inf USB\\VID\_045E&PID\_078F** + `devcon install usbsamp.inf USB\VID_045E&PID_078F` ## View the device in Device Manager @@ -83,9 +86,9 @@ On the target computer, in a Command Prompt window, enter **devmgmt** to open De As an alternative to building the USBSAMP sample in Visual Studio, you can build it in a Visual Studio Command Prompt window. In Visual Studio, on the **Tools** menu, choose **Visual Studio Command Prompt**. In the Visual Studio Command Prompt window, navigate to the folder that has the solution file, Usbsamp.sln. Use the MSBuild command to build the solution. Here are some examples: - **msbuild /p:configuration="Debug" /p:platform="x64" Usbsamp.sln** + `msbuild /p:configuration="Debug" /p:platform="x64" Usbsamp.sln` - **msbuild /p:configuration="Release" /p:platform="Win32" Usbsamp.sln** + `msbuild /p:configuration="Release" /p:platform="Win32" Usbsamp.sln` For more information about using MSBuild to build a driver package, see [Building a Driver with Visual Studio and the WDK](https://docs.microsoft.com/windows-hardware/drivers/develop/building-a-driver). @@ -94,53 +97,55 @@ For more information about using MSBuild to build a driver package, see [Buildin The sample includes a test application, usbsamp.exe. This console application enumerates the interface registered by the driver and opens the device to send Read, Write, or DeviceIoControl requests based on the command line options. To test the sample, 1. In Visual Studio, choose **Solution Explorer** from the **View** menu. Locate the application project named **usbsamp**, under the **Exe** folder. + 1. Right-click and choose **Build**. For example, if your settings are Debug and x64, the application executable is in your solution folder under the exe\\Debug\\usbsamp.exe. + 1. Run the executable on the target machine. - To view all descriptors and endpoint information, use the following command. - **usbsamp.exe -u** + `usbsamp.exe -u` You can use the preceding command to view pipe numbers for read and write requests. - To send a Read-Write request, use the following command. - **usbsamp.exe -r 1024 -w 1024 -c 100 -v** + `usbsamp.exe -r 1024 -w 1024 -c 100 -v` The preceding command first writes 1024 bytes of data to bulk out endpoint (pipe 1), then reads 1024 bytes from bulk in endpoint (pipe 0), and compares the read buffer with write buffer to see if they match. If the buffer contents match, it performs this operation 100 times. - To send Read-Write requests to bulk endpoints, use any of the following commands, simultaneously. If Read-Write requests are sent to a SuperSpeed bulk endpoint with streams, the sample driver always uses the first underlying stream associated with that endpoint. The driver is multi-thread safe so it can handle multiple requests at a time. - **usbsamp.exe -r 65536** + `usbsamp.exe -r 65536` The preceding command reads 65536 bytes from pipe 0. - **usbsamp.exe -w 65536** + `usbsamp.exe -w 65536` The preceding command writes 65536 bytes to pipe 1. - **usbsamp.exe -r 65536 -i pipe02** + `usbsamp.exe -r 65536 -i pipe02` The preceding command reads 65536 bytes from pipe 2. - **usbsamp.exe -w 65536 -o pipe03** + `usbsamp.exe -w 65536 -o pipe03` The preceding command writes 65536 bytes to pipe 3. - To send Read and Write requests to isochronous endpoints you can use one or more of these commands simultaneously. - **usbsamp.exe -r 512 -i pipe04** + `usbsamp.exe -r 512 -i pipe04` The preceding command reads 512 bytes from pipe 4. - **usbsamp.exe -w 512 -o pipe05** + `usbsamp.exe -w 512 -o pipe05` The preceding command writes 512 bytes to pipe 5. - **usbsamp.exe -w 1024 -o pipe05 -r 1024 -i pipe04 -c 100 -v** + `usbsamp.exe -w 1024 -o pipe05 -r 1024 -i pipe04 -c 100 -v` The preceding command writes 1024 bytes to pipe 5, then reads 1024 bytes from pipe 4, and compares the buffers to see if they match. If the buffer contents match, it performs this operation 100 times. - To skip validation of the data to be read or written in a particular request, use the command with **-x** option as follows: - **usbsamp.exe -r 1024 -w 1024 -c 100 -x** + usbsamp.exe -r 1024 -w 1024 -c 100 -x diff --git a/usb/wdf_osrfx2_lab/README.md b/usb/wdf_osrfx2_lab/README.md index 07fbc2294..2f6221ef9 100644 --- a/usb/wdf_osrfx2_lab/README.md +++ b/usb/wdf_osrfx2_lab/README.md @@ -16,13 +16,13 @@ In the Windows Driver Kit (WDK) for Windows 7 and earlier versions of Windows, t Starting in Windows 8.1, the osrusbfx2 sample has been divided into these samples: -- [wdf\_osrfx2](https://docs.microsoft.com/en-us/samples/microsoft/windows-driver-samples/wdf-sample-driver-learning-lab-for-osr-usb-fx2/): This sample is a series of iterative drivers that demonstrate how to write a "Hello World" driver and adds additional features in each step. +- [wdf\_osrfx2](https://docs.microsoft.com/samples/microsoft/windows-driver-samples/wdf-sample-driver-learning-lab-for-osr-usb-fx2/): This sample is a series of iterative drivers that demonstrate how to write a "Hello World" driver and adds additional features in each step. -- [kmdf\_fx2](https://docs.microsoft.com/en-us/samples/microsoft/windows-driver-samples/sample-kmdf-bus-driver-for-osr-usb-fx2/): This sample is the final version of kernel-mode wdf\_osrfx2 driver. The sample demonstrates KMDF methods. +- [kmdf\_fx2](https://docs.microsoft.com/samples/microsoft/windows-driver-samples/sample-kmdf-bus-driver-for-osr-usb-fx2/): This sample is the final version of kernel-mode wdf\_osrfx2 driver. The sample demonstrates KMDF methods. -- [umdf\_fx2](https://docs.microsoft.com/en-us/samples/microsoft/windows-driver-samples/sample-umdf-function-driver-for-osr-usb-fx2-umdf-version-1/): This sample is the final version of the user-mode driver wdf\_osrfx2. The sample demonstrates UMDF methods. +- [umdf\_fx2](https://docs.microsoft.com/samples/microsoft/windows-driver-samples/sample-umdf-function-driver-for-osr-usb-fx2-umdf-version-1/): This sample is the final version of the user-mode driver wdf\_osrfx2. The sample demonstrates UMDF methods. -This sample is written for the OSR USB-FX2 Learning Kit. The specification for the device is at . +This sample is written for the OSR USB-FX2 Learning Kit. For more information, see the specification for the [OSR USB FX-2 Learning Kit](http://www.osronline.com/hardware/OSRFX2_32.pdf). ## Build the sample @@ -35,6 +35,7 @@ The default Solution build configuration is Windows 8.1 Debug and Win32. You ca 1. Right-click the solution in the **Solutions Explorer** and select **Configuration Manager**. 1. From the **Configuration Manager**, select the **Active Solution Configuration** (for example, Windows 8.1 Debug or Windows 8.1 Release) and the **Active Solution Platform** (for example, Win32) that correspond to the type of build you are interested in. + 1. Each driver project in this iterative sample creates a binary with the same name, osrusbfx2.sys. As a result, you can build only the single project you're currently working on, as well as the package project. You can do this by selecting only these two projects in **Configuration Manager**. 1. From the **Build** menu, click **Build Solution** (Ctrl+Shift+B). @@ -44,48 +45,48 @@ The default Solution build configuration is Windows 8.1 Debug and Win32. You ca Here is the overview of the device: - The device is based on the development board supplied with the Cypress EZ-USB FX2 Development Kit (CY3681). + - It contains 1 interface and 3 endpoints (Interrupt IN, Bulk Out, Bulk IN). + - Firmware supports vendor commands to query or set LED Bar graph display and 7-segment LED display, and to query toggle switch states. + - Interrupt Endpoint: + - Sends an 8-bit value that represents the state of the switches. + - Sent on startup, resume from suspend, and whenever the switch pack setting changes. + - Firmware does not de-bounce the switch pack. + - One switch change can result in multiple bytes being sent. + - Bits are in the reverse order of the labels on the pack (for example, bit 0x80 is labeled 1 on the pack). + - Bulk Endpoints are configured for loopback: + - The device moves data from IN endpoint to OUT endpoint. + - The device does not change the values of the data it receives nor does it internally create any data. + - Endpoints are always double buffered. + - Maximum packet size depends on speed (64 full speed, 512 high speed). ## Sample Contents for KMDF -The KMDF sample contains a console test application and a series of drivers. The driver is iterative as a series of steps, starting with a basic "Hello World" driver. Each step is describe in the following table. - - ---- - - - - - - - - - - - -
Folder -Description
usb\wdf_osrfx2_lab\kmdf\step1

-The most basic step. The source file contains a minimal amount of code to get the driver loaded in memory and respond to PnP and Power events. You can install, uninstall, disable, enable, suspend, and resume the system.
usb\wdf_osrfx2_lab\kmdf\step2 -
    -
  1. Creates a context with the WDFDEVICE object.
  2. -
  3. Initializes the USB device by registering a EvtPrepareHardware callback.
  4. -
  5. Registers an interface so that application can open a handle to the device.
  6. -
+The KMDF sample contains a console test application and a series of drivers. The driver is iterative as a series of steps, starting with a basic "Hello World" driver. + +### usb\wdf_osrfx2_lab\kmdf\step1 + +The most basic step. The source file contains a minimal amount of code to get the driver loaded in memory and respond to PnP and Power events. You can install, uninstall, disable, enable, suspend, and resume the system. + +### usb\wdf_osrfx2_lab\kmdf\step2 + +- Creates a context with the WDFDEVICE object + +- Initializes the USB device by registering a **EvtPrepareHardware** callback + +- Registers an interface so that application can open a handle to the device ## Testing the driver @@ -94,18 +95,24 @@ The sample includes a test application, osrusbfx2.exe, that you can use to test Usage for Read/Write test: - -r [*n*], where *n* is number of bytes to read. + - -w [*n*], where *n* is number of bytes to write. + - -c [*n*], where *n* is number of iterations (default = 1). + - -v, shows verbose read data. + - -p, plays with Bar Display, Dip Switch, 7-Segment Display. + - -a, performs asynchronous I/O operation. + - -u, dumps USB configuration and pipe information. ### Playing with the 7 segment display, toggle switches and bar graph display Use the command `osrusbfx2.exe -p` with options 1-9 to set and clear bar graph display, set and get 7-segment state, and read the toggle switch states. The following list shows the function options: -```txt +```cmd 1. Light bar 2. Clear bar 3. Light entire bar graph @@ -157,216 +164,202 @@ The following command displays all the descriptors and endpoint information. If the device is operating in high speed mode, you get the following information: -```txt -`===================` +```cmd +=================== -`USB_CONFIGURATION_DESCRIPTOR` +USB_CONFIGURATION_DESCRIPTOR -`bLength = 0x9, decimal 9` +bLength = 0x9, decimal 9 -`bDescriptorType = 0x2 ( USB_CONFIGURATION_DESCRIPTOR_TYPE )` +bDescriptorType = 0x2 ( USB_CONFIGURATION_DESCRIPTOR_TYPE ) -`wTotalLength = 0x27, decimal 39` +wTotalLength = 0x27, decimal 39 -`bNumInterfaces = 0x1, decimal 1` +bNumInterfaces = 0x1, decimal 1 -`bConfigurationValue = 0x1, decimal 1` +bConfigurationValue = 0x1, decimal 1 -`iConfiguration = 0x4, decimal 4` +iConfiguration = 0x4, decimal 4 -`bmAttributes = 0xa0 ( USB_CONFIG_BUS_POWERED )` +bmAttributes = 0xa0 ( USB_CONFIG_BUS_POWERED ) -`MaxPower = 0x32, decimal 50` +MaxPower = 0x32, decimal 50 -`-----------------------------` +----------------------------- -`USB_INTERFACE_DESCRIPTOR #0` +USB_INTERFACE_DESCRIPTOR #0 -`bLength = 0x9` +bLength = 0x9 -`bDescriptorType = 0x4 ( USB_INTERFACE_DESCRIPTOR_TYPE )` +bDescriptorType = 0x4 ( USB_INTERFACE_DESCRIPTOR_TYPE ) -`bInterfaceNumber = 0x0` +bInterfaceNumber = 0x0 -`bAlternateSetting = 0x0` +bAlternateSetting = 0x0 -`bNumEndpoints = 0x3` +bNumEndpoints = 0x3 -`bInterfaceClass = 0xff` +bInterfaceClass = 0xff -`bInterfaceSubClass = 0x0` +bInterfaceSubClass = 0x0 -`bInterfaceProtocol = 0x0` +bInterfaceProtocol = 0x0 -`bInterface = 0x0` +bInterface = 0x0 -`------------------------------` +------------------------------ -`USB_ENDPOINT_DESCRIPTOR for Pipe00` +USB_ENDPOINT_DESCRIPTOR for Pipe00 -`bLength = 0x7` +bLength = 0x7 -`bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE )` +bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE ) -`bEndpointAddress= 0x81 ( INPUT )` +bEndpointAddress= 0x81 ( INPUT ) -`bmAttributes= 0x3 ( USB_ENDPOINT_TYPE_INTERRUPT )` +bmAttributes= 0x3 ( USB_ENDPOINT_TYPE_INTERRUPT ) -`wMaxPacketSize= 0x49, decimal 73` +wMaxPacketSize= 0x49, decimal 73 -`bInterval = 0x1, decimal 1` +bInterval = 0x1, decimal 1 -`------------------------------` +------------------------------ -`USB_ENDPOINT_DESCRIPTOR for Pipe01` +USB_ENDPOINT_DESCRIPTOR for Pipe01 -`bLength = 0x7` +bLength = 0x7 -`bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE )` +bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE ) -`bEndpointAddress= 0x6 ( OUTPUT )` +bEndpointAddress= 0x6 ( OUTPUT ) -`bmAttributes= 0x2 ( USB_ENDPOINT_TYPE_BULK )` +bmAttributes= 0x2 ( USB_ENDPOINT_TYPE_BULK ) -`wMaxPacketSize= 0x200, ` +wMaxPacketSize= 0x200, -`decimal 512 bInterval = 0x0, ` +decimal 512 bInterval = 0x0, -`decimal 0` +decimal 0 -`------------------------------` +------------------------------ -`USB_ENDPOINT_DESCRIPTOR for Pipe02` +USB_ENDPOINT_DESCRIPTOR for Pipe02 -`bLength = 0x7` +bLength = 0x7 -`bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE )` +bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE ) -`bEndpointAddress= 0x88 ( INPUT )` +bEndpointAddress= 0x88 ( INPUT ) -`bmAttributes= 0x2 ( USB_ENDPOINT_TYPE_BULK )` +bmAttributes= 0x2 ( USB_ENDPOINT_TYPE_BULK ) -`wMaxPacketSize= 0x200, decimal 512` +wMaxPacketSize= 0x200, decimal 512 -`bInterval = 0x0, decimal 0` +bInterval = 0x0, decimal 0 ``` If the device is operating in low speed mode, you will get the following information: ```txt -`===================` +=================== -`USB_CONFIGURATION_DESCRIPTOR` +USB_CONFIGURATION_DESCRIPTOR -`bLength = 0x9, decimal 9` +bLength = 0x9, decimal 9 -`bDescriptorType = 0x2 ( USB_CONFIGURATION_DESCRIPTOR_TYPE )` +bDescriptorType = 0x2 ( USB_CONFIGURATION_DESCRIPTOR_TYPE ) -`wTotalLength = 0x27, decimal 39` +wTotalLength = 0x27, decimal 39 -`bNumInterfaces = 0x1, decimal 1` +bNumInterfaces = 0x1, decimal 1 -`bConfigurationValue = 0x1, decimal 1` +bConfigurationValue = 0x1, decimal 1 -`iConfiguration = 0x3, decimal 3` +iConfiguration = 0x3, decimal 3 -`bmAttributes = 0xa0 ( USB_CONFIG_BUS_POWERED )` +bmAttributes = 0xa0 ( USB_CONFIG_BUS_POWERED ) -`MaxPower = 0x32, decimal 50 ` +MaxPower = 0x32, decimal 50 -`-----------------------------` +----------------------------- -`USB_INTERFACE_DESCRIPTOR #0` +USB_INTERFACE_DESCRIPTOR #0 -`bLength = 0x9` +bLength = 0x9 -`bDescriptorType = 0x4 ( USB_INTERFACE_DESCRIPTOR_TYPE )` +bDescriptorType = 0x4 ( USB_INTERFACE_DESCRIPTOR_TYPE ) -`bInterfaceNumber = 0x0 bAlternateSetting = 0x0` +bInterfaceNumber = 0x0 bAlternateSetting = 0x0 -`bNumEndpoints = 0x3` +bNumEndpoints = 0x3 -`bInterfaceClass = 0xff` +bInterfaceClass = 0xff -`bInterfaceSubClass = 0x0` +bInterfaceSubClass = 0x0 -`bInterfaceProtocol = 0x0` +bInterfaceProtocol = 0x0 -`bInterface = 0x0` +bInterface = 0x0 -`------------------------------` +------------------------------ -`USB_ENDPOINT_DESCRIPTOR for Pipe00` +USB_ENDPOINT_DESCRIPTOR for Pipe00 -`bLength = 0x7` +bLength = 0x7 -`bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE )` +bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE ) -`bEndpointAddress= 0x81 ( INPUT )` +bEndpointAddress= 0x81 ( INPUT ) -`bmAttributes= 0x3 ( USB_ENDPOINT_TYPE_INTERRUPT )` +bmAttributes= 0x3 ( USB_ENDPOINT_TYPE_INTERRUPT ) -`wMaxPacketSize= 0x49, decimal 73` +wMaxPacketSize= 0x49, decimal 73 -`bInterval = 0x1, decimal 1` +bInterval = 0x1, decimal 1 -`------- -----------------------` +------------------------------ -`USB_ENDPOINT_DESCRIPTOR for Pipe01` +USB_ENDPOINT_DESCRIPTOR for Pipe01 -`bLength = 0x7` +bLength = 0x7 -`bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE )` +bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE ) -`bEndpointAddress= 0x6 ( OUTPUT )` +bEndpointAddress= 0x6 ( OUTPUT ) -`bmAttributes= 0x2 ( USB_ENDPOINT_TYPE_BULK )` +bmAttributes= 0x2 ( USB_ENDPOINT_TYPE_BULK ) -`wMaxPacketSize= 0x40, decimal 64` +wMaxPacketSize= 0x40, decimal 64 -`bInterval = 0x0, decimal 0` +bInterval = 0x0, decimal 0 -`------------------------------` +------------------------------ -`USB_ENDPOINT_DESCRIPTOR for Pipe02` +USB_ENDPOINT_DESCRIPTOR for Pipe02 -`bLength = 0x7` +bLength = 0x7 -`bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE )` +bDescriptorType = 0x5 ( USB_ENDPOINT_DESCRIPTOR_TYPE ) -`bEndpointAddress= 0x88 ( INPUT )` +bEndpointAddress= 0x88 ( INPUT ) -`bmAttributes= 0x2 ( USB_ENDPOINT_TYPE_BULK )` +bmAttributes= 0x2 ( USB_ENDPOINT_TYPE_BULK ) -`wMaxPacketSize= 0x40, decimal 64` +wMaxPacketSize= 0x40, decimal 64 -`bInterval = 0x0, decimal 0 ` +bInterval = 0x0, decimal 0 ``` ## Sample Contents for UMDF -The UMDF sample driver is developed as a series of steps, starting with a basic "Hello World" driver. Each step progressively adds functionality to the previous step. Each step is described in the following table. - - ---- - - - - - - - - - - - -
Folder -Description
usb\wdf_osrfx2_lab\umdf\step1

-The most basic step. The source file contains a minimal amount of code to get the driver loaded in memory and respond to PnP and Power events. You can install, uninstall, disable, enable, suspend, and resume the system.
usb\wdf_osrfx2_lab\umdf\step2 -
    -
  1. The device registers a PnP device interface so that application can open a handle to the device.
  2. -
  3. The device object implements IPnpCallbackHardware interface and initializes USB I/O targets in IPnpCallbackHardware::OnPrepareHardware method.
  4. -
+The UMDF sample driver is developed as a series of steps, starting with a basic "Hello World" driver. Each step progressively adds functionality to the previous step. + +### usb\wdf_osrfx2_lab\umdf\step1 + +The most basic step. The source file contains a minimal amount of code to get the driver loaded in memory and respond to PnP and Power events. You can install, uninstall, disable, enable, suspend, and resume the system. + +### usb\wdf_osrfx2_lab\umdf\step2 + +- The device registers a PnP device interface so that application can open a handle to the device. + +- The device object implements **IPnpCallbackHardware** interface and initializes USB I/O targets in **IPnpCallbackHardware::OnPrepareHardware** method.