C
BYTE MDD_SDSPI_SectorWrite( DWORD sector_addr, BYTE* buffer, BYTE allowWriteToZero );
Description
The MDD_SDSPI_SectorWrite function writes one sector of data (512 bytes) of data from the location pointed to by 'buffer' to the specified sector of the SD card.
Preconditions
The MDD_SectorWrite function pointer must be pointing to this function.
Parameters
Parameters |
Description |
sector_addr |
The address of the sector on the card. |
buffer |
The buffer with the data to write. |
allowWriteToZero |
|
Return Values
Return Values |
Description |
TRUE |
The sector was written successfully. |
FALSE |
The sector could not be written. |
Side Effects
None.
Remarks
The card expects the address field in the command packet to be a byte address. The sector_addr value is ocnverted to a byte address by shifting it left nine times (multiplying by 512).