Nut/OS  4.10.3
API Reference
MCI Multimedia Card Interface

Multimedia card interface registers. More...

Collaboration diagram for MCI Multimedia Card Interface:

Data Structures

struct  _MCIFC
 Local card interface information. More...
struct  _MCIFCB
 Local multimedia card mount information. More...

Defines

#define MMC_BLOCK_SIZE   512
#define MCI_INI_BITRATE   400000
#define MCI_MMC_BITRATE   20000000
#define MCI_SDC_BITRATE   25000000
#define MMCARD_VRANGE   (MMCARD_32_33V | MMCARD_31_32V | MMCARD_30_31V)
#define MMC_PINS_A   _BV(PA8_MCCK_A)
#define MMC_PINS_B   _BV(PA1_MCCDB_B) | _BV(PA0_MCDB0_B) | _BV(PA5_MCDB1_B) | _BV(PA4_MCDB2_B) | _BV(PA3_MCDB3_B)
#define MCICMD_ALL_SEND_CID   (MMCMD_ALL_SEND_CID | MCI_MAXLAT | MCI_RSPTYP_136)
#define MCICMD_DESELECT_CARD   (MMCMD_SELECT_CARD)
#define MCICMD_GO_IDLE_STATE   (MMCMD_GO_IDLE_STATE)
#define MCICMD_READ_SINGLE_BLOCK   (MMCMD_READ_SINGLE_BLOCK | MCI_TRCMD_START | MCI_TRDIR | MCI_MAXLAT | MCI_RSPTYP_48)
#define MCICMD_SELECT_CARD   (MMCMD_SELECT_CARD | MCI_MAXLAT | MCI_RSPTYP_48)
#define MCICMD_SEND_APP_CMD   (MMCMD_SEND_APP_CMD | MCI_MAXLAT | MCI_RSPTYP_48)
#define MCICMD_SEND_APP_OP_COND   (MMCMD_SEND_APP_OP_COND | MCI_MAXLAT | MCI_RSPTYP_48)
#define MCICMD_SEND_OP_COND   (MMCMD_SEND_OP_COND | MCI_MAXLAT | MCI_RSPTYP_48)
#define MCICMD_SEND_RELATIVE_ADDR   (MMCMD_SEND_RELATIVE_ADDR | MCI_MAXLAT | MCI_RSPTYP_48)
#define MCICMD_SEND_STATUS   (MMCMD_SEND_STATUS | MCI_MAXLAT | MCI_RSPTYP_48)
#define MCICMD_SET_BLOCKLEN   (MMCMD_SET_BLOCKLEN | MCI_MAXLAT | MCI_RSPTYP_48)
#define MCICMD_WRITE_BLOCK   (MMCMD_WRITE_BLOCK | MCI_TRCMD_START | MCI_MAXLAT | MCI_RSPTYP_48)
#define MCICMD_IERROR   (MCI_RTOE | MCI_RENDE | MCI_RDIRE | MCI_RINDE)
#define MCICMD_ERROR   (MCI_UNRE | MCI_OVRE | MCI_DTOE | MCI_DCRCE | MCI_RCRCE | MCICMD_IERROR)
#define MCIFLG_SDCARD   0x00000001
#define MCIFLG_4BIT   0x00000010

Typedefs

typedef struct _MCIFC MCIFC
 Local card interface information.
typedef struct _MCIFCB MCIFCB
 Local multimedia card mount information.

Variables

NUTDEVICE devAt91Mci0
 Multimedia card device information structure.

Detailed Description

Multimedia card interface registers.

Multimedia Card Interface.

