Browse files

Added SPI API. Starting on wire.

  • Loading branch information...
1 parent 258ddc2 commit 331e385b57e8efd5e63abbbd452495fe6ce3103a @voodootikigod committed Jan 23, 2014
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;
}
}

0 comments on commit 331e385

Please sign in to comment.