FreeCalypso > hg > freecalypso-tools
comparison target-utils/lunadrv/sleep.c @ 849:a66095c7f35f
lunadrv: add suspend and resume commands
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 18 Aug 2021 04:00:14 +0000 |
parents | |
children | 57f7db8c4f45 |
comparison
equal
deleted
inserted
replaced
848:6c306705f503 | 849:a66095c7f35f |
---|---|
1 /* | |
2 * This module implements suspend and resume commands for entering | |
3 * and exiting ILI9225G sleep mode. These commands are expected | |
4 * to work the same on both HaoRan and Formike LCDs, but the | |
5 * current measurement resistor that allows one to see the actual | |
6 * power supply current drawn by the LCD is present only on lunalcd2 | |
7 * boards. | |
8 */ | |
9 | |
10 #include "types.h" | |
11 #include "luna.h" | |
12 | |
13 void | |
14 cmd_suspend() | |
15 { | |
16 LCD_REG_WR(0x0007, 0); /* display off */ | |
17 wait_ARM_cycles(DELAY_1MS * 50); | |
18 LCD_REG_WR(0x0010, 1); /* suspend mode */ | |
19 } | |
20 | |
21 void | |
22 cmd_resume() | |
23 { | |
24 LCD_REG_WR(0x0010, 0); /* out of suspend */ | |
25 wait_ARM_cycles(DELAY_1MS * 50); | |
26 LCD_REG_WR(0x0007, 0x1017); /* display on */ | |
27 } |