Subdirectory provided by Embedded Artists
Dependencies: DM_FATFileSystem DM_HttpServer DM_USBHost EthernetInterface USBDevice mbed-rpc mbed-rtos mbed-src
Dependents: lpc4088_displaymodule_hello_world_Sept_2018
Fork of DMSupport 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=P4_16) | |
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 51 of file MCIFileSystem.h.
Constructor & Destructor Documentation
MCIFileSystem | ( | const char * | name, |
PinName | cd = P4_16 |
||
) |
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 599 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 853 of file MCIFileSystem.cpp.
Generated on Wed Jul 13 2022 02:57:24 by 1.7.2