Example for Microchip 23K256
Revision 0:0e31c6068b47, committed 2010-08-15
- Comitter:
- romilly
- Date:
- Sun Aug 15 13:15:00 2010 +0000
- Commit message:
Changed in this revision
--- /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
--- /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
--- /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
Microchip 23K256 SRAM