1.1.4.4.10 DRV_NAND_FLASH_GeometryGet Function

C

bool DRV_NAND_FLASH_GeometryGet( const DRV_HANDLE handle, DRV_NAND_FLASH_GEOMETRY *geometry );

Summary

Returns the geometry of the NAND Flash device.

Description

This API gives the following geometrical details of the NAND Flash:

  • deviceId (JEDEC Manufacturer ID)

  • Bus Width

  • Number of data bytes per page

  • Number of spare bytes per page

  • Block Size

  • Device Size

  • Number of logical units

  • Number of bits of ECC correction

Precondition

The DRV_NAND_FLASH_Open() routine must have been called for the specified NAND FLASH driver instance.

Parameters

ParamDescription
handleA valid open-instance handle, returned from the driver's open routine
geometryPointer to destination geometry buffer into which geometry to be placed

Returns

true - If geometry is successfully read from the NAND Flash

false - If geometry read is failed

Example

DRV_HANDLE handle; // Returned from DRV_NAND_FLASH_Open
DRV_NAND_FLASH_GEOMETRY nandFlashFlashGeometry;

if (DRV_NAND_FLASH_GeometryGet(handle, &nandFlashFlashGeometry))
{
    // Geometry read successfully
}

Remarks

This routine will block wait for hardware access.