1.1.4.4.18 DRV_NAND_FLASH_SkipBlock_PageWrite Function

C

bool DRV_NAND_FLASH_SkipBlock_PageWrite(
    const DRV_HANDLE handle,
    uint16_t blockNum,
    uint16_t pageNum,
    uint8_t *data,
    uint8_t *spare,
    bool disableBlockCheck
);

Summary

Writes the data and/or the spare area of a page of given block to NAND Flash.

Description

This function schedules a blocking operation for writing the data and/or the spare area of a page of given block to NAND Flash.

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
blockNumBlock number to write page
pageNumPage number to write inside the given block
dataPointer to source data buffer
sparePointer to source spare buffer.
disableBlockCheck0 - Block will be checked as good before writing a page. 1 - Block will not check before writing a page.

Returns

true - If Page write is successfully completed

false - If Page write fails

Example

DRV_HANDLE handle; // Returned from DRV_NAND_FLASH_Open
uint16_t blockNum = 3;
uint16_t pageNum = 0;
static uint8_t pageBuffer[4096 + 224];

memset(pageBuffer, 0x55, sizeof(pageBuffer));
if (DRV_NAND_FLASH_SkipBlock_PageWrite(handle, blockNum, pageNum, pageBuffer, 0, 0))
{
    // Page write successfully completed
}

Remarks

This routine will block wait until write request is submitted successfully.

Client should wait until write is complete to send next transfer request.