SD Card Driver on wince4

 

Client Driver

目前,WINCE5.0所支持的client driver如下:

l         SD Memory Class

l         SDIO Bluetooth Class - Type A

l         SDIO WiFi (vendor specific)

如果需要自己写client驱动的话可以参考D:/WINCE500/PUBLIC/COMMON/OAK/DRIVERS/SDCARD/SDCLIENTDRIVERS目录下的微软自带的SD client驱动来写。

example1: SD MEMORY DRIVER UNDER WINCE 5.0

Wince自带的SD存储卡client驱动,代码路径为:

D:/WINCE500/PUBLIC/COMMON/OAK/DRIVERS/SDCARD/SDCLIENTDRIVERS/SDMEMORY

一个SD存储卡在WINCE里的驱动架构如下图所示:
[图无法插入]

1注册表和启动

在注册表里告诉Storage Manager

[HKEY_LOCAL_MACHINE/System/StorageManager/Profiles/SDMemory]

    "Name"="SD Memory Card"

    "Folder"="Storage Card"

    ;"PartitionDriver"=""          ; removable storage cannot have partitions

[HKEY_LOCAL_MACHINE/System/StorageManager/Profiles/MMC]

    "Name"="MMC Card"

    "Folder"="Storage Card"

    ;"PartitionDriver"=""          ; removable storage cannot have partitions

; SD Memory Storage class driver

[HKEY_LOCAL_MACHINE/Drivers/SDCARD/ClientDrivers/Class/SDMemory_Class]

   "Dll"="SDMemory.dll"

   "Prefix"="DSK"

   "BlockTransferSize"=dword:40  ; send no more than 64 blocks of data per bus transfer

   ;"SingleBlockWrites"=dword:1  ; alternatively force the driver to use single block access

   ;"IdleTimeout"=dword:7D0      ; 2000 milliseconds

   ;"IdlePowerState"=dword:2     ; 0 == D0, 1 == D1, etc.

   ;"DisablePowerManagement"=""  ; if value present, then disable (remove value to enable)

   "Profile"="SDMemory"

   "IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}",

                     "{A32942B7 -920C -486b-B0E6 -92A 702A 99B35}"

; MMC Storage Class Driver

[HKEY_LOCAL_MACHINE/Drivers/SDCARD/ClientDrivers/Class/MMC_Class]

   "Dll"="SDMemory.dll"

   "Prefix"="DSK"

   "BlockTransferSize"=dword:40  ; send no more than 64 blocks of data per bus transfer

   ;"SingleBlockWrites"=dword:1  ; alternatively force the driver to use single block access

   ;"IdleTimeout"=dword:7D0      ; milliseconds

   ;"IdlePowerState"=dword:2     ; 0 == D0, 1 == D1, etc.

   ;"DisablePowerManagement"=""  ; if value present, then disable (remove value to enable)

   "Profile"="MMC"

   "IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}",

                     "{A32942B7 -920C -486b-B0E6 -92A 702A 99B35}"

2 SD命令和总线要求

将所有磁盘的操作转换成SD的命令和总线要求

NAME SDMEMORY.DLL

EXPORTS

DSK_Close=SMC_Close

DSK_Deinit=SMC_Deinit

DSK_Init=SMC_Init

DSK_IOControl=SMC_IOControl

DSK_Open=SMC_Open

DSK_PowerDown=SMC_PowerDown

DSK_PowerUp=SMC_PowerUp

DSK_Read=SMC_Read

DSK_Seek=SMC_Seek

DSK_Write=SMC_Write

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值