Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

Secure Digital Library

Modules

Functions


Detailed Description

Secure Digital (SD) is a nonvolatile memory card used extensively in portable devices, such as mobile phones, digital cameras, GPS navigation devices, handheld consoles, and tablet computers. The Secure Digital standard was introduced in August 1999 as an evolutionary improvement over MultiMediaCards (MMC). The Secure Digital standard is maintained by the SD Association (SDA). SD technologies have been implemented in more than 400 brands across dozens of product categories and more than 8,000 models.

Function Documentation

bool SD_CardCheck  ) 
 

Check if SD has been inserted.

Returns:
true if the card is present, false if not.
See also:
SD_Init, SD_GetInfo, SD_Write, SD_Read, SD_SendCommand, SD_Sync, SD_SetSpeed, SD_CardWriteProtect, SD_Selection, SD_Init, SD_Power

int SD_CardWriteProtect  ) 
 

Check if SD have write protect set or not.

Returns:
1 if the card is locked, 0 if it is not.
See also:
SD_Init, SD_GetInfo, SD_Write, SD_Read, SD_SendCommand, SD_Sync, SD_CardCheck, SD_SetSpeed, SD_Selection, SD_Init, SD_Power

unsigned char SD_GetInfo struct SD_Info info  ) 
 

Read SD card features.

Parameters:
info Pointer to struct data where SD features are stored.
Returns:
0 on failure, 1 on success.
See also:
SD_Init, SD_Write, SD_Read, SD_SendCommand, SD_Sync, SD_CardCheck, SD_SetSpeed, SD_CardWriteProtect, SD_Selection, SD_Init, SD_Power

unsigned char SD_Init  ) 
 

Init SD card.

See also:
SD_Selection, SD_GetInfo, SD_Write, SD_Read, SD_SendCommand, SD_Sync, SD_CardCheck, SD_SetSpeed, SD_CardWriteProtect, SD_Power
Returns:
Command status Secure Digital, Error codes

void SD_Power bool  ena  ) 
 

Turn ON/OFF SD card power. This is the first procedure to be execute for SD access.

Parameters:
ena true turn on SD, false turn off SD
See also:
SD_Selection, SD_GetInfo, SD_Write, SD_Read, SD_SendCommand, SD_Sync, SD_CardCheck, SD_SetSpeed, SD_CardWriteProtect, SD_Init

unsigned char SD_Read offset_t  offset,
unsigned char *  buffer,
unsigned int  length
 

Reads raw data from SD card.

Parameters:
offset The offset from which to read.
buffer The buffer into which to write the data.
length The number of bytes to read.
Returns:
0 on failure, 1 on success.
See also:
SD_Init, SD_GetInfo, SD_Write, SD_SendCommand, SD_Sync, SD_CardCheck, SD_SetSpeed, SD_CardWriteProtect, SD_Selection, SD_Init, SD_Power

void SD_Selection int  ena  ) 
 

unsigned char SD_SendCommand unsigned char  command,
unsigned long  arg
 

Send a command to SD.

Parameters:
command Secure Digital
arg Command argument
Returns:
Secure Digital Command responses R1: size 1 byte, Secure Digital Command responses R2: size 2 bytes, Secure Digital Command responses R3: size 5 bytes, Secure Digital Data Response: size 1 byte
See also:
SD_Init, SD_GetInfo, SD_Write, SD_Read, SD_Sync, SD_CardCheck, SD_SetSpeed, SD_CardWriteProtect, SD_Selection, SD_Init, SD_Power

void SD_SetSpeed int  sx  ) 
 

Set the frequency used for communicate with SD. As default this value is set to 25MHz for SD and 15MHz for MMC.

Parameters:
sx Frequency in Hz
See also:
SD_Init, SD_GetInfo, SD_Write, SD_Read, SD_SendCommand, SD_Sync, SD_CardCheck, SD_CardWriteProtect, SD_Selection, SD_Init, SD_Power

bool SD_Sync  ) 
 

Write on SD buffer contents.

Returns:
true buffer is written.
See also:
SD_Init, SD_GetInfo, SD_Write, SD_Read, SD_SendCommand, SD_CardCheck, SD_SetSpeed, SD_CardWriteProtect, SD_Selection, SD_Init, SD_Power

unsigned char SD_Write offset_t  offset,
const unsigned char *  buffer,
unsigned int  length
 

Write raw data to SD card.

Parameters:
offset The offset from which to write.
buffer The buffer into which to read the data.
length The number of bytes to write.
Returns:
0 on failure, 1 on success.
See also:
SD_Init, SD_GetInfo, SD_Read, SD_SendCommand, SD_Sync, SD_CardCheck, SD_SetSpeed, SD_CardWriteProtect, SD_Selection, SD_Init, SD_Power


Generated on Tue Apr 7 20:07:45 2015 for BF592A Library by doxygen 1.3.1