2021-01-20 16:52:33 +00:00
|
|
|
import time
|
|
|
|
import rp2
|
|
|
|
|
|
|
|
@rp2.asm_pio()
|
|
|
|
def irq_test():
|
|
|
|
wrap_target()
|
|
|
|
nop() [31]
|
|
|
|
nop() [31]
|
|
|
|
nop() [31]
|
|
|
|
nop() [31]
|
|
|
|
irq(0)
|
|
|
|
nop() [31]
|
|
|
|
nop() [31]
|
|
|
|
nop() [31]
|
|
|
|
nop() [31]
|
|
|
|
irq(1)
|
|
|
|
wrap()
|
|
|
|
|
|
|
|
|
|
|
|
rp2.PIO(0).irq(lambda pio: print(pio.irq().flags()))
|
|
|
|
|
2021-03-13 18:02:03 +00:00
|
|
|
sm = rp2.StateMachine(0, irq_test, freq=2000)
|
2021-01-20 16:52:33 +00:00
|
|
|
sm.active(1)
|
|
|
|
time.sleep(1)
|
2021-03-13 18:02:03 +00:00
|
|
|
sm.active(0)
|