mirror of
https://github.com/Anshorei/epd-waveshare.git
synced 2026-10-04 06:16:42 +00:00
Removed #[allow(non_camel_case_types)] to fix issues
This commit is contained in:
+17
-17
@@ -103,7 +103,7 @@ where
|
||||
// Default Values: A = Height of Screen (0x127), B = 0x00 (GD, SM and TB=0?)
|
||||
self.interface.cmd_with_data(
|
||||
spi,
|
||||
Command::DRIVER_OUTPUT_CONTROL,
|
||||
Command::DriverOutputControl,
|
||||
&[HEIGHT as u8, (HEIGHT >> 8) as u8, 0x00],
|
||||
)?;
|
||||
|
||||
@@ -114,26 +114,26 @@ where
|
||||
//TODO: test
|
||||
self.interface.cmd_with_data(
|
||||
spi,
|
||||
Command::BOOSTER_SOFT_START_CONTROL,
|
||||
Command::BoosterSoftStartControl,
|
||||
&[0xD7, 0xD6, 0x9D],
|
||||
)?;
|
||||
|
||||
// One Databyte with value 0xA8 for 7V VCOM
|
||||
self.interface
|
||||
.cmd_with_data(spi, Command::WRITE_VCOM_REGISTER, &[0xA8])?;
|
||||
.cmd_with_data(spi, Command::WriteVcomRegister, &[0xA8])?;
|
||||
|
||||
// One Databyte with default value 0x1A for 4 dummy lines per gate
|
||||
self.interface
|
||||
.cmd_with_data(spi, Command::SET_DUMMY_LINE_PERIOD, &[0x1A])?;
|
||||
.cmd_with_data(spi, Command::SetDummyLinePeriod, &[0x1A])?;
|
||||
|
||||
// One Databyte with default value 0x08 for 2us per line
|
||||
self.interface
|
||||
.cmd_with_data(spi, Command::SET_GATE_LINE_WIDTH, &[0x08])?;
|
||||
.cmd_with_data(spi, Command::SetGateLineWidth, &[0x08])?;
|
||||
|
||||
// One Databyte with default value 0x03
|
||||
// -> address: x increment, y increment, address counter is updated in x direction
|
||||
self.interface
|
||||
.cmd_with_data(spi, Command::DATA_ENTRY_MODE_SETTING, &[0x03])?;
|
||||
.cmd_with_data(spi, Command::DataEntryModeSetting, &[0x03])?;
|
||||
|
||||
self.set_lut(spi, None)?;
|
||||
|
||||
@@ -194,7 +194,7 @@ where
|
||||
// 0x00 for Normal mode (Power on Reset), 0x01 for Deep Sleep Mode
|
||||
//TODO: is 0x00 needed here or would 0x01 be even more efficient?
|
||||
self.interface
|
||||
.cmd_with_data(spi, Command::DEEP_SLEEP_MODE, &[0x00])?;
|
||||
.cmd_with_data(spi, Command::DeepSleepMode, &[0x00])?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ where
|
||||
self.wait_until_idle();
|
||||
self.use_full_frame(spi)?;
|
||||
self.interface
|
||||
.cmd_with_data(spi, Command::WRITE_RAM, buffer)?;
|
||||
.cmd_with_data(spi, Command::WriteRam, buffer)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ where
|
||||
self.set_ram_counter(spi, x, y)?;
|
||||
|
||||
self.interface
|
||||
.cmd_with_data(spi, Command::WRITE_RAM, buffer)?;
|
||||
.cmd_with_data(spi, Command::WriteRam, buffer)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -230,9 +230,9 @@ where
|
||||
// enable clock signal, enable cp, display pattern -> 0xC4 (tested with the arduino version)
|
||||
//TODO: test control_1 or control_2 with default value 0xFF (from the datasheet)
|
||||
self.interface
|
||||
.cmd_with_data(spi, Command::DISPLAY_UPDATE_CONTROL_2, &[0xC4])?;
|
||||
.cmd_with_data(spi, Command::DisplayUpdateControl2, &[0xC4])?;
|
||||
|
||||
self.interface.cmd(spi, Command::MASTER_ACTIVATION)?;
|
||||
self.interface.cmd(spi, Command::MasterActivation)?;
|
||||
// MASTER Activation should not be interupted to avoid currption of panel images
|
||||
// therefore a terminate command is send
|
||||
self.interface.cmd(spi, Command::NOP)?;
|
||||
@@ -252,7 +252,7 @@ where
|
||||
// clear the ram with the background color
|
||||
let color = self.background_color.get_byte_value();
|
||||
|
||||
self.interface.cmd(spi, Command::WRITE_RAM)?;
|
||||
self.interface.cmd(spi, Command::WriteRam)?;
|
||||
self.interface
|
||||
.data_x_times(spi, color, WIDTH / 8 * HEIGHT)?;
|
||||
Ok(())
|
||||
@@ -321,14 +321,14 @@ where
|
||||
// aren't relevant
|
||||
self.interface.cmd_with_data(
|
||||
spi,
|
||||
Command::SET_RAM_X_ADDRESS_START_END_POSITION,
|
||||
Command::SetRamXAddressStartEndPosition,
|
||||
&[(start_x >> 3) as u8, (end_x >> 3) as u8],
|
||||
)?;
|
||||
|
||||
// 2 Databytes: A[7:0] & 0..A[8] for each - start and end
|
||||
self.interface.cmd_with_data(
|
||||
spi,
|
||||
Command::SET_RAM_Y_ADDRESS_START_END_POSITION,
|
||||
Command::SetRamYAddressStartEndPosition,
|
||||
&[
|
||||
start_y as u8,
|
||||
(start_y >> 8) as u8,
|
||||
@@ -349,12 +349,12 @@ where
|
||||
// x is positioned in bytes, so the last 3 bits which show the position inside a byte in the ram
|
||||
// aren't relevant
|
||||
self.interface
|
||||
.cmd_with_data(spi, Command::SET_RAM_X_ADDRESS_COUNTER, &[(x >> 3) as u8])?;
|
||||
.cmd_with_data(spi, Command::SetRamXAddressCounter, &[(x >> 3) as u8])?;
|
||||
|
||||
// 2 Databytes: A[7:0] & 0..A[8]
|
||||
self.interface.cmd_with_data(
|
||||
spi,
|
||||
Command::SET_RAM_Y_ADDRESS_COUNTER,
|
||||
Command::SetRamYAddressCounter,
|
||||
&[y as u8, (y >> 8) as u8],
|
||||
)?;
|
||||
Ok(())
|
||||
@@ -365,7 +365,7 @@ where
|
||||
assert!(buffer.len() == 30);
|
||||
|
||||
self.interface
|
||||
.cmd_with_data(spi, Command::WRITE_LUT_REGISTER, buffer)?;
|
||||
.cmd_with_data(spi, Command::WriteLutRegister, buffer)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user