aboutsummaryrefslogtreecommitdiffstats
path: root/src/display.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/display.c')
-rw-r--r--src/display.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/display.c b/src/display.c
index e961299..376ba43 100644
--- a/src/display.c
+++ b/src/display.c
@@ -206,7 +206,13 @@ void dsp_init(void)
dsp_write_cmd(0x11);
delay(150);
dsp_write_cmd(0x29); // set display on
- delay(500);
+ delay(150);
+
+ dsp_write_cmd(0x53);
+ dsp_write_data(0x2C);
+ //dsp_write_cmd(0x51);
+ //dsp_write_data(128);
+
/*dsp_write_cmd(0x33); // set scroll area
dsp_write_data(0x00);
dsp_write_data(0x00);
@@ -219,3 +225,32 @@ void dsp_init(void)
dsp_write_data(0x00);*/
}
+void dsp_backlight(uint8_t value)
+{
+ dsp_write_cmd(0x51);
+ dsp_write_data(value);
+}
+
+void dsp_sleep(void)
+{
+ // backlight
+ dsp_backlight(0x00);
+ // display off
+ dsp_write_cmd(0x28);
+ // sleep mode
+ dsp_write_cmd(0x10);
+ delay(5);
+}
+
+void dsp_wakeup(void)
+{
+ // unsleep
+ dsp_write_cmd(0x11);
+ //delay(5);
+ for (uint32_t i = 0; i < 20000; i++)
+ asm("");
+ // display on
+ dsp_write_cmd(0x29);
+ dsp_backlight(0xFF);
+}
+