Feature/add documentation#4
Merged
Merged
Conversation
Introduce a new peripheral generator for the SAMD21 GCLK module, including documented register accessors, typed bitfield accessors, and supporting enums (Generator, ClockSource, PeripheralClockID, DivideSelection). Refactor shared infrastructure extracted from the SERCOM generator into central utilities and register/bitfield generators: - Move swiftMemberIdentifier, swiftLowerCamelIdentifier, swiftUpperCamelIdentifier, and swiftReservedWords to Utils.swift - Add generateSVDRegister() and generateSVDBitfieldAccessors() to RegisterGenerator.swift and BitfieldGenerator.swift Enhance the documentation loader with scoped lookup keys (e.g. "GCLK.CTRL") and enum value support, and add the new GenericClockControllerGenerator to the registry and Xcode project.
Adds a PowerManagerGenerator that produces Swift register access for the SAM D21 Power Manager peripheral, covering sleep modes, CPU/APB clock prescalers, peripheral clock gate masks (AHB, APBA, APBB, APBC), clock-ready interrupts, and reset-cause flag registers. Introduces writeOneToClear write behavior in the bitfield generator so that interrupt clear/set/flag registers only write on non-zero values, avoiding accidental clearing of bits. Also registers the generator in GeneratorRegistry and adds the corresponding PM documentation data for ATSAMD21E18A.
…safeMutablePointer access Remove the _volatileRegisterReadUInt32 and _volatileRegisterWriteUInt32 helper functions in favor of direct UnsafeMutablePointer reads and writes. This simplifies the generated register accessors by eliminating aligned-offset and bit-shift computations that were previously needed to pack/unpack sub-32-bit registers into 32-bit word accesses. Apply the same change to the SERCOM peripheral's write-one-to-clear bitfield setters for consistency.
Revert the shared register/bitfield generators back to _volatileRegister* helper functions so that SERCOM, PowerManager, GCLK, and GPIO continue using the aligned read-modify-write approach through volatile helpers. Instead, add DMAC-proprietary register generation functions (dmacBuild*) that use direct UnsafeMutablePointer<T> access per register width. This keeps the shared generators clean while DMAC gets the direct pointer approach. Changes: - RegisterGenerator.swift: restore aligned volatile access in getter/setter builders; make svdRegisterDocumentation/svdRegisterVariableName accessible - SERCOM.swift: revert sercomBuildWriteOneToClearBitfieldSetter back to _volatileRegisterWriteUInt32 - DMAC.swift: add generateDMACRegister, dmacBuildRegisterGetter, dmacBuildRegisterSetter, dmacBuildDirectRegisterSetter; switch buildDMACFile to call generateDMACRegister
Provides documentation for navigating the HALGEN-ARM project, including the architecture, how to add new peripheral generators, the supplemental documentation system, build instructions, and a full directory reference. Written for future contributors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.