Skip to content

Commit

Permalink
Merge min-samd20x features
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaizen Wolf committed Dec 27, 2021
1 parent ca44022 commit c86f731
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 229 deletions.
5 changes: 3 additions & 2 deletions hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,9 @@ same54n = ["atsame54n", "same54", "min-samd51n"]
same54n-rt = ["same54n", "atsame54n/rt"]
same54p = ["atsame54p", "same54", "min-samd51p"]
same54p-rt = ["same54p", "atsame54p/rt"]
min-samd20j = []
min-samd21g = []
min-samd2x = []
min-samd20j = ["min-samd2x"]
min-samd21g = ["min-samd2x"]
min-samd21j = ["min-samd21g"]
min-samd51g = []
min-samd51j = ["min-samd51g"]
Expand Down
156 changes: 26 additions & 130 deletions hal/src/gpio/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -617,17 +617,9 @@ port!([
(PA10, Pa10),
#[cfg(not(feature = "samd11"))]
(PA11, Pa11),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21g",
feature = "min-samd51g"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PA12, Pa12),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21g",
feature = "min-samd51g"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PA13, Pa13),
(PA14, Pa14),
(PA15, Pa15),
Expand All @@ -639,17 +631,9 @@ port!([
(PA18, Pa18),
#[cfg(not(feature = "samd11"))]
(PA19, Pa19),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21g",
feature = "min-samd51g"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PA20, Pa20),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21g",
feature = "min-samd51g"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PA21, Pa21),
#[cfg(not(feature = "samd11c"))]
(PA22, Pa22),
Expand All @@ -663,113 +647,41 @@ port!([
(PA28, Pa28),
(PA30, Pa30),
(PA31, Pa31),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21j",
feature = "min-samd51j"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB00, Pb0),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21j",
feature = "min-samd51j"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB01, Pb1),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21g",
feature = "min-samd51g"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB02, Pb2),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21g",
feature = "min-samd51g"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB03, Pb3),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21j",
feature = "min-samd51j"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB04, Pb4),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21j",
feature = "min-samd51j"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB05, Pb5),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21j",
feature = "min-samd51j"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB06, Pb6),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21j",
feature = "min-samd51j"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB07, Pb7),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21g",
feature = "min-samd51g"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB08, Pb8),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21g",
feature = "min-samd51g"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB09, Pb9),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21g",
feature = "min-samd51g"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB10, Pb10),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21g",
feature = "min-samd51g"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB11, Pb11),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21j",
feature = "min-samd51j"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB12, Pb12),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21j",
feature = "min-samd51j"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB13, Pb13),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21j",
feature = "min-samd51j"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB14, Pb14),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21j",
feature = "min-samd51j"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB15, Pb15),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21j",
feature = "min-samd51j"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB16, Pb16),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21j",
feature = "min-samd51j"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB17, Pb17),
#[cfg(any(feature = "min-samd51n"))]
(PB18, Pb18),
Expand All @@ -779,17 +691,9 @@ port!([
(PB20, Pb20),
#[cfg(any(feature = "min-samd51n"))]
(PB21, Pb21),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21g",
feature = "min-samd51g"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB22, Pb22),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21g",
feature = "min-samd51g"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB23, Pb23),
#[cfg(any(feature = "min-samd51n"))]
(PB24, Pb24),
Expand All @@ -803,17 +707,9 @@ port!([
(PB28, Pb28),
#[cfg(any(feature = "min-samd51p"))]
(PB29, Pb29),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21j",
feature = "min-samd51j"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB30, Pb30),
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21j",
feature = "min-samd51j"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB31, Pb31),
#[cfg(any(feature = "min-samd51n"))]
(PC00, Pc0),
Expand Down
52 changes: 26 additions & 26 deletions hal/src/gpio/v2/pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1084,9 +1084,9 @@ declare_pins!(
(PA10, 10),
#[cfg(not(feature = "samd11"))]
(PA11, 11),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21g", feature = "min-samd51g"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PA12, 12),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21g", feature = "min-samd51g"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PA13, 13),
(PA14, 14),
(PA15, 15),
Expand All @@ -1098,9 +1098,9 @@ declare_pins!(
(PA18, 18),
#[cfg(not(feature = "samd11"))]
(PA19, 19),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21g", feature = "min-samd51g"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PA20, 20),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21g", feature = "min-samd51g"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PA21, 21),
#[cfg(not(feature = "samd11c"))]
(PA22, 22),
Expand All @@ -1116,41 +1116,41 @@ declare_pins!(
(PA31, 31),
}
B {
#[cfg(any(feature = "min-samd20j", feature = "min-samd21j", feature = "min-samd51j"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51j"))]
(PB00, 00),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21j", feature = "min-samd51j"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51j"))]
(PB01, 01),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21g", feature = "min-samd51g"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB02, 02),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21g", feature = "min-samd51g"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB03, 03),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21j", feature = "min-samd51j"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51j"))]
(PB04, 04),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21j", feature = "min-samd51j"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51j"))]
(PB05, 05),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21j", feature = "min-samd51j"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51j"))]
(PB06, 06),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21j", feature = "min-samd51j"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51j"))]
(PB07, 07),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21g", feature = "min-samd51g"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB08, 08),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21g", feature = "min-samd51g"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB09, 09),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21g", feature = "min-samd51g"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB10, 10),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21g", feature = "min-samd51g"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB11, 11),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21j", feature = "min-samd51j"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51j"))]
(PB12, 12),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21j", feature = "min-samd51j"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51j"))]
(PB13, 13),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21j", feature = "min-samd51j"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51j"))]
(PB14, 14),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21j", feature = "min-samd51j"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51j"))]
(PB15, 15),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21j", feature = "min-samd51j"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51j"))]
(PB16, 16),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21j", feature = "min-samd51j"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51j"))]
(PB17, 17),
#[cfg(feature = "min-samd51n")]
(PB18, 18),
Expand All @@ -1160,9 +1160,9 @@ declare_pins!(
(PB20, 20),
#[cfg(feature = "min-samd51n")]
(PB21, 21),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21g", feature = "min-samd51g"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB22, 22),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21g", feature = "min-samd51g"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
(PB23, 23),
#[cfg(feature = "min-samd51n")]
(PB24, 24),
Expand All @@ -1176,9 +1176,9 @@ declare_pins!(
(PB28, 28),
#[cfg(feature = "min-samd51p")]
(PB29, 29),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21j", feature = "min-samd51j"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51j"))]
(PB30, 30),
#[cfg(any(feature = "min-samd20j", feature = "min-samd21j", feature = "min-samd51j"))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51j"))]
(PB31, 31),
}
C {
Expand Down
6 changes: 1 addition & 5 deletions hal/src/sercom/v1/pads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,7 @@ macro_rules! pad_alias {
pad_alias!(Sercom0, Sercom1);
#[cfg(any(feature = "samd2x", feature = "min-samd51g"))]
pad_alias!(Sercom2, Sercom3);
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21g",
feature = "min-samd51g"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
pad_alias!(Sercom4, Sercom5);
#[cfg(feature = "min-samd51n")]
pad_alias!(Sercom6, Sercom7);
Expand Down
8 changes: 2 additions & 6 deletions hal/src/sercom/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ use pac::PM as APB_CLK_CTRL;
use pac::{sercom0, SERCOM0, SERCOM1};
#[cfg(any(feature = "samd2x", feature = "min-samd51g"))]
use pac::{SERCOM2, SERCOM3};
#[cfg(any(
feature = "min-samd20j",
feature = "min-samd21g",
feature = "min-samd51g"
))]
#[cfg(any(feature = "min-samd2x", feature = "min-samd51g"))]
use pac::{SERCOM4, SERCOM5};
#[cfg(feature = "min-samd51n")]
use pac::{SERCOM6, SERCOM7};
Expand Down Expand Up @@ -89,7 +85,7 @@ macro_rules! sercom {
sercom!(apbcmask: (0, 1));
#[cfg(feature = "samd2x")]
sercom!(apbcmask: (2, 3));
#[cfg(any(feature = "min-samd20j", feature = "min-samd21g"))]
#[cfg(feature = "min-samd2x")]
sercom!(apbcmask: (4, 5));

#[cfg(feature = "min-samd51g")]
Expand Down
Loading

0 comments on commit c86f731

Please sign in to comment.