Jump to main content

##

# DRV_SST38_GeometryGet Function

## C

    bool DRV_SST38_GeometryGet(const DRV_HANDLE handle, DRV_SST38_GEOMETRY *geometry)

## Summary

Returns the geometry of the device.

## Description

This API gives the following geometrical details of the DRV_SST38 PROM:

- Number of Read/Write/Erase Blocks and their size in each region of the device.

## Preconditions

DRV_SST38_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 routine
geometry | Pointer to flash device geometry table instance

## Returns

True if able to get the geometry details of the flash. False if the handle is invalid or errors occurs.

## Example

    DRV_SST38_GEOMETRY flashGeometry;
    uint32_t readBlockSize, writeBlockSize, eraseBlockSize;
    uint32_t nReadBlocks, nReadRegions, totalFlashSize;

    DRV_SST38_GeometryGet(myHandle, &flashGeometry);

    readBlockSize  = flashGeometry.readBlockSize;
    nReadBlocks = flashGeometry.readNumBlocks;
    nReadRegions = flashGeometry.readNumRegions;

    writeBlockSize  = flashGeometry.writeBlockSize;
    eraseBlockSize  = flashGeometry.eraseBlockSize;

    totalFlashSize = readBlockSize * nReadBlocks * nReadRegions;

## Remarks

None.