almindor / mipidsi

MIPI Display Serial Interface unified driver
MIT License
108 stars 46 forks source link

Add ILI9341 and use display-driver-hal #39

Closed rfuest closed 8 months ago

rfuest commented 1 year ago

The PR adds ILI9341 support. I've marked it as a draft PR because it also uses the unreleased display-driver-hal to test it's API. The offset calculation is also disabled at the moement, because I didn't have an appropriate display to test it.

The new Orientation type uses a builder like interface:

let display = Builder::ili9341_rgb565(interface)
    .with_orientation(Orientation::new().rotate(Rotation::Deg270).flip_horizontal())
    .init(&mut delay, Some(display_reset))
    .unwrap();

IMO this is easier to use, because you can easily tweak the orientation by adding a rotate or flip_vertical/flip_horizontal commands. Perviously it was only possible to mirror around one axis and the user had to add the necessary rotation manually if they wanted to mirror around the other axis.

georgik commented 1 year ago

Driver works on ESP32, tested with M5 Core Fire and Wokwi. Color channels are also correct for RGB565. 👍

almindor commented 1 year ago

Looks good. NOTE: I'm also in the middle of https://github.com/almindor/mipidsi/pull/44 but I think the orientation change would be easier to get in first.

rfuest commented 1 year ago

I can finish the PR if you want to merge it before #44, but this would also mean that display-driver-hal needs to be released on crates.io before the next release of mipidsi.

almindor commented 1 year ago

I can finish the PR if you want to merge it before #44, but this would also mean that display-driver-hal needs to be released on crates.io before the next release of mipidsi.

What if we split this into 2 PRs then? get the model in ASAP, and then we can do the orientation separately.

rfuest commented 1 year ago

What if we split this into 2 PRs then? get the model in ASAP, and then we can do the orientation separately.

OK, I'll prepare another PR without the orientation changes.

rfuest commented 8 months ago

The ILI9341 model has already been added in #45 and the rest of the changes are now included in #80.