-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the sercom::v2::Pad type (#451)
The `sercom::v2::Pad` type was a simple wrapper around a `gpio::v2::Pin` type. Its purpose was to ensure that each `Pin` was properly configured to act as the corresponding SERCOM `Pad`. However, one of my goals in designing the `v2::spi` API was to avoid the need for users to manually convert `Pin` types to `Pad` types. As that module progressed, it became clear that the `v2::Pad` type served no real purpose. All the same constraints could be imposed using a slightly different approach to type-level programming. Remove the `v2::Pad` type and modify the `sercom::v2::pad` module accordingly. Update the `v1::Pad` type as well. Rename some of the type-level items in the `v2::pad` module and improve the documentation. Update the `sercom::v1` peripheral APIs to accept both `v1::Pad` types and the equivalent of a `v2::Pad`, which is simply a properly configured `v2::Pin`. Finally, redefine the type parameters of `v2::spi::Pads` to be `OptionalPad`s rather than `OptionalPinId`s, and provide a new `PadsFromIds` to make up for it. This change increases consistency in the definition of the `spi::Pads` type, and it allows me to remove a significant amount of trait boilerplate needed to make it all work.
- Loading branch information
1 parent
b9095ca
commit 854e3e1
Showing
19 changed files
with
1,585 additions
and
2,035 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.