Skip to content
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

Merged
merged 6 commits into from
Oct 10, 2021

Conversation

sajattack
Copy link
Member

No description provided.

@jbeaurivage
Copy link
Contributor

Should we merge this even though the SAMD51 still seems to be buggy?

@jbeaurivage jbeaurivage mentioned this pull request Aug 25, 2021
10 tasks
Copy link
Contributor

@TDHolmes TDHolmes left a 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>();
Copy link
Contributor

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>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar into() comment here

Copy link
Member Author

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>();
Copy link
Contributor

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>;
Copy link
Contributor

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?

@sajattack
Copy link
Member Author

@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.

@bradleyharden bradleyharden merged commit ca1046c into atsamd-rs:master Oct 10, 2021
kaizensparc pushed a commit to kaizensparc/atsamd that referenced this pull request Dec 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants