Datasheet
Mmc_Write_Sector
Mmc_Read_Cid
Mmc_Read_Csd
326
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6
Prototype
unsigned char Mmc_Write_Sector(unsigned long sector, char
*dbuff);
Returns
Returns 0 if write was successful; returns 1 if there was an error in sending write
command; returns 2 if there was an error in writing.
Description
Function writes 512 bytes of data to MMC card at sector address sector. Func-
tion returns 0 if write was successful, or 1 if there was an error in sending write
command, or 2 if there was an error in writing.
Requires Library needs to be initialized, see Mmc_Init.
Example
error := Mmc_Write_Sector(sector, data);
Prototype
unsigned char Mmc_Read_Cid(char * data_for_registers);
Returns Returns 0 if read was successful, or 1 if an error occurred.
Description
Function reads CID register and returns 16 bytes of content into data_for_reg-
isters
.
Requires Library needs to be initialized, see Mmc_Init.
Example
error = Mmc_Read_Cid(data);
Prototype
unsigned char Mmc_Read_Csd(char * data_for_registers);
Returns Returns 0 if read was successful, or 1 if an error occurred.
Description
Function reads CSD register and returns 16 bytes of content into
data_for_registers.
Requires Library needs to be initialized, see Mmc_Init.
Example
error = Mmc_Read_Csd(data);