I've been wondering about the PIO for a while.
Can it be used for old-school parallel bus? Like 16 bit address 8 bit data? Or the 16 bit address + data multiplexed?
Multiplexed yes, although I only looked at the PIO details to see if I could experiment with PDM with it (no, the PIO units have no adder). Do check the
datasheet for yourself, though. The PIO instruction set is on page 341, I recommend reading from page 330 (Chapter 3. PIO) onwards.
The IN and OUT PIO instructions can set/get the state of any number of pins (up to 32), but the set is contiguous and always starts at the same pin (unless the 2040 modifies the PINCTRL register for that state machine). So, for 16-bit address and 8-bit data, I think you could do it if you push 32-bit words to the FIFO, consisting of the data byte in the least and most significant bytes, sandwiching the address bits. Writing the address would always write the data bits too (set all 24 pins).
The multiplexed form seems much easier. Essentially, the PIO "program" will pop off an address, emit it to the PIO pins, and toggle the additional clock/read/write pin. A read program will then read the PIO pins and push it to the 2040 proper; a write program will pop off the data, and emit it to the PIO pins. Each instruction has an optional delay (generally, 0-31). The limit of 32 instruction words per PIO unit (four state machines) might be an issue, but you'll need at least two of the state machines (read and write operations) anyway. Autopull and wrap will reduce the number of state machine instructions you'll need.
I believe you can also do "block" DMA to the multiplexed bus, with the PIO program autoincrementing (or decrementing) the address. For example, you supply the PIO program with the length of the data, the initial address, and the data (bytes or words), and it will write the interleaved address-data to the pins as needed, without the DMA'd data having the addresses interleaved.
Obviously, I haven't tried this myself, as I don't have a use for it, so there might be gotchas I haven't seen.