-
Notifications
You must be signed in to change notification settings - Fork 261
Add support for putget to PIO #935
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
Comments
As far as I can tell, we can avoid adding extra typestate to the |
Sounds reasonable on first glance. What's the use case for random access? |
I use it for a 64 channel LED matrix driver. Two FIFO slots for 32 channels each.
The PIO drives the shift register and sets 8 output pins of the RP2350 on each shift register cycle.
…On 4 June 2025 20:24:30 CEST, thejpster ***@***.***> wrote:
thejpster left a comment (rp-rs/rp-hal#935)
Sounds reasonable on first glance.
What's the use case for random access?
--
Reply to this email directly or view it on GitHub:
#935 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
oh, nice. |
Oha, looks like initial support for the feature was added in 8328792. I would still consider the typestate method a valuable improvement. 8328792 does not introduce the necessary changes to the (Also, we need to ensure that autopush is turned off, because that's UB with RxGet or RxPut enabled, according to 11.5.4 of the reference) |
I opened #936, but there's an open question which we should discuss, preferably over there. It already works for my use case, but there's a few bits which need to be fixed. I'd like to get some guidance on the open question before that, though :). |
Uh oh!
There was an error while loading. Please reload this page.
PIOs support changing the FIFO configuration to support random access instead of acting as a FIFO (see for example Section 11.4.8 and 11.4.9. of the reference manual, as well as
FJOIN_RX_PUT
/FJOIN_RX_GET
in theSMx_SHIFTCTRL
registers).As far as I can tell, this is currently not supported by the RP235x HAL.
I was thinking to add support for that (as I am currently bypassing the HAL for one of my PIO uses because of that) and I'd like to get a quick gauge whether I'm heading the right way. Here's what I was planning to do:
RxGet
/RxPut
/RxPutGet
types which provide access to the "fifo" contents.build()
to use the correctRx*
form as mentioned in point 2.This will increase the complexity of the builder somewhat, but I think this is the only typesafe way of doing it.
While we're at it, we could also move the effect of the
buffers()
call into typestate, so that the return type ofbuild()
wouldn't contain atx
if thetx
has been merged into therx
fifo, and vice versa.Opinions / thoughts?
The text was updated successfully, but these errors were encountered: