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

Pull out shared bus #52

Closed
wants to merge 5 commits into from
Closed

Pull out shared bus #52

wants to merge 5 commits into from

Conversation

Dominaezzz
Copy link
Contributor

@Dominaezzz Dominaezzz commented Mar 19, 2022

This allows users to create multiple devices on one bus.

The current SPI interface allows one to create a single Master struct which represents the spi bus and the device.
This prevents one from communicating with multiple SPI devices on the same bus. In my case, I have an E-Ink display and an SD card on the same bus and I'm only able to use one at a time.

This PR pulls out the spi bus from the Master struct into a Bus struct, which allows one to create multiple Masters on the same bus.

The one thing I wasn't too sure about is whether Bus should be a struct or trait. I've got with struct for the moment. I don't really see the need for a trait atm.

@ivmarkov
Copy link
Collaborator

Could you please provide a short summary of what this pull request exactly is doing? To me, it seems like you just renamed Master to Bus? Is there more to it that I don't see?

@Dominaezzz
Copy link
Contributor Author

Sorry I took so long to get back to you. I've updated the first comment with a short summary.

I didn't rename Master, I just added Bus.

@Dominaezzz
Copy link
Contributor Author

After reading the esp-idf doc on the SPI driver, I change my mind.
Bus should be a trait and there should a separate struct for SPI, QSPI and OSPI.
Thoughts?

@ivmarkov
Copy link
Collaborator

Obsoleted by #61

@ivmarkov ivmarkov closed this Apr 17, 2022
usbalbin pushed a commit to usbalbin/esp-idf-hal that referenced this pull request May 5, 2022
* More ergonomic async traits

* Use AtomicWaker

* Get rid of the callback Result return

* More work on async compat

* Async work

* Switch all traits to a single error type

* Make Eth & Wifi API implementations fully async

* Rename Service to Errors

* New version

* Fix non-experimental build

* Fix non-experimental build

* Merge fix from @anichno

* Again clippy warnings

* Again clippy warnings
maximeborges pushed a commit to yaak-ai/esp-idf-hal that referenced this pull request Jun 7, 2022
…Waveshare board and 4.2" e-paper screen (esp-rs#52)

Signed-off-by: simon <Simon Tropée>

Co-authored-by: simon <Simon Tropée>
@Dominaezzz Dominaezzz deleted the spi_bus branch November 21, 2022 19:42
@DS3a
Copy link

DS3a commented Jan 9, 2023

@Dominaezzz I've been trying to read files from an sd card using esp_rs. I found a bunch of complex functions over here. Is there anything as simple as the SD.h header file we have in the arduino IDE?

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