Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions reference/micropython/rp2/PIO.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions reference/micropython/rp2/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@ 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,
autopull=False,
push_thresh=32,
pull_thresh=32,
fifo_join=PIO.JOIN_NONE,
execctrl=0,
) -> Callable[..., _PIO_ASM_Program]:
"""
Assemble a PIO program.
Expand All @@ -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()`:
Expand All @@ -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.
"""
...

Expand Down
6 changes: 6 additions & 0 deletions stubs/micropython-v1_27_0_preview-docstubs/rp2/PIO.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down
7 changes: 6 additions & 1 deletion stubs/micropython-v1_27_0_preview-docstubs/rp2/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -41,13 +41,15 @@ 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,
autopull=False,
push_thresh=32,
pull_thresh=32,
fifo_join=PIO.JOIN_NONE,
execctrl=0,
) -> Callable[..., _PIO_ASM_Program]:
"""
Assemble a PIO program.
Expand Down Expand Up @@ -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.
"""
...

Expand Down
Loading