This simple implementation supports reading a single 3.3V MultiMedia Card in slot A or B only.

 *
 * $Log$
 * Revision 1.3  2008/10/03 11:28:58  haraldkipp
 * Corrected and modified initialization of MultiMedia and SD Cards.
 *
 * Revision 1.2  2008/08/11 06:59:04  haraldkipp
 * BSD types replaced by stdint types (feature request #1282721).
 *
 * Revision 1.1  2006/09/05 12:34:21  haraldkipp
 * Support for hardware MultiMedia Card interface added.
 * SD Cards are currently not supported.
 *
 *
 * 

Define Documentation

#define MMC_BLOCK_SIZE   512

Definition at line 90 of file at91_mci.c.

#define MCI_INI_BITRATE   400000

Definition at line 95 of file at91_mci.c.

#define MCI_MMC_BITRATE   20000000

Definition at line 100 of file at91_mci.c.

#define MCI_SDC_BITRATE   25000000

Definition at line 105 of file at91_mci.c.

#define MMCARD_VRANGE   (MMCARD_32_33V | MMCARD_31_32V | MMCARD_30_31V)

Definition at line 109 of file at91_mci.c.

#define MMC_PINS_A   _BV(PA8_MCCK_A)

Definition at line 125 of file at91_mci.c.

#define MMC_PINS_B   _BV(PA1_MCCDB_B) | _BV(PA0_MCDB0_B) | _BV(PA5_MCDB1_B) | _BV(PA4_MCDB2_B) | _BV(PA3_MCDB3_B)

Definition at line 129 of file at91_mci.c.

#define MCICMD_ALL_SEND_CID   (MMCMD_ALL_SEND_CID | MCI_MAXLAT | MCI_RSPTYP_136)

Definition at line 134 of file at91_mci.c.

#define MCICMD_DESELECT_CARD   (MMCMD_SELECT_CARD)

Definition at line 135 of file at91_mci.c.

#define MCICMD_GO_IDLE_STATE   (MMCMD_GO_IDLE_STATE)

Definition at line 136 of file at91_mci.c.

#define MCICMD_READ_SINGLE_BLOCK   (MMCMD_READ_SINGLE_BLOCK | MCI_TRCMD_START | MCI_TRDIR | MCI_MAXLAT | MCI_RSPTYP_48)

Definition at line 137 of file at91_mci.c.

#define MCICMD_SELECT_CARD   (MMCMD_SELECT_CARD | MCI_MAXLAT | MCI_RSPTYP_48)

Definition at line 138 of file at91_mci.c.

#define MCICMD_SEND_APP_CMD   (MMCMD_SEND_APP_CMD | MCI_MAXLAT | MCI_RSPTYP_48)

Definition at line 139 of file at91_mci.c.

#define MCICMD_SEND_APP_OP_COND   (MMCMD_SEND_APP_OP_COND | MCI_MAXLAT | MCI_RSPTYP_48)

Definition at line 140 of file at91_mci.c.

#define MCICMD_SEND_OP_COND   (MMCMD_SEND_OP_COND | MCI_MAXLAT | MCI_RSPTYP_48)

Definition at line 141 of file at91_mci.c.

#define MCICMD_SEND_RELATIVE_ADDR   (MMCMD_SEND_RELATIVE_ADDR | MCI_MAXLAT | MCI_RSPTYP_48)

Definition at line 142 of file at91_mci.c.

#define MCICMD_SEND_STATUS   (MMCMD_SEND_STATUS | MCI_MAXLAT | MCI_RSPTYP_48)

Definition at line 143 of file at91_mci.c.

#define MCICMD_SET_BLOCKLEN   (MMCMD_SET_BLOCKLEN | MCI_MAXLAT | MCI_RSPTYP_48)

Definition at line 144 of file at91_mci.c.

#define MCICMD_WRITE_BLOCK   (MMCMD_WRITE_BLOCK | MCI_TRCMD_START | MCI_MAXLAT | MCI_RSPTYP_48)

Definition at line 145 of file at91_mci.c.

#define MCICMD_IERROR   (MCI_RTOE | MCI_RENDE | MCI_RDIRE | MCI_RINDE)

Definition at line 147 of file at91_mci.c.

#define MCICMD_ERROR   (MCI_UNRE | MCI_OVRE | MCI_DTOE | MCI_DCRCE | MCI_RCRCE | MCICMD_IERROR)

Definition at line 148 of file at91_mci.c.

#define MCIFLG_SDCARD   0x00000001

Definition at line 150 of file at91_mci.c.

#define MCIFLG_4BIT   0x00000010

Definition at line 151 of file at91_mci.c.


Typedef Documentation

typedef struct _MCIFC MCIFC

Local card interface information.

typedef struct _MCIFCB MCIFCB

Local multimedia card mount information.


Variable Documentation

Initial value:
 {
    0,                          
    {'M', 'C', 'I', '0', 0, 0, 0, 0, 0}
    ,                           
    0,                          
    0,                          
    0,                          
    &mci0_info,                 
    0,                          
    At91MciInit,                
    At91MciIOCtrl,              
    At91MciBlockRead,           
    At91MciBlockWrite,          
    At91MciMount,               
    At91MciUnmount,             
    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("MCI0:", _O_RDWR | _O_BINARY); /endverbatim to mount the first active primary partition with any previously registered file system driver (typically devPhat0).

Definition at line 912 of file at91_mci.c.