123

Dependencies:   FATFileSystem

Fork of SDFileSystem by YenChun Tung

Embed: (wiki syntax)

« Back to documentation index

SDFileSystem Class Reference

SDFileSystem Class Reference

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

#include <SDFileSystem.h>

Public Member Functions

 SDFileSystem (PinName mosi, PinName miso, PinName sclk, PinName cs, const char *name)
 Create the File System for accessing an SD Card using SPI.

Detailed Description

Access the filesystem on an SD Card using SPI.

 #include "mbed.h"
 #include "SDFileSystem.h"

 SDFileSystem sd(p5, p6, p7, p12, "sd"); // MOSI, MISO, SCLK, SSEL
  
 int main() {
     FILE *fp = fopen("/sd/mbed.txt", "w");
     fprintf(fp, "Hello World!\n");
     fclose(fp);
 }

Definition at line 44 of file SDFileSystem.h.


Constructor & Destructor Documentation

SDFileSystem ( PinName  mosi,
PinName  miso,
PinName  sclk,
PinName  cs,
const char *  name 
)

Create the File System for accessing an SD Card using SPI.

Parameters:
mosiSPI mosi pin connected to SD Card
misoSPI miso pin conencted to SD Card
sclkSPI sclk pin connected to SD Card
csDigitalOut pin used as SD Card chip select
nameThe name used to access the virtual filesystem

Definition at line 123 of file SDFileSystem.cpp.