diff options
-rw-r--r-- | drivers/lcd/ssd1289_lld.c | 18 | ||||
-rw-r--r-- | glcd.h | 2 |
2 files changed, 14 insertions, 6 deletions
diff --git a/drivers/lcd/ssd1289_lld.c b/drivers/lcd/ssd1289_lld.c index cfacfb47..9f3303f9 100644 --- a/drivers/lcd/ssd1289_lld.c +++ b/drivers/lcd/ssd1289_lld.c @@ -142,14 +142,22 @@ static __inline void lld_lcdDelay(uint16_t us) { } void lld_lcdSetPowerMode(uint8_t powerMode) { - /* TODO */ - switch(powerMode) { - case poweroff: + case powerOff: + lld_lcdWriteReg(0x0010, 0x0000); // leave sleep mode + lld_lcdWriteReg(0x0007, 0x0000); // halt operation + lld_lcdWriteReg(0x0000, 0x0000); // turn off oszillator + lld_lcdWriteReg(0x0010, 0x0001); // enter sleepmode + break; + case powerOn: + lld_lcdWriteReg(0x0010, 0x0000); // leave sleep mode + lld_lcdInit(); break; - case poweron: + case sleepOn: + lld_lcdWriteReg(0x0010, 0x0001); // enter sleep mode break; - case standby: + case sleepOff: + lld_lcdWriteReg(0x0010, 0x0000); // leave sleep mode break; } } @@ -28,7 +28,7 @@ enum orientation {portrait, landscape, portraitInv, landscapeInv}; enum filled {frame, filled}; enum transparency {solid, transparent}; -enum powermode {poweroff, poweron, standby}; +enum powermode {powerOff, powerOn, sleepOn, sleepOff}; // For text rendering only extern uint16_t bgcolor, fgcolor; |