Add an (unused) DISPOFF step
This commit is contained in:
parent
45dc19c329
commit
21c6f30a7d
@ -93,7 +93,7 @@ unsafe fn main() -> ! {
|
|||||||
// The SPI system uses the peripheral clock
|
// The SPI system uses the peripheral clock
|
||||||
clocks.peripheral_clock.freq(),
|
clocks.peripheral_clock.freq(),
|
||||||
// Transmit data at a rate of 1Mbit.
|
// 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
|
// 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.
|
// be sampled starting at the first falling edge.
|
||||||
embedded_hal::spi::MODE_3,
|
embedded_hal::spi::MODE_3,
|
||||||
@ -115,14 +115,6 @@ unsafe fn main() -> ! {
|
|||||||
let mut strength = 0;
|
let mut strength = 0;
|
||||||
loop {
|
loop {
|
||||||
led.set_high();
|
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();
|
let display = display.acquire();
|
||||||
display.send_buf(&frame);
|
display.send_buf(&frame);
|
||||||
|
@ -66,6 +66,12 @@ const NORON: Step = Step {
|
|||||||
params: [0, 0, 0, 0],
|
params: [0, 0, 0, 0],
|
||||||
delay: Some(10),
|
delay: Some(10),
|
||||||
};
|
};
|
||||||
|
const DISPOFF: Step = Step {
|
||||||
|
param_cnt: 0,
|
||||||
|
command: 0x28,
|
||||||
|
params: [0, 0, 0, 0],
|
||||||
|
delay: Some(10),
|
||||||
|
};
|
||||||
const DISPON: Step = Step {
|
const DISPON: Step = Step {
|
||||||
param_cnt: 0,
|
param_cnt: 0,
|
||||||
command: 0x29,
|
command: 0x29,
|
||||||
@ -180,10 +186,12 @@ impl<BoardSelectId: PinId, DataCommandId: PinId, D: SpiDevice, Pinout: ValidSpiP
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn send_buf(&mut self, frame: &[u8]) {
|
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.data_command.set_low();
|
||||||
let _ = self.spi.write(&[RAMWR]);
|
let _ = self.spi.write(&[RAMWR]);
|
||||||
let _ = self.data_command.set_high();
|
let _ = self.data_command.set_high();
|
||||||
let _ = self.spi.write(&frame);
|
let _ = self.spi.write(&frame);
|
||||||
|
// let _ = DISPON.send_command(&mut self.spi, &mut self.data_command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user