-
Notifications
You must be signed in to change notification settings - Fork 34
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
SPI Updates #13
base: master
Are you sure you want to change the base?
SPI Updates #13
Conversation
- Updated Adafruit_SSD1306 to optionally use SPI1. - Pass chip select pin to spi::begin so that the driver no longer sets the pin mode for the default pins which may not be used.
spiClass->setClockDivider(SPI_CLOCK_DIV8); // 72MHz / 8 = 9Mhz | ||
spiClass->setDataMode(0); | ||
spiClass->begin(cs); // Passing the chip-select here just sets the pin mode. | ||
// The peripheral won't automatically assert/deassert the pin during operation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By not passing the chip select pin here, we were mistakenly allowing the SPI driver to set up the default chip select pin, A2
, as an output in addition to the pin that was passed in by the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See https://docs.particle.io/reference/firmware/photon/#begin--3 for details
@JSchaenzle, to make this library work with Particle Libraries V2, I will need to add folders and move code around. I propose doing this in a different repo call Adafruit_SSD1306PK. That way, it will be compatible with Particle and make it easier to maintain. |
@JSchaenzle, seems I had already converted a version of this library to the Libraries 2.0 format but also to use mfGFX instead of just GFX. Perhaps we should make the changes in that repo instead. Any thoughts? |
Yeah sure. I can create a similar PR against that repo. What's the difference between mfGFX and GFX? |
I wrote mfGFX to support multiple fonts including user-defined ones. The latest Adafruit_GFX library does the same thing but fonts can ONLY be generated with their custom linux app which is difficult to use. Mine uses Windows free apps and is simple to use. |
no longer sets the pin mode for the default pins which may not
be used.