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

SNS - Create HypedSpi trait #38

Merged
merged 2 commits into from
Oct 25, 2024
Merged

Conversation

davidbeechey
Copy link
Collaborator

@davidbeechey davidbeechey commented Oct 18, 2024

Creates the HypedSpi trait for abstracting SPI. Will enable a MockSpi struct and for SPI sensors to be implemented without having to wait for the STM32 implementation of SPI to be implemented first.

To do:

  • Is the way that word size is implemented okay?

The alternative to this if word size is a problem is to just use the Embassy implementation of SPI to implement sensors that are board-specific. E.g. create optical flow in boards/stm32h7.../sensors. Would mean that if we want to support this sensor on another board we would have to duplicate the entire sensor implementation (and maybe change it), rather than just implementing HypedSpi for it. Thoughts?

Copy link

linear bot commented Oct 18, 2024

@davidbeechey davidbeechey added the needs-reviews Needs reviews, otherwise finished label Oct 23, 2024
@davidbeechey
Copy link
Collaborator Author

Might have to modify the WordSize later on, or just replace it with a generic type T, but it's good enough to start with.

@davidbeechey davidbeechey merged commit 75de789 into main Oct 25, 2024
8 checks passed
@davidbeechey davidbeechey deleted the hype-42-implement-spi-trait branch October 25, 2024 14:24
SinY-Over-CosY pushed a commit that referenced this pull request Nov 6, 2024
H00pyFr00d pushed a commit that referenced this pull request Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-reviews Needs reviews, otherwise finished
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants