<< Previous | Next >>

sdspi_write_sector

int sdspi_write_sector( sd_device * sd, unsigned long sector_number, char * data_buffer );

Description

This function is called to execute protocol command 24 to write a 512 byte block of data to the SD card.

Parameter

sd
Pointer to device structure of the SD card.

sector_number
The sector number to write.

data_buffer
Pointer to a buffer of 512 bytes to write.

Return Value

0: Success
-EIO: I/O error
-EACCES: Write protected block, no write access
-EINVAL: Invalid parameter given
-ENOMEDIUM: No SD card in socket
-ESHAREDBUSY: Shared SPI port busy
-EBUSY: SD card is busy with write operation; call sdspi_WriteContinue() to complete (only when SD_NON_BLOCK is defined)

Library

SDFLASH.LIB


Dynamic C Functions << Previous | Next >> rabbit.com