Nut/OS  4.10.3
API Reference
SPI Mode MMC Interface

SPI mode MMC interface registers. More...

Collaboration diagram for SPI Mode MMC Interface:

Defines

#define MMC_PIO_ASR   PIOA_ASR
#define MMC_PIO_BSR   PIOA_BSR
#define MMC_PIO_PDR   PIOA_PDR
#define MMC_PINS_A   (_BV(MMC_DATAOUT_BIT) | _BV(MMC_DATAIN_BIT) | _BV(MMC_CLK_BIT))
#define MMC_PINS_B   0
#define MMC_CS_PER   PIOA_PER
#define MMC_CS_OER   PIOA_OER
#define MMC_CS_SODR   PIOA_SODR
#define MMC_CS_CODR   PIOA_CODR
#define MMC_SPI_CR   SPI0_CR
#define MMC_SPI_MR   SPI0_MR
#define MMC_SPI_RDR   SPI0_RDR
#define MMC_SPI_TDR   SPI0_TDR
#define MMC_SPI_SR   SPI0_SR
#define MMC_SPI_CSR1   SPI0_CSR1
#define MMC_SPI_ID   SPI0_ID

Functions

int At91SpiMmCard0Avail (void)
 Check if card is available in slot 0.
int At91SpiMmCard0WrProt (void)
 Check if card in slot 0 is write protected.

Variables

NUTDEVICE devAt91SpiMmc0
 Multimedia card device information structure.
NUTDEVICE devAt91SpiMmc0
 Multimedia card device information structure.

Detailed Description

SPI mode MMC interface registers.

Low Level Multimedia Card Access.

Low level MMC hardware routines, tested on the AT91SAM7X.

These routines support SPI mode only and are required by the basic MMC driver.

 *
 * $Log$
 * Revision 1.7  2010/12/15 15:14:13  ve2yag
 * Add support for all SAM7S and 7SE family.
 *
 * Revision 1.6  2008/08/11 06:59:13  haraldkipp
 * BSD types replaced by stdint types (feature request #1282721).
 *
 * Revision 1.5  2008/08/06 12:51:01  haraldkipp
 * Added support for Ethernut 5 (AT91SAM9XE reference design).
 *
 * Revision 1.4  2008/02/15 16:59:02  haraldkipp
 * Spport for AT91SAM7SE512 added.
 *
 * Revision 1.3  2008/01/31 09:16:03  haraldkipp
 * Failed to compile for SAM7S. Added some default settings.
 *
 * Revision 1.2  2006/09/05 12:27:55  haraldkipp
 * Added support for the AT91SAM9260.
 *
 * Revision 1.1  2006/07/26 11:20:08  haraldkipp
 * Added MMC/SD-Card support for AT91SAM7X Evaluation Kit.
 *
 *
 * 

Define Documentation

#define MMC_PIO_ASR   PIOA_ASR

Definition at line 130 of file spimmc_at91.c.

#define MMC_PIO_BSR   PIOA_BSR

Definition at line 134 of file spimmc_at91.c.

#define MMC_PIO_PDR   PIOA_PDR

Definition at line 138 of file spimmc_at91.c.

#define MMC_PINS_A   (_BV(MMC_DATAOUT_BIT) | _BV(MMC_DATAIN_BIT) | _BV(MMC_CLK_BIT))

Definition at line 142 of file spimmc_at91.c.

#define MMC_PINS_B   0

Definition at line 146 of file spimmc_at91.c.

#define MMC_CS_PER   PIOA_PER

Definition at line 150 of file spimmc_at91.c.

#define MMC_CS_OER   PIOA_OER

Definition at line 154 of file spimmc_at91.c.

#define MMC_CS_SODR   PIOA_SODR

Definition at line 158 of file spimmc_at91.c.

#define MMC_CS_CODR   PIOA_CODR

Definition at line 162 of file spimmc_at91.c.

#define MMC_SPI_CR   SPI0_CR

Definition at line 166 of file spimmc_at91.c.

#define MMC_SPI_MR   SPI0_MR

Definition at line 170 of file spimmc_at91.c.

#define MMC_SPI_RDR   SPI0_RDR

Definition at line 174 of file spimmc_at91.c.

#define MMC_SPI_TDR   SPI0_TDR

Definition at line 178 of file spimmc_at91.c.

#define MMC_SPI_SR   SPI0_SR

Definition at line 182 of file spimmc_at91.c.

#define MMC_SPI_CSR1   SPI0_CSR1

Definition at line 186 of file spimmc_at91.c.

#define MMC_SPI_ID   SPI0_ID

Definition at line 190 of file spimmc_at91.c.


Function Documentation

int At91SpiMmCard0Avail ( void  )

Check if card is available in slot 0.

Todo:
Card change should verify the card identifier. Right now any detection of removing and re-inserting a card counts as a card change.
Returns:
0 if no card is detected, 1 if a card is available or 2 if a card change had been detected after the last mount.

Definition at line 270 of file spimmc_at91.c.

int At91SpiMmCard0WrProt ( void  )

Check if card in slot 0 is write protected.

Todo:
Not implemented.
Returns:
Always 0.

Definition at line 282 of file spimmc_at91.c.


Variable Documentation

Multimedia card device information structure.

A pointer to this structure must be passed to NutRegisterDevice() to bind this driver to the Nut/OS kernel. An application may then call /verbatim _open("MMC0:", _O_RDWR | _O_BINARY); /endverbatim to mount the first active primary partition with any previously registered file system driver (typically devPhat0).

Definition at line 344 of file spimmc_at91.c.

Initial value:
 {
    0,                          
    {'M', 'M', 'C', '0', 0, 0, 0, 0, 0}
    ,                           
    0,                          
    0,                          
    0,                          
    &mmc0_ifc,                  
    0,                          
    At91SpiMmcIfcInit,          
    MmCardIOCtl,                
    MmCardBlockRead,            
    MmCardBlockWrite,           

    MmCardBlockWrite_P,         

    MmCardMount,                
    MmCardUnmount,              
    0                           
}

Multimedia card device information structure.

A pointer to this structure must be passed to NutRegisterDevice() to bind this driver to the Nut/OS kernel. An application may then call /verbatim _open("MMC0:", _O_RDWR | _O_BINARY); /endverbatim to mount the first active primary partition with any previously registered file system driver (typically devPhat0).

Definition at line 344 of file spimmc_at91.c.