rust-embedded-community / ssd1306

SSD1306 OLED driver
Apache License 2.0
315 stars 70 forks source link

Move interface-independent code out into new impl blocks #180

Closed bugadani closed 1 year ago

bugadani commented 1 year ago

Hi! Thank you for helping out with SSD1306 development! Please:

PR description

Some code doesn't rely on the display interface. This PR moves these to impl blocks that don't restrict DI to any particular trait. While this isn't immediately useful, this refactor will help in avoiding code duplication.

I've added FastNoop instead of short circuiting the current Noop command just in case someone relies on the current command's details. Backwards compatibility FTW. FastNoop is currently used to fill out Command arrays where a particular option requires less elements than the array's capacity.

Warning: some of my decisions may be controversial.