Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add color section to the troubleshooting document #102

Merged
merged 1 commit into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions mipidsi/docs/TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,47 @@ This driver does **NOT** handle the backlight pin to keep the code simpler. User
### Transport misconfiguration (e.g. SPI)

Make sure that the transport layer is configured correctly. Typical mistakes are the use of wrong SPI MODE or too fast transfer speeds that are not supported by the display

## Incorrect colors

The way colors are displayed depend on the subpixel layout and technology (like TN or IPS) used by the LCD panel. These physical parameters aren't known by the display controller and must be manually set by the user as `Builder` settings when the display is initialized.

To make it easier to identify the correct settings the `mipidsi` crate provides a `TestImage`, which can be used to verify the color settings and adjust them in case they are incorrect.

```rust
let mut display = Builder::ili9486_rgb666(di)
.init(&mut delay, Some(rst))?;

TestImage::new().draw(&mut display)?;
```

The expected output from drawing the test image is:

![Correct colors](colors_correct.svg)

If the test image isn't displayed as expected use one of the reference image below the determine which settings need to be added to the `Builder`.

### Wrong subpixel order

![Wrong subpixel order](colors_wrong_subpixel_order.svg)

```rust
.with_color_order(mipidsi::options::ColorOrder::Bgr)
```

### Wrong color inversion

![Wrong color inversion](colors_wrong_color_inversion.svg)

```rust
.with_invert_colors(mipidsi::options::ColorInversion::Inverted)
```

### Wrong subpixel order and color inversion

![Wrong subpixel order and color inversion](colors_both_wrong.svg)

```rust
.with_color_order(mipidsi::options::ColorOrder::Bgr)
.with_invert_colors(mipidsi::options::ColorInversion::Inverted)
```
1 change: 1 addition & 0 deletions mipidsi/docs/colors_both_wrong.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions mipidsi/docs/colors_correct.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions mipidsi/docs/colors_wrong_color_inversion.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions mipidsi/docs/colors_wrong_subpixel_order.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading