1.首先在BSP底下建你要的driver folder。
\WINCE600\PLATFORM\DEVICEEMULATOR\SRC\DRIVERS
2.接著建立所需的makefile、.def、sources、.c(or .cpp)檔。 內容設定如下:簡略說明,可參閱stream driver文章。
D:\WINCE600\PLATFORM\DEVICEEMULATOR\SRC\DRIVERS\CINTEST
.def檔
//=========================================
LIBRARY CINTEST // driver folder 名稱
EXPORTS
// 要export 的function
XXX_Init
XXX_Deinit
XXX_Open
XXX_Close
XXX_IOControl
XXX_PowerUp
XXX_PowerDown
XXX_Read
XXX_Write
XXX_Seek
//=========================================
source檔
//=========================================
SYNCHRONIZE_DRAIN=1
TARGETNAME=CIN //.dll的名稱
RELEASETYPE=PLATFORM
TARGETTYPE=DYNLINK
TARGETLIBS= \
$(_SYSGENSDKROOT)\lib\$(_CPUINDPATH)\coredll.lib \ //會呼叫到的library
SOURCES= \
cin.c \\用到的.c檔
//=========================================
3.修改platform.reg和platform.bib檔
\WINCE600\PLATFORM\DEVICEEMULATOR\FILES
platform.reg
//=========================================
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Cin]
"Dll" = "CIN.dll"
"Prefix" ="CIN"
"Index"= dword:1
"Order"= dword:0
"FriendlyName" = "CIN Demo Driver"
"Ioctl" = dword:0
//=========================================
platform.bib
//=========================================
CIN.dll $(_FLATRELEASEDIR)\CIN.dll NK SHK
//=========================================
沒有留言:
張貼留言