diff --git a/pico-st7789/src/main.rs b/pico-st7789/src/main.rs index 532810c..cdb6130 100644 --- a/pico-st7789/src/main.rs +++ b/pico-st7789/src/main.rs @@ -93,7 +93,7 @@ unsafe fn main() -> ! { // The SPI system uses the peripheral clock clocks.peripheral_clock.freq(), // Transmit data at a rate of 1Mbit. - 2_u32.MHz(), + 1_u32.MHz(), // Run with SPI Mode 1. This means that the clock line should start high and that data will // be sampled starting at the first falling edge. embedded_hal::spi::MODE_3, @@ -115,14 +115,6 @@ unsafe fn main() -> ! { let mut strength = 0; loop { led.set_high(); - /* - let _ = board_select.set_low(); - let _ = data_command.set_low(); - let _ = spi.write(&[RAMWR]); - let _ = data_command.set_high(); - let _ = spi.write(&frame); - let _ = board_select.set_high(); - */ { let display = display.acquire(); display.send_buf(&frame); diff --git a/pico-st7789/src/st7789.rs b/pico-st7789/src/st7789.rs index 4e19441..c2bb0e2 100644 --- a/pico-st7789/src/st7789.rs +++ b/pico-st7789/src/st7789.rs @@ -66,6 +66,12 @@ const NORON: Step = Step { params: [0, 0, 0, 0], delay: Some(10), }; +const DISPOFF: Step = Step { + param_cnt: 0, + command: 0x28, + params: [0, 0, 0, 0], + delay: Some(10), +}; const DISPON: Step = Step { param_cnt: 0, command: 0x29, @@ -180,10 +186,12 @@ impl