-
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
spi
modules to improve structure
Make several improvements to the `sercom::v2::spi` module: - Introduce a `Registers` type that acts as a task-focused API for the registers, as opposed to the register-focused API of the PAC. This abstraction also serves to remove interior mutability of the PAC struct and lets us implement `Sync` for `Registers` - Add a `Capability` trait and three corresponding types: `Rx`, `Tx` and `Duplex`. Add a `Capability` type parameter to the `Spi` struct and use it to differentiate the various embedded HAL trait implementations. This is a better solution than the previous approach, which was a set of marker traits implemented on `Pads` types. - Combine the `thumbv6m` and `thumbv7em` modules to reuse more code. The major differences between the two chips come in the `Pads` type, and the `Length` and `CharSize` types. Introduce a `Size` trait that essentially acts a trait alias for either `Length` or `CharSize`. Split up the modules and use conditional imports to handle everything correctly for the three different chips. Because the `spi` module is no longer split between the two chip-specific modules, also consolidate the `impl_pad` modules as well. Finally, improve the documentation for the `spi` module itself, as well as for the embedded HAL trait implementations.
- Loading branch information
1 parent
68c443b
commit 81176e2
Showing
23 changed files
with
4,050 additions
and
4,180 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
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
File renamed without changes.
File renamed without changes.
Oops, something went wrong.