USB Mass Storage Device demo with SD card

Dependencies:   USBDevice USBMSD_SD max32630fthr

Fork of blinky_max32630fthr by Greg Steiert

Committer:
switches
Date:
Sun Nov 20 23:58:11 2016 +0000
Revision:
3:7264c8044625
Parent:
1:464c8b3634dc
Child:
4:b5764a3c5530
Updated to new MAX32630FTHR Class Library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
switches 0:60a522ae2e35 1 #include "mbed.h"
switches 1:464c8b3634dc 2 #include "max32630fthr.h"
switches 1:464c8b3634dc 3 #include "USBMSD_SD.h"
switches 0:60a522ae2e35 4
switches 3:7264c8044625 5 MAX32630FTHR pegasus(MAX32630FTHR::VIO_3V3);
switches 3:7264c8044625 6
switches 1:464c8b3634dc 7 DigitalOut rLED(LED1);
switches 1:464c8b3634dc 8 DigitalOut gLED(LED2);
switches 0:60a522ae2e35 9
switches 0:60a522ae2e35 10 // main() runs in its own thread in the OS
switches 0:60a522ae2e35 11 // (note the calls to Thread::wait below for delays)
switches 0:60a522ae2e35 12 int main()
switches 0:60a522ae2e35 13 {
switches 1:464c8b3634dc 14 gLED = LED_OFF;
switches 1:464c8b3634dc 15 rLED = LED_ON;
switches 3:7264c8044625 16 pegasus.init();
switches 1:464c8b3634dc 17
switches 1:464c8b3634dc 18 gLED = LED_ON;
switches 1:464c8b3634dc 19 Thread::wait(100);
switches 1:464c8b3634dc 20
switches 1:464c8b3634dc 21 USBMSD_SD sd(P0_5, P0_6, P0_4, P0_7); // mosi, miso, sclk, cs
switches 1:464c8b3634dc 22 rLED = LED_OFF;
switches 0:60a522ae2e35 23
switches 0:60a522ae2e35 24 while (true) {
switches 1:464c8b3634dc 25 gLED = !gLED;
switches 0:60a522ae2e35 26 Thread::wait(500);
switches 0:60a522ae2e35 27 }
switches 0:60a522ae2e35 28 }
switches 0:60a522ae2e35 29