Releases: apple/swift-mmio
Releases · apple/swift-mmio
Swift MMIO 0.0.2
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 ofBitFieldProjectable
. Conforming
types only need to provide an implementation forbitWidth
. #81
Changes
- Updates bit-field macros bits parameter to be generic over
BinaryInteger
RangeExpression
s. 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!
Swift MMIO 0.0.1
Swift MMIO initial release.
Additions
- Introduces
@RegisterBank
and@RegisterBank(offset:)
macros, enabling you
to define register groups directly in Swift code. #2 - Introduces
@Register
macro and bit field macros (@Reserved
,@ReadWrite
,
@ReadOnly
,@WriteOnly
) for declaring registers composed of bit fields. Bit
field macros take a range parameter which describes the subset of bits they
reference (e.g.,@ReadWrite(bits: 3..<7)
). #4 - Enhances bit field macros to support discontiguous bit fields. They now accept
a variadic list of bit ranges and automatically handle scattering/gathering
from the relevant bits (e.g.,@ReadWrite(bits: 3..<7, 10..<12)
). #10 - Enhances bit field macros with type projections via a new
as:
parameter.
Projections allow you to operation on bit fields using strong types instead of
raw integers (e.g.@ReadWrite(bits: 3..<7, as: A.self)
) #27 - Enhances registers with support for interposing reads and writes when
compiling withFEATURE_INTERPOSABLE
. You can use interposers to unit test
drivers. This feature is enabled when building with the
SWIFT_MMIO_FEATURE_INTERPOSABLE
environment variable defined. #31
The 0.0.1 release includes contributions from @rauhul. Thank you!