Skip to content

Change SPI to allow detaching some pins, like MISO or CS #9066

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

Closed
SuGlider opened this issue Jan 3, 2024 · 3 comments · Fixed by #9117
Closed

Change SPI to allow detaching some pins, like MISO or CS #9066

SuGlider opened this issue Jan 3, 2024 · 3 comments · Fixed by #9117
Assignees
Labels
Type: Feature request Feature request for Arduino ESP32
Milestone

Comments

@SuGlider
Copy link
Collaborator

SuGlider commented Jan 3, 2024

          > Wonderful. Purely for my own understanding, why would configuring the pin with pin mode cause the SPI to break? Does it disable the SPI interface?

In Arduino 3.0.0 there is a new feature called Peripheral Manager.
In the specific case of SPI, when any of its 4 pins (MOSI, MISO, CLK and CS) are used for any other function, for instance, with pinMode(), the whole SPI is detached. Therefore, SPI stops working, being necessary to restart it with SPI.begin().

I think that your example brings a good questioning because most displays will only care about using MOSI and not MISO.
I could also use CS pin for something else and only set it as CS whenever it is necessary.

Therefore, I would say that we may review it in order to allow using SPI pins partly.

Originally posted by @SuGlider in #9040 (comment)

@SuGlider SuGlider added the Type: Feature request Feature request for Arduino ESP32 label Jan 3, 2024
@SuGlider SuGlider self-assigned this Jan 3, 2024
@SuGlider SuGlider added this to the 3.0.0-RC1 milestone Jan 3, 2024
@ForrestFire0
Copy link

As a user, it also would have been sufficient to note in the documentation that pinMode-ing any of the pins used for SPI would stop SPI. But it of course would have also been nice if it just worked 😄

@ForrestFire0
Copy link

I will also note that this is a breaking change from 2.x to 3.0, but it is not mentioned in the migration guide.

@SuGlider
Copy link
Collaborator Author

SuGlider commented Jan 4, 2024

Yes, I agree. The documentation must be enhanced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature request Feature request for Arduino ESP32
Projects
Development

Successfully merging a pull request may close this issue.

3 participants