/** * @brief Initializes the SD/SD communication. * @param None * @retval The SD Response: * - MSD_ERROR : Sequence failed * - MSD_OK : Sequence succeed */ uint8_t BSP_SD_Init(void) { /* Configure IO functionalities for SD pin */ SD_IO_Init(); /* Check SD card detect pin */ if(BSP_SD_IsDetected()==SD_NOT_PRESENT) { SdStatus = SD_NOT_PRESENT; return MSD_ERROR; } else { SdStatus = SD_PRESENT; } /* SD initialized and set to SPI mode properly */ return (SD_GoIdleState()); }
/** * @brief Initializes the SD/SD communication. * @param None * @retval The SD Response: * - MSD_ERROR: Sequence failed * - MSD_OK: Sequence succeed */ uint8_t BSP_SD_Init(void) { uint8_t status = MSD_ERROR; /* Configure IO functionalities for SD pin */ SD_IO_Init(); /* SD detection pin is not physically mapped on the Adafruit shield */ SdStatus = SD_PRESENT; /* SD initialized and set to SPI mode properly */ status = SD_GoIdleState(); if (status == SD_RESPONSE_NO_ERROR) { return MSD_OK; } else { return MSD_ERROR; } }