ssd1289 powermodes implemented (powerOn, powerOff, sleepOn, sleepOff)

This commit is contained in:
Tectu 2012-06-23 14:04:56 +02:00
parent 83f22aaeb6
commit de71035ce4
2 changed files with 14 additions and 6 deletions

View File

@ -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:
case powerOn:
lld_lcdWriteReg(0x0010, 0x0000); // leave sleep mode
lld_lcdInit();
break;
case standby:
case sleepOn:
lld_lcdWriteReg(0x0010, 0x0001); // enter sleep mode
break;
case sleepOff:
lld_lcdWriteReg(0x0010, 0x0000); // leave sleep mode
break;
}
}

2
glcd.h
View File

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