summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-10-31 17:16:34 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-10-31 17:16:34 +0100
commit4bbf07511979f3f918e316e80ba36ebac7f2bf9d (patch)
tree2472954694cfc7b76b6a798440cd1fbe1c295c88 /src
parent9e909994e78dae8071a6fc51bb339519a6cded89 (diff)
pervasive aurora mb: add initialization code for flashless updates
Diffstat (limited to 'src')
-rw-r--r--src/driver/pervasive_aurora_mb.cc85
1 files changed, 79 insertions, 6 deletions
diff --git a/src/driver/pervasive_aurora_mb.cc b/src/driver/pervasive_aurora_mb.cc
index b422916..0e14437 100644
--- a/src/driver/pervasive_aurora_mb.cc
+++ b/src/driver/pervasive_aurora_mb.cc
@@ -1,5 +1,6 @@
/*
* Copyright 2021 Daniel Friesel
+ * Copyright 2021 Amar Memic
*
* SPDX-License-Identifier: BSD-2-Clause
*
@@ -31,7 +32,7 @@ void PervasiveAuroraMb::powerOn()
gpio.write(PERVASIVE_AURORA_CS_PIN, 1);
}
-void PervasiveAuroraMb::initialize(signed char temperature)
+void PervasiveAuroraMb::initialize(signed char temperature, bool flashless)
{
// "Input Temperature"
spiWrite(0xe5, (const unsigned char*)&temperature, 1);
@@ -40,10 +41,11 @@ void PervasiveAuroraMb::initialize(signed char temperature)
spiWrite(0xe0, (const unsigned char[]){0x02}, 1);
// "Panel Settings"
- spiWrite(0x00, (const unsigned char[]){0x0f}, 1);
-
- // "Panel Settings"
- spiWrite(0x00, (const unsigned char[]){0x0f}, 1);
+ if (flashless) {
+ spiWrite(0x00, (const unsigned char[]){0x3f}, 1);
+ } else {
+ spiWrite(0x00, (const unsigned char[]){0x0f}, 1);
+ }
// "Booster soft start settings"
spiWrite(0x06, (const unsigned char[]){0x17, 0x17, 0x27}, 3);
@@ -52,10 +54,81 @@ void PervasiveAuroraMb::initialize(signed char temperature)
spiWrite(0x61, (const unsigned char[]){0x01, 0x90, 0x01, 0x2c}, 4);
// "Vcom and data interval setting"
- spiWrite(0x50, (const unsigned char[]){0x87}, 1);
+ if (flashless) {
+ spiWrite(0x50, (const unsigned char[]){0x80}, 1);
+ } else {
+ spiWrite(0x50, (const unsigned char[]){0x87}, 1);
+ }
// "Power Saving"
spiWrite(0xe3, (const unsigned char[]){0x88}, 1);
+
+ if (flashless) {
+ // PLL
+ spiWrite(0x30, (const unsigned char[]){0x3d}, 1);
+
+ // VCom DC
+ spiWrite(0x82, (const unsigned char[]){0x0e}, 1);
+
+ // TCon
+ spiWrite(0x60, (const unsigned char[]){0x00}, 1);
+
+ // VCom LUT
+ spiWrite(0x20, (const unsigned char[]){
+ 0x00, 0x06, 0x06, 0x06, 0x06, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00
+ }, 44);
+
+ // W2B LUT
+ spiWrite(0x23, (const unsigned char[]){
+ 0xaa, 0x06, 0x06, 0x06, 0x06, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ }, 42);
+
+ // B2W LUT
+ spiWrite(0x22, (const unsigned char[]){
+ 0x55, 0x06, 0x06, 0x06, 0x06, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ }, 42);
+
+ // W2W LUT
+ spiWrite(0x21, (const unsigned char[]){
+ 0x00, 0x06, 0x06, 0x06, 0x06, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ }, 42);
+
+ // B2B LUT
+ spiWrite(0x24, (const unsigned char[]){
+ 0xff, 0x06, 0x06, 0x06, 0x06, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ }, 42);
+ }
}
void PervasiveAuroraMb::sendImage(unsigned char *frame, unsigned int x, unsigned int y, unsigned int w, unsigned int h)