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

MMC Library

Modules

Functions


Detailed Description

The MultiMediaCard (MMC) is a memory card standard. Unveiled in 1997 by SanDisk and Siemens AG, it is based on Toshiba's NAND-based flash memory, and is therefore much smaller than earlier systems based on Intel NOR-based memory such as CompactFlash. MMC is about the size of a postage stamp: 24 mm ? 32 mm ? 1.4 mm. MMC originally used a 1-bit serial interface, but newer versions of the specification allow transfers of 4 or 8 bits at a time. MMC can be used in most devices that support SD cards.

Function Documentation

void MMC_Close  ) 
 

Turn OFF MMC card.

See also:
MMC_Open, MMC_WriteCommand, MMC_WriteCommandCRC, MMC_ReadSector, MMC_WriteSector

int MMC_Open  ) 
 

Init MMC interface. For this procedure you must also init Expansion Port see the code below.

Returns:
On success return true.
See also:
MMC_Close, MMC_WriteCommand, MMC_WriteCommandCRC, MMC_ReadSector, MMC_WriteSector
        // Init Expansion Port
        Set_SPI(SPI_PP);                        // Set Expansion Port channel
        Set_ExpansionPort(0xF0);        // Set bit direction of PA[7:4], all in input
        if(MMC_Open())
        {
        ...
        }
        MMC_Close();

unsigned char MMC_ReadSector unsigned int  sector,
unsigned char *  buf
 

Read a specified sector of the MMC.

Parameters:
sector Sector number.
buf Buffer pointer where data will be written (512 byte).
See also:
MMC_Open, MMC_Close, MMC_WriteCommand, MMC_WriteCommandCRC, MMC_WriteSector, crc7
Returns:
Command status, 1 = OK else error code.

unsigned char MMC_WriteCommand unsigned int  cmd,
unsigned int  address
 

Send a command to MMC.

Parameters:
cmd Command code /ref mmcCommands
address Address number.
See also:
MMC_Open, MMC_Close, MMC_WriteCommandCRC, MMC_ReadSector, MMC_WriteSector
Returns:
Command status.

unsigned char MMC_WriteCommandCRC unsigned int  cmd,
unsigned int  address,
unsigned char  crc
 

Send a command to MMC with CRC.

Parameters:
cmd Command code /ref mmcCommands
address Address number.
crc CRC-7 (polynomial x^7 + x^3 + 1)
See also:
MMC_Open, MMC_Close, MMC_WriteCommand, MMC_ReadSector, MMC_WriteSector
Returns:
Command status.

unsigned char MMC_WriteSector unsigned int  sector,
unsigned char *  buf
 

Write a specified sector of the MMC.

Parameters:
sector Sector number.
buf Buffer pointer where there is stored data to be write (512 byte).
See also:
MMC_Open, MMC_Close, MMC_WriteCommand, MMC_WriteCommandCRC, MMC_WriteSector
Returns:
Command status, 1 = OK else error code.


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