USB composite device example program, drag-and-drop flash writer.

Dependencies:   SWD USBDevice mbed BaseDAP

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers USBMSD_LPC.h Source File

USBMSD_LPC.h

00001 // USBMSD_LPC.h 2013/9/26
00002 #pragma once
00003 #include "USBMSD_Drop.h"
00004 #include "Target2.h"
00005 #include "Flash.h"
00006 
00007 /** drag-and-drop flash writer using the USBMSD class
00008  *
00009  * @code
00010  * #include "mbed.h"
00011  * #include "USBMSD_LPC.h"
00012  * Serial pc(USBTX, USBRX);
00013  * SWD swd(PTB8,PTB9,PTB10); // SWDIO(dp12),SWCLK(dp3),nReset(dp23)
00014  *
00015  * int main() {
00016  *     USBMSD_LPC* LPC1114 = new USBMSD_LPC(&swd, &pc); 
00017  *     while(1); // forever
00018  * }
00019  * @endcode
00020  */
00021 class USBMSD_LPC : public USBMSD_Drop {
00022 public:
00023     /** create drag-and-drop flash writer
00024      * @param swd SWD interface
00025      */
00026     USBMSD_LPC(SWD* swd, Serial* usbpc);
00027     virtual ~USBMSD_LPC() {}
00028     virtual void Drop(const uint8_t* data, int len, int offset, int total);
00029 protected:
00030     Target2* _target;
00031     Flash* _flash;
00032     Serial* _pc;
00033 };