Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for 16-bit words to SPI API #17

Merged
merged 4 commits into from Jul 10, 2019

Conversation

@hannobraun
Copy link
Member

commented Jul 10, 2019

This PR adds support for 16-bit words to the SPI API, except for the DMA part.

hannobraun added some commits Jul 9, 2019

Add dedicated `Enabled` state struct for SPI
The difference to `state::Enabled` is that `spi::Enabled` tracks the
word size the SPI instance was configured for. This is required to add
support for other word sizes. Specifically, I'm working on adding
support for 16-bit writes.

This commit doesn't add support for other word sized yet. It just
replaces `state::Enabled` with `spi::Enabled<u8>` where applicable.
Make SPI mostly generic over word size
There are two caveats here:
1. Notice that the title says "mostly". The exception is DMA, as the DMA
   API only works with `u8`s right now.
2. This doesn't actually add support for other word sized than `u8`. It
   only puts the infrastructure in place for doing so.
@mvertescher
Copy link
Member

left a comment

Nice, looks good!

@mvertescher mvertescher merged commit 4ee222a into stm32-rs:master Jul 10, 2019

1 check passed

Travis CI - Pull Request Build Passed
Details

@hannobraun hannobraun deleted the braun-embedded:spi-16 branch Jul 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.