The raw spiIO mode is incorporated into the latest nightly build for v1, v2go, and v3:
http://code.google.com/p/the-bus-pirate/source/browse/#svn/trunk/firmwareTo activate it:
Send 0x00 to the command prompt, Bus Pirate replies BBIO1
send 0x01 to setup the SPI mode, BP replies SPI1
Here's some minor changes and updates:
rawSPI mode:
00000000//reset, rawIO mode init (reply:BBIO1)
00000001//rawSPI mode init (reply:SPI1)
0001xxxx//low 4 bits of byte + send/read byte (reply: spi read byte)
0010xxxx//high 4 bits of byte (reply: 1=ok)
0011000x//set CS pin high (1) or low(0) (reply:1=ok)
0100wxyz//configure peripherals w=power, x=pullups, y=AUX, z=CS (reply: 1=ok)
Helpful HEX values:
0x30 (00110000) CS high (actually 0volts, CS enable)
0x31 (00110001) CS low (actually 3.3volts, CS disable)
0x48 (01001000) turn on power supply (other peripherals off)
0x40 (01000000) turn off power supply (other peripherals also off)
To write the value 11110000 (0xF0):
//first setup the BBIO mode and enter SPI mode
0x00 //enter raw mode, BP returns "BBIO1"
0x01 //setup raw SPI, BP returns "SPI1"
//now send values
0x2a //(00101111) send high 4 bits, BP returns 1
0x1a //(00010000) send low 4 bits, write value, BP returns SPI read
//send additional commands as needed