diff --git a/reference/micropython/rp2/PIO.pyi b/reference/micropython/rp2/PIO.pyi index 896e0e8ed..ecef755b8 100644 --- a/reference/micropython/rp2/PIO.pyi +++ b/reference/micropython/rp2/PIO.pyi @@ -69,6 +69,14 @@ class PIO: IRQ_SM2: int = 0x400 IRQ_SM3: int = 0x800 + # STATUS constants for execctrl argument to asm_pio + STATUS_TXLEVEL: int = 0 + """Status value for TX FIFO level threshold.""" + STATUS_RXLEVEL: int = 32 + """Status value for RX FIFO level threshold.""" + STATUS_IRQ: int = 64 + """Status value for IRQ flags.""" + def __init__(self, id:int) -> None: ... def add_program(self, program: _PIO_ASM_Program) -> None: diff --git a/reference/micropython/rp2/__init__.pyi b/reference/micropython/rp2/__init__.pyi index 91af11f9b..e61a5282a 100644 --- a/reference/micropython/rp2/__init__.pyi +++ b/reference/micropython/rp2/__init__.pyi @@ -40,6 +40,7 @@ def asm_pio( out_init: Union[Pin, List[Pin], int, List[int], None] = None, set_init: Union[Pin, List[Pin], int, List[int], None] = None, sideset_init: Union[Pin, List[Pin], int, List[int], None] = None, + side_pindir: Optional[bool] = None, in_shiftdir=0, out_shiftdir=0, autopush=False, @@ -47,6 +48,7 @@ def asm_pio( push_thresh=32, pull_thresh=32, fifo_join=PIO.JOIN_NONE, + execctrl=0, ) -> Callable[..., _PIO_ASM_Program]: """ Assemble a PIO program. @@ -61,6 +63,8 @@ def asm_pio( be at most 5. - *sideset_init* configures the pins used side-setting. There can be at most 5. + - *side_pindir* when set to ``True`` configures ``.side()`` modifiers to be + used for pin directions, instead of pin values (the default, when ``False``). The following parameters are used by default, but can be overridden in `StateMachine.init()`: @@ -81,6 +85,9 @@ def asm_pio( - *fifo_join* configures whether the 4-word TX and RX FIFOs should be combined into a single 8-word FIFO for one direction only. The options are `PIO.JOIN_NONE`, `PIO.JOIN_RX` and `PIO.JOIN_TX`. + - *execctrl* configures additional execution control options. Can be used + with constants like `PIO.STATUS_TXLEVEL` + n to trigger status checks + based on FIFO thresholds. """ ... diff --git a/stubs/micropython-v1_27_0_preview-docstubs/rp2/PIO.pyi b/stubs/micropython-v1_27_0_preview-docstubs/rp2/PIO.pyi index 242f92710..0c22b7ab5 100644 --- a/stubs/micropython-v1_27_0_preview-docstubs/rp2/PIO.pyi +++ b/stubs/micropython-v1_27_0_preview-docstubs/rp2/PIO.pyi @@ -62,6 +62,12 @@ class PIO: """These constants are used for the *trigger* argument to `PIO.irq`.""" IRQ_SM3: Incomplete """These constants are used for the *trigger* argument to `PIO.irq`.""" + STATUS_TXLEVEL: Incomplete + """Status value for TX FIFO level threshold.""" + STATUS_RXLEVEL: Incomplete + """Status value for RX FIFO level threshold.""" + STATUS_IRQ: Incomplete + """Status value for IRQ flags.""" def __init__(self, id: int) -> None: ... def gpio_base(self, base: Optional[Any] = None) -> Incomplete: """ diff --git a/stubs/micropython-v1_27_0_preview-docstubs/rp2/__init__.pyi b/stubs/micropython-v1_27_0_preview-docstubs/rp2/__init__.pyi index bacf77eaf..f7a292ca6 100644 --- a/stubs/micropython-v1_27_0_preview-docstubs/rp2/__init__.pyi +++ b/stubs/micropython-v1_27_0_preview-docstubs/rp2/__init__.pyi @@ -24,8 +24,8 @@ from rp2.PIO import PIO from rp2.StateMachine import StateMachine from rp2 import PIOASMEmit, _PIO_ASM_Program, bootsel_button from rp2.PIOASMEmit import PIOASMEmit +from typing import Callable, List, Union, Optional, overload from machine import Pin -from typing import Callable, List, Union, overload from micropython import const _PIO_ASM_Program: TypeAlias = PIOASMEmit @@ -41,6 +41,7 @@ def asm_pio( out_init: Union[Pin, List[Pin], int, List[int], None] = None, set_init: Union[Pin, List[Pin], int, List[int], None] = None, sideset_init: Union[Pin, List[Pin], int, List[int], None] = None, + side_pindir: Optional[bool] = None, in_shiftdir=0, out_shiftdir=0, autopush=False, @@ -48,6 +49,7 @@ def asm_pio( push_thresh=32, pull_thresh=32, fifo_join=PIO.JOIN_NONE, + execctrl=0, ) -> Callable[..., _PIO_ASM_Program]: """ Assemble a PIO program. @@ -84,6 +86,9 @@ def asm_pio( - *fifo_join* configures whether the 4-word TX and RX FIFOs should be combined into a single 8-word FIFO for one direction only. The options are `PIO.JOIN_NONE`, `PIO.JOIN_RX` and `PIO.JOIN_TX`. + - *execctrl* configures additional execution control options. Can be used + with constants like `PIO.STATUS_TXLEVEL` + n to trigger status checks + based on FIFO thresholds. """ ...