<< Previous | Next >>

sdspi_set_block_length

int sdspi_set_block_length( sd_device * sd, int block_length );

Description

This function executes protocol command 16 to set the block length for the SD card. The default block length for SD cards is 512 bytes. Please note that sdspi_write_sector() and sdspi_read_sector() work on 512 byte blocks only. If you change the block size, these functions will need to be modified, or you will need to execute commands directly through sdspi_process_command() and internal write block and read block functions.

Parameter

sd
Pointer to device structure of the SD card.

block_length
The block size in bytes for the SD card.

Return Value

0: Success
-EIO: I/O error
-EINVAL: Invalid parameter given
-ENOMEDIUM: No SD card in socket
-ESHAREDBUSY: Shared SPI port busy

Library

SDFLASH.LIB


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