Skip to content

Swift MMIO 0.0.2

Latest
Compare
Choose a tag to compare
@rauhul rauhul released this 08 Feb 00:16
· 39 commits to main since this release
e75a138

Quality of life improvements

Additions

  • Adds a variant of the @RegisterBank macro with offset, stride, and count
    arguments. This allows you to declare a logical vector of registers with a
    user-defined stride between them, e.g.
    @RegisterBank(offset: 0x100, stride: 0x10, count: 0x8). #65
  • Adds a variant of Register.write taking a builder closure:
    write<T>(_: (inout Value.Write) -> (T)) -> T. This method allows you to form
    a write value without needing to create a named temporary value. #75
  • Adds conditional extension to RawRepresentable types conforming to
    FixedWidthInteger for easier adoption of BitFieldProjectable. Conforming
    types only need to provide an implementation for bitWidth. #81

Changes

  • Updates bit-field macros bits parameter to be generic over BinaryInteger
    RangeExpressions. You can now specify bit ranges using any Swift range
    syntax, e.g. 0..<1, 0...1, 0..., ...1, or .... #43
  • Updates the MMIOVolatile bridge to eliminate the dependency on stdint.h,
    allowing you to build needing a copy of libc headers. #52
  • Removes restrictions on computed properties for @RegisterBank and
    @Register macros. #59
  • Updates error messages for members missing a macro annotation to include
    fix-its. #64

Fixes

  • Replaces the use of hasFeature(Embedded) with $Embedded for proper
    compilation condition checking. #60
  • Corrects the generation of placeholder attributes for Macros with multiple
    arguments, ensuring proper commas between the arguments. #63
  • Resolves build issues for 32-bit platforms, ensuring compatibility with
    watchOS. The use of 64-bit wide integers is now conditionally compiled based
    on target architecture. #79

The 0.0.2 release includes contributions from @rauhul and @SamHastings1066.
Thank you!