For what its worth:
The control messages are 5 bytes long. The OpCode is the first byte.
The OpCode 0x03 corresponds to WRITE_GPIO in the MPS430 firmware for the DRV8825 EVM.
DIR is sent as 03 10 00 00 00
clearing DIR is sent as 03 00 00 00 00
I'm calling the 10 the control code. The control codes for WRITE_GPIO are
DIR 03
DECAY 02
nRESET 40
nSLEEP 80
clear codes 00
The source will have to keep track of the codes sent because they combine. For example DIR + DECAY +nSLEEP is 92
MODE OpCode is 16, which corrosponds to SPI_GPIO, with the control codes
MODE0 08
MODE1 02
MODE2 01
nENABLE has the OpCod 0E, which corresponds with SET_TMR_OUT , with the control code 02.
Lines 30 to 35 (plus a comment that I added at line 32) in Task0.cpp
30 // Write GPIO Data [ OPCODE = 3 ] [ GPIO DATA ] [ Not Used ] [ Not Used ] [ Not Used ]
31 // GPIO DATA = P47/ P46/P45/P44/ NO/ NO/ P41/NO
// (DRV8825) nSLEEP/nRESET/ NC/DIR/STEP/nENABLE/nDECAY/NO
32 case (WRITE_GPIO):
33 P4OUT = SerialBuffer[1]; //set bit pattern to contents of SerialBuffer[1]
34 SerialOutBuffer[1] = ~SerialBuffer[1];
35 break;
I will add another reply if I run into something that is not obvious in Task0 that needs explaining.