-
Notifications
You must be signed in to change notification settings - Fork 48
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
The ST7789 device displays abnormalities when using the master branch. #129
Comments
What do you mean by "white screen"? Is the display inverted or is nothing visible at all? |
The entire screen is white, with only the backlight on, resembling an uninitialized state. |
That's strange we didn't really change the initialization of the ST7789 between 0.7.1 and the latest GIT revision. I only have access to a cheap ST7789 without a CS pin, which did work with the You could also try to run the display without using the CS pin. This isn't a great solution, but it might help to narrow down the issue: /// Noop impl of OutputPin.
struct NoCs;
impl OutputPin for NoCs {
fn set_low(&mut self) -> Result<(), Self::Error> {
Ok(())
}
fn set_high(&mut self) -> Result<(), Self::Error> {
Ok(())
}
}
impl embedded_hal::digital::ErrorType for NoCs {
type Error = core::convert::Infallible;
}
// replace this:
let cs = io.pins.gpio10.into_push_pull_output();
let spi = Spi::new(peripherals.SPI2, 60u32.MHz(), SpiMode::Mode0, &clocks).with_pins(
Some(sck),
Some(mosi),
NO_PIN,
NO_PIN,
);
let spi_device = embedded_hal_bus::spi::ExclusiveDevice::new(spi, cs, delay);
let di = SPIInterface::new(spi_device, dc);
// with:
let cs = io.pins.gpio10.into_push_pull_output();
cs.set_low().unwrap();
let spi = Spi::new(peripherals.SPI2, 10u32.MHz(), SpiMode::Mode3, &clocks).with_pins(
Some(sck),
Some(mosi),
NO_PIN,
NO_PIN,
);
let spi_device = embedded_hal_bus::spi::ExclusiveDevice::new_no_delay(spi, NoCS);
let di = SPIInterface::new(spi_device, dc); |
According to your modifications, it can now function, but it seems to be mirrored. |
I am an amateur player and do not have these devices at hand |
Do you mean that the coordinates are mirrored or are the colors mirrored? If the colors are inverted (e.g. black is displayed as white), add
No worries, thanks for reporting this issue and testing the workaround. We'll try to reproduce the issue. @almindor: Do you have a ESP-C3 to test the difference between the |
I'm afraid not, I'm actually stuck on a single Red-V (RISC-V) MCU atm, and am the only party responsible for updating the HAL to v1.0 on it as well. My testing is essentially blocked due to this. I do hope to get that resolved in a week or so, but I have no other functioning MCUs atm. |
OK, I'll try to reproduce the issue. |
In this situation, it is working normally. |
coordinates are mirrored |
In version 0.7.1 you'll need to add something like |
I've just tried the closest configuration I have at the moment, which is a ESP32-S3 with a ST7789 display attached via a parallel interface. This still works as expected with the master branch. I'll do further testing with a SPI display when my ESP32-C3 arrives. |
My ESP32-C3 arrived and after some surgery on my cheap ST7789 module to add a CS connection I was able to reproduce the problem. The problem is caused by an invalid initial state of the CS line. It is low after let mut cs = cs.into_push_pull_output();
cs.set_high(); Ping @bugadani: Do you think this is a bug in |
Thanks for the ping. As I'm not an embedded-hal team member, I don't feel comfortable to just propose an API change like this, so I posted the issue as a discussion point for the next Rust Embedded meeting. |
Nice, thanks for taking care of that. |
|
@Song-aff: Can you verify that updating |
Could we close this issue? |
first,I use the master branch code.
cargo.toml
main.rs
The ST7789 device performance in the following models (x for white screen)
ST7735 and ST7796 devices are both normal.
Link: https://github.com/Song-aff/esp32-mipidsi-test
When using mipidsi = "0.7.1"
The display is normal.
The text was updated successfully, but these errors were encountered: