SPI library used to communicate with an altera development board attached to four zigbee-header pins.
Diff: mmSPI.cpp
- Revision:
- 28:80b46485fa1d
- Parent:
- 27:fb63c8b70bc2
--- a/mmSPI.cpp Sun Aug 25 05:16:58 2013 +0000 +++ b/mmSPI.cpp Sun Aug 25 05:38:28 2013 +0000 @@ -138,7 +138,7 @@ clear_transmit_vector(); // clear transmit vector. - pcSend[7] = 0x02; // mbed sends a command. + pcSend[7] = 0x06; // mbed sends a command. // align into instruction word. pcSend[1] = ((cRegister & 0x07) << 2) | 0xA0; @@ -177,12 +177,12 @@ write_register(0x02,cHData); // R2 <- high-data. write_register(0x01,cLdata); // R1 <- low-data. - pcSend[7] = 0x02; // mbed sends command. + pcSend[7] = 0x06; // mbed sends command. pcSend[1] = 0x02; // write-enable high. pcSend[0] = 0x00; // remainder of instruction. transceive_vector(); - pcSend[7] = 0x02; // mbed sends command. + pcSend[7] = 0x06; // mbed sends command. pcSend[1] = 0x00; // write-enable low. pcSend[0] = 0x00; // remainder of instruction. transceive_vector(); @@ -201,12 +201,12 @@ write_register(0x03,cAddress); // R3 <= address. - pcSend[7] = 0x02; // mbed sends command. + pcSend[7] = 0x06; // mbed sends command. pcSend[1] = 0xC8; // R2 <- MM[R3] pcSend[0] = 0x00; transceive_vector(); // send command. - pcSend[7] = 0x02; // mbed sends command. + pcSend[7] = 0x06; // mbed sends command. pcSend[1] = 0xC4; // R1 <- MM[R3] pcSend[0] = 0x00; transceive_vector(); // send command.