diff options
| author | Markus Gyger <markus@gyger.org> | 2024-12-31 15:34:17 +0700 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-02-08 12:34:26 +1100 |
| commit | 0662c551216db1a3ab40dafbeffcc3ee929d7690 (patch) | |
| tree | 6cbb0ef301fa510aa78555fff16cbe33836aa8e7 /docs | |
| parent | 9d0a5ac7e9ac8b90d1bbea402fd16a410aa4008f (diff) | |
rp2/rp2_pio: Add side_pindir support for PIO.
Side-setting can also be used to change pin directions instead of pin
values. This adds a parameter `side_pindir` to decorator `asm_pio()` to
configure it.
Also replaces a few close-by 0s with corresponding PIO.* constants.
Addresses issue #10027.
Signed-off-by: Markus Gyger <markus@gyger.org>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/library/rp2.rst | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/library/rp2.rst b/docs/library/rp2.rst index f0189327d..a215e98b5 100644 --- a/docs/library/rp2.rst +++ b/docs/library/rp2.rst @@ -23,7 +23,7 @@ The ``rp2`` module includes functions for assembling PIO programs. For running PIO programs, see :class:`rp2.StateMachine`. -.. function:: asm_pio(*, out_init=None, set_init=None, sideset_init=None, in_shiftdir=0, out_shiftdir=0, autopush=False, autopull=False, push_thresh=32, pull_thresh=32, fifo_join=PIO.JOIN_NONE) +.. function:: asm_pio(*, out_init=None, set_init=None, sideset_init=None, side_pindir=False, in_shiftdir=PIO.SHIFT_LEFT, out_shiftdir=PIO.SHIFT_LEFT, autopush=False, autopull=False, push_thresh=32, pull_thresh=32, fifo_join=PIO.JOIN_NONE) Assemble a PIO program. @@ -35,8 +35,10 @@ For running PIO programs, see :class:`rp2.StateMachine`. - *out_init* configures the pins used for ``out()`` instructions. - *set_init* configures the pins used for ``set()`` instructions. There can be at most 5. - - *sideset_init* configures the pins used side-setting. There can be at - most 5. + - *sideset_init* configures the pins used for ``.side()`` modifiers. 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()`: |
