I'm putting together an additional binary mode. This provides bitwise access to 2- and 3- wire protocols like the user mode raw-wire libraries.
* 00000000 – Enter raw bitbang mode, reset to raw bitbang mode
* 00000001 – Mode version string (RAW1)
* 00000010 - I2C style start bit
* 00000011 - I2C style stop bit
* 00000100 - CS low (0) (respects hiz setting)
* 00000101 - CS high (1)
* 00000110 - Read byte
* 00000111 - Read bit
* 00001000 - Peek at input pin
* 00001001 - Clock tick
* 00001010 - Clock low
* 00001011 - Clock high
* 00001100 - Data low
* 00001101 - Data high
* 0001xxxx – Bulk transfer, send 1-16 bytes (0=1byte!)
* 0100wxyz – Configure peripherals, w=power, x=pullups, y=AUX, z=CS
* 0110000x – Set speed
* 1000wxyz – Config, w=output type, x=3wire, y=lsb, z=n/a
This is useful for serial devices with funky interfaces, like Sensirion sensors, Smart Cards, and ShiftBrite modules.
Comments are welcome.
0010xxxx - Bulk clock ticks, 1-16 (?)
what would be a good default for the rawwire configuration operation? 0b000, 0b001, 0b100?
It'll start it at 0000 (hi-z, 2-wire, MSB first, don't care).
You moved really fast on that one, wow!