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.
Diff: Maple_console.h
- Revision:
- 3:eec13a411e94
diff -r 299a1c9a5795 -r eec13a411e94 Maple_console.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Maple_console.h Sun Oct 30 21:20:23 2011 +0000 @@ -0,0 +1,60 @@ +//copyright 2011 Uehara Yoshiyuki +//==================================================================== +//The author provide the programs without any guarantees or warranty. +//The author is not responsible for any damage or losses of any kind +//caused by using or misusing of the programs. +//The author is under no obligation to provide support, service, +//corrections, or upgrades to the programs. +//==================================================================== +// MAPLE board[MARM01-BASE] +// operation console utilizing text-LCD and buttons +#ifndef MAPLE_CONSOLE_H_ +#define MAPLE_CONSOLE_H_ + +// constants +#define CONSOLE_REFRESH_RATE 0.1 // 100ms + +#define DISPLAY_OFF 0 +#define DISPLAY_ON 1 + +#define MODE_CLOCK 0 +#define MODE_ADJUST 1 +#define MODE_ALARM 2 +#define MODE_TIMER 3 +#define MODE_TEST 4 + +#define BUTTON_A 0 +#define BUTTON_B 1 +#define BUTTON_LEFT 2 +#define BUTTON_DOWN 3 +#define BUTTON_RIGHT 4 +#define BUTTON_UP 5 +#define BUTTON_SIZE 6 + +#define BUTTON_OFF 1 +#define BUTTON_ON 0 + +#define BUTTON_THRESHOLD 0 // 0 x 100ms +#define BUTTON_REPEAT 10 // 1s +#define BUTTON_FAST 40 // 4s +#define BUTTON_PERIOD_REPEAT 3 // 300ms +#define BUTTON_PERIOD_FAST 1 // 100ms + +#define BUTTON_IDLE 0 // button status not active +#define BUTTON_BUSY 1 // button status active once and repeat + +// proto types +void console_initialize(); +void console_refresh(); + +static void refresh_display(); +static void button_action(); +static void button_check(int r, int button_number); +static bool button_trigger(int b, int r, int f); +void button_exit(); +static void button_function(); +static void button_cursor_move(int flag); +void cursor_move(int flag, int cursor_max); +static void button_xxcrement(int flag); + +#endif