Skip to content
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

Register macro should allow a provision for specifying a reset value #35

Open
phausler opened this issue Nov 16, 2023 · 0 comments
Open
Labels
mmio Related to the MMIO library

Comments

@phausler
Copy link
Member

For writable registers there should be a way of specifying a reset value which would grant a reset method.

    @Register(bitWidth: 16, reset: 0x0)
    public struct EEAR {
      @ReadWrite(bits: 0..<16, as: UInt16.self)
      public var value: VALUE
    }

that would add a method onto the register such that you can issue a reset to the contents of the register. This could perhaps be done by conforming the structure (in this case EEAR) to ResettableRegisterValue and Register has a conditional conformance that adds the public func reset() method that asks the static value from the register value type for its reset value.

@rauhul rauhul added the mmio Related to the MMIO library label Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mmio Related to the MMIO library
Projects
None yet
Development

No branches or pull requests

2 participants