Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: USBDevice USBMSD_AT45 mbed
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 }
Generated on Wed Jul 20 2022 03:10:57 by
1.7.2