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.
Revision 0:5dea2dc6ac9e, committed 2015-12-07
- Comitter:
- AndyTran
- Date:
- Mon Dec 07 04:10:11 2015 +0000
- Commit message:
- spi_test
Changed in this revision
| 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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Mon Dec 07 04:10:11 2015 +0000
@@ -0,0 +1,21 @@
+#include "mbed.h"
+
+SPISlave slave (p11,p12,p13,p14);
+RawSerial pc(USBTX, USBRX);
+
+int main() {
+ while (true) {
+ pc.baud (921600);
+ slave.format(10, 3);
+ slave.frequency(10000000);
+ slave.reply(0x00);
+ int check = slave.receive();
+ pc.printf("receive = %d\n\r",check);
+ if(check==1)
+ {
+ int mes = slave.read();
+ pc.printf("%d\n\r",mes);
+ }
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Dec 07 04:10:11 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/165afa46840b \ No newline at end of file