Skip to content

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

@phausler

Description

@phausler

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    mmioRelated to the MMIO library

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions