Gast
#752771
Hallo Jungs ich habe folgendes Problem beim ansteuern einer mmc-karte:
wenn ich folgenden befehl an meine karte schicke, kommt alles nach
wunsch zurück:
mmc_commandss(0x51,1,26,0xFF); //command17 read block
wenn ich das ganze jedoch so, also etwas komfortabler in eine funktion
eingebettet habe, funktioniert´s nicht mehr:
mmc_commandss(0x51,(adr>>16),adr,0xFF); //command17 read block
nochmal im zusammenhang;
char mmc_commandss(char befF,short AdrH,short AdrL,char befH ){
spi0_sendbyte(0xFF);
spi0_sendbyte(befF);
spi0_sendbyte(AdrH>>8);
spi0_sendbyte(AdrH);
spi0_sendbyte(AdrL>>8);
spi0_sendbyte(AdrL);
spi0_sendbyte(befH);
spi0_sendbyte(0xFF);
return (spi0_sendnget(0xFF)); // Response als Rückgabewert
}
void mmc_readblock(unsigned long adr,unsigned long length ){
mmc_commandss(0x50,0,length,0xFF); //block size einstellen
mmc_commandss(0x51,(adr>>16),adr,0xFF); //block anfordern
while(spi0_sendnget(0xFF) != 0xFE);
}