DRV_AT24_GeometryGet Function
C
bool DRV_AT24_GeometryGet(const DRV_HANDLE handle, DRV_AT24_GEOMETRY *geometry)
Summary
Returns the geometry of the device.
Description
This API gives the following geometrical details of the DRV_AT24 Flash:
Number of Read/Write/Erase Blocks and their size in each region of the device
Precondition
DRV_AT24_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 handle is invalid
Example
DRV_AT24_GEOMETRY eepromGeometry; uint32_t readBlockSize, writeBlockSize, eraseBlockSize; uint32_t nReadBlocks, nReadRegions, totalFlashSize; // myHandle is the handle returned from DRV_AT24_Open API. DRV_AT24_GeometryGet(myHandle, &eepromGeometry); readBlockSize = eepromGeometry.readBlockSize; nReadBlocks = eepromGeometry.readNumBlocks; nReadRegions = eepromGeometry.readNumRegions; writeBlockSize = eepromGeometry.writeBlockSize; eraseBlockSize = eepromGeometry.eraseBlockSize; totalFlashSize = readBlockSize * nReadBlocks * nReadRegions;
Remarks
None.