# CARD_WriteFlashSectorAsync

## Syntax

  `#include <nitro/card.h>`
  `static inline void CARD_WriteFlashSectorAsync( u32 dst, const void *src, u32 len, MIDmaCallback callback, void *arg);`

## Arguments

dst | The flash memory address of the transfer destination. This must be an integer multiple of the value obtained by the `CARD_GetBackupSectorSize` function. For more about the sector size for each device, see Overview.
src | Transfer source memory address.
len | Byte length of the data to be written. This must be an integer multiple of the value obtained by the `CARD_GetBackupSectorSize` function. For more about the sector size for each device, see Overview.
callback | Completion callback function. Specify `NULL` if this is unnecessary. This callback is called from within the interrupt handler.
arg | Arguments to pass to the completion callback function. This is simply ignored if `NULL` was specified for `callback`.

## Return Values

None.

## Description

This function writes data to the FLASH device asynchronously at the sector level. This function immediately returns control. Use the `CARD_WaitBackupAsync` function to wait for processing to end. To determine the processing result, call the `CARD_GetResultCode` function after processing has ended.

This function simply calls a combination of the `CARD_EraseFlashSector` and `CARD_ProgramFlashAsync` functions internally. For more information, see the function references for these functions.

To use this function, you must first lock the access bus with the `CARD_LockBackup` function.

## Internal Operation

`This function communicates with the ARM7 processor internally via PXI.
The process will not end if PXI interrupts are not enabled.
The function uses an internal thread to execute an asynchronous process. See the description of the `CARD_GetThreadPriority` function for more information on this thread.`

## See Also

`CARD_WaitBackupAsync, CARD_GetResultCode, CARD_IsBackupFlash, CARD_ProgramFlash, CARD_ProgramFlashAsync, CARD_ProgramAndVerifyFlash, CARD_ProgramAndVerifyFlashAsync, CARD_EraseFlashSector, CARD_EraseFlashSectorAsync, CARD_WriteFlashSector, CARD_WriteFlashSectorAsync, CARD_WriteAndVerifyFlashSector, CARD_WriteAndVerifyFlashSectorAsync, CARD_ReadFlash, CARD_WriteFlash, CARD_WriteAndVerifyFlash, CARD_VerifyFlash, CARD_GetThreadPriority`

## Revision History

2007/08/22 Initial version.

CONFIDENTIAL