display-interface icon indicating copy to clipboard operation
display-interface copied to clipboard

New api

Open GrantM11235 opened this issue 4 years ago • 2 comments

Pros

  • Much faster for iterators, probably because it doesn't take a dyn Iterator anymore
  • 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

GrantM11235 avatar Mar 10 '21 04:03 GrantM11235

Update: I was able to port the top three display drivers (ssd1306, ili9341, and st7789) to this api without much difficulty

GrantM11235 avatar Mar 10 '21 22:03 GrantM11235

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.

GrantM11235 avatar Mar 11 '21 07:03 GrantM11235