Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3854

MicroPython • Re: Testing PIO on Pico 2

$
0
0
I'm trying to figure out what the MicroPython implementation of the 'wait' opcode will be. The native PIO Assembly version is stated in the RP235X datasheet as -

wait <polarity> gpio <gpio_num>
wait <polarity> pin <pin_num>
wait <polarity> irq <irq_num> (rel, next, prev)
wait <polarity> jmppin (+ <pin_offset>)

But there's nothing in the Raspberry Pi Pico Python SDK document which still seems to describe only the RP2040 version.

It's not even clear to me if the '(' and ')' represent optionals, a list of options for 'irq', or literal tokens.

The first two would appear to remain the same as they are for RP2040 -

wait( <polarity> , gpio , <gpio_num> )
wait( <polarity> , pin , <pin_num> )

Though I'm not convinced the second below is valid Python syntax, the third of the above, 'irq', could be any of --

wait( <polarity> , irq , <irq_num> , rel , next , prev )
wait( <polarity> , irq , <irq_num> (rel , next , prev) )
wait( <polarity> , irq , rel( <irq_num> ) )
wait( <polarity> , irq , next( <irq_num> ) )
wait( <polarity> , irq , prev( <irq_num> ) )

The last, 'jmppin', could be any of these -

wait( <polarity> , jmppin , <pin_offset> )
wait( <polarity> , jmppin (+ <pin_offset>) )
wait( <polarity> , jmppin + <pin_offset> )

Anyone know, or is it a case of waiting for whatever MicroPython eventually deliver for RP235X 'from rp2 import asm_pio' ?

Statistics: Posted by hippy — Tue Aug 27, 2024 1:36 am



Viewing all articles
Browse latest Browse all 3854

Trending Articles