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

SPI1/SPI2 master mode #2

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

SPI1/SPI2 master mode #2

wants to merge 2 commits into from

Conversation

rubdos
Copy link
Contributor

@rubdos rubdos commented Dec 8, 2020

Based on the STM32L0 code.

Currently untested and WIP

src/spi.rs Outdated
/// CRC error
Crc,
#[doc(hidden)]
_Extensible,
Copy link
Owner

Choose a reason for hiding this comment

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

Could we use a #[non_exhaustive] here instead?

@rubdos
Copy link
Contributor Author

rubdos commented Dec 8, 2020

I've pushed an I2C commit too, because I'm refactoring something that's currently on I2C to SPI. I'll split up the PR when it works, just having spi as a "me-branch" for a second :-)

-> Moved to #3, will rebase when that gets merged.

@rubdos rubdos force-pushed the spi branch 2 times, most recently from 4cb687b to ab8fe0e Compare December 8, 2020 13:31
@rubdos
Copy link
Contributor Author

rubdos commented Dec 8, 2020

@eupn Apparently my slave device talks in MSB-first u16 mode. I don't think the MSB-first mode is a documented thing in embedded_hal, shall I make our own marker structs for that? Or contribute them to embedded_hal, what do you think?

@eupn
Copy link
Owner

eupn commented Dec 12, 2020

@rubdos similar thing has been asked here recently. I think this should be included in the HAL as it's a pretty common setting. But before that, you could inverse the bit order of words before sending them and after receiving them or configure the SPI separately (outside your device driver crate).

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