Made the initialize function try up to three times to get the card in IDLE state before giving up. This fixes the issue with f_open failing the first time after a power cycle.
Dependents: dm_sdcard_with_adapter dm_sdcard
Fork of SDFileSystem by
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:
-
mosi SPI mosi pin connected to SD Card miso SPI miso pin conencted to SD Card sclk SPI sclk pin connected to SD Card cs DigitalOut pin used as SD Card chip select name The name used to access the virtual filesystem
Definition at line 123 of file SDFileSystem.cpp.
Generated on Thu Jul 14 2022 01:39:14 by 1.7.2