Skip to content

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

Merged
mvertescher merged 4 commits intostm32-rs:masterfrom
braun-embedded:spi-16
Jul 10, 2019
Merged

Add support for 16-bit words to SPI API#17
mvertescher merged 4 commits intostm32-rs:masterfrom
braun-embedded:spi-16

Conversation

@hannobraun
Copy link
Contributor

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

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.
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.
Copy link
Member

@mvertescher mvertescher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, looks good!

@mvertescher mvertescher merged commit 4ee222a into stm32-rs:master Jul 10, 2019
@hannobraun hannobraun deleted the spi-16 branch July 11, 2019 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants