The wait in mci_WaitForEvent will delay all card transactions.
Fork of EALib by
MCIFileSystem Class Reference
Access the filesystem on an SD Card using MCI. More...
#include <MCIFileSystem.h>
Public Member Functions | |
MCIFileSystem (const char *name, PinName cd=p38) | |
Create the File System for accessing an SD/MMC Card using MCI. | |
bool | cardInserted () const |
Tests if a SD/MMC card is inserted or not. |
Detailed Description
Access the filesystem on an SD Card using MCI.
#include "mbed.h" #include "MCIFileSystem.h" MCIFileSystem mcifs("mci"); int main() { printf("Please insert a SD/MMC card\n"); while(!mcifs.cardInserted()) { wait(0.5); } printf("Found SD/MMC card, writing to /mci/myfile.txt ...\n"); FILE *fp = fopen("/mci/myfile.txt", "w"); if (fp != NULL) { fprintf(fp, "Hello World!\n"); fclose(fp); printf("Wrote to /mci/myfile.txt\n"); } else { printf("Failed to open /mci/myfile.txt\n"); } }
Definition at line 34 of file MCIFileSystem.h.
Constructor & Destructor Documentation
MCIFileSystem | ( | const char * | name, |
PinName | cd = p38 |
||
) |
Create the File System for accessing an SD/MMC Card using MCI.
- Parameters:
-
name The name used to access the virtual filesystem cd The pin connected to the CardDetect line
Definition at line 584 of file MCIFileSystem.cpp.
Member Function Documentation
bool cardInserted | ( | ) | const |
Tests if a SD/MMC card is inserted or not.
- Returns:
- True if a card has been inserted, False if no card is inserted or if the card detect pin is unavailable
Definition at line 780 of file MCIFileSystem.cpp.
Generated on Tue Jul 12 2022 15:13:42 by 1.7.2