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

Dependencies:   SWD USBDevice mbed BaseDAP

Embed: (wiki syntax)

« Back to documentation index

USBMSD_LPC Class Reference

USBMSD_LPC Class Reference

drag-and-drop flash writer using the USBMSD class More...

#include <USBMSD_LPC.h>

Inherits USBMSD_Drop.

Public Member Functions

 USBMSD_LPC (SWD *swd, Serial *usbpc)
 create drag-and-drop flash writer
virtual void Drop (const uint8_t *data, int len, int offset, int total)
 drag-and-drop file received
void attach (void(*fptr)(const uint8_t *data, int len, int offset, int total))
 Attach a callback for when a file is received.

Detailed Description

drag-and-drop flash writer using the USBMSD class

 #include "mbed.h"
 #include "USBMSD_LPC.h"
 Serial pc(USBTX, USBRX);
 SWD swd(PTB8,PTB9,PTB10); // SWDIO(dp12),SWCLK(dp3),nReset(dp23)

 int main() {
     USBMSD_LPC* LPC1114 = new USBMSD_LPC(&swd, &pc); 
     while(1); // forever
 }

Definition at line 21 of file USBMSD_LPC.h.


Constructor & Destructor Documentation

USBMSD_LPC ( SWD *  swd,
Serial *  usbpc 
)

create drag-and-drop flash writer

Parameters:
swdSWD interface

Definition at line 17 of file USBMSD_LPC.cpp.


Member Function Documentation

void attach ( void(*)(const uint8_t *data, int len, int offset, int total)  fptr ) [inherited]

Attach a callback for when a file is received.

Parameters:
fptrfunction pointer

Definition at line 17 of file USBMSD_Drop.cpp.

void Drop ( const uint8_t *  data,
int  len,
int  offset,
int  total 
) [virtual]

drag-and-drop file received

Parameters:
datareceived data pointer
lendata length
offsetoffset from file top
totaltotal file size

Reimplemented from USBMSD_Drop.

Definition at line 24 of file USBMSD_LPC.cpp.