Jump to main content

##

# 1.1.3.4.22 DRV_MEMORY_EraseWrite Function

## C

    void DRV_MEMORY_EraseWrite
    (
        const DRV_HANDLE handle,
        SYS_MEDIA_BLOCK_COMMAND_HANDLE* commandHandle,
        void* sourceBuffer,
        uint32_t blockStart,
        uint32_t nBlock
    )

## Summary

Interface to the file system to perform a erase-write operation in Synchronous mode

## Description

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

## Preconditions

The DRV_MEMORY_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_MEMORY_COMMAND_HANDLE_INVALID if the request was not successful.

## Remarks

This function is internally used by the file system and should not be used by application.