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

capsules: spi_controller: Support read only and inline operations #3991

Merged
merged 1 commit into from
May 27, 2024

Conversation

alistair23
Copy link
Contributor

Pull Request Overview

Support read only and inline read/write operations.

In order to fully implement the embedded_hal::spi::SpiDevice [1] trait we need to support a read only operation (writing 0xFF) and a single buffer read/write operation (in place transfer).

This commit adds support for those two operations to the userspace capsule so we can then build embedded_hal::spi::SpiDevice support on top.

1: https://docs.rs/embedded-hal/1.0.0/embedded_hal/spi/trait.SpiDevice.html

Testing Strategy

Implementing https://docs.rs/embedded-hal/1.0.0/embedded_hal/spi/trait.SpiDevice.html in libtock-rs

TODO or Help Wanted

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make prepush.

Copy link
Contributor

@bradjc bradjc left a comment

Choose a reason for hiding this comment

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

This does change the "read" allow buffer to be technically the "read or read/write" allow buffer. I'm not sure how much that matters versus the overhead of adding another allow slot.

capsules/core/src/spi_controller.rs Outdated Show resolved Hide resolved
capsules/core/src/spi_controller.rs Outdated Show resolved Hide resolved
capsules/core/src/spi_controller.rs Outdated Show resolved Hide resolved
In order to fully implement the embedded_hal::spi::SpiDevice [1] trait
we need to support a read only operation (writing 0xFF) and a single
buffer read/write operation (in place transfer).

This commit adds support for those two operations to the userspace
capsule so we can then build embedded_hal::spi::SpiDevice support on
top.

1: https://docs.rs/embedded-hal/1.0.0/embedded_hal/spi/trait.SpiDevice.html

Signed-off-by: Alistair Francis <alistair@alistair23.me>
@alistair23
Copy link
Contributor Author

Ping!

@alevy alevy added this pull request to the merge queue May 27, 2024
Merged via the queue into tock:master with commit ebbfdba May 27, 2024
12 checks passed
@alistair23 alistair23 deleted the alistair/embedded-rust-spi branch May 27, 2024 22:00
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.

None yet

3 participants