sajattack / st7735-lcd-rs

Rust library for displays using the ST7735 driver
https://docs.rs/st7735-lcd
MIT License
36 stars 27 forks source link

Test on more ST7735 variants #1

Open sajattack opened 5 years ago

sajattack commented 5 years ago

So far I've only tested this with 0.96" 160x80 ST7735S. There are more ST7735 variants we can test like ST7735R, ST7735B, and ST7789. cc @jamwaffles

sajattack commented 5 years ago

I've tested on an ST7735R now (on the adafruit pygamer), It was RGB, and non-inverted, opposite of ST7735S.

jamwaffles commented 5 years ago

Tested on the only ST7789 (240x240) I have lying around. I couldn't get anything to show up without changing anything. It seems the commands are different between the two datasheets which might be the issue. Or my module is just broken.

jamwaffles commented 5 years ago

Also tried porting the Adafruit driver's init commands from here to this library, still no dice. I can't rule out that my display is broken what with its crappy soldering, so I'm going to halt my efforts for now.

sajattack commented 4 years ago

@almindor tested ST7789 over at https://github.com/almindor/pinetime-quickstart/blob/master/examples/display.rs and got it working.

almindor commented 4 years ago

ST7789 works fine with these caveats:

  1. "inverted" param needs to be set to true to get proper colors for some reason
  2. draw_sized is bugged with anything but filled rects (this is a driver bug here), however embedded-graphics is removing this Trait/style anyhow so not worth fixing
  3. All primitives, raw font and raw image seems to work fine
  4. Speed is pretty terrible because draw resets the frame window for each pixel, but it can't be helped without embedded-graphics improving things I think.
jessebraham commented 4 years ago

I just received one of these displays today and tested it successfully. Just ran the Ferris example so by no means exhaustive, but it works AFAICT. My particular display is 1.8" with a resolution of 160x128. I'm not sure of which variant this is, but I set rgb to true and inverted to false if that helps.

almindor commented 4 years ago

I've created a fork specifically for the ST7789 here

The commands and some setup instructions differ between ST7789 and ST7735* so if you use ST7789 you should use my driver. The different commands and values also explain why things like inverted and rgb settings were somewhat inconsistent on the ST7789.

NOTE: it's meant to work with the soon-to-be-released embedded-graphics 0.6.0 so I didn't do a release yet as only a beta is out at this time, but the master branch is stable now.