rp2.PIO ======= .. This document was autogenerated by Sphinx-autoapi from a .pyi stub or a source code file. .. Do not edit this file, instead edit the source file and run Sphinx to update. .. Source: docs/stubs/rp2/PIO.pyi .. py:module:: rp2.PIO Classes ------- .. autoapisummary:: rp2.PIO.PIO Module Contents --------------- .. py:class:: PIO(id) Gets the PIO instance numbered *id*. The RP2040 has two PIO instances, numbered 0 and 1. Raises a ``ValueError`` if any other argument is provided. .. py:method:: add_program(program) -> _typeshed.Incomplete Add the *program* to the instruction memory of this PIO instance. The amount of memory available for programs on each PIO instance is limited. If there isn't enough space left in the PIO's program memory this method will raise ``OSError(ENOMEM)``. .. py:method:: irq(handler=None, trigger=IRQ_SM0, hard=False) -> _typeshed.Incomplete Returns the IRQ object for this PIO instance. MicroPython only uses IRQ 0 on each PIO instance. IRQ 1 is not available. Optionally configure it. .. py:method:: remove_program(program: Optional[Any] = None) -> None Remove *program* from the instruction memory of this PIO instance. If no program is provided, it removes all programs. It is not an error to remove a program which has already been removed. .. py:method:: state_machine(id, program, *args, **kwargs) -> _typeshed.Incomplete Gets the state machine numbered *id*. On the RP2040, each PIO instance has four state machines, numbered 0 to 3. Optionally initialize it with a *program*: see `StateMachine.init`. >>> rp2.PIO(1).state_machine(3) StateMachine(7) .. py:attribute:: IN_HIGH :type: _typeshed.Incomplete These constants are used for the *out_init*, *set_init*, and *sideset_init* arguments to `asm_pio`. .. py:attribute:: IN_LOW :type: _typeshed.Incomplete These constants are used for the *out_init*, *set_init*, and *sideset_init* arguments to `asm_pio`. .. py:attribute:: IRQ_SM0 :type: _typeshed.Incomplete These constants are used for the *trigger* argument to `PIO.irq`. .. py:attribute:: IRQ_SM1 :type: _typeshed.Incomplete These constants are used for the *trigger* argument to `PIO.irq`. .. py:attribute:: IRQ_SM2 :type: _typeshed.Incomplete These constants are used for the *trigger* argument to `PIO.irq`. .. py:attribute:: IRQ_SM3 :type: _typeshed.Incomplete These constants are used for the *trigger* argument to `PIO.irq`. .. py:attribute:: JOIN_NONE :type: _typeshed.Incomplete These constants are used for the *fifo_join* argument to `asm_pio`. .. py:attribute:: JOIN_RX :type: _typeshed.Incomplete These constants are used for the *fifo_join* argument to `asm_pio`. .. py:attribute:: JOIN_TX :type: _typeshed.Incomplete These constants are used for the *fifo_join* argument to `asm_pio`. .. py:attribute:: OUT_HIGH :type: _typeshed.Incomplete These constants are used for the *out_init*, *set_init*, and *sideset_init* arguments to `asm_pio`. .. py:attribute:: OUT_LOW :type: _typeshed.Incomplete These constants are used for the *out_init*, *set_init*, and *sideset_init* arguments to `asm_pio`. .. py:attribute:: SHIFT_LEFT :type: _typeshed.Incomplete These constants are used for the *in_shiftdir* and *out_shiftdir* arguments to `asm_pio` or `StateMachine.init`. .. py:attribute:: SHIFT_RIGHT :type: _typeshed.Incomplete These constants are used for the *in_shiftdir* and *out_shiftdir* arguments to `asm_pio` or `StateMachine.init`.