diff options
| author | Tim Radvan | 2021-04-02 19:35:18 +0100 |
|---|---|---|
| committer | Damien George | 2021-04-17 00:45:38 +1000 |
| commit | f842a40df4d26bd74b92a3903096fc6b1709222d (patch) | |
| tree | 5941eceda408a5ba00862e29f49248a80c308fa8 /ports/rp2/modules/rp2.py | |
| parent | e5d2ddde25351f1ede7d0d1b00be632301962fb0 (diff) | |
rp2/rp2_pio: Add fifo_join support for PIO.
The PIO state machines on the RP2040 have 4 word deep TX and RX FIFOs. If
you only need one direction, you can "merge" them into either a single 8
word deep TX or RX FIFO.
We simply add constants to the PIO object, and set the appropriate bits in
`shiftctrl`.
Resolves #6854.
Signed-off-by: Tim Radvan <tim@tjvr.org>
Diffstat (limited to 'ports/rp2/modules/rp2.py')
| -rw-r--r-- | ports/rp2/modules/rp2.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ports/rp2/modules/rp2.py b/ports/rp2/modules/rp2.py index 17e35c73b..c7e4d1fdd 100644 --- a/ports/rp2/modules/rp2.py +++ b/ports/rp2/modules/rp2.py @@ -31,7 +31,8 @@ class PIOASMEmit: autopush=False, autopull=False, push_thresh=32, - pull_thresh=32 + pull_thresh=32, + fifo_join=0 ): # uarray is a built-in module so importing it here won't require # scanning the filesystem. @@ -40,7 +41,8 @@ class PIOASMEmit: 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 |
