Example for Microchip 23K256

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
romilly
Date:
Sun Aug 15 13:15:00 2010 +0000
Commit message:

Changed in this revision

Ser23K256.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 0e31c6068b47 Ser23K256.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Ser23K256.lib	Sun Aug 15 13:15:00 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/romilly/code/Ser23K256/#d2314b1ac797
diff -r 000000000000 -r 0e31c6068b47 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Aug 15 13:15:00 2010 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+#include "Ser23K256.h"
+
+
+SPI spi(p5,p6,p7);
+Ser23K256 sram(spi,p14);
+
+
+int main() {
+    char buff[50];
+    sram.write(0, 'h');
+    sram.write(1, 'i');
+    sram.write(2, '!');
+    sram.write(3, '\0');
+    for (int address = 0; address < 4; address++) {
+        buff[address] = sram.read(address);
+    }
+    printf("sram = %s\r\n", buff);
+    sram.write(0, "Hello world!",12);
+    sram.read(0, buff, 12);
+    buff[12]='\0';
+    printf("now = %s\r\n", buff);
+}
\ No newline at end of file
diff -r 000000000000 -r 0e31c6068b47 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Aug 15 13:15:00 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9114680c05da