Sun, 10 Aug 2014 13:26:35 +0200
Start initial menu setup
197 | 1 | #ifndef _PANEL_H |
2 | #define _PANEL_H | |
3 | ||
4 | ||
5 | #ifdef HAVE_WIRINGPI_H | |
6 | ||
7 | /* | |
8 | * GPIO pins for the frontpanel LED and push buttons. | |
9 | */ | |
10 | #define PANEL_LED 2 | |
11 | #define PANEL_ENTER 4 | |
12 | #define PANEL_DOWN 5 | |
13 | #define PANEL_UP 6 | |
14 | ||
15 | /* | |
200
a215ddaabbe2
Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
16 | * 10 Milliseconds counts for a key to be short or long pressed. |
197 | 17 | */ |
200
a215ddaabbe2
Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
18 | #define PRESS_NORMAL 5 |
a215ddaabbe2
Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
19 | #define PRESS_LONG 200 |
197 | 20 | |
21 | /* | |
22 | * LCD timeout in seconds | |
23 | */ | |
24 | #define LCD_SLEEP 120 | |
25 | ||
26 | /* | |
27 | * Menu timeout in seconds | |
28 | */ | |
29 | #define MENU_TIMEOUT 60 | |
30 | ||
200
a215ddaabbe2
Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
31 | /* |
a215ddaabbe2
Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
32 | * Key names |
a215ddaabbe2
Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
33 | */ |
a215ddaabbe2
Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
34 | #define KEY_NONE 0 |
a215ddaabbe2
Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
35 | #define KEY_UP 1 |
a215ddaabbe2
Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
36 | #define KEY_DOWN 2 |
205 | 37 | #define KEY_ESCAPE 3 |
200
a215ddaabbe2
Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
38 | #define KEY_ENTER 4 |
a215ddaabbe2
Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
39 | #define KEY_CONFIRM 5 /* Long Enter */ |
a215ddaabbe2
Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
40 | #define KEY_ALL 99 |
a215ddaabbe2
Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
41 | |
a215ddaabbe2
Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
42 | |
a215ddaabbe2
Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents:
199
diff
changeset
|
43 | int keycheck(void); |
204
9a14d6b2de7f
Fixed LCD display updates. Better key routines.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
44 | int keypressed(void); |
9a14d6b2de7f
Fixed LCD display updates. Better key routines.
Michiel Broek <mbroek@mbse.eu>
parents:
200
diff
changeset
|
45 | |
197 | 46 | |
199 | 47 | PI_THREAD (my_panel_loop); |
48 | ||
49 | ||
197 | 50 | #endif |
51 | ||
52 | #endif |