raspberrypi / pico-feedback

25 stars 2 forks source link

Inconsistent PIO instruction docs in Pico C/C++ SDK PDF and RP2350 datasheet #416

Open achan1989 opened 1 month ago

achan1989 commented 1 month ago

The Pico C/C++ SDK PDF v3.0 is missing the assembler syntax for the wait <polarity> jmppin variant. Thankfully it's documented in the RP2350 datasheet, but the SDK doc should get it too.

The C/C++ SDK doc says the syntax for the wait <polarity> irq variant only permits (rel). The 2350 datasheet shows (rel, next, prev) at the top of section 11.4.3.3, but only (rel) immediately below that (which also re-explains the meaning of rel, which was done in the preceding section 11.4.3.2).

achan1989 commented 1 month ago

And the RP2350 datasheet says wait <polarity> jmppin (+ <pin_offset>). Does it mean that providing an offset is optional, with a default of zero?

achan1989 commented 1 month ago

Looking at the parser source, it looks like pioasm will accept wait <polarity> irq variants like

WAIT <pol> IRQ <num> REL
WAIT <pol> IRQ PREV <num>
WAIT <pol> IRQ NEXT <num>

The latter two conflict with the RP2350 datasheet, which says that PREV and NEXT must go after <num>, just like the REL variant.

achan1989 commented 1 month ago

That was all for the wait instruction. Similar issues with the irq instruction.

The C/C++ SDK doc says the syntax for the irq instruction only permits the (rel) option. The 2350 datasheet says it can be (prev, rel, next).

Pioasm will accept IRQ PREV <value> and IRQ NEXT <value>, but the RP2350 datasheet says PREV and NEXT must go after the <value>, like with REL.

achan1989 commented 1 month ago

Related: the C/C++ SDK docs for pioasm expressions (section 3.3.4) doesn't mention bitwise and/or/xor. But it looks like pioasm will accept them.