USB Mass Storage Device demo with SD card
Dependencies: USBDevice USBMSD_SD max32630fthr
Fork of FTHR_USBMSD_Demo by
This example implements a micro SD card reader allowing access to a card inserted into the micro SD connector through the micro USB connector using the standard USB-MSD interface so that it appears just like a USB drive to your system.
main.cpp
- Committer:
- switches
- Date:
- 2017-02-06
- Revision:
- 6:1f64f4cf7cc7
- Parent:
- 4:b5764a3c5530
- Child:
- 8:8c31b3ba5371
File content as of revision 6:1f64f4cf7cc7:
#include "mbed.h" #include "max32630fthr.h" #include "USBMSD_SD.h" MAX32630FTHR pegasus(MAX32630FTHR::VIO_3V3); DigitalOut rLED(LED1); DigitalOut gLED(LED2); // main() runs in its own thread in the OS // (note the calls to Thread::wait below for delays) int main() { gLED = LED_ON; rLED = LED_ON; Thread::wait(100); USBMSD_SD sd(P0_5, P0_6, P0_4, P0_7); // mosi, miso, sclk, cs rLED = LED_OFF; while (true) { gLED = !gLED; Thread::wait(500); } }