annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
217
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 #include "r2d/lcds/luna/r2d_luna_lcd.h"
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 #include "main/sys_types.h"
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 #include "armio.h"
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 static void r2d_onoff_action(enum blrr_display_state set_state)
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 {
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 UBYTE on_off;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 /*
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 * PWL control: on our current Luna setups (Caramel2 or iWOW DSK)
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 * PWL is only an indicator LED for developers, but the Mother's
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 * plan for the dream FreeCalypso handset includes having PWL
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 * regulate the backlight intensity.
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 */
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 switch (set_state) {
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 case BLRR_DISPLAY_OFF:
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 *(volatile SYS_UWORD8 *)0xFFFE8000 = 0;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 *(volatile SYS_UWORD8 *)0xFFFE8001 = 0;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 on_off = 0;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 break;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 case BLRR_DISPLAY_ON:
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 *(volatile SYS_UWORD8 *)0xFFFE8000 = 255;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 *(volatile SYS_UWORD8 *)0xFFFE8001 = 1;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 on_off = 1;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 break;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 case BLRR_DISPLAY_INCALL:
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 *(volatile SYS_UWORD8 *)0xFFFE8000 = 16;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 *(volatile SYS_UWORD8 *)0xFFFE8001 = 1;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 on_off = 1;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 break;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 case BLRR_DISPLAY_CHG_BOOT:
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 *(volatile SYS_UWORD8 *)0xFFFE8000 = 64;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 *(volatile SYS_UWORD8 *)0xFFFE8001 = 1;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 on_off = 1;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 break;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 default:
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 return; /* error, but we are a void function */
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 }
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 /* physical backlight on/off */
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 if (on_off)
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 AI_SetBit(9);
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 else
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 AI_ResetBit(9);
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 /* TFT on/off control remains to be implemented */
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 }