-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HAL: add PIO configuration API #18
Closed
Closed
Conversation
This file contains 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
Sourced from [0]; /vendor/asamx7x-hal. [0] jamesmunns/same70-experiments@58a3c34
More features will be added in future commits that require explicit configuration. Moved to build.rs to remove noise from HAL implementation.
device-selected is a meta-feature that is not described in §2.
This change supports the theoretical case of non-constant VDDIO (for E70/S70). An enum is also a much stronger association, rather than an environmental variable (feature).
That is, so the crate does not build if only device-selected is enabled.
memory.x tail courtesy of [0]. [0] atsamd-rs/atsamd@d7e054f
From my interpretation there there is only one single internal oscillator (not counting the slow clocks) which can be overridden by a single external oscillator, only that there are two switches that must be flipped to use the external.
"pmc" is shorter than "periph", and make it clear what peripheral that is being configured, if we in the future must configure more of them.
Changes made in 465f7d7 incorrectly assumed that there was only one way to configure the main crystal oscillator.
The datasheet documents two methods of selecting a clock for HCLK/MCK: one for PLLs and one for the slow and main clock.
We will be utilizing this information later down the line, for example when configuring peripheral baud rates.
UPLLCKDIV is derived from UPLLCK by either /1 or /2. Only the divider is forwarded to HCLK and PCK, as per §31.3.
Some clocks will emit MHz (UPLLCK, MAINCK) while others will emit Hz (PLLA - depending on dev/mult, and SLCK).
This will later be moved into a proper examples/*.rs when a GPIO API is available.
Branch is now deprecated. Closing. Refer to #24. |
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.
This PR starts the work on a PIO configuration API, heavily inspired by the API available in the
atsamd
crate.This PR depends on #16.