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

Remove LPSPI chip select type state, and other refactors #180

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

mciantyre
Copy link
Member

@mciantyre mciantyre commented Dec 1, 2024

Most of these commits support a larger change that implements embedded-hal SpiBus and SpiDevice (#181). They also anticipate support for the 1180. See commit messages for details.

Although some of these may be backwards compatible, I'm not immediately back-porting them onto v0.5. Let me know if something seems useful.

Closes #131, since it provides a way to select and change the LPSPI hardware chip select. Also closes #149; this PR has a similar breaking change.

mciantyre and others added 7 commits December 3, 2024 09:12
We're testing unsafe code in the HAL. Make sure miri is happy with that
unsafe code.

We build with minimal optimizations by default, no matter the target.
Turn those off during the miri invocation.
When we support the embedded-hal 1.0 traits, we should distinguish
between the bus -- having the data and clock pins -- and the device(s),
which have the chip select. Removing the chip select type state is the
first step in supporting this interface.

Temporarily enable PCS0 in the board setup routines. This keeps the
examples working as expected.
We'll need something like this when we implement SPI devices.
This'll make it easier to associate bus state with each transaction.
Default behavior is unchanged, in that the mode is still set by the
user's `Lpspi::set_mode` value. But now users could define it as part
of a one-off transaction.
On the RT1180, these two fields are WO/RAZ. Since we can't trust the
hardware to retrieve these values for us, we cache them in memory.
Writes will behave as before. The driver ensures that all accesses on
CCR pass through the cache.
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.

Designate LPSPI hardware chip select
1 participant