swift-mmio
swift-mmio copied to clipboard
Define and operate on type safe MMIO
We should be able to round trip SVD files from and back to XML. We should add tests which cover this behavior. They will also help ensure we aren't dropping...
Peripheral clusters ignored by svd2swift, instead they should generate nested RegisterBlock struct hierarchies.
(I originally proposed this change [here](https://forums.swift.org/t/introducing-swift-mmio/68525/23).) --- Currently, the bit width of a register is specified as a parameter of the `@Register` macro: ```swift @Register(bitWidth: 32) struct CR1 { @ReadWrite(bits:...
(I originally proposed this change [here](https://forums.swift.org/t/introducing-swift-mmio/68525/23).) --- The `@Register` macro generates 3 structs: `Read`, `Write`, and `Raw`. The `Raw` struct is accessed through the `.raw` property of the `Read` and...
(I originally proposed this change [here](https://forums.swift.org/t/introducing-swift-mmio/68525/23).) --- The raw value of the register can be read/written to by accessing the `.raw.storage` property like so: ```swift cr1.modify { cr1 in cr1.raw.storage...
(I originally proposed this change [here](https://forums.swift.org/t/introducing-swift-mmio/68525/23).) --- The `@Register` macro is used like so: ```swift @Register(bitWidth: 32) struct CR1 { @ReadOnly(bits: 0..
`UInt8`, `UInt16`, `UInt32`, and `UInt64` are common field member types (when not enumerations or option sets). ```swift extension UInt8: BitFieldProjectable { public static var bitWidth: Int { 8 } public...
`@Register` should diagnose and emit errors if it contains bit field macros which have overlapping bit ranges, e.g.: ```swift @Register(bitWidth: 32) struct R32 { @ReadWrite(bits: 0..
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..