This is a block device implementation of the USB MSD driver. It will allow you to easily change between different storage devices that implement the block device API.

Dependencies:   USBDevice USBMSD_BD max32630fthr

Fork of FTHR_USBMSD_Demo by Maxim Integrated

main.cpp

Committer:
switches
Date:
2016-12-13
Revision:
4:b5764a3c5530
Parent:
3:7264c8044625
Child:
6:1f64f4cf7cc7

File content as of revision 4:b5764a3c5530:

#include "mbed.h"
#include "max32630fthr.h"
#include "USBMSD_SD.h"

MAX32630FTHR pegasus;

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_OFF;
    rLED = LED_ON;
    pegasus.init(MAX32630FTHR::VIO_3V3);

    gLED = 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);
    }
}