Romilly Cocking
/
Ser23K256Example
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
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