Add an (unused) DISPOFF step

This commit is contained in:
Savanni D'Gerinel 2025-02-27 09:46:46 -05:00
parent 45dc19c329
commit 21c6f30a7d
2 changed files with 9 additions and 9 deletions

View File

@ -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);

View File

@ -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<BoardSelectId: PinId, DataCommandId: PinId, D: SpiDevice, Pinout: ValidSpiP
}
pub fn send_buf(&mut self, frame: &[u8]) {
// let _ = DISPOFF.send_command(&mut self.spi, &mut self.data_command);
let _ = self.data_command.set_low();
let _ = self.spi.write(&[RAMWR]);
let _ = self.data_command.set_high();
let _ = self.spi.write(&frame);
// let _ = DISPON.send_command(&mut self.spi, &mut self.data_command);
}
}