Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added SPI API. Starting on wire.

  • Loading branch information...
commit 331e385b57e8efd5e63abbbd452495fe6ce3103a 1 parent 258ddc2
@voodootikigod authored
Showing with 30 additions and 1 deletion.
  1. +30 −1 firmware/firmware.cpp
View
31 firmware/firmware.cpp
@@ -211,7 +211,36 @@ void loop() {
SPI.setDataMode(SPI_MODE3);
}
break;
- default:
+
+ case 0x24: // SPI.transfer
+ val = client.read();
+ SPI.transfer(val);
+ break;
+
+
+ // Wire API
+ case 0x30:
+ Wire.begin();
+ break;
+ case 0x21: // SPI.end
+ SPI.end();
+ break;
+ case 0x22: // SPI.setBitOrder
+ type = client.read();
+ SPI.setBitOrder((type ? MSBFIRST : LSBFIRST));
+ break;
+ val = client.read();
+ SPI.transfer(val);
+ break;
+
+
+
+
+
+
+
+
+ default: // noop
break;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.