next up previous contents
Next: 5. Developing a Driver Up: 4. Using DriverWizard Previous: 4.2 DriverWizard Walkthrough   Contents

Subsections


4.3 DriverWizard Notes


4.3.1 Sharing a Resource

If you want more than one driver to share a single resource, you must define that resource as shared:

  1. Select the resource.
  2. Right click on the resource.
  3. Select Share from the menu.

****************************************************************************************
  NOTE
  New interrupts are set as Shared by default. If you wish to define an interrupt as unshared, follow Steps 1 and 2, and select Unshared in Step 3.
****************************************************************************************


4.3.2 Disabling a Resource

During your diagnostics, you may wish to disable a resource so that DriverWizard will ignore it and not create code for it.

  1. Select the resource.
  2. Right click on the resource name.
  3. Choose Disable from the menu.


4.3.3 Logging WinDriver API Calls

You have the option to log all the WinDriver API calls using the DriverWizard, with the API calls input and output parameters. You can select this option by selecting the Log API calls option from the Tools menu or by clicking on the Log API calls toolbar icon in the DriverWizard's opening window.


4.3.4 DriverWizard Logger

The wizard logger is the empty window that opens along with the Device Resources dialogue box when you open a new project. The logger keeps track of all of the input and output during the diagnostics stage, so that you may analyze your device's physical performance at a later time. You can save the log for future reference. When saving the project, your log is saved as well. Each log is associated with one project.


4.3.5 Automatic Code Generation

After you have finished diagnosing your device and have ensured that it runs according to your specifications, you are ready to write your driver.


4.3.5.1 Generating the Code

Generate code by selecting this option either via the DriverWizard's Generate Code toolbar icon or from the wizard's Project | Generate Code menu. DriverWizard will generate the source code for your driver, and place it along with the project file (xxx.wdp, where "xxx" is the project name). The files are saved in a directory DriverWizard creates for every development environment and operating system selected in the code generation dialogue box.


4.3.5.2 The Generated PCI/PCMCIA/ISA C Code

In the source code directory you now have a new xxx_lib.h file, which contains type definitions and functions declarations for the API created for you by the DriverWizard, and an xxx_lib.c source file, which contains the implementation of the generated device-specific API.
In addition, you will find an xxx_diag.c source file, which includes a main() function and implements a sample diagnostics application that utilizes the generated DriverWizard API to communicate with your device.

The code generated by DriverWizard is composed of the following elements and files, where xxx represents your DriverWizard project name:

After creating your code, compile it with your favorite compiler, and see it work!

Change the function main() of the program so that the functionality suites your needs.


4.3.5.3 The Generated Visual Basic and Delphi Code

The generated DriverWizard Visual Basic and Delphi code includes similar functions and provides similar functionality as the generated C code described in section 4.3.5.2.

The generated Delphi code implements a console application (like the C code), while the Visual Basic code implements a GUI application.


4.3.5.4 The Generated C# Code

The generated DriverWizard C# code provides similar functionality as the generated C code [4.3.5.2], but from a GUI .NET program.


4.3.6 Compiling the Generated Code


4.3.6.1 Windows and Windows CE Compilation:

As explained above, on Windows you can select to generate project and workspace/solution files for any of the supported integrated development environments (IDEs) - MSDEV/Visual C++ 5/6, MSDEV .NET 2003/2005, Borland C++ Builder, Visual Basic 6.0, Borland Delphi, MS eMbedded Visual C++ or MS Platform Builder - and you can also select to automatically invoke your selected IDE from the wizard. You can then proceed to immediately build and run the code from your IDE.

You can also build the generated code from any other IDE that supports the selected code language and target OS. Simply create a new project file for your selected IDE, then add the generated source files to your project and compile and run the code.

****************************************************************************************
  NOTES
 
  • For Windows 98/Me/2000/XP/Server 2003/Vista, the generated IDE files are located under an x86$\backslash$ directory - for 32-bit projects, or amd64$\backslash$ directory - for 64-bit projects.
  • For Windows CE, note that the generated Windows Mobile code is targeted at the Windows Mobile 5.0/6.0 ARMV4I SDK.
****************************************************************************************


4.3.6.2 Linux and Solaris Compilation

Use the makefile that was created for you by DriverWizard in order to build the generated code using your favourite compiler, preferably GCC.


next up previous contents
Next: 5. Developing a Driver Up: 4. Using DriverWizard Previous: 4.2 DriverWizard Walkthrough   Contents