-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement SpiBus, SpiDevice for LPSPI
We implement all I/O in terms of `transact`. We'll manually flush at the end of eh02 SPI writes. Since the `SpiBus` interface exposes a flush, we have no need to perform an internal flush when transacting I/O. Keep the spinning async state machines to manage the TX and FX FIFOs. We introduce a schedule to eagerly execute transmit operations ahead of receive operations. Without this ability, we'll stall the LPSPI bus. (The NOSTALL field can change this behavior, but then we move complexity into TX FIFO underrun handling.) There's some miri tests to simulate our hardware utilization. Our `SpiDevice` impls mimic the embedded-bus design. There's an "exclusive" device that owns the bus and uses a hardware chip select. There's a `RefCellDevice` that lets users share the bus and use hardware chip selects. There's no critical section / mutex device, but it should be straightforward to add that later.
- Loading branch information
Showing
5 changed files
with
996 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.