MDD_SDSPI_MediaDetect Function

MDD File System Interface Library

MDDFS Interface Library Help
MDD_SDSPI_MediaDetect Function
C
BYTE MDD_SDSPI_MediaDetect();
Description

The MDD_SDSPI_MediaDetect function determine if an SD card is connected to the microcontroller. If the MEDIA_SOFT_DETECT is not defined, the detection is done by polling the SD card detect pin. The MicroSD connector does not have a card detect pin, and therefore a software mechanism must be used. To do this, the SEND_STATUS command is sent to the card. If the card is not answering with 0x00, the card is either not present, not configured, or in an error state. If this is the case, we try to reconfigure the card. If the configuration fails, we consider the card not present (it still may be present, but malfunctioning). In order to use the software card detect mechanism, the MEDIA_SOFT_DETECT macro must be defined.

Preconditions

The MDD_MediaDetect function pointer must be configured to point to this function in FSconfig.h

Return Values
Return Values 
Description 
TRUE 
Card detected 
FALSE 
No card detected 
Side Effects

None.

Remarks

None

Microchip MDD File System Interface 1.4.2 - [Oct 15, 2012]
Copyright © 2012 Microchip Technology, Inc.  All rights reserved.