GithubHelp home page GithubHelp logo

Comments (5)

bjoernQ avatar bjoernQ commented on July 28, 2024

According to https://docs.rs/embedded-hal/1.0.0/embedded_hal/spi/index.html#for-hal-authors

HALs must implement SpiBus. Users can combine the bus together with the CS pin (which should implement OutputPin) using HAL-independent SpiDevice implementations such as the ones in embedded-hal-bus.

HALs may additionally implement SpiDevice to take advantage of hardware CS management, which may provide some performance benefits. (There’s no point in a HAL implementing SpiDevice if the CS management is software-only, this task is better left to the HAL-independent implementations).

I agree that we probably should implement SpiDevice since our hardware is capable of managing CS pins

TL;DR should be possible to use embedded-hal-bus with our implementation

from esp-hal.

reivilibre avatar reivilibre commented on July 28, 2024

TL;DR should be possible to use embedded-hal-bus with our implementation

This seems to be for embedded-hal rather than embedded-hal-async, unfortunately.

But you're right, that it seems like someone could make a very easy wrapper, particularly since the ESP32C3 implementation of SpiBus can manage the CS pin itself, the CS management could be a 'no-op'.

However it seems like this should be encoded directly in the type system of the ESP HAL: if the SpiBus has a CS pin attached, it ought to offer an SpiDevice interface (as well?).

from esp-hal.

bjoernQ avatar bjoernQ commented on July 28, 2024

This seems to be for embedded-hal rather than embedded-hal-async, unfortunately.

There is an async feature: https://github.com/rust-embedded/embedded-hal/blob/04b4f1897a126d1f3aebf679489b60d8e994c839/embedded-hal-bus/Cargo.toml#L19

from esp-hal.

reivilibre avatar reivilibre commented on July 28, 2024

ah sorry, yes there is! Thanks :)

from esp-hal.

jessebraham avatar jessebraham commented on July 28, 2024

I don't think there's really anything actionable here so going to go ahead and close the issue. If you disagree feel free to re-open it.

from esp-hal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.