Skip to content

Feat enums and write only fn#73

Merged
Poofjunior merged 6 commits intoharp-tech:mainfrom
AllenNeuralDynamics:feat-enums-and-write-only-fn
Mar 23, 2026
Merged

Feat enums and write only fn#73
Poofjunior merged 6 commits intoharp-tech:mainfrom
AllenNeuralDynamics:feat-enums-and-write-only-fn

Conversation

@Poofjunior
Copy link
Copy Markdown
Collaborator

@Poofjunior Poofjunior commented Feb 24, 2026

For larger projects, we're having name collision issues with the #defined constants in this project. This PR cleans up some of these #defines and replaces them with inline constexpr where appropriate. In cases where the #defines should be local to the file scope only, these are moved into enum classes or integrated into the enums directly.

Generally we also want to be able to track updates to this library with semantic versioning in a way that's independent of the Harp protocol version that the library best implements. To do that, I added a separate set of version constants.

Finally, I added a convenience handler function for reading from a register that should be "write-only."

  • Update compilation instructions in the example.
  • Add PICO_CORE_VERSION_MAJOR, *_MINOR, and *_PATCH to track the version of this project independent of the Harp Protocol version that the project best implements.
  • Update CXX Standard to 23
    • required for std::to_underlying
    • required for enum classes (minimum was CXX 20)
  • make the reg_type_t an enum class to reduce name collisions
  • remove enum-related #defines which had a name collision with the etl library
  • make a callback convenience function for handling read from a "write-only" register.

This is a breaking change to the library API because projects that create Harp Apps will need to either:

  • rescope all of their usages of reg_type_t with: reg_type_t:U8, etc. OR
  • add using enum reg_type_t from reg_types.h at the top of function bodies or in class interfaces that want to use the enum without the namespace prefix.

Poofjunior and others added 2 commits February 24, 2026 16:19
add notes disambiguating versions.
@Poofjunior Poofjunior merged commit 7e87de4 into harp-tech:main Mar 23, 2026
2 checks passed
@Poofjunior Poofjunior deleted the feat-enums-and-write-only-fn branch March 23, 2026 22:52
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.

2 participants