To add a new driver in Wince7: (Take a simple led driver as an example)
1 . Right-click the Platform\zynq7000\src\drivers directory in the Solution Explorer window and select Add->new Sources subproject, In the pop-Up Subproject wizard dialog box, select the WCE dynamic-link Library and set the subproject name to the LED. Click Next and select an empty subproject, click Next and select Add to the current Dirs file. This allows you to create a new LED driver directory under the drivers directory.
2 . In the Solution Explorer window, you can see the newly created led catalog, under which the Include files and source files directories can be added to the header files and sources. Here, add the led.h and LED.C files separately. As shown below:
This allows you to add the required driver code to the LED.C. Here are a few functions that should be required:
3. Add the following code to the Led.def:
LIBRARY ledexportsLed_initLed_deinitLed_openLed_closeLed_powerupLed_powerdownLed_iocontrol
4 . Right-click on the LED catalog to open the Properties dialog box. The settings in this dialog box are actually equivalent to the modification of the sources file. Here you can set the warning level, the dynamic library name, and so on, as shown below.
5. Create a new registry file Led.reg in the LED directory and enter the following code:
[hkey_local_machine\drivers\builtin\led]"Prefix" = "LED""Dll" = "Led.dll""Order" = "1"
6 . Add the Platform.bib file modules area in the parameter files directory
Led.dll $ (_flatreleasedir) \led.dll NK SHK
7 . Add the Platform.reg file in the parameter files directory
#include "$ (_targetplatroot) \src\drivers\led\led.reg"
8. Sysgen recompile once NK
How to add a new driver under Wince7