Jump to main content

##

# 1.1.6.4.1 DRV_SDMMC_Initialize Function

## C

    SYS_MODULE_OBJ DRV_SDMMC_Initialize (
        const SYS_MODULE_INDEX index,
        const SYS_MODULE_INIT* const init
    );

## Summary

Initializes the SD Card driver.

## Description

This routine initializes the SD Card driver, making it ready for clients to open and use the driver.

## Precondition

None.

## Parameters

Param | Description
--- | ---
drvIndex | Index for the driver instance to be initialized
init | Pointer to a data structure containing any data necessary to initialize the driver. This pointer may be null if no data is required because static overrides have been provided.

## Returns

If successful, returns a valid handle to a driver object. Otherwise, it returns SYS_MODULE_OBJ_INVALID.

## Example

    DRV_SDMMC_INIT init;
    SYS_MODULE_OBJ objectHandle;

    // Populate the SD Card initialization structure

    objectHandle = DRV_SDMMC_Initialize(DRV_SDMMC_INDEX_0, (SYS_MODULE_INIT*)&init);
    if (objectHandle == SYS_MODULE_OBJ_INVALID)
    {
        // Handle error
    }

## Remarks

This routine must be called before any other SD Card routine is called. This routine should only be called once during system initialization.

This routine will NEVER block for hardware access. The system must use DRV_SDMMC_Status to find out when the driver is in the ready state.