⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sdhcd.h

📁 6410BSP3
💻 H
📖 第 1 页 / 共 2 页
字号:
    (pSlot)->SlotIndex,         \
    SDHCDAckSDIOInterrupt,      \
    NULL,                       \
    0)

typedef struct _SDHOST_API_FUNCTIONS {
    DWORD dwSize;

    SD_API_STATUS (*pAllocateContext)(DWORD cSlots,
        PSDCARD_HC_CONTEXT *ppHostContext);

    VOID (*pDeleteContext)(PSDCARD_HC_CONTEXT pHostContext);

    SD_API_STATUS (*pRegisterHostController)(PSDCARD_HC_CONTEXT pHCContext);

    SD_API_STATUS (*pDeregisterHostController)(PSDCARD_HC_CONTEXT pHCContext);

    VOID (*pIndicateSlotStateChange)(PSDCARD_HC_CONTEXT pHCContext, 
        DWORD              SlotNumber,
        SD_SLOT_EVENT      Event);

    VOID (*pIndicateBusRequestComplete)(PSDCARD_HC_CONTEXT pHCContext,
        PSD_BUS_REQUEST    pRequest,
        SD_API_STATUS      Status);

    VOID (*pUnlockRequest)(PSDCARD_HC_CONTEXT  pHCContext,
        PSD_BUS_REQUEST     pRequest);

    PSD_BUS_REQUEST (*pGetAndLockCurrentRequest)(PSDCARD_HC_CONTEXT pHCContext, 
        DWORD              SlotIndex);

    VOID (*pPowerUpDown)(PSDCARD_HC_CONTEXT  pHCContext, 
        BOOL                PowerUp, 
        BOOL                SlotKeepPower,
        DWORD               SlotIndex);
} SDHOST_API_FUNCTIONS, *PSDHOST_API_FUNCTIONS;
typedef SDHOST_API_FUNCTIONS const * PCSDHOST_API_FUNCTIONS;



#ifdef __cplusplus
extern "C" {
#endif //__cplusplus

// SDHCDInitializeHCLib - Initialize the host controller library
//
// Return: SD_API_STATUS 
// Notes: Call from DLL entry
//
SD_API_STATUS SDHCDInitializeHCLib();

// SDHCDDeinitializeHCLib - Deinitialize the host controller library
//
// Return: SD_API_STATUS 
// Notes: Call from DLL entry
//
SD_API_STATUS SDHCDDeinitializeHCLib();

// SDHCDAllocateContext - Allocate an HCD Context
//
// Input: NumberOfSlots - Number of slots
// Output:
//        ppHostContext - caller supplied storage for the host context
// Return: SD_API_STATUS 
// Notes:
//
SD_API_STATUS SDHCDAllocateContext(
    DWORD               cSlots, 
    PSDCARD_HC_CONTEXT *ppHostContext);

// SDHCDDeleteContext - Delete an HCD context
//
// Input: pHostContext - Host Context to delete
// Output:
// Return:
//
VOID SDHCDDeleteContext(
    PSDCARD_HC_CONTEXT pHostContext);


// SDHCDRegisterHostController - Register a host controller with the bus driver
//
// Input: pHCContext - Allocated Host controller context
//
// Output:
// Return: SD_API_STATUS 
// Notes:      
//      the caller must allocate a host controller context and 
//      initialize the various parameters
SD_API_STATUS SDHCDRegisterHostController(
    PSDCARD_HC_CONTEXT pHCContext);

// SDHCDDeregisterHostController - Deregister a host controller 
//
// Input: pHCContext - Host controller context that was previously registered
//        
// Output:
// Return: SD_API_STATUS 
// Notes:       
//      A host controller must call this api before deleting the HC context
//      
// returns SD_API_STATUS
SD_API_STATUS SDHCDDeregisterHostController(
    PSDCARD_HC_CONTEXT pHCContext);


// SDHCDIndicateSlotStateChange - indicate a change in the SD Slot 
//
// Input: pHCContext - Host controller context that was previously registered
//        SlotNumber - Slot Number
//        Event     - new event code
// Output:
// Return:
// Notes:        
//      A host controller driver calls this api when the slot changes state (i.e.
//      device insertion/deletion).
//      
// 
VOID SDHCDIndicateSlotStateChange(
    PSDCARD_HC_CONTEXT pHCContext, 
    DWORD              SlotNumber,
    SD_SLOT_EVENT      Event);

// SDHCDIndicateBusRequestComplete - indicate to the bus driver that
//                                   the request is complete
//
// Input: pHCContext - host controller context
//        pRequest   - the request to indicate
//        Status     - the ending status of the request
// Output:
// Return: 
// Notes:       
//     
VOID SDHCDIndicateBusRequestComplete(
    PSDCARD_HC_CONTEXT pHCContext,
    PSD_BUS_REQUEST    pRequest,
    SD_API_STATUS      Status);


// SDHCDUnlockRequest - Unlock a request that was previous locked
//                             
// Input:   pHCContext - host controller context   
//          pRequest  - the request to lock
// Output:
// Return:    
// Notes:   This function unlocks the request that was returned from the
//          function SDHCDGetAndLockCurrentRequest()
//          
//          This request can now be cancelled from any thread context
VOID SDHCDUnlockRequest(
    PSDCARD_HC_CONTEXT  pHCContext,
    PSD_BUS_REQUEST     pRequest);

// SDHCDGetAndLockCurrentRequest - get the current request in the host controller
//                                 slot and lock it to keep it from being cancelable
// Input:   pHCContext - host controller context   
//          SlotIndex  - the slot number 
// Output:
// Return: current bus request  
// Notes:
//          This function retrieves the current request and marks the
//          request as NON-cancelable.  To return the request back to the
//          cancelable state the caller must call SDHCDUnlockRequest()     
//          This function returns the current request which can be NULL if 
//          the request was previously marked cancelable and the host controller's
//          cancelIo Handler completed the request 
PSD_BUS_REQUEST SDHCDGetAndLockCurrentRequest(
    PSDCARD_HC_CONTEXT pHCContext, 
    DWORD              SlotIndex);


// SDHCDPowerUpDown - Indicate a power up/down event
//                             
// Input:   pHCContext - host controller context   
//          PowerUp    - set to TRUE if powering up
//          SlotKeepPower - set to TRUE if the slot maintains power to the
//                          slot during power down
// Output:
// Return:        
// Notes:   This function notifies the bus driver of a power up/down event.
//          The host controller driver can indicate to the bus driver that power
//          can be maintained for the slot.  If power is removed, the bus driver
//          will unload the device driver on the next power up event.
//          This function can only be called from the host controller's XXX_PowerOn
//          and XXX_PowerOff function.
VOID SDHCDPowerUpDown(
    PSDCARD_HC_CONTEXT  pHCContext, 
    BOOL                PowerUp, 
    BOOL                SlotKeepPower,
    DWORD               SlotIndex);

#ifdef __cplusplus
}
#endif //__cplusplus


#endif // _SDCARD_HCD_DEFINED

// DO NOT REMOVE --- END EXTERNALLY DEVELOPED SOURCE CODE ID --- DO NOT REMOVE

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -