[display] Support SH1106 Display, Improve SSD1306 Display #624
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Support SH1106
Various SSD1306 Displays sold today do actually integrate the cheaper SH1106. This thing is said to be compatible with SSD1306 what's not 100% the case: SH1106 does only support Page MemoryMode. thus requires a different
writeDisplay()
routine than actually used for modm::Ssd1306.Current result using modm::Ssd1306 with SH1106
When sending a frame, one has to alternate between setting the incremented page-address and sending page-data.
However, SSD1306 can also be driven in
MemoryMode::PAGE
but would result in worse performance vs. transmitting the whole frame aSh1106t once like it is now, thanks toMemoryMode::VERTICAL
/MemoryMode::HORIZONTAL
.Solutions
Sh1106
inheritingSsd1306
and override for the differences.MemoryMode
as template parameter toSsd1306
and specialize for the differences.Ssd1306_I2cWriteTransaction
as template parameter and handle the differences there.I've choosen 1. because:
SSD1306
andSsd1306_I2cWriteTransaction
.MemoryMode::PAGE
due to worse performance. This excludes 2. and 3.Improved SSD1306
Structure
DataTranmissionAdapter
->Ssd1306_I2cWriteTransaction
for clarificationWriteData()
methodsPerformance
writeDisplay()
commandBuffer
could be halfedSsd1306_I2cWriteTransaction
Flipped buffer[x][y] to buffer[y][x]
The current layout of
MonochromeGraphicDisplay::buffer
is not directly compatible with the memory-order requested by SH1106. For SH1106 we need the rows ( x-dimension) being ordered behind each other rather than the columns.SH1106 unfortunately offers no other options for MemoryMode to adjust for the current buffer-layout.
Kindly Ssd1306 comes to meet the constraints of SH106. We can switch from
MemoryMode::VERTICAL
->MemoryMode::HORIZONTAL
in Ssd1306::initialisation(). Now SSD1306 also receives the rows in a line so the buffer dimensions could be flipped:buffer[x][y]
->buffer[y][x]
.