Jump to main content

##

# DRV_MX25L_Read Function

## C

    bool DRV_MX25L_Read( const DRV_HANDLE handle, void *rx_data, uint32_t rx_data_length, uint32_t address );

## Summary

Reads n bytes of data from the specified start address of flash memory.

## Description

This function schedules a blocking operation for reading requested number of data bytes from the flash memory.

The request is sent in QUAD_MODE to flash device.

## Precondition

The DRV_MX25L_Open() routine must have been called for the specified MX25L driver instance.

## Parameters

Param | Description
--- | ---
handle | A valid open-instance handle, returned from the driver's open routine
*rx_data | Buffer pointer into which the data read from the MX25L Flash memory will be placed.
rx_data_length | Total number of bytes to be read.
address | Read memory start address from where the data should be read.

## Returns

true - if number of bytes requested are read from flash memory

false - if read command itself fails

## Example

    #define BUFFER_SIZE 1024
    #define MEM_ADDRESS 0x0

    DRV_HANDLE handle; // Returned from DRV_MX25L_Open
    uint8_t CACHE_ALIGN readBuffer[BUFFER_SIZE];

    if (DRV_MX25L_Read(handle, (void *)&readBuffer, BUFFER_SIZE, MEM_ADDRESS) == false)
    {
        // Error handling here
    }

## Remarks

This routine will block waiting until read request is completed successfully.