SD Card Driver on wince5

来源:互联网 发布:反美颜软件作文 编辑:程序博客网 时间:2024/05/18 00:34
 

下面为具体的DISK I/O操作函数和CARD I/O操作函数,详细实现见sdmemdiskio.cppsdmemcardio.cpp

//

// SDDiskIO

//

//  SDMemCardConfig    - Initialise the memcard structure and card itself

DWORD SDMemCardConfig( PSD_MEMCARD_INFO pMemCard );

    //  SDMemRead          - Read data from card into pSG scatter gather buffers

DWORD SDMemRead( PSD_MEMCARD_INFO pMemCard, PSG_REQ pSG );

    //  SDMemWrite         - Write data to card from pSG scatter gather buffers

DWORD SDMemWrite( PSD_MEMCARD_INFO pMemCard, PSG_REQ pSG );

    //  SDMemErase         - Erase a contiguous set of blocks

DWORD SDMemErase( PSD_MEMCARD_INFO pMemCard, PDELETE_SECTOR_INFO pDSI );

    //  SDMemEraseAll      - Erase all blocks

DWORD SDMemEraseAll( PSD_MEMCARD_INFO pMemCard );

//

// SDCardIO

//

    //  SDMemDoBusRequest  - Perform a bus request, returns Windows Status

DWORD SDMemDoBusRequest( PSD_MEMCARD_INFO  pMemcard,

                         UCHAR             Command,

                         DWORD             Argument,

                         SD_TRANSFER_CLASS TransferClass,

                         SD_RESPONSE_TYPE  ResponseType,

                         ULONG             NumBlocks,

                         ULONG             BlockSize,

                         PUCHAR            pBuffer,

                         DWORD             Flags);

    //  SDMemSetBlockLen   - Sets read/write block length for SD memory card

DWORD SDMemSetBlockLen( PSD_MEMCARD_INFO pMemcard,

                        DWORD            BlockLen );

    //  SDMemReadMultiple  - Read multiple 512 byte blocks of data from card

DWORD SDMemReadMultiple( PSD_MEMCARD_INFO pHandle,

                         ULONG            StartBlock,

                         ULONG            NumBlocks,

                         PUCHAR           pBuffer );

    //  SDMemWriteMultiple - Write multiple 512 byte blocks of data to card

DWORD SDMemWriteMultiple( PSD_MEMCARD_INFO pHandle,

                          LONG             StartBlock,

                          LONG             NumBlocks,

                          PUCHAR           pBuffer );

    //  SDMemWriteUsingSingleBlocks - Write using single block writes

DWORD SDMemWriteUsingSingleBlocks( PSD_MEMCARD_INFO pHandle,

                                   LONG             StartBlock,

                                   LONG             NumBlocks,

                                   PUCHAR           pBuffer );

    //  SDMemDoErase - Erase a contiguous set of blocks

DWORD SDMemDoErase( PSD_MEMCARD_INFO pHandle,

                    LONG             StartBlock,

                    LONG             NumBlocks );

DWORD SDAPIStatusToErrorCode( SD_API_STATUS Status );

DWORD SDGetCardStatus(PSD_MEMCARD_INFO pMemCard , SD_CARD_STATUS *pCardStatus);

VOID HandleIoctlPowerSet(PSD_MEMCARD_INFO       pMemCard,

                         PCEDEVICE_POWER_STATE  pDevicePowerState);

VOID InitializePowerManagement(PSD_MEMCARD_INFO pMemCard);

VOID DeinitializePowerManagement(PSD_MEMCARD_INFO pMemCard);

SD_API_STATUS IssueCardSelectDeSelect(PSD_MEMCARD_INFO pMemCard, BOOL Select);

VOID RequestEnd(PSD_MEMCARD_INFO pMemCard);

SD_API_STATUS RequestPrologue(PSD_MEMCARD_INFO pMemCard, DWORD DeviceIoControl);

原创粉丝点击