Revision 101
Added by markw about 11 years ago
firmware/sd_direct/diskio_mmc.c | ||
---|---|---|
#include "mmc.h"
|
||
#include "spi.h"
|
||
|
||
#include "printf.h"
|
||
//#include "printf.h"
|
||
|
||
void mmcReadCached(u32 sector);
|
||
u32 n_actual_mmc_sector;
|
||
... | ... | |
|
||
//printf(" in init ");
|
||
n_actual_mmc_sector = 0xffffffff;
|
||
do
|
||
{
|
||
mmcInit();
|
||
}
|
||
while(mmcReset()); //dokud nenulove, tak smycka (return 0 => ok!)
|
||
mmc_init();
|
||
|
||
//printf(" setting freq ");
|
||
|
firmware/sd_direct/mmc.c | ||
---|---|---|
#include "mmcconf.h"
|
||
#include "debug.h"
|
||
|
||
u08 mmcSendCommand(u08 cmd, u32 arg);
|
||
u08 mmcCommand(u08 cmd, u32 arg);
|
||
|
||
void mmcInit(void)
|
||
{
|
||
// initialize SPI interface
|
||
... | ... | |
return 0;
|
||
}
|
||
|
||
void mmc_init()
|
||
{
|
||
do
|
||
{
|
||
mmcInit();
|
||
}
|
||
while(mmcReset()); //dokud nenulove, tak smycka (return 0 => ok!)
|
||
}
|
||
|
||
u08 mmcSendCommand(u08 cmd, u32 arg)
|
||
{
|
||
u08 r1;
|
firmware/sd_direct/mmc.h | ||
---|---|---|
|
||
//! Initialize AVR<->MMC hardware interface.
|
||
/// Prepares hardware for MMC access.
|
||
void mmcInit(void);
|
||
void mmc_init(void);
|
||
|
||
//! Initialize the card and prepare it for use.
|
||
/// Returns zero if successful.
|
||
u08 mmcReset(void);
|
||
//u08 mmcReset(void);
|
||
|
||
//! Send card an MMC command.
|
||
/// Returns R1 result code.
|
||
u08 mmcSendCommand(u08 cmd, u32 arg);
|
||
//u08 mmcSendCommand(u08 cmd, u32 arg);
|
||
|
||
//! Read 512-byte sector from card to buffer
|
||
/// Returns zero if successful.
|
||
... | ... | |
|
||
//! Internal command function.
|
||
/// Issues a generic MMC command as specified by cmd and arg.
|
||
u08 mmcCommand(u08 cmd, u32 arg);
|
||
//u08 mmcCommand(u08 cmd, u32 arg);
|
||
|
||
#endif
|
Also available in: Unified diff
Prepare interface for alternative version of mmc.c - for >1GB cards