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

Passing SPIClass in the constructor #4

Closed
opseb opened this issue Dec 20, 2023 · 3 comments
Closed

Passing SPIClass in the constructor #4

opseb opened this issue Dec 20, 2023 · 3 comments

Comments

@opseb
Copy link

opseb commented Dec 20, 2023

Thank you very much for this library.

ESP32 has got two SPI interfaces namely VSPI (default) and HSPI. When passing a custom SPIClass to use the HSPI interface the setup gets stuck after reading a single value. After several attempts to assign different pins and avoiding restricted pins, I found that there is a method ( void ADS1220_WE::command(uint8_t cmd) ) in the file ADS1220_WE.cpp where there the global SPI is used instead of custom member_spi assigned in the constructor .

Changing the line SPI.transfer(cmd) to _spi->transfer(cmd) solves the problem when assigning a different SPI interface in ESP32.

Kindly advice if this change is correct and if it could be a possible bug fix

@wollewald
Copy link
Owner

@opseb , thank you! I I have absolutely no idea why I left this single SPI instruction as SPI.transfer() and not like all others to _spi->transfer(). Will change this immediately.

@wollewald
Copy link
Owner

Since I changed the code and haven't heard anything I consider this issue to be completed.

@opseb
Copy link
Author

opseb commented Jul 16, 2024

Sorry for late reply. There has been no problem since the code was updated.

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

2 participants