use crate::traits;
#[allow(dead_code)]
#[derive(Copy, Clone)]
pub(crate) enum Command {
PanelSetting = 0x00,
PowerSetting = 0x01,
PowerOff = 0x02,
PowerOffSequenceSetting = 0x03,
PowerOn = 0x04,
BoosterSoftStart = 0x06,
DeepSleep = 0x07,
DataStartTransmission1 = 0x10,
DataStop = 0x11,
DisplayRefresh = 0x12,
ImageProcess = 0x13,
LutForVcom = 0x20,
LutBlack = 0x21,
LutWhite = 0x22,
LutGray1 = 0x23,
LutGray2 = 0x24,
LutRed0 = 0x25,
LutRed1 = 0x26,
LutRed2 = 0x27,
LutRed3 = 0x28,
LutXon = 0x29,
PllControl = 0x30,
TemperatureSensor = 0x40,
TemperatureCalibration = 0x41,
TemperatureSensorWrite = 0x42,
TemperatureSensorRead = 0x43,
VcomAndDataIntervalSetting = 0x50,
LowPowerDetection = 0x51,
TconSetting = 0x60,
TconResolution = 0x61,
SpiFlashControl = 0x65,
Revision = 0x70,
GetStatus = 0x71,
AutoMeasurementVcom = 0x80,
ReadVcomValue = 0x81,
VcmDcSetting = 0x82,
FlashMode = 0xE5,
}
impl traits::Command for Command {
fn address(self) -> u8 {
self as u8
}
}
#[cfg(test)]
mod tests {
use super::*;
use crate::traits::Command as CommandTrait;
#[test]
fn command_addr() {
assert_eq!(Command::PanelSetting.address(), 0x00);
assert_eq!(Command::DisplayRefresh.address(), 0x12);
}
}