-
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.
Refactor SERCOM pads, add documentation and port feather_m0 to gpio::…
…v2 (#434) * Remove warnings * Add pac alias for target_device * Update HAL to accept both v1::Pin and v2::Pins everywhere Update all users of the `gpio` module to accept both `v1::Pin` and `v2::Pin` types. In most cases, this was fairly straightforward and did not involve any breaking changes. However, the `thumbv7em::pwm` required a pretty major syntax hack. What used to be an `enum` is now a `struct`. Update the few instances of broken code in the BSPs. * Add .vscode to .gitignore * Fix feather_m0 build in crates.json * Overhaul `sercom::pads`, update `bsp_pins!` and add documentation - Modify `AnyKind` trait bounds to eliminate `unsafe` implementations of AsRef and AsMut - When changing `PinMode`, only write to registers when the starting mode is different from the ending mode. - Consolidate documentation of several type-level programming patterns into the `typelevel` module and link to them as needed throughout the HAL. - Add an `OptionalPinId` trait for use in the `sercom::v2::pad` module and elsewhere. - Fix attribute bugs in the `bsp_pins!` macro, and modify it to allow documentation on every item. - Refactor the `sercom::v1::pads` shim. Create a distinct `v1::Pad` type that wraps a `v2::Pad` type. This should help clarify the distinction between the two types. - Move the `sercom::v2::pads` module to `sercom::v2::pad` to better reflect the principle type it defines. - Refactor the definition of the `Pad` type. - Rename `sercom::v2::spi::Mode` to `sercom::v2::spi::OpMode` to help distinguish it from the SPI mode (CPOL/CPHA). - Update the `sercom::v1` APIs to account for the modified definition of `v1::Pad` and add implementations to support using `v2::Pad`s. - Update `sercom::v2::spi` to use the new `v2::Pad` type and simplify the `spi::Pads` type. Update and improve documentation. - For thumbv6 chips, move to a macro-based definition of the `v2::spi::DipoDopo` implementations, instead of the previous, brute-force approach. - Do not implement the `AnyKind` pattern for `spi::Pads`, since there is no particular use case for it. Instead, use a normal trait. - Add an `spi_pads_from_pins!` macro to support creating an `spi::Pads` type from `Pin` aliases instead of `PinId`s * Update Wio Terminal to use `sercom::v2::spi` * Update entire feather_m0 BSP to use `v2` APIs Completely convert the feather_m0 BSP to use the `gpio::v2` and `sercom::v2` APIs. It will serve as an example of how to migrate. * Fix formatting * Fix typo in typelevel module docs
- Loading branch information
1 parent
a4e38e4
commit 9a9e762
Showing
60 changed files
with
4,327 additions
and
3,550 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ Cargo.lock | |
**/*.idea | ||
**/.DS_Store | ||
*.svd.patched | ||
.vscode |
Empty file.
Empty file.
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
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
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.