little llumpu / Mbed 2 deprecated USBMSD_AT45_HelloWorld

Dependencies:   USBDevice USBMSD_AT45 mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "USBMSD_AT45.h"
00003 
00004 USBMSD_AT45 Flash(p5, p6, p7, p8, 512);  // Mosi, Miso, Sclk, CS, Size of block being transported over USB
00005                                   // each time. Can be 512, 1024, 2048, 4096. Best is to select same
00006                                   // size as AT45DBxx SRAM buffer size. If page size of flash is not
00007                                   // binary 2^N (256, 512, 1024 bytes) but is 264, 528 or 1056 bytes
00008                                   // before each write we read block being written to SRAM then rewrite
00009                                   // part of them with data from host and write whole SRAM buffer back
00010                                   // to flash. This avoids to data being rewritten in other blocks
00011                                   // we actually do not write to.
00012 int main() {
00013 
00014     while(1) {
00015    
00016    // Do something else here
00017    
00018     }
00019 }