Jump to main content

##

# 1.1.7.4.16 DRV_SDSPI_Write Function

## C

    void DRV_SDSPI_Write
    (
        const DRV_HANDLE handle,
        DRV_SDSPI_COMMAND_HANDLE* commandHandle,
        void* sourceBuffer,
        uint32_t blockStart,
        uint32_t nBlock
    )

## Summary

This routine provides interface to the file system to perform a media write operation in synchronous mode of the SDSPI driver.

## Description

This function is internally used by the file system.

## Preconditions

The DRV_SDSPI_Initialize routine must have been called. The DRV_SDSPI_Open must have been called to obtain a valid opened device handle.

## Parameters

Param | Description
--- | ---
handle | A valid open-instance handle, returned from the driver's open function
commandHandle | Pointer to an argument that will contain the return buffer handle
sourceBuffer | The source buffer containing data to be programmed to the SD Card.
blockStart | Start block address of SD Card where the writes should begin.
nBlock | Total number of blocks to be written.

## Returns

The buffer handle is returned in the commandHandle argument. It will be DRV_SDSPI_COMMAND_HANDLE_INVALID if the request was not successful.

## Example

None.

## Remarks

This function is internally used by the file system.