Skip to content

Commit

Permalink
Add undocumented IOSet (#506)
Browse files Browse the repository at this point in the history
Also see #467
  • Loading branch information
TDHolmes authored Oct 10, 2021
1 parent 55b2f0a commit 17afec4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Unreleased Changes

- Add undocumented but valid IOSet for ATSAMD5x/ATSAME5x (#506)
- Fixed the RTC implementation of embedded-hal timer traits to be periodic again (#490)

---
Expand Down
13 changes: 13 additions & 0 deletions hal/src/sercom/v2/pad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,19 @@ seq!(N in 1..=6 {
}
});

/// Type-level variant of [`IoSet`] representing an undocumented SERCOM
/// IOSET
///
/// See the [type-level enum] documentation for more details on the pattern.
///
/// [type-level enum]: crate::typelevel#type-level-enum
#[cfg(feature = "min-samd51g")]
pub enum UndocIoSet1 {}
#[cfg(feature = "min-samd51g")]
impl Sealed for UndocIoSet1 {}
#[cfg(feature = "min-samd51g")]
impl IoSet for UndocIoSet1 {}

/// Type class for SERCOM pads in a given [`IoSet`]
///
/// This trait is used to label each [`Pin`] implementing [`IsPad`] with its
Expand Down
8 changes: 8 additions & 0 deletions hal/src/thumbv7em/sercom/v2/impl_pad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,3 +427,11 @@ pad_table!(
D: (Sercom3, Pad3, IoSet4),
}
);

// Implement an undocumented `IoSet` for PA16, PA17, PB22 & PB23 configured for
// `Sercom1`. The pygamer & feather_m4 uses this combination, but it is not
// listed as valid in the datasheet.
impl InIoSet<UndocIoSet1> for Pin<PA16, Alternate<C>> {}
impl InIoSet<UndocIoSet1> for Pin<PA17, Alternate<C>> {}
impl InIoSet<UndocIoSet1> for Pin<PB22, Alternate<C>> {}
impl InIoSet<UndocIoSet1> for Pin<PB23, Alternate<C>> {}

0 comments on commit 17afec4

Please sign in to comment.