USB Mass Storage Device demo with SD card
Dependencies: USBDevice USBMSD_SD max32630fthr
Fork of blinky_max32630fthr by
main.cpp@4:b5764a3c5530, 2016-12-13 (annotated)
- Committer:
- switches
- Date:
- Tue Dec 13 21:33:30 2016 +0000
- Revision:
- 4:b5764a3c5530
- Parent:
- 3:7264c8044625
Updated pegasus_dev and max32630fthr libraries
Who changed what in which revision?
User | Revision | Line number | New 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 | 4:b5764a3c5530 | 5 | MAX32630FTHR pegasus; |
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 | 4:b5764a3c5530 | 16 | pegasus.init(MAX32630FTHR::VIO_3V3); |
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 |