Add optional OLED peripheral to ULX3S target #96
Merged
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.
The ULX3S comes with a dedicated header where the user can plug in a SSD1331 or SSD1306 OLED display panel. So while not a built-in part of the board, these pins are definitely specifically for this display. They are also present in the official lpf: https://github.com/emard/ulx3s/blob/master/doc/constraints/ulx3s_v20.lpf
I made the choice to use the SPI mode of the display, rather than the less common I2C mode. In particular since LiteX does not come with an official I2C core, I think this is a defensible choice.
I am not 100% sure if the way I split the pins for the SPI and GPIO lines is idiomatic, but it is convenient. I think the way I faked the MISO is a bit ugly, but not too bad. I chose not to include the CS pin with the SPI pins because as far as I can tell it just becomes a separate register.
It is of course up to the maintainers of this project if support for this extra peripheral should be included. I have just added it for my own pleasure, and figured I'd share the code if it is of interest.