diff --git a/ion/src/device/shared/drivers/display.cpp b/ion/src/device/shared/drivers/display.cpp index a2448c574..6c0625a1b 100644 --- a/ion/src/device/shared/drivers/display.cpp +++ b/ion/src/device/shared/drivers/display.cpp @@ -386,6 +386,16 @@ void pullPixels(KDColor * pixels, size_t numberOfPixels) { send_command(Command::PixelFormatSet, 0x05); } +uint32_t panelIdentifier() { + send_command(Command::ReadDisplayID); + receive_data(); // Dummy read, per datasheet + uint8_t id1 = receive_data(); + uint8_t id2 = receive_data(); + uint8_t id3 = receive_data(); + + return (id1 << 16) | (id2 << 8) | id3; +} + void pushBlackWhitePixels() { send_command(Command::MemoryWrite); int numberOfPixels = Ion::Display::Width * Ion::Display::Height; diff --git a/ion/src/device/shared/drivers/display.h b/ion/src/device/shared/drivers/display.h index 516ad3cac..1d2c856df 100644 --- a/ion/src/device/shared/drivers/display.h +++ b/ion/src/device/shared/drivers/display.h @@ -32,10 +32,12 @@ void waitForPendingDMAUploadCompletion(); void pushPixels(const KDColor * pixels, size_t numberOfPixels); void pushColor(KDColor color, size_t numberOfPixels); void pullPixels(KDColor * pixels, size_t numberOfPixels); +uint32_t panelIdentifier(); enum class Command : uint16_t { Nop = 0x00, Reset = 0x01, + ReadDisplayID = 0x04, SleepIn = 0x10, SleepOut = 0x11, DisplayInversionOff = 0x20,