Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Maple_console.h@3:eec13a411e94, 2011-10-30 (annotated)
- Committer:
- uehara00
- Date:
- Sun Oct 30 21:20:23 2011 +0000
- Revision:
- 3:eec13a411e94
OLED(MARY-OB) drivers and demonstrations are added.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| uehara00 | 3:eec13a411e94 | 1 | //copyright 2011 Uehara Yoshiyuki |
| uehara00 | 3:eec13a411e94 | 2 | //==================================================================== |
| uehara00 | 3:eec13a411e94 | 3 | //The author provide the programs without any guarantees or warranty. |
| uehara00 | 3:eec13a411e94 | 4 | //The author is not responsible for any damage or losses of any kind |
| uehara00 | 3:eec13a411e94 | 5 | //caused by using or misusing of the programs. |
| uehara00 | 3:eec13a411e94 | 6 | //The author is under no obligation to provide support, service, |
| uehara00 | 3:eec13a411e94 | 7 | //corrections, or upgrades to the programs. |
| uehara00 | 3:eec13a411e94 | 8 | //==================================================================== |
| uehara00 | 3:eec13a411e94 | 9 | // MAPLE board[MARM01-BASE] |
| uehara00 | 3:eec13a411e94 | 10 | // operation console utilizing text-LCD and buttons |
| uehara00 | 3:eec13a411e94 | 11 | #ifndef MAPLE_CONSOLE_H_ |
| uehara00 | 3:eec13a411e94 | 12 | #define MAPLE_CONSOLE_H_ |
| uehara00 | 3:eec13a411e94 | 13 | |
| uehara00 | 3:eec13a411e94 | 14 | // constants |
| uehara00 | 3:eec13a411e94 | 15 | #define CONSOLE_REFRESH_RATE 0.1 // 100ms |
| uehara00 | 3:eec13a411e94 | 16 | |
| uehara00 | 3:eec13a411e94 | 17 | #define DISPLAY_OFF 0 |
| uehara00 | 3:eec13a411e94 | 18 | #define DISPLAY_ON 1 |
| uehara00 | 3:eec13a411e94 | 19 | |
| uehara00 | 3:eec13a411e94 | 20 | #define MODE_CLOCK 0 |
| uehara00 | 3:eec13a411e94 | 21 | #define MODE_ADJUST 1 |
| uehara00 | 3:eec13a411e94 | 22 | #define MODE_ALARM 2 |
| uehara00 | 3:eec13a411e94 | 23 | #define MODE_TIMER 3 |
| uehara00 | 3:eec13a411e94 | 24 | #define MODE_TEST 4 |
| uehara00 | 3:eec13a411e94 | 25 | |
| uehara00 | 3:eec13a411e94 | 26 | #define BUTTON_A 0 |
| uehara00 | 3:eec13a411e94 | 27 | #define BUTTON_B 1 |
| uehara00 | 3:eec13a411e94 | 28 | #define BUTTON_LEFT 2 |
| uehara00 | 3:eec13a411e94 | 29 | #define BUTTON_DOWN 3 |
| uehara00 | 3:eec13a411e94 | 30 | #define BUTTON_RIGHT 4 |
| uehara00 | 3:eec13a411e94 | 31 | #define BUTTON_UP 5 |
| uehara00 | 3:eec13a411e94 | 32 | #define BUTTON_SIZE 6 |
| uehara00 | 3:eec13a411e94 | 33 | |
| uehara00 | 3:eec13a411e94 | 34 | #define BUTTON_OFF 1 |
| uehara00 | 3:eec13a411e94 | 35 | #define BUTTON_ON 0 |
| uehara00 | 3:eec13a411e94 | 36 | |
| uehara00 | 3:eec13a411e94 | 37 | #define BUTTON_THRESHOLD 0 // 0 x 100ms |
| uehara00 | 3:eec13a411e94 | 38 | #define BUTTON_REPEAT 10 // 1s |
| uehara00 | 3:eec13a411e94 | 39 | #define BUTTON_FAST 40 // 4s |
| uehara00 | 3:eec13a411e94 | 40 | #define BUTTON_PERIOD_REPEAT 3 // 300ms |
| uehara00 | 3:eec13a411e94 | 41 | #define BUTTON_PERIOD_FAST 1 // 100ms |
| uehara00 | 3:eec13a411e94 | 42 | |
| uehara00 | 3:eec13a411e94 | 43 | #define BUTTON_IDLE 0 // button status not active |
| uehara00 | 3:eec13a411e94 | 44 | #define BUTTON_BUSY 1 // button status active once and repeat |
| uehara00 | 3:eec13a411e94 | 45 | |
| uehara00 | 3:eec13a411e94 | 46 | // proto types |
| uehara00 | 3:eec13a411e94 | 47 | void console_initialize(); |
| uehara00 | 3:eec13a411e94 | 48 | void console_refresh(); |
| uehara00 | 3:eec13a411e94 | 49 | |
| uehara00 | 3:eec13a411e94 | 50 | static void refresh_display(); |
| uehara00 | 3:eec13a411e94 | 51 | static void button_action(); |
| uehara00 | 3:eec13a411e94 | 52 | static void button_check(int r, int button_number); |
| uehara00 | 3:eec13a411e94 | 53 | static bool button_trigger(int b, int r, int f); |
| uehara00 | 3:eec13a411e94 | 54 | void button_exit(); |
| uehara00 | 3:eec13a411e94 | 55 | static void button_function(); |
| uehara00 | 3:eec13a411e94 | 56 | static void button_cursor_move(int flag); |
| uehara00 | 3:eec13a411e94 | 57 | void cursor_move(int flag, int cursor_max); |
| uehara00 | 3:eec13a411e94 | 58 | static void button_xxcrement(int flag); |
| uehara00 | 3:eec13a411e94 | 59 | |
| uehara00 | 3:eec13a411e94 | 60 | #endif |