|
Дела. как в примере для мегы...
for (c=0; c<4; c++) // try reset command 3 times if needed
{
SD_CS_OFF();
for (n=0; n<10; n++) // initialize clk signal to sync card
_FF_spi(0xFF);
resp = send_cmd(CMD0,0);
for (n=0; n<200; n++)
{
if (resp == 0x1)
{
SD_CS_OFF();
S0SPCR_bit.MSTR = 1;
S0SPCCR = 8;
return(1);
}
resp = _FF_spi(0xFF);
}
if (spi_speedset()==0) //set new SPI speed
{
SD_CS_OFF();
return (0);
}
}
E-mail: info@telesys.ru