FreeCalypso > hg > fc-tourmaline
comparison src/cs/drivers/drv_app/r2d/lcds/luna/r2d_onoff_i.c @ 217:6541e43f88e5
R2D display on/off control implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 24 Apr 2021 23:38:18 +0000 |
parents | |
children | 0196b6bf633c |
comparison
equal
deleted
inserted
replaced
216:777698cf6583 | 217:6541e43f88e5 |
---|---|
1 #include "r2d/lcds/luna/r2d_luna_lcd.h" | |
2 #include "main/sys_types.h" | |
3 #include "armio.h" | |
4 | |
5 static void r2d_onoff_action(enum blrr_display_state set_state) | |
6 { | |
7 UBYTE on_off; | |
8 | |
9 /* | |
10 * PWL control: on our current Luna setups (Caramel2 or iWOW DSK) | |
11 * PWL is only an indicator LED for developers, but the Mother's | |
12 * plan for the dream FreeCalypso handset includes having PWL | |
13 * regulate the backlight intensity. | |
14 */ | |
15 switch (set_state) { | |
16 case BLRR_DISPLAY_OFF: | |
17 *(volatile SYS_UWORD8 *)0xFFFE8000 = 0; | |
18 *(volatile SYS_UWORD8 *)0xFFFE8001 = 0; | |
19 on_off = 0; | |
20 break; | |
21 case BLRR_DISPLAY_ON: | |
22 *(volatile SYS_UWORD8 *)0xFFFE8000 = 255; | |
23 *(volatile SYS_UWORD8 *)0xFFFE8001 = 1; | |
24 on_off = 1; | |
25 break; | |
26 case BLRR_DISPLAY_INCALL: | |
27 *(volatile SYS_UWORD8 *)0xFFFE8000 = 16; | |
28 *(volatile SYS_UWORD8 *)0xFFFE8001 = 1; | |
29 on_off = 1; | |
30 break; | |
31 case BLRR_DISPLAY_CHG_BOOT: | |
32 *(volatile SYS_UWORD8 *)0xFFFE8000 = 64; | |
33 *(volatile SYS_UWORD8 *)0xFFFE8001 = 1; | |
34 on_off = 1; | |
35 break; | |
36 default: | |
37 return; /* error, but we are a void function */ | |
38 } | |
39 /* physical backlight on/off */ | |
40 if (on_off) | |
41 AI_SetBit(9); | |
42 else | |
43 AI_ResetBit(9); | |
44 /* TFT on/off control remains to be implemented */ | |
45 } |