8000 rp2/rp2_pio: Add fifo_join support for PIO. by tjvr · Pull Request #7093 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

rp2/rp2_pio: Add fifo_join support for PIO. #7093

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
1 change: 1 addition & 0 deletions examples/rp2/pio_uart_rx.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
autopush=True,
push_thresh=8,
in_shiftdir=rp2.PIO.SHIFT_RIGHT,
fifo_join=PIO.JOIN_RX,
)
def uart_rx_mini():
# fmt: off
Expand Down
6 changes: 4 additions & 2 deletions ports/rp2/modules/rp2.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@ def __init__(
autopush=False,
autopull=False,
push_thresh=32,
pull_thresh=32
pull_thresh=32,
fifo_join=0
):
from array import array

self.labels = {}
execctrl = 0
shiftctrl = (
(pull_thresh & 0x1F) << 25
fifo_join << 30
| (pull_thresh & 0x1F) << 25
| (push_thresh & 0x1F) << 20
| out_shiftdir << 19
| in_shiftdir << 18
Expand Down
4 changes: 4 additions & 0 deletions ports/rp2/rp2_pio.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,10 @@ STATIC const mp_rom_map_elem_t rp2_pio_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_IRQ_SM1), MP_ROM_INT(0x200) },
{ MP_ROM_QSTR(MP_QSTR_IRQ_SM2), MP_ROM_INT(0x400) },
{ MP_ROM_QSTR(MP_QSTR_IRQ_SM3), MP_ROM_INT(0x800) },

{ MP_ROM_QSTR(MP_QSTR_JOIN_NONE), MP_ROM_INT(0) },
{ MP_ROM_QSTR(MP_QSTR_JOIN_TX), MP_ROM_INT(1) },
{ MP_ROM_QSTR(MP_QSTR_JOIN_RX), MP_ROM_INT(2) },
};
STATIC MP_DEFINE_CONST_DICT(rp2_pio_locals_dict, rp2_pio_locals_dict_table);

Expand Down
0