Pretty print commands and parameters in the same format as the datasheet
This commit is contained in:
parent
f46a5a5c2d
commit
5807c7a81c
@ -21,7 +21,7 @@ use crate::panel::Mode;
|
|||||||
/// transferred by the D/CX pin. If D/CX is “low”, the transmission byte is
|
/// transferred by the D/CX pin. If D/CX is “low”, the transmission byte is
|
||||||
/// interpreted as a command byte. If D/CX is “high”, the transmission byte
|
/// interpreted as a command byte. If D/CX is “high”, the transmission byte
|
||||||
/// is command register as parameter.
|
/// is command register as parameter.
|
||||||
#[derive(Clone)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct Command {
|
pub struct Command {
|
||||||
pub address: u8,
|
pub address: u8,
|
||||||
pub parameters: Vec<u8>,
|
pub parameters: Vec<u8>,
|
||||||
|
@ -34,12 +34,13 @@ impl ST7701S {
|
|||||||
Ok(c) => {
|
Ok(c) => {
|
||||||
let address = &c.serialize_address();
|
let address = &c.serialize_address();
|
||||||
self.spi.write(&c.serialize_address());
|
self.spi.write(&c.serialize_address());
|
||||||
println!("address {}", c.address);
|
println!("Address: {:#04X}", c.address);
|
||||||
|
|
||||||
for parameter in c.parameters {
|
for parameter in c.parameters {
|
||||||
self.spi.write(&Command::serialize_parameter(parameter));
|
self.spi.write(&Command::serialize_parameter(parameter));
|
||||||
println!("parameter {}", parameter);
|
println!("Parameter: {:08b}", parameter);
|
||||||
}
|
}
|
||||||
|
println!("--------------------");
|
||||||
}
|
}
|
||||||
Err(e) => println!("{}", e),
|
Err(e) => println!("{}", e),
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user