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

SpiDevice implementations in embedded-hal-bus don't provide a way to use active-high chip select #584

Closed
gary600 opened this issue Mar 28, 2024 · 3 comments

Comments

@gary600
Copy link

gary600 commented Mar 28, 2024

I am using a SPI display which requires active-high chip select, but all of the SpiDevice implementations don't mention the polarity of their CS pin anywhere. Looking at the implementation, these implementations are all hard-coded to use active-low CS, which won't work for this display. Adding a way of specifying the chip select polarity would make this usable for this case.

@burrbull
Copy link
Member

pub struct ExclusiveDevice<BUS, CS, D, const CSHIGH = false> {

???

@Dominaezzz
Copy link

Couldn't you just create an InvertedPin struct that implements the OutputPin trait and does the inversion?

This seems like a non issue to me.

@eldruin
Copy link
Member

eldruin commented May 24, 2024

As a matter of fact, I wrote an inverted-pin crate that does exactly that.
In my experience, active-low CS is the overwhelming majority so I think using an inverting wrapper should be enough and there is no pressing need to support this in a dedicated way.
Closing. Feel free to reopen if you think otherwise.

@eldruin eldruin closed this as completed May 24, 2024
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

No branches or pull requests

4 participants