How to define own macros?


got my BusPirate and now I’m thinking of how to use it. I understood that i can simply write and read to/from serial interfaces from the demos. And that there are a few macros that perform this commands automatically.
So how can i define my own macros for my application?

Let’s say I want to setup an A2B Audio Bus for that i would need to enable a 48kHz clock and then write and read a bunch of registers. Can i put that into some kind of macro or program?
Sorry if I missed something in the documentation but I’m a bit lost in all this stuff.

Thanks in adcance

I’d you want to add commands or modes, there are two “dummy” examples in the code.

If you just want to repeat repetitive tasks, there’s some working going on here:

Had a few minutes to read over the A2B site. It looks like a transport layer? I2C/I2S/SPI can all flow through a 2 wire interface, and the transceivers decode that while also having on-board voltage regulation/output from the 2 wire setup?

The Bus Pirate supports I2C and SPI already. There is an I2S PIO program for the RP2040, I’d like to add it but don’t have anything to test with at the moment.

How do you want to access the A2B bus?

Yes, basically it brings the I2S Interface to the wire. Once set up you can connect audio peripherals as they where on one board with only 2 samples latency.

I’m a hardware developer at a big car vendor and responsible for this bus.
I would like to try a few things and see if I can make it work. Shouldn’t be a big problem since I already achieved this with an arduino. For the beginning I would just generate an 48kHz clock and set up the bus via I2C commands.

There’s user defined macros now:

And also some scripting ability:

1 Like

This is a better overview of scripting