SPI to Ethernet Slave

Dependencies:   WIZnetInterface mbed

Fork of SPI_HelloWorld_Mbed by mbed official

Files at this revision

API Documentation at this revision

Comitter:
Ricky_Kwon
Date:
Thu Mar 10 02:11:57 2016 +0000
Parent:
5:709f1ad85e97
Child:
7:b09eade395f7
Commit message:
Ethernet ---> W7500 ---> SPI ---> W7500 ---> Ethernet

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Mar 10 01:28:35 2016 +0000
+++ b/main.cpp	Thu Mar 10 02:11:57 2016 +0000
@@ -15,7 +15,7 @@
 SPISlave slave(PA_8, PA_7, PA_6, PA_5); // mosi, miso, sclk, ssel
  
 int main() {
-    int spidata=0;
+    int SpiData=0;
     char EthTx[1];
 
     printf("SPI to Ethernet Slave\r\n");
@@ -66,8 +66,8 @@
         {
             if(slave.receive())
             {
-                spidata = slave.read();
-                EthTx[0] = spidata;
+                SpiData = slave.read();
+                EthTx[0] = SpiData;
                 socket.send(EthTx, 1);   
             }
         }