Skip to content

Conversation

@dragonnn
Copy link
Contributor

Thank you!

Thank you for your contribution.
Please make sure that your submission includes the following:

Must

  • The code compiles without errors or warnings.
  • All examples work.
  • cargo fmt was run.
  • Your changes were added to the CHANGELOG.md in the proper section.
  • You updated existing examples or added examples (if applicable).
  • Added examples are checked in CI

Nice to have

  • You add a description of your work to this PR.
  • You added proper docs for your newly added features and code.

Add new_no_mosi function to Spi in FullDuplexMode, this is useful for devices like spi displays with share a single bus. They don't need a Miso connection but do need CS pin for selection with display to write to. Fixes also #791

@bugadani
Copy link
Contributor

At this point, wouldn't it be better to pass in pins as Options?

@dragonnn
Copy link
Contributor Author

I am not sure how well Options would work with the generic parameters, I suspect making an option function might be harder then it might seem. Also I think that is the last option that make sense, new_no_mosi isn't something you can find in real work from what I can tell.

@bjoernQ
Copy link
Contributor

bjoernQ commented Sep 18, 2023

The bigger problem when using optional pins would be to pass None - we have gpio::NO_PIN for that. It's what we do for half-duplex. However, to have it aligned to other constructors I think it's fine to have this constructor and later maybe add a constructor which works like the half-duplex constructor

Copy link
Contributor

@bjoernQ bjoernQ left a comment

Choose a reason for hiding this comment

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

LGTM- Thanks

@bjoernQ bjoernQ merged commit 08a4722 into esp-rs:main Sep 18, 2023
SergioGasquez pushed a commit to SergioGasquez/esp-hal that referenced this pull request Sep 22, 2023
* Add new_no_miso to Spi FullDuplexMode

* adjust changelog
playfulFence pushed a commit to playfulFence/esp-hal that referenced this pull request Sep 26, 2023
* Add new_no_miso to Spi FullDuplexMode

* adjust changelog
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.

3 participants