DRV_AT25DF_ChipErase Function
C
bool DRV_AT25DF_ChipErase(const DRV_HANDLE handle);
Summary
Erase entire flash memory.
Description
This function schedules a non-blocking chip erase operation of flash memory.
The requesting client should call DRV_AT25DF_TransferStatusGet() API to know the current status of the request.
Preconditions
The DRV_AT25DF_Open() routine must have been called for the specified AT25DF driver instance.
Parameters
Param | Description |
---|---|
handle | A valid open-instance handle, returned from the driver's open routine |
Returns
true
- if the erase request is successfully sent to the flash
false
- if Write enable fails before sending sector erase command to flash
- if chip erase command itself fails
Example
DRV_HANDLE handle; // Returned from DRV_AT25DF_Open if(DRV_AT25DF_ChipErase(handle) == false) { // Error handling here } // Wait for erase to be completed while(DRV_AT25DF_TransferStatusGet(handle) == DRV_AT25DF_TRANSFER_STATUS_BUSY);
Remarks
This routine will block wait until erase request is submitted successfully. Client should wait until erase is complete to send next transfer request.