| Example |
/* MCI Device Driver Control Block */
MCI_DRV mci0_drv = {
Init,
UnInit,
Delay,
BusMode,
BusWidth,
BusSpeed,
Command,
ReadBlock,
WriteBlock,
NULL,
CheckMedia
};
/* Initialize MCI interface. */
static BOOL Init (void) {
PCONP |= 0x30000000; /* Power Up the MCI and DMA controller. */
SCS |= 0x08; /* MCIPWR pin is active high. */
/* Required for the silicon rev. 'B' and later. */
PINSEL1 &= ~0x00003FC0; /* Enable MCI pins. */
PINSEL1 |= 0x00002A80;
PINSEL4 &= ~0x0FC00000;
PINSEL4 |= 0x0A800000;
MCI_COMMAND = 0; /* Clear all pending interrupts. */
MCI_DATA_CTRL = 0;
MCI_CLEAR = 0x7FF;
MCI_POWER = 0x02; /* Power up, switch on VCC for the Flash Card. */
Delay (10000);
MCI_POWER |= 0x01; /* Power on the Flash Card. */
return (__TRUE);
}
|