RegSpec Interface Update and Touchups#76
Open
Poofjunior wants to merge 15 commits intoharp-tech:mainfrom
Open
Conversation
Feat new reg specs
Mention RP2350 Support in README
Feat infer harp version
example cleanup; rename read/write-only convenience funcs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Full disclosure! We've started using this branch on devices (quad-dac) we're developing now.
Summary
This PR is a rewrite of how we define registers to consolidate all register-related info into one location based on some related discussion in #47 . This looks simple, but it's a huge readability cleanup for creating/maintaining harp devices with a few bugfixes along the way. It's also not necessarily the way we'll do things long-term, but the pico core project is versioned, so we can always make changes later.
(This is a breaking change because we changed some function signatures and made some previously-exposed functions private.)
Here's the breakdown:
RegSpecsandRegFnPairare now combined intoRegSpec, reducing the bookkeeping we needed to do between arrays of these elements, which was cumbersome and error-prone for more than a couple registers.RegSpecs. These include one per every primitive Harp data type (i.e:RegSpec::U8,RegSpec::U8Array, etc), and they reduce the boilerplate and bookkeeping to create custom registers.(uint8_t*)Fixes
OperationCtrlDUMP BehaviorDUMPfunction does not invoke read handler functions #75clear_msgshould be protected #57update_timestamp_regs()could be inlined. #29Example
Common:
Old:
New:
Testing
This works when issuing a "DUMP" event of all registers from pyharp. I will follow-up by rewriting the interface to an existing device to clean it up.
Harp.device.quac examples also work after rewriting the Harp interface to represent the changes in the core API above.