int SD_Open_(uint32_t cardSel) { // power (H.2) SYS->GPH_MFPL = (SYS->GPH_MFPL & ~(SYS_GPH_MFPL_PH2MFP_Msk)); PH->MODE = (PH->MODE & ~GPIO_MODE_MODE2_Msk) | ( GPIO_MODE_OUTPUT << GPIO_MODE_MODE2_Pos); PH2 = 0; SD_Open(cardSel); SD_Probe(cardSel & 0x00ff); return SD_GET_CARD_CAPACITY(SD_PORT0); }
void SD_Open_(unsigned int cardSel) { switch(cardSel & 0xff) { case SD_PORT0: SD_Open(cardSel); if (SD_Probe(cardSel & 0x00ff) != TRUE) { sysprintf("SD0 initial fail!!\n"); return; } f_mount(&_FatfsVolSd0, _Path, 1); break; case SD_PORT1: SD_Open(cardSel); if (SD_Probe(cardSel & 0x00ff) != TRUE) { sysprintf("SD1 initial fail!!\n"); return; } _Path[0] = 1 + '0'; f_mount(&_FatfsVolSd1, _Path, 1); break; } }