[ion/device/display] Add panelIdentifier

This commit is contained in:
Romain Goyet
2019-05-23 17:47:30 +02:00
parent 7b2884a6c7
commit 5c21670103
2 changed files with 12 additions and 0 deletions

View File

@@ -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;

View File

@@ -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,