A board support package for the LPC4088 Display Module.

Dependencies:   DM_HttpServer DM_USBHost

Dependents:   lpc4088_displaymodule_emwin lpc4088_displaymodule_demo_sphere sampleGUI sampleEmptyGUI ... more

Fork of DMSupport by EmbeddedArtists AB

Embed: (wiki syntax)

« Back to documentation index

MCIFileSystem Class Reference

MCIFileSystem Class Reference

Access the filesystem on an SD Card using MCI. More...

#include <MCIFileSystem.h>

Public Member Functions

 MCIFileSystem (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 ( PinName  cd = P4_16 )

Create the File System for accessing an SD/MMC Card using MCI.

Parameters:
cdThe 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 878 of file MCIFileSystem.cpp.