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: mbed
Diff: main.cpp
- Revision:
- 5:25197dce2db7
- Parent:
- 4:a12fae0b702b
diff -r a12fae0b702b -r 25197dce2db7 main.cpp
--- a/main.cpp Sat Jan 31 09:55:39 2015 +0000
+++ b/main.cpp Sat Jan 31 19:30:16 2015 +0000
@@ -22,20 +22,23 @@
uint8_t val_register = spi.write(0x00);
cs = 1;
}
-void enableWrite(){
+void sendCommand(uint8_t reg){
cs = 0;
- spi.write(FM25CL_WREN);
+ spi.write(reg);
cs = 1;
}
//Test that spi is working with fram FM25CL memory
+//mosi: || 0x05 0x00 || 0x06 || 0x05 0x00 || 0x06 ||
+//miso: || 0x00 0x00 || 0x00 || 0x00 0x02 || 0x00 ||
int main() {
hold=1;
cs=1;
while(1) {
readRegister();
- enableWrite();
+ sendCommand(FM25CL_WREN);
readRegister();
+ sendCommand(FM25CL_WRDI);
wait(0.5);
}
}