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

Hability to share SPI with TFT and Other devices #165

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

bmorcelli
Copy link

The original state of this library doens't allow us to share the SPI bus with other devices, such as TFT and SD Card.

I am working on Bruce Firmware, and wanted to use this library to control a CC1101 and faced this issue, so I found a way to solve this problem and make the lib work on devices such as M5Cardputer (sharing SPI bus with SD Card using a SdCard Sniffer) and finally with Lyligo T-Embed CC1101 (CC1101 is mounted sharing the bus with Display and SD Card)

The changes I've made are:

  • Created a SPIClass instance for the library, for better control of the bus,
  • Added a function called setSPIinstance(SPIClass sspi)*, where you can specify which SPI class to use when sharing the SPI bus (This instance must have been initialized before using init() function)
  • Added a function called getSPIinstance(), if ou want to specify the other device to use the CC1101 instance after starting CC1101 (in this case is good to turn off a logic called BeginEndLogic.
  • If no Instance was specified, the Init function will point to the SPIClass of the library, and using the SPI.begin(..) and SPI.end() Logic that is used atm.
  • this logic can be activated and deactivated using setBeginEndLogic(bool), and the state of this logic using getBeginEndLogic();

Thank you for this lib, I hope my contribuitions can make the difference in your projects.

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.

1 participant