SPI library used to communicate with an altera development board attached to four zigbee-header pins.
Diff: mmSPI.cpp
- Revision:
- 33:59e13ec04ea8
- Parent:
- 32:5a5d9525c6c4
--- a/mmSPI.cpp Mon Aug 26 22:39:44 2013 +0000 +++ b/mmSPI.cpp Fri Aug 30 20:46:52 2013 +0000 @@ -161,7 +161,7 @@ // 2 R2 // 3 R3 // 4 PC -// 5 <meta, don't do> +// 5 IR // 6 <nothing> // 7 <nothing> @@ -171,8 +171,13 @@ clear_transmit_vector(); // clear transmit vector. - pcSend[7] = 0x02; // mbed sends a command. - + switch(cRegister) + { + case 5 : {pcSend[7] = 0x02; break;} // write IR-L. + case 6 : {pcSend[7] = 0x0A; break;} // write IR-H. + default: {pcSend[7] = 0x02; break;} // other register writes. + } + // align into instruction word. pcSend[1] = ((cRegister & 0x07) << 2) | 0xA0; pcSend[0] = cValue & 0xFF; // immediate value to i.w.