mirror of
https://github.com/Anshorei/epd-waveshare.git
synced 2026-10-03 22:06:43 +00:00
Removed #[allow(non_camel_case_types)] to fix issues
This commit is contained in:
+17
-17
@@ -104,7 +104,7 @@ where
|
||||
// 0.. B[2:0]
|
||||
// Default Values: A = Height of Screen (0x127), B = 0x00 (GD, SM and TB=0?)
|
||||
self.interface
|
||||
.cmd_with_data(spi, Command::DRIVER_OUTPUT_CONTROL, &[0x27, 0x01, 0x00])?;
|
||||
.cmd_with_data(spi, Command::DriverOutputControl, &[0x27, 0x01, 0x00])?;
|
||||
|
||||
// 3 Databytes: (and default values from datasheet and arduino)
|
||||
// 1 .. A[6:0] = 0xCF | 0xD7
|
||||
@@ -113,26 +113,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)
|
||||
}
|
||||
@@ -182,7 +182,7 @@ where
|
||||
// 0x00 for Normal mode (Power on Reset), 0x01 for Deep Sleep Mode
|
||||
//TODO: is 0x00 needed here? (see also epd1in54)
|
||||
self.interface
|
||||
.cmd_with_data(spi, Command::DEEP_SLEEP_MODE, &[0x00])?;
|
||||
.cmd_with_data(spi, Command::DeepSleepMode, &[0x00])?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ where
|
||||
self.use_full_frame(spi)?;
|
||||
|
||||
self.interface
|
||||
.cmd_with_data(spi, Command::WRITE_RAM, buffer)?;
|
||||
.cmd_with_data(spi, Command::WriteRam, buffer)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -220,7 +220,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(())
|
||||
}
|
||||
|
||||
@@ -229,9 +229,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)?;
|
||||
@@ -251,7 +251,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(())
|
||||
@@ -319,14 +319,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,
|
||||
@@ -341,12 +341,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(())
|
||||
@@ -357,7 +357,7 @@ where
|
||||
self.wait_until_idle();
|
||||
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