Skip to content

Implement StdRegister readback - #285

Merged
kcaisley merged 1 commit into
masterfrom
stdregister-readback
Sep 16, 2026
Merged

kcaisley merged 1 commit into
masterfrom
stdregister-readback

Conversation

@kcaisley

Copy link
Copy Markdown
Member

On my behavioral-modules branch, I've had this fix for a while, but actually Stella needs it too now. Can we merge this? Since my other branch is too big to review quickly

@kcaisley

Copy link
Copy Markdown
Member Author

Hmm, I'm now uncertain if this is a good idea. Do we know the historical reason why this was not implemented? Back in 2019 Jens changed it:

I guess one thing to think about here, is that it will update the StdRegister object which might not be desirable? Just directly calling get_data would avoid this. But I'm not sure if that is a bug or feature.

@kcaisley

Copy link
Copy Markdown
Member Author

To be more clear, .get_data() fetches raw bytes from the hardware; but this StdRegister.read() additionally copies those bytes into the named fields. If we request to read just one named field, then only that one will be refreshed in StdRegister. So what I mean is:

daq["gpio1"].read()  # Refresh every field
ready = daq["gpio1"]["COMP_IDELAY_RDY"]  # Access and refresh only one field

@cbespin

cbespin commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

It seems reasonable to me and well-worded that .read() reads all hardware values into the dictionary fields. Especially, if it is needed and useful, you have my blessings 😀

@cbespin cbespin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to merge when ready

@kcaisley

Copy link
Copy Markdown
Member Author

Sweet okay, let's try it!

@kcaisley
kcaisley merged commit 42efa4e into master Sep 16, 2026
7 checks passed
@kcaisley
kcaisley deleted the stdregister-readback branch September 16, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants