There’s some scripts out there that support the BBIO1 binary interface, but the support is so old and variable I’m not sure emulating it has much value. The major targets are sigrok and flashrom. Sigroks windows SUMP driver is messed up, and flash rom still tries to parse ancient text from the terminal. Maybe also AVRdude?
I’m going to take this as license to build something new. BBIO1 is a mess because it was hacked together in stages and we just didn’t have many resources left in the PIC. It’s simple and easy to understand, but it’s inconsistent and overly involved.
Goals
- Consistent control of all bus pirate features in every mode
- Data first, always be sending data unless otherwise requested
- Simple values - PWM, PSU, etc set with plain text values and the right dividers are calculated
Many wireless packet protocols use 0x7f as an escape character to indicate system commands. I think that’s the direction to go. If 7f is data, it’s escaped with 7f, otherwise commands follow. Maybe commands can be 7f with command byte and 4 data bytes (like sump commands).
Global commands
- Change mode
- Vreg enable (optional current limit)
- pull ups
- echo string to terminal
- xon flow control ?
- xoff flow control
- setup mode. Possible get descriptor of mode setup options? Maybe speed and settings are separate commands?
- LED control
- LCD control (maybe a mode?)
- pwm
- measure freq
- gpio aux stuff
- pin direction
- ADC measure (setup and get reading)
- get current (plain text)
- get pin voltage (plain text)
- delay
- silent (wether to acknowledge every command?)
Mode specific commands, like what we now call bus syntax in the user terminal
- read
- all non escaped data is write
- start
- stop
- bulk read write (used by flashrom and avrdude)
- scan for devices (I2C, 1wire)
7f 02 03 30 - command 2 set PSU at 3. 30 volts for example.
It would be cool to have a mode that debugs the binary interface from the UI. All least it would be convenient to me.
I’m going to target flashrom, avrdude, and asprogrammer. I saw dreg has an asprogrammer hack in his github. I’ll get a build server setup so we get auto compiles.
Any thoughts?