Closed EAGrahamJr closed 1 year ago
I was attempting to tackle this and it got ugly really fast.
dcPin
to differentiateThese are my thoughts, but since it's not my project and not my API, I will leave it to your discretion:
data
and command
methods to the SsdOledCommunicationChannel
objects
dcPin
and resetPin
devicescommand
and data
prefixesSsdOled(SsdOledCommunicationChannel channel, int width, int height, int type)
protected SsdOled(...) {
this.device = device;
// init sequence
this.device.command(getInitializationSequence());
}
protected abstract byte[] getInitializationSequence();
SSD1306
might get a bit tricky because there are two variants: 64 and 32 height
SSD1337
which is 128 x 128 (the command set looks to be almost identical, but still working on that)Additional note: since I don't have any of the Colour :grinning: OLED, I won't be able to test any changes against what's already there.
Yes, a tricky one. I recall someone contributed the barebones of the I2C code. I typically use SPI for OLED coms hence cannot personally confirm whether it works or not via I2C. The ones I have could be both SPI and I2C, let me check. Also, it could be related to the fact that it is 128x32 rather than the 128x64 one that I test with.
Oh, it definitely is - I'm referring to the CircuitPython drivers and some of the init/offsets are just slightly different.
If you can at least check that I didn't break anything, I think what I'm doing will work.
BTW, I was the one that had started the I2C channel.
I had a completely different display than those listed in
core
so I'd not paid much attention to the existing classes, but have recently received an OLED that says it's an SSD1306, but only 128 by 32, not 64. It's also I2C, thusSsdOled
class (e.g. cannot use the I2C channel)dcPin
and aresetPin
, which are not available for an I2C interface1306
class cannot be set - whether this is required or not is TBDgoTo
is only used inColourSsdOled
and only used to "home" the cursor - the1306
implementation kinda skipped that