-
Notifications
You must be signed in to change notification settings - Fork 215
Updates the ICM peripheral to use the clock::v2
API
#927
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
base: master
Are you sure you want to change the base?
Conversation
Looks good to me! Appreciate the documentation updates as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor naming suggestion, but otherwise LGTM
hal/src/peripherals/icm.rs
Outdated
@@ -877,23 +910,19 @@ impl<I: RegionNum> Region<I> { | |||
pub struct Icm { | |||
/// ICM pac register providing hardware access | |||
icm: crate::pac::Icm, | |||
_ahb_clk: IcmAhbClk, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove the leading underscore from these, they do get used in free()
.
hal/src/peripherals/icm.rs
Outdated
pub fn new(icm: crate::pac::Icm, ahb_clk: IcmAhbClk, apb_clk: IcmApbClk) -> Self { | ||
Self { | ||
icm, | ||
_ahb_clk: ahb_clk, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the underscore removed as above, clippy will want this to look like ahb_clk,
r/t ahb_clk: ahb_clk,
…in the `Icm` struct per the recommendation in PR atsamd-rs#927.
…in the `Dsu` struct per the recommendation in PR atsamd-rs#927.
…in the `Dsu` struct per the recommendation in PR atsamd-rs#927.
…in the `Dsu` struct per the recommendation in PR atsamd-rs#927.
…in the `Icm` struct per the recommendation in PR atsamd-rs#927.
…in the `Dsu` struct per the recommendation in PR atsamd-rs#927.
* `Icm::new` now requires ownership of its `AhbClk` and `ApbClk`. * Renames `Icm::destroy` to the standard `Icm::free` method to free the `pac::Icm` and bus clocks. * Updates the `icm` module documentation example to include the above changes.
…in the `Icm` struct per the recommendation in PR atsamd-rs#927.
Summary
As part of the
clock::v2
effort tracked in Issue #912, this PR updates theicm
to use theclock::v2
API by requiring ownership of itsAhbClk
andApbClk
. Note that this peripheral is only onthumbv7
targets.No examples on any Tier 1 BSPs use the ICM so none were affected.
Checklist
#[allow]
certain lints where reasonable, but ideally justify those with a short comment.