1.9.10.3 FCW_RowWrite Function
C
bool FCW_RowWrite( uint32_t* data, uint32_t address )
Summary
Writes one row of data to given FCW address.
Description
This function will write one row of data to the FCW address specified by the address parameter. The size of the input buffer should be one FCW row. The address should be aligned on a row boundary.
Calling this function will cause the CPU execution to stall, hence blocking execution of any other thread. Execution resumes when the Write operation has completed.
If the interrupt operation was enabled and if a callback was registered, then the callback function will be called. The FCW_IsBusy() function can be used to poll for completion of the operation.
The application should ensure that there are no other operations in progress before calling this function.
Once the operation is complete, the FCW_ErrorGet() function can be called to check operation success.
Precondition
Validate if FCW controller is ready to accept a new request by calling FCW_IsBusy().
A page containing the row should be erased before the row can be written.
Parameters
Param | Description |
---|---|
address | start address of row to be written. This should be aligned on a row boundary. |
data | pointer to data buffer. The size of this buffer should be the same as the row size. |
Returns
Always return true.
Example
// This code snippet shows how the FCW_RowWrite function is called and // how the FCW_IsBusy function is used to poll for completion. // Erase the page. This will erase all the rows in the page. FCW_PageErase(0xC088608U); while(FCW_IsBusy()); // Now write the row. FCW_RowWrite( (uint32_t *)buffer, 0xC088608U); while(FCW_IsBusy()); if(FCW_ErrorGet() == FCW_ERROR_NONE) { // Operation was successful. }