-
Notifications
You must be signed in to change notification settings - Fork 205
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
Update Metro M4 BSP and examples for v2/tier1 #478
Conversation
Should we merge this even though the SAMD51 still seems to be buggy? |
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.
looks good overall to me!
&mut peripherals.MCLK, | ||
(rx, tx), | ||
); | ||
let mut a0 = pins.a0.into_alternate::<B>(); |
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.
Could use the aliases
feature for this one:
let mut a0: bsp::Analog0 = pins.a0.into();
and lib.rs
would have something like:
PA02 {
/// Analog pin 0. Can act as a true analog output
/// as it has a DAC (which is not currently supported
/// by this hal) as well as input.
name: a0,
aliases: {
AlternateB: Analog0
}
.configure_gclk_divider_and_source(GCLK2, 12, DPLL0, false) | ||
.unwrap(); | ||
pins.d13.into_function_m(&mut pins.port); | ||
let _ = pins.d7.into_alternate::<M>(); |
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.
similar into()
comment here
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.
This is an example-specific pin, not a board-specific one, so it should be in the example, not the bsp.
|
||
let d12 = pins.d12.into_function_e(&mut pins.port); | ||
let d12 = pins.d12.into_alternate::<E>(); |
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.
similar into()
comment here
} | ||
|
||
pub type UartPads = uart::Pads<Sercom3, IoSet1, UartRx, UartTx>; |
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.
since its public, should we doc?
efae333
to
fa38a69
Compare
@TDHolmes I'm not totally sold on the need for all the different aliases, so I just added the doc comment you recommended. Maybe we can have a discussion about it on matrix at a later time. |
No description provided.