display-interface
display-interface copied to clipboard
New api
Pros
- Much faster for iterators, probably because it doesn't take a
dyn Iteratoranymore - Easier to write interface drivers, no more gigantic match blocks (the parallel interface impl is about 100 lines shorter)
- No more runtime errors for unimplimented data formats
- It should work with 9-bit and 18-bit interfaces (untested)
Cons
- 8-bit Display drivers are now responsible for splitting up
u16s. This only requires 1-3 lines of code - Display drivers that support 8-bit and 16-bit interfaces are slightly more complex (only an extra 50 lines or so)
Todo
- [ ] Rename trait?
- [ ] Update comments
- [ ] Update changelog
- [ ] Write migration guide
Update: I was able to port the top three display drivers (ssd1306, ili9341, and st7789) to this api without much difficulty
Sorry for the force-push, I wanted to make a small change to the api.
The previous version of this PR had send_{iter,slice} methods that took a DataOrCommand enum but I realized that it is more ergonomic to just have send_{command,data}_{iter,slice} methods